From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 01:28:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 166C7298; Sun, 18 Jan 2015 01:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 028733B9; Sun, 18 Jan 2015 01:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I1S8QA089960; Sun, 18 Jan 2015 01:28:08 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I1S8EG089959; Sun, 18 Jan 2015 01:28:08 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201501180128.t0I1S8EG089959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 18 Jan 2015 01:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277308 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 01:28:09 -0000 Author: bz Date: Sun Jan 18 01:28:08 2015 New Revision: 277308 URL: https://svnweb.freebsd.org/changeset/base/277308 Log: There are still kernel configs and mk files depending on the OFED option. This will need a proper cleanup and in the meantime after r277302 unbreak LINT builds. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Jan 17 19:57:03 2015 (r277307) +++ head/sys/conf/options Sun Jan 18 01:28:08 2015 (r277308) @@ -908,6 +908,7 @@ FDT opt_platform.h FDT_DTB_STATIC opt_platform.h # OFED Infiniband stack +OFED opt_ofed.h OFED_DEBUG_INIT opt_ofed.h SDP opt_ofed.h SDP_DEBUG opt_ofed.h From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 01:33:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3E81536; Sun, 18 Jan 2015 01:33:55 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A87A6657; Sun, 18 Jan 2015 01:33:55 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 92B3E25D3A92; Sun, 18 Jan 2015 01:33:52 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 754ADC770AE; Sun, 18 Jan 2015 01:33:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vPWNXj6fAlZq; Sun, 18 Jan 2015 01:33:49 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a] (unknown [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0A556C7709A; Sun, 18 Jan 2015 01:33:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... From: "Bjoern A. Zeeb" In-Reply-To: <201501171636.t0HGadsf039591@svn.freebsd.org> Date: Sun, 18 Jan 2015 01:33:12 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> References: <201501171636.t0HGadsf039591@svn.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 01:33:56 -0000 > On 17 Jan 2015, at 16:36 , Hans Petter Selasky = wrote: >=20 > Author: hselasky > Date: Sat Jan 17 16:36:39 2015 > New Revision: 277302 > URL: https://svnweb.freebsd.org/changeset/base/277302 >=20 > Log: > Start importing the basic OFED linux compatibility layer changes made > by dumbbell@ to be able to compile this layer as a dependency module. > Clean up some Makefiles and remove the no longer used OFED define. Build files, NOTES files, .. still referenced the =E2=80=9COFED=E2=80=9D = option. I put it back in for now to unbreak LINT builds. Please = cleanup properly. Can always put it into reviews and find someone to = make sure you caught all places. > Currently only i386 and amd64 targets are supported. >=20 > MFC after: 1 month > Sponsored by: Mellanox Technologies >=20 > Added: > .. > Modified: > .. > head/sys/conf/options > .. > Modified: head/sys/conf/options > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/options Sat Jan 17 15:19:18 2015 = (r277301) > +++ head/sys/conf/options Sat Jan 17 16:36:39 2015 = (r277302) > @@ -85,6 +85,7 @@ COMPAT_FREEBSD6 opt_compat.h > COMPAT_FREEBSD7 opt_compat.h > COMPAT_FREEBSD9 opt_compat.h > COMPAT_FREEBSD10 opt_compat.h > +COMPAT_LINUXAPI opt_compat.h On another note: this sounds really strange to me. > COMPILING_LINT opt_global.h > COMPRESS_USER_CORES opt_core.h > CY_PCI_FASTINTR > @@ -907,7 +908,6 @@ FDT opt_platform.h > FDT_DTB_STATIC opt_platform.h >=20 > # OFED Infiniband stack > -OFED opt_ofed.h > OFED_DEBUG_INIT opt_ofed.h > SDP opt_ofed.h > SDP_DEBUG opt_ofed.h >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 01:34:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B93FA675; Sun, 18 Jan 2015 01:34:27 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A55E65E; Sun, 18 Jan 2015 01:34:27 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5C9BC25D3891; Sun, 18 Jan 2015 01:34:25 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D33EEC7709A; Sun, 18 Jan 2015 01:34:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8S2-ZZ2H_xaA; Sun, 18 Jan 2015 01:34:22 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a] (unknown [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 12494C770F0; Sun, 18 Jan 2015 01:34:21 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277285 - head/sys/x86/isa From: "Bjoern A. Zeeb" In-Reply-To: <717DFAD4-3B25-4ED8-A154-E7F91B61C959@bsdimp.com> Date: Sun, 18 Jan 2015 01:34:19 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201501170218.t0H2I0AW038857@svn.freebsd.org> <9BA78F3A-C96C-4B51-A6CA-67B15665F511@FreeBSD.org> <717DFAD4-3B25-4ED8-A154-E7F91B61C959@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 01:34:27 -0000 > On 17 Jan 2015, at 23:19 , Warner Losh wrote: >=20 >=20 >> On Jan 17, 2015, at 6:31 AM, Bjoern A. Zeeb wrote: >>=20 >>=20 >>> On 17 Jan 2015, at 02:18 , Warner Losh wrote: >>>=20 >>> Author: imp >>> Date: Sat Jan 17 02:17:59 2015 >>> New Revision: 277285 >>> URL: https://svnweb.freebsd.org/changeset/base/277285 >>>=20 >>> Log: >>> Need to include opt_mca.h to test for DEV_MCA. >>>=20 >>> Modified: >>> head/sys/x86/isa/atpic.c >>=20 >>=20 >> i386 LINT kernels: >>=20 >> /scratch/tmp/bz/head.svn/sys/x86/isa/atpic.c:376:6: error: use of = undeclared identifier 'MCA_system' >> /scratch/tmp/bz/head.svn/sys/x86/isa/atpic.c:440:6: error: use of = undeclared identifier =E2=80=98MCA_system' >=20 >=20 > I don=E2=80=99t get that far. After =E2=80=98make LINT=E2=80=99 in = i386, I get OFED unknown option=E2=80=A6 Yeah blame r277302 on that ;-) I put it back for now and let hps know but you could also go back to = 277301 and try to fix yours ;-) >=20 > Warner >=20 >>>=20 >>> Modified: head/sys/x86/isa/atpic.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/x86/isa/atpic.c Sat Jan 17 02:17:57 2015 = (r277284) >>> +++ head/sys/x86/isa/atpic.c Sat Jan 17 02:17:59 2015 = (r277285) >>> @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); >>>=20 >>> #include "opt_auto_eoi.h" >>> #include "opt_isa.h" >>> +#include "opt_mca.h" >>>=20 >>> #include >>> #include >>>=20 >>=20 >> =E2=80=94 >> Bjoern A. Zeeb Charles Haddon = Spurgeon: >> "Friendship is one of the sweetest joys of life. Many might have = failed >> beneath the bitterness of their trial had they not found a friend." >>=20 >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 01:50:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3094ABB0; Sun, 18 Jan 2015 01:50:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CD7C7B7; Sun, 18 Jan 2015 01:50:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I1oANT099819; Sun, 18 Jan 2015 01:50:10 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I1oAZw099818; Sun, 18 Jan 2015 01:50:10 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501180150.t0I1oAZw099818@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 18 Jan 2015 01:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277309 - head/share/examples/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 01:50:11 -0000 Author: neel Date: Sun Jan 18 01:50:10 2015 New Revision: 277309 URL: https://svnweb.freebsd.org/changeset/base/277309 Log: Make the error message explicit instead of just printing the usage if the virtual machine name is not specified. Requested by: grehan MFC after: 1 week Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Sun Jan 18 01:28:08 2015 (r277308) +++ head/share/examples/bhyve/vmrun.sh Sun Jan 18 01:50:10 2015 (r277309) @@ -39,7 +39,13 @@ DEFAULT_CONSOLE=stdio DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" +errmsg() { + echo "*** $1" +} + usage() { + local msg=$1 + echo "Usage: vmrun.sh [-ahi] [-c ] [-C ] [-d ]" echo " [-e ] [-g ] [-H ]" echo " [-I ] [-m ]" @@ -58,18 +64,18 @@ usage() { echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" echo "" - echo " This script needs to be executed with superuser privileges" - echo "" + [ -n "$msg" ] && errmsg "$msg" exit 1 } if [ `id -u` -ne 0 ]; then - usage + errmsg "This script must be executed with superuser privileges" + exit 1 fi kldstat -n vmm > /dev/null 2>&1 if [ $? -ne 0 ]; then - echo "vmm.ko is not loaded!" + errmsg "vmm.ko is not loaded" exit 1 fi @@ -140,7 +146,7 @@ fi shift $((${OPTIND} - 1)) if [ $# -ne 1 ]; then - usage + usage "virtual machine name not specified" fi vmname="$1" From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 03:08:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5950366E; Sun, 18 Jan 2015 03:08:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444DBE98; Sun, 18 Jan 2015 03:08:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I38Y21037583; Sun, 18 Jan 2015 03:08:34 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I38VJt037565; Sun, 18 Jan 2015 03:08:31 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501180308.t0I38VJt037565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 18 Jan 2015 03:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277310 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 03:08:34 -0000 Author: neel Date: Sun Jan 18 03:08:30 2015 New Revision: 277310 URL: https://svnweb.freebsd.org/changeset/base/277310 Log: Simplify instruction restart logic in bhyve. Keep track of the next instruction to be executed by the vcpu as 'nextrip'. As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should start execution. Also, instruction restart happens implicitly via 'vm_inject_exception()' or explicitly via 'vm_restart_instruction()'. The APIs behave identically in both kernel and userspace contexts. The main beneficiary is the instruction emulation code that executes in both contexts. bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length' as readonly: - Restarting an instruction is now done by calling 'vm_restart_instruction()' as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout()) - Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch()) Differential Revision: https://reviews.freebsd.org/D1526 Reviewed by: grehan MFC after: 2 weeks Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/task_switch.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/lib/libvmmapi/vmmapi.c Sun Jan 18 03:08:30 2015 (r277310) @@ -368,14 +368,13 @@ vm_get_register(struct vmctx *ctx, int v } int -vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *vmexit) +vm_run(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit) { int error; struct vm_run vmrun; bzero(&vmrun, sizeof(vmrun)); vmrun.cpuid = vcpu; - vmrun.rip = rip; error = ioctl(ctx->fd, VM_RUN, &vmrun); bcopy(&vmrun.vm_exit, vmexit, sizeof(struct vm_exit)); @@ -399,36 +398,22 @@ vm_reinit(struct vmctx *ctx) return (ioctl(ctx->fd, VM_REINIT, 0)); } -static int -vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, - int error_code, int error_code_valid) +int +vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, int errcode_valid, + uint32_t errcode, int restart_instruction) { struct vm_exception exc; - bzero(&exc, sizeof(exc)); exc.cpuid = vcpu; exc.vector = vector; - exc.error_code = error_code; - exc.error_code_valid = error_code_valid; + exc.error_code = errcode; + exc.error_code_valid = errcode_valid; + exc.restart_instruction = restart_instruction; return (ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc)); } int -vm_inject_exception(struct vmctx *ctx, int vcpu, int vector) -{ - - return (vm_inject_exception_real(ctx, vcpu, vector, 0, 0)); -} - -int -vm_inject_exception2(struct vmctx *ctx, int vcpu, int vector, int errcode) -{ - - return (vm_inject_exception_real(ctx, vcpu, vector, errcode, 1)); -} - -int vm_apicid2vcpu(struct vmctx *ctx, int apicid) { /* @@ -1198,3 +1183,11 @@ vm_rtc_gettime(struct vmctx *ctx, time_t *secs = rtctime.secs; return (error); } + +int +vm_restart_instruction(void *arg, int vcpu) +{ + struct vmctx *ctx = arg; + + return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sun Jan 18 01:50:10 2015 (r277309) +++ head/lib/libvmmapi/vmmapi.h Sun Jan 18 03:08:30 2015 (r277310) @@ -32,6 +32,12 @@ #include #include +/* + * API version for out-of-tree consumers like grub-bhyve for making compile + * time decisions. + */ +#define VMMAPI_VERSION 0101 /* 2 digit major followed by 2 digit minor */ + struct iovec; struct vmctx; enum x2apic_state; @@ -70,13 +76,12 @@ int vm_get_seg_desc(struct vmctx *ctx, i struct seg_desc *seg_desc); int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val); int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); -int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, - struct vm_exit *ret_vmexit); +int vm_run(struct vmctx *ctx, int vcpu, struct vm_exit *ret_vmexit); int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); int vm_reinit(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); -int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); -int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); +int vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, + int errcode_valid, uint32_t errcode, int restart_instruction); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sun Jan 18 01:50:10 2015 (r277309) +++ head/sys/amd64/include/vmm_dev.h Sun Jan 18 03:08:30 2015 (r277310) @@ -54,7 +54,6 @@ struct vm_seg_desc { /* data or code s struct vm_run { int cpuid; - uint64_t rip; /* start running here */ struct vm_exit vm_exit; }; @@ -238,6 +237,7 @@ enum { IOCNUM_LAPIC_MSI = 36, IOCNUM_LAPIC_LOCAL_IRQ = 37, IOCNUM_IOAPIC_PINCOUNT = 38, + IOCNUM_RESTART_INSTRUCTION = 39, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -360,4 +360,6 @@ enum { _IOW('v', IOCNUM_RTC_SETTIME, struct vm_rtc_time) #define VM_RTC_GETTIME \ _IOR('v', IOCNUM_RTC_GETTIME, struct vm_rtc_time) +#define VM_RESTART_INSTRUCTION \ + _IOW('v', IOCNUM_RESTART_INSTRUCTION, int) #endif Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/sys/amd64/vmm/intel/vmx.c Sun Jan 18 03:08:30 2015 (r277310) @@ -2412,6 +2412,7 @@ vmx_exit_process(struct vmx *vmx, int vc if (vm_mem_allocated(vmx->vm, gpa) || apic_access_fault(vmx, vcpu, gpa)) { vmexit->exitcode = VM_EXITCODE_PAGING; + vmexit->inst_length = 0; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/sys/amd64/vmm/vmm.c Sun Jan 18 03:08:30 2015 (r277310) @@ -109,6 +109,7 @@ struct vcpu { uint64_t guest_xcr0; /* (i) guest %xcr0 register */ void *stats; /* (a,i) statistics */ struct vm_exit exitinfo; /* (x) exit reason and collateral */ + uint64_t nextrip; /* (x) next instruction to execute */ }; #define vcpu_lock_initialized(v) mtx_initialized(&((v)->mtx)) @@ -850,16 +851,26 @@ vm_get_register(struct vm *vm, int vcpu, } int -vm_set_register(struct vm *vm, int vcpu, int reg, uint64_t val) +vm_set_register(struct vm *vm, int vcpuid, int reg, uint64_t val) { + struct vcpu *vcpu; + int error; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); if (reg >= VM_REG_LAST) return (EINVAL); - return (VMSETREG(vm->cookie, vcpu, reg, val)); + error = VMSETREG(vm->cookie, vcpuid, reg, val); + if (error || reg != VM_REG_GUEST_RIP) + return (error); + + /* Set 'nextrip' to match the value of %rip */ + VCPU_CTR1(vm, vcpuid, "Setting nextrip to %#lx", val); + vcpu = &vm->vcpu[vcpuid]; + vcpu->nextrip = val; + return (0); } static boolean_t @@ -1199,6 +1210,9 @@ vm_handle_paging(struct vm *vm, int vcpu vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; + KASSERT(vme->inst_length == 0, ("%s: invalid inst_length %d", + __func__, vme->inst_length)); + ftype = vme->u.paging.fault_type; KASSERT(ftype == VM_PROT_READ || ftype == VM_PROT_WRITE || ftype == VM_PROT_EXECUTE, @@ -1224,9 +1238,6 @@ vm_handle_paging(struct vm *vm, int vcpu if (rv != KERN_SUCCESS) return (EFAULT); done: - /* restart execution at the faulting instruction */ - vm_restart_instruction(vm, vcpuid); - return (0); } @@ -1281,10 +1292,13 @@ vm_handle_inst_emul(struct vm *vm, int v return (EFAULT); /* - * If the instruction length is not specified the update it now. + * If the instruction length was not specified then update it now + * along with 'nextrip'. */ - if (vme->inst_length == 0) + if (vme->inst_length == 0) { vme->inst_length = vie->num_processed; + vcpu->nextrip += vie->num_processed; + } /* return to userland unless this is an in-kernel emulated device */ if (gpa >= DEFAULT_APIC_BASE && gpa < DEFAULT_APIC_BASE + PAGE_SIZE) { @@ -1433,7 +1447,7 @@ vm_run(struct vm *vm, struct vm_run *vmr int error, vcpuid; struct vcpu *vcpu; struct pcb *pcb; - uint64_t tscval, rip; + uint64_t tscval; struct vm_exit *vme; bool retu, intr_disabled; pmap_t pmap; @@ -1455,7 +1469,6 @@ vm_run(struct vm *vm, struct vm_run *vmr pmap = vmspace_pmap(vm->vmspace); vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; - rip = vmrun->rip; restart: critical_enter(); @@ -1470,7 +1483,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - error = VMRUN(vm->cookie, vcpuid, rip, pmap, rptr, sptr); + error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, pmap, rptr, sptr); vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1481,6 +1494,7 @@ restart: if (error == 0) { retu = false; + vcpu->nextrip = vme->rip + vme->inst_length; switch (vme->exitcode) { case VM_EXITCODE_SUSPENDED: error = vm_handle_suspend(vm, vcpuid, &retu); @@ -1517,10 +1531,8 @@ restart: } } - if (error == 0 && retu == false) { - rip = vme->rip + vme->inst_length; + if (error == 0 && retu == false) goto restart; - } /* copy the exit information */ bcopy(vme, &vmrun->vm_exit, sizeof(struct vm_exit)); @@ -1530,14 +1542,43 @@ restart: int vm_restart_instruction(void *arg, int vcpuid) { + struct vm *vm; struct vcpu *vcpu; - struct vm *vm = arg; + enum vcpu_state state; + uint64_t rip; + int error; + vm = arg; if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; - vcpu->exitinfo.inst_length = 0; + state = vcpu_get_state(vm, vcpuid, NULL); + if (state == VCPU_RUNNING) { + /* + * When a vcpu is "running" the next instruction is determined + * by adding 'rip' and 'inst_length' in the vcpu's 'exitinfo'. + * Thus setting 'inst_length' to zero will cause the current + * instruction to be restarted. + */ + vcpu->exitinfo.inst_length = 0; + VCPU_CTR1(vm, vcpuid, "restarting instruction at %#lx by " + "setting inst_length to zero", vcpu->exitinfo.rip); + } else if (state == VCPU_FROZEN) { + /* + * When a vcpu is "frozen" it is outside the critical section + * around VMRUN() and 'nextrip' points to the next instruction. + * Thus instruction restart is achieved by setting 'nextrip' + * to the vcpu's %rip. + */ + error = vm_get_register(vm, vcpuid, VM_REG_GUEST_RIP, &rip); + KASSERT(!error, ("%s: error %d getting rip", __func__, error)); + VCPU_CTR2(vm, vcpuid, "restarting instruction by updating " + "nextrip from %#lx to %#lx", vcpu->nextrip, rip); + vcpu->nextrip = rip; + } else { + panic("%s: invalid state %d", __func__, state); + } return (0); } Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/sys/amd64/vmm/vmm_dev.c Sun Jan 18 03:08:30 2015 (r277310) @@ -205,6 +205,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_ACTIVATE_CPU: case VM_SET_INTINFO: case VM_GET_INTINFO: + case VM_RESTART_INSTRUCTION: /* * XXX fragile, handle with care * Assumes that the first field of the ioctl data is the vcpu. @@ -506,6 +507,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c rtctime = (struct vm_rtc_time *)data; rtctime->secs = vrtc_get_time(sc->vm); break; + case VM_RESTART_INSTRUCTION: + error = vm_restart_instruction(sc->vm, vcpu); + break; default: error = ENOTTY; break; Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/usr.sbin/bhyve/bhyverun.c Sun Jan 18 03:08:30 2015 (r277310) @@ -185,20 +185,14 @@ vm_inject_fault(void *arg, int vcpu, int int errcode) { struct vmctx *ctx; - int error; + int error, restart_instruction; ctx = arg; - if (errcode_valid) - error = vm_inject_exception2(ctx, vcpu, vector, errcode); - else - error = vm_inject_exception(ctx, vcpu, vector); - assert(error == 0); + restart_instruction = 1; - /* - * Set the instruction length to 0 to ensure that the instruction is - * restarted when the fault handler returns. - */ - vmexit[vcpu].inst_length = 0; + error = vm_inject_exception(ctx, vcpu, vector, errcode_valid, errcode, + restart_instruction); + assert(error == 0); } void * @@ -329,12 +323,6 @@ vmexit_inout(struct vmctx *ctx, struct v } error = emulate_inout(ctx, vcpu, vme, strictio); - if (!error && in && !string) { - error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, - vme->u.inout.eax); - assert(error == 0); - } - if (error) { fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); @@ -358,7 +346,7 @@ vmexit_rdmsr(struct vmctx *ctx, struct v vme->u.msr.code, *pvcpu); if (strictmsr) { vm_inject_gp(ctx, *pvcpu); - return (VMEXIT_RESTART); + return (VMEXIT_CONTINUE); } } @@ -384,7 +372,7 @@ vmexit_wrmsr(struct vmctx *ctx, struct v vme->u.msr.code, vme->u.msr.wval, *pvcpu); if (strictmsr) { vm_inject_gp(ctx, *pvcpu); - return (VMEXIT_RESTART); + return (VMEXIT_CONTINUE); } } return (VMEXIT_CONTINUE); @@ -462,9 +450,11 @@ static int vmexit_bogus(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + assert(vmexit->inst_length == 0); + stats.vmexit_bogus++; - return (VMEXIT_RESTART); + return (VMEXIT_CONTINUE); } static int @@ -494,9 +484,11 @@ static int vmexit_mtrap(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + assert(vmexit->inst_length == 0); + stats.vmexit_mtrap++; - return (VMEXIT_RESTART); + return (VMEXIT_CONTINUE); } static int @@ -581,7 +573,7 @@ static vmexit_handler_t handler[VM_EXITC }; static void -vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip) +vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip) { int error, rc, prevcpu; enum vm_exitcode exitcode; @@ -596,8 +588,11 @@ vm_loop(struct vmctx *ctx, int vcpu, uin error = vm_active_cpus(ctx, &active_cpus); assert(CPU_ISSET(vcpu, &active_cpus)); + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RIP, startrip); + assert(error == 0); + while (1) { - error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]); + error = vm_run(ctx, vcpu, &vmexit[vcpu]); if (error != 0) break; @@ -614,10 +609,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin switch (rc) { case VMEXIT_CONTINUE: - rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; - break; - case VMEXIT_RESTART: - rip = vmexit[vcpu].rip; break; case VMEXIT_ABORT: abort(); Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Sun Jan 18 01:50:10 2015 (r277309) +++ head/usr.sbin/bhyve/bhyverun.h Sun Jan 18 03:08:30 2015 (r277310) @@ -35,9 +35,8 @@ #define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] #endif -#define VMEXIT_CONTINUE 1 /* continue from next instruction */ -#define VMEXIT_RESTART 2 /* restart current instruction */ -#define VMEXIT_ABORT 3 /* abort the vm run loop */ +#define VMEXIT_CONTINUE (0) +#define VMEXIT_ABORT (-1) struct vmctx; extern int guest_ncpus; Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/usr.sbin/bhyve/inout.c Sun Jan 18 03:08:30 2015 (r277310) @@ -104,7 +104,7 @@ int emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) { int addrsize, bytes, flags, in, port, prot, rep; - uint32_t val; + uint32_t eax, val; inout_func_t handler; void *arg; int error, retval; @@ -214,16 +214,20 @@ emulate_inout(struct vmctx *ctx, int vcp } /* Restart the instruction if more iterations remain */ - if (retval == 0 && count != 0) - vmexit->inst_length = 0; - } else { - if (!in) { - val = vmexit->u.inout.eax & vie_size2mask(bytes); + if (retval == 0 && count != 0) { + error = vm_restart_instruction(ctx, vcpu); + assert(error == 0); } + } else { + eax = vmexit->u.inout.eax; + val = eax & vie_size2mask(bytes); retval = handler(ctx, vcpu, in, port, bytes, &val, arg); if (retval == 0 && in) { - vmexit->u.inout.eax &= ~vie_size2mask(bytes); - vmexit->u.inout.eax |= val & vie_size2mask(bytes); + eax &= ~vie_size2mask(bytes); + eax |= val & vie_size2mask(bytes); + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, + eax); + assert(error == 0); } } return (retval); Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/usr.sbin/bhyve/task_switch.c Sun Jan 18 03:08:30 2015 (r277310) @@ -725,21 +725,11 @@ vmexit_task_switch(struct vmctx *ctx, st assert(paging->cpu_mode == CPU_MODE_PROTECTED); /* - * Calculate the %eip to store in the old TSS before modifying the - * 'inst_length'. + * Calculate the instruction pointer to store in the old TSS. */ eip = vmexit->rip + vmexit->inst_length; /* - * Set the 'inst_length' to '0'. - * - * If an exception is triggered during emulation of the task switch - * then the exception handler should return to the instruction that - * caused the task switch as opposed to the subsequent instruction. - */ - vmexit->inst_length = 0; - - /* * Section 4.6, "Access Rights" in Intel SDM Vol 3. * The following page table accesses are implicitly supervisor mode: * - accesses to GDT or LDT to load segment descriptors @@ -883,8 +873,8 @@ vmexit_task_switch(struct vmctx *ctx, st * after this point will be handled in the context of the new task and * the saved instruction pointer will belong to the new task. */ - vmexit->rip = newtss.tss_eip; - assert(vmexit->inst_length == 0); + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RIP, newtss.tss_eip); + assert(error == 0); /* Load processor state from new TSS */ error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov); Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sun Jan 18 01:50:10 2015 (r277309) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sun Jan 18 03:08:30 2015 (r277310) @@ -2118,10 +2118,7 @@ main(int argc, char *argv[]) } if (!error && run) { - error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); - assert(error == 0); - - error = vm_run(ctx, vcpu, rip, &vmexit); + error = vm_run(ctx, vcpu, &vmexit); if (error == 0) dump_vm_run_exitcode(&vmexit, vcpu); else From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 03:37:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91266A93; Sun, 18 Jan 2015 03:37:24 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 187C7142; Sun, 18 Jan 2015 03:37:23 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8FE0425D3A00; Sun, 18 Jan 2015 03:37:20 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BA5ADC770AE; Sun, 18 Jan 2015 03:37:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id oQ_rXAa1CVHf; Sun, 18 Jan 2015 03:37:17 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a] (unknown [IPv6:fde9:577b:c1a9:4410:f501:6ee5:ce6a:361a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4DAF1C7706F; Sun, 18 Jan 2015 03:37:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... From: "Bjoern A. Zeeb" In-Reply-To: <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> Date: Sun, 18 Jan 2015 03:37:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 03:37:24 -0000 > On 18 Jan 2015, at 01:33 , Bjoern A. Zeeb wrote: >=20 >=20 >> On 17 Jan 2015, at 16:36 , Hans Petter Selasky = wrote: >>=20 >> Author: hselasky >> Date: Sat Jan 17 16:36:39 2015 >> New Revision: 277302 >> URL: https://svnweb.freebsd.org/changeset/base/277302 >>=20 >> Log: >> Start importing the basic OFED linux compatibility layer changes made >> by dumbbell@ to be able to compile this layer as a dependency module. >> Clean up some Makefiles and remove the no longer used OFED define. >=20 > Build files, NOTES files, .. still referenced the =E2=80=9COFED=E2=80=9D= option. I put it back in for now to unbreak LINT builds. Please = cleanup properly. Can always put it into reviews and find someone to = make sure you caught all places. >=20 Ok, never mind: = /home/baz21/SVN/head-reviews.svn/sys/ofed/include/linux/linux_compat.c:49:= 10: fatal error: 'linux/kobject.h' file not found #include ^ 1 error generated. = /home/baz21/SVN/head-reviews.svn/sys/ofed/include/linux/linux_pci.c:47:10:= fatal error: 'linux/kobject.h' file not found #include ^ 1 error generated. = /home/baz21/SVN/head-reviews.svn/sys/ofed/include/linux/linux_idr.c:40:10:= fatal error: 'linux/bitops.h' file not found #include ^ 1 error generated. = /home/baz21/SVN/head-reviews.svn/sys/ofed/include/linux/linux_radix.c:36:1= 0: fatal error: 'linux/slab.h' file not found #include ^ 1 error generated. mkdep: compile failed --- .depend --- *** [.depend] Error code 1 >> Currently only i386 and amd64 targets are supported. >>=20 >> MFC after: 1 month >> Sponsored by: Mellanox Technologies >>=20 >> Added: >> .. >> Modified: >> .. >> head/sys/conf/options >> .. >=20 >> Modified: head/sys/conf/options >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/conf/options Sat Jan 17 15:19:18 2015 = (r277301) >> +++ head/sys/conf/options Sat Jan 17 16:36:39 2015 = (r277302) >> @@ -85,6 +85,7 @@ COMPAT_FREEBSD6 opt_compat.h >> COMPAT_FREEBSD7 opt_compat.h >> COMPAT_FREEBSD9 opt_compat.h >> COMPAT_FREEBSD10 opt_compat.h >> +COMPAT_LINUXAPI opt_compat.h >=20 > On another note: this sounds really strange to me. >=20 >=20 >> COMPILING_LINT opt_global.h >> COMPRESS_USER_CORES opt_core.h >> CY_PCI_FASTINTR >> @@ -907,7 +908,6 @@ FDT opt_platform.h >> FDT_DTB_STATIC opt_platform.h >>=20 >> # OFED Infiniband stack >> -OFED opt_ofed.h >> OFED_DEBUG_INIT opt_ofed.h >> SDP opt_ofed.h >> SDP_DEBUG opt_ofed.h >>=20 >=20 > =E2=80=94=20 > Bjoern A. Zeeb Charles Haddon = Spurgeon: > "Friendship is one of the sweetest joys of life. Many might have = failed > beneath the bitterness of their trial had they not found a friend." >=20 >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 03:43:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78B2CBF1; Sun, 18 Jan 2015 03:43:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662641EF; Sun, 18 Jan 2015 03:43:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I3hmG1055420; Sun, 18 Jan 2015 03:43:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I3hm8n055419; Sun, 18 Jan 2015 03:43:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201501180343.t0I3hm8n055419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 18 Jan 2015 03:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277311 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 03:43:48 -0000 Author: imp Date: Sun Jan 18 03:43:47 2015 New Revision: 277311 URL: https://svnweb.freebsd.org/changeset/base/277311 Log: Include mca_machdep.h. Modified: head/sys/x86/isa/atpic.c Modified: head/sys/x86/isa/atpic.c ============================================================================== --- head/sys/x86/isa/atpic.c Sun Jan 18 03:08:30 2015 (r277310) +++ head/sys/x86/isa/atpic.c Sun Jan 18 03:43:47 2015 (r277311) @@ -58,6 +58,9 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#ifdef DEV_MCA +#include +#endif #ifdef __amd64__ #define SDT_ATPIC SDT_SYSIGT From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 03:55:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EFA5E08 for ; Sun, 18 Jan 2015 03:55:52 +0000 (UTC) Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D95592E2 for ; Sun, 18 Jan 2015 03:55:51 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id l18so4429831wgh.10 for ; Sat, 17 Jan 2015 19:55:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=EMqmKDste9WvslNXHrxNK+iPHYwIeFgQSwelUpNCAa4=; b=lXRboBOH44EB2VxqQWMT4/YOhFAVd3E36WtV2yQvINUd6r98fvVG/wxwt0ch7yzgfa ThggVpnphYu+ww1b1ho+TjhnW92QnjBmakSYZkiXRFxhsPS7Tsx+zZsJEXJQWAOBPDNd KvjiZB8BdMkfgFg5pzm3YCa5hC+blUmVQK42kAJIH03QT3Fn3AxlnPRhqRNw8bFS7ZAd s9lU8MXvV+xCyycon8PR8qVD9JWrJNyVOvM7Hp1VOqjDywox3zVlBao14Q6UnmXIMrit PkNbBvyT9/EAduJ6KDRq66cflPZBfoDeVeqCXfc3q9BmyPmTyl+fn47HklzE4BDPHlfe tmsA== X-Gm-Message-State: ALoCoQkzzcICN8VnmhDPcvf6kglTvukfYvf6Mrb3BdQl8X8ZPOiqcV0GUvuKATFzrjOTjbFz6qRx X-Received: by 10.194.80.193 with SMTP id t1mr25204422wjx.8.1421553344591; Sat, 17 Jan 2015 19:55:44 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id fi10sm8833718wib.13.2015.01.17.19.55.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Jan 2015 19:55:43 -0800 (PST) Message-ID: <54BB2EBB.3090006@multiplay.co.uk> Date: Sun, 18 Jan 2015 03:55:39 +0000 From: Steven Hartland User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: d@delphij.net, svn-src-head@freebsd.org Subject: Re: svn commit: r276123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201412230931.sBN9VPMK017968@svn.freebsd.org> <54A35B88.9090102@delphij.net> <54A39153.8040905@freebsd.org> <54A3ACEF.70905@delphij.net> <54A5AC21.5070802@multiplay.co.uk> <54A6DB61.9060607@delphij.net> In-Reply-To: <54A6DB61.9060607@delphij.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 03:55:52 -0000 On 02/01/2015 17:54, Xin Li wrote: > Yes, this fixes the problem, thanks for working on it. I'm not fully > convinced with the approach though -- shouldn't we update the > cachefile (again) when the pool become available? Just been looking at this again and when I import a pool which was previously unavailable it does write the cache file out. Do you have some basic reproduction steps for your setup where it isn't? Regards Steve From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 05:05:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6C0D314 for ; Sun, 18 Jan 2015 05:05:00 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CA901A12 for ; Sun, 18 Jan 2015 05:05:00 +0000 (UTC) Received: from Xins-MBP.home.us.delphij.net (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id E5CD92113; Sat, 17 Jan 2015 21:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1421557499; x=1421571899; bh=WfVWdn2/PdGQhVZycWHLWKEj2SNS4arBAXrxZhSaPoA=; h=Date:From:To:Subject:References:In-Reply-To; b=a9A5xUgXHNL7CwAQw83MjsXRrKr1i7lEnOaL72XjuazqgJROVy0f7LkfpVEIj8wuC yuG8cpYa2VRS3oGi2xVMIl9HYan5InHfvZAckcvrRVjS5X/NxoiPkziqpkW5WIzMMS Mzt0JFuhys/AeTm5k8syuNwoFRlYFzYdMwfi4Qb4= Message-ID: <54BB3EF9.2080701@delphij.net> Date: Sat, 17 Jan 2015 21:04:57 -0800 From: Xin Li User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Steven Hartland , d@delphij.net, svn-src-head@freebsd.org Subject: Re: svn commit: r276123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201412230931.sBN9VPMK017968@svn.freebsd.org> <54A35B88.9090102@delphij.net> <54A39153.8040905@freebsd.org> <54A3ACEF.70905@delphij.net> <54A5AC21.5070802@multiplay.co.uk> <54A6DB61.9060607@delphij.net> <54BB2EBB.3090006@multiplay.co.uk> In-Reply-To: <54BB2EBB.3090006@multiplay.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 05:05:01 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 1/17/15 19:55, Steven Hartland wrote: > > On 02/01/2015 17:54, Xin Li wrote: >> Yes, this fixes the problem, thanks for working on it. I'm not >> fully convinced with the approach though -- shouldn't we update >> the cachefile (again) when the pool become available? > Just been looking at this again and when I import a pool which was > previously unavailable it does write the cache file out. Well technically it's not an explicit import: the encrypted devices do not exist at the time the system boots (when zfs tries to update the cache file, it would not "see" the devices), but they would appear before 'zfs mount -va' runs by /etc/rc.d/zfs. > Do you have some basic reproduction steps for your setup where it > isn't? Yes, it's mostly: - Create an encrypted GELI provider that is protected by key (or passphrase, or both, this shouldn't matter). - Configure in /etc/rc.conf, something like: geli_devices="ada1" geli_default_flags="-k /keys/geli.key -p" geli_autodetach="NO" - Create a pool with ada1.eli (the encrypted provider). - Reboot twice. Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUuz74AAoJEJW2GBstM+nscTwP/jL0rCoamjondX6TXC3uNfKI LoAWOd5++cBcI8/4iBDx8xLF4bZ3lUayP1hAP6i1QTrhV6Ba3l629M49CjADueIx lyrcUvRXfwanb1a7WQGBMr238AF3H0PAlrdeX3szCQT9FYFWKe+kCD24EeKzs6QL CJxewl/5o05Pv3zF/sjbpLC/hgFpqUFreSgN40ohrhMVbTzl45dLy49gwbRuDF5K WQfmWJAL6JnUySobalWcTIkZCZARphyWwMnhjNeswAZnCMbvJXp0nHWbtl7CTven ptvBfJ3phcR9tqGGtInUhS63wrO6PAHxQ+2drsW5nbJOqLFgWyP5ngxyWqQIkYs5 BISR7xBabwMyBlZK9hyKYT29p/aTwTUn1iy51m/KY5soSnyzDE9OSwJqOvLXwQiJ +uG9y7RT3PFqLWYQ5wJiDRt2WwC+GFkK6q6KHoa3I2ox0ohP3Gv8beGI35n3Xxa5 aslCs4cDJaIueaRpDQPdvWmH6qky4dfbsVEDOSSzmXSJA84UVSh8KdXMrfPVFnXT LAK5ocE4nfxLQsaOGl8RzKJHzjhrsqaWoVoMfviVyTVUQ69PZHoRDH7vUOBn8pQx YsZT+XkruHscqTPDAbpJn9Jxxkx5A/xnPW0yE+j/Uyn5im/SOdlqDCjzXw1SrUTq CRB8sixwPgjDJP95oOrp =Yhmr -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 06:43:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2545AFF2; Sun, 18 Jan 2015 06:43:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 060D31FB; Sun, 18 Jan 2015 06:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I6h9wj038298; Sun, 18 Jan 2015 06:43:09 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I6h9me038297; Sun, 18 Jan 2015 06:43:09 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501180643.t0I6h9me038297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 18 Jan 2015 06:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277313 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 06:43:10 -0000 Author: gonzo Date: Sun Jan 18 06:43:09 2015 New Revision: 277313 URL: https://svnweb.freebsd.org/changeset/base/277313 Log: Fix programming timing parameters to LCDC. Actual value used for HBP, HFP, HSW, VSW is register's programmed value + 1. Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sun Jan 18 05:31:26 2015 (r277312) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sun Jan 18 06:43:09 2015 (r277313) @@ -433,6 +433,9 @@ am335x_lcd_attach(device_t dev) uint32_t burst_log; int err; size_t dma_size; + uint32_t hbp, hfp, hsw; + uint32_t vbp, vfp, vsw; + uint32_t width, height; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -527,31 +530,42 @@ am335x_lcd_attach(device_t dev) /* Set timing */ timing0 = timing1 = timing2 = 0; + hbp = panel.panel_hbp - 1; + hfp = panel.panel_hfp - 1; + hsw = panel.panel_hsw - 1; + + vbp = panel.panel_vbp; + vfp = panel.panel_vfp; + vsw = panel.panel_vsw - 1; + + height = panel.panel_height - 1; + width = panel.panel_width - 1; + /* Horizontal back porch */ - timing0 |= (panel.panel_hbp & 0xff) << RASTER_TIMING_0_HBP_SHIFT; - timing2 |= ((panel.panel_hbp >> 8) & 3) << RASTER_TIMING_2_HBPHI_SHIFT; + timing0 |= (hbp & 0xff) << RASTER_TIMING_0_HBP_SHIFT; + timing2 |= ((hbp >> 8) & 3) << RASTER_TIMING_2_HBPHI_SHIFT; /* Horizontal front porch */ - timing0 |= (panel.panel_hfp & 0xff) << RASTER_TIMING_0_HFP_SHIFT; - timing2 |= ((panel.panel_hfp >> 8) & 3) << RASTER_TIMING_2_HFPHI_SHIFT; + timing0 |= (hfp & 0xff) << RASTER_TIMING_0_HFP_SHIFT; + timing2 |= ((hfp >> 8) & 3) << RASTER_TIMING_2_HFPHI_SHIFT; /* Horizontal sync width */ - timing0 |= (panel.panel_hsw & 0x3f) << RASTER_TIMING_0_HSW_SHIFT; - timing2 |= ((panel.panel_hsw >> 6) & 0xf) << RASTER_TIMING_2_HSWHI_SHIFT; + timing0 |= (hsw & 0x3f) << RASTER_TIMING_0_HSW_SHIFT; + timing2 |= ((hsw >> 6) & 0xf) << RASTER_TIMING_2_HSWHI_SHIFT; /* Vertical back porch, front porch, sync width */ - timing1 |= (panel.panel_vbp & 0xff) << RASTER_TIMING_1_VBP_SHIFT; - timing1 |= (panel.panel_vfp & 0xff) << RASTER_TIMING_1_VFP_SHIFT; - timing1 |= (panel.panel_vsw & 0x3f) << RASTER_TIMING_1_VSW_SHIFT; + timing1 |= (vbp & 0xff) << RASTER_TIMING_1_VBP_SHIFT; + timing1 |= (vfp & 0xff) << RASTER_TIMING_1_VFP_SHIFT; + timing1 |= (vsw & 0x3f) << RASTER_TIMING_1_VSW_SHIFT; /* Pixels per line */ - timing0 |= (((panel.panel_width - 1) >> 10) & 1) + timing0 |= ((width >> 10) & 1) << RASTER_TIMING_0_PPLMSB_SHIFT; - timing0 |= (((panel.panel_width - 1) >> 4) & 0x3f) + timing0 |= ((width >> 4) & 0x3f) << RASTER_TIMING_0_PPLLSB_SHIFT; /* Lines per panel */ - timing1 |= ((panel.panel_height - 1) & 0x3ff) + timing1 |= (height & 0x3ff) << RASTER_TIMING_1_LPP_SHIFT; - timing2 |= (((panel.panel_height - 1) >> 10 ) & 1) + timing2 |= ((height >> 10 ) & 1) << RASTER_TIMING_2_LPP_B10_SHIFT; /* clock signal settings */ From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 07:08:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D74BB34A; Sun, 18 Jan 2015 07:08:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C302A3C8; Sun, 18 Jan 2015 07:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0I787iL048064; Sun, 18 Jan 2015 07:08:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0I787OL048063; Sun, 18 Jan 2015 07:08:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201501180708.t0I787OL048063@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 18 Jan 2015 07:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277314 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 07:08:08 -0000 Author: jhibbits Date: Sun Jan 18 07:08:06 2015 New Revision: 277314 URL: https://svnweb.freebsd.org/changeset/base/277314 Log: Use proper signed types. The ADT746x uses signed 8-bit numbers for the temperature. MFC after: 2 weeks Modified: head/sys/dev/iicbus/adt746x.c Modified: head/sys/dev/iicbus/adt746x.c ============================================================================== --- head/sys/dev/iicbus/adt746x.c Sun Jan 18 06:43:09 2015 (r277313) +++ head/sys/dev/iicbus/adt746x.c Sun Jan 18 07:08:06 2015 (r277314) @@ -539,9 +539,10 @@ static int adt746x_sensor_read(struct adt746x_sensor *sens) { struct adt746x_softc *sc; - uint16_t tmp = 0; + int tmp = 0; uint16_t val; - uint8_t temp, data[1], data1[1]; + uint8_t data[1], data1[1]; + int8_t temp; sc = device_get_softc(sens->dev); if (sens->type != ADT746X_SENSOR_SPEED) { From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 09:47:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 584B8423; Sun, 18 Jan 2015 09:47:46 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14A0D2A2; Sun, 18 Jan 2015 09:47:46 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D711B1FE023; Sun, 18 Jan 2015 10:47:43 +0100 (CET) Message-ID: <54BB8170.7000106@selasky.org> Date: Sun, 18 Jan 2015 10:48:32 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> In-Reply-To: <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 09:47:46 -0000 On 01/18/15 02:33, Bjoern A. Zeeb wrote: > >> On 17 Jan 2015, at 16:36 , Hans Petter Selasky wrote: >> >> Author: hselasky >> Date: Sat Jan 17 16:36:39 2015 >> New Revision: 277302 >> URL: https://svnweb.freebsd.org/changeset/base/277302 >> >> Log: >> Start importing the basic OFED linux compatibility layer changes made >> by dumbbell@ to be able to compile this layer as a dependency module. >> Clean up some Makefiles and remove the no longer used OFED define. > > Build files, NOTES files, .. still referenced the “OFED†option. I put it back in for now to unbreak LINT builds. Please cleanup properly. Can always put it into reviews and find someone to make sure you caught all places. > OK, then I need to do a universe build simply. --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 09:50:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC3D4690; Sun, 18 Jan 2015 09:50:04 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 786D22BF; Sun, 18 Jan 2015 09:50:04 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9137A1FE023; Sun, 18 Jan 2015 10:50:02 +0100 (CET) Message-ID: <54BB81FC.3030501@selasky.org> Date: Sun, 18 Jan 2015 10:50:52 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 09:50:04 -0000 On 01/18/15 04:37, Bjoern A. Zeeb wrote: > >> On 18 Jan 2015, at 01:33 , Bjoern A. Zeeb wrote: >> >> >>> On 17 Jan 2015, at 16:36 , Hans Petter Selasky wrote: >>> >>> Author: hselasky >>> Date: Sat Jan 17 16:36:39 2015 >>> New Revision: 277302 >>> URL: https://svnweb.freebsd.org/changeset/base/277302 >>> >>> Log: >>> Start importing the basic OFED linux compatibility layer changes made >>> by dumbbell@ to be able to compile this layer as a dependency module. >>> Clean up some Makefiles and remove the no longer used OFED define. >> >> Build files, NOTES files, .. still referenced the “OFED†option. I put it back in for now to unbreak LINT builds. Please cleanup properly. Can always put it into reviews and find someone to make sure you caught all places. >> > > Ok, never mind: > > /home/baz21/SVN/head-reviews.svn/sys/ofed/include/linux/linux_compat.c:49:10: fatal error: 'linux/kobject.h' file not found > #include > ^ > 1 error generated. I'll fix it. --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 10:53:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CDC495C; Sun, 18 Jan 2015 10:53:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87A5FADA; Sun, 18 Jan 2015 10:53:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IArnrW059397; Sun, 18 Jan 2015 10:53:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IArnjd059396; Sun, 18 Jan 2015 10:53:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501181053.t0IArnjd059396@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 18 Jan 2015 10:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277316 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 10:53:49 -0000 Author: hselasky Date: Sun Jan 18 10:53:48 2015 New Revision: 277316 URL: https://svnweb.freebsd.org/changeset/base/277316 Log: Extend fixes made in r277308 to fix build of LINT kernels for i386 and amd64. Until further we need some custom C-flags when building the Linux compat API. MFC after: 1 month Sponsored by: Mellanox Technologies Reported by: bz@ Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 18 09:49:32 2015 (r277315) +++ head/sys/conf/files Sun Jan 18 10:53:48 2015 (r277316) @@ -3572,11 +3572,16 @@ nlm/nlm_prot_xdr.c optional nfslockd | nlm/sm_inter_xdr.c optional nfslockd | nfsd # Linux Kernel Compatibility API -ofed/include/linux/linux_kmod.c optional ofed | compat_linuxapi -ofed/include/linux/linux_compat.c optional ofed | compat_linuxapi -ofed/include/linux/linux_pci.c optional ofed | compat_linuxapi -ofed/include/linux/linux_idr.c optional ofed | compat_linuxapi -ofed/include/linux/linux_radix.c optional ofed | compat_linuxapi +ofed/include/linux/linux_kmod.c optional ofed | compat_linuxapi \ + no-depend compile-with "${OFED_C}" +ofed/include/linux/linux_compat.c optional ofed | compat_linuxapi \ + no-depend compile-with "${OFED_C}" +ofed/include/linux/linux_pci.c optional ofed | compat_linuxapi \ + no-depend compile-with "${OFED_C}" +ofed/include/linux/linux_idr.c optional ofed | compat_linuxapi \ + no-depend compile-with "${OFED_C}" +ofed/include/linux/linux_radix.c optional ofed | compat_linuxapi \ + no-depend compile-with "${OFED_C}" # OpenFabrics Enterprise Distribution (Infiniband) ofed/drivers/infiniband/core/addr.c optional ofed \ no-depend \ From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 10:54:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 107B9A99; Sun, 18 Jan 2015 10:54:18 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C116ADF; Sun, 18 Jan 2015 10:54:17 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0IAsASh080577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jan 2015 12:54:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0IAsASh080577 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0IAsAYd080576; Sun, 18 Jan 2015 12:54:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Jan 2015 12:54:10 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277199 - in head/sys: fs/devfs kern Message-ID: <20150118105410.GN42409@kib.kiev.ua> References: <201501142207.t0EM7Dfn041543@svn.freebsd.org> <20150115033109.GM42409@kib.kiev.ua> <54B76F2B.8040106@selasky.org> <20150115093841.GX42409@kib.kiev.ua> <54B79B25.3070707@selasky.org> <20150115115123.GA42409@kib.kiev.ua> <54B7AF2F.3080802@selasky.org> <20150116080332.GE42409@kib.kiev.ua> <54B8D31B.9030805@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54B8D31B.9030805@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 10:54:18 -0000 On Fri, Jan 16, 2015 at 10:00:11AM +0100, Hans Petter Selasky wrote: > Hi Konstantin, > > On 01/16/15 09:03, Konstantin Belousov wrote: > > My opinion is that you should have tried to handle the issue at the driver > > level, instead of making this devfs issue. I.e., if you already have > > cdev node with the correct name, driver should have replaced the private > > data to point to new device. > > I think this way cannot be implemented in a clean way, because of > locking order reversal. And if you try to avoid the LOR you end up with > the race. Chess mate sort of ;-) Let me explain: > > Thread 1: > usb_sx_lock(); > cdev = Look in freelist for existing device(); > else > cdev = make_dev(); > usb_sx_unlock(); > > Thread 2: > usb_sx_lock(); > put cdev on freelist > usb_sx_unlock(); > > Thread 3: > usb_sx_lock(); > cdev = remove first entry in freelist > usb_sx_unlock(); > > /* > * XXX because USB needs to call destroy_dev() unlocked we > * are racing with Thread 1 again > */ > destroy_dev(cdev); I do not understand the 'freelist' part. You have some usb (or whatever other kind) device, which is represented by some data structure. This data structure references cdev. In reverse, cdev points to this data structure by si_drv1 or similar driver-owned member of struct cdev. The structures naming usb devices have some mapping to/from usb bus addresses. When device is destroyed or created due to external plug event, there is some mechanism that ensures mapping consistence. It could be lock, it could be single-threaded process which discover the bus, or something else, I do not know. While the structure notes that device with some address goes out and comes in, it can look up the corresponding cdev and just change the si_drv1 pointer to point to the new device. I find it very strange that you need sleepless operation which can _both_ destroy and create cdev. At least one operation of creation or destruction must sleep, at least in the current devfs design. It could be made sleepless, by making VFS visible part even less connected to the cdev part, but this is not how it (can) currently work. > > > > > This would also close a window where /dev node is non-existent or operate > > erronously. > > I'm not saying I plan so, but I think "cdevs" at some point need to > understand mutexes and locks. That means like with other API's in the > kernel we can associate a lock with the "cdev", and this lock is then > used to ensure an atomic shutdown of the system in a non-blocking > fashion. In my past experience multithreaded APIs should be high level > implemented like this: > > NON-BLOCKING methods: > lock(); ** > xxx_start(); > xxx_stop(); > unlock(); > > BLOCKING methods: > setup(); // init > unsetup(); // drain > > Any callbacks should always be called locked ** > > In devfs there was no non-blocking stop before I added the delist_dev() > function. > > > > > You do not understand my point. > > > > I object against imposing one additional global reference on all cdevs > > just to cope with the delist hack. See the patch at the end of the message. > > It's fine by me. > > > > WRT destroy_dev_sched_cb() calling delist_dev(), even after calling > > delist_dev(), the node still exists in the /dev. It is only removed > > after populate loop is run sometime later. dev_sched() KPI is inheritly > > racy, drivers must handle the races for other reasons. > > The populate loop is all running under the dev_lock() from what I can > see and make_dev() is also keeping the same lock when inserting and > removing new cdevs. The populate loop should always give a consistent No, populate loop is not run under dev_mtx. It would not be able to allocate memory, even in M_NOWAIT fashion. The dev_mtx is after the vm and vnode locks. Only iteration over the cdevp_list is protected by dev_mtx, which is dropped right after something which require an action, is found on the list. Populate() needs some way to avoid reading inconsistent data from the cdev layer, but there is not guarantee that we are always up to date. > view of the character devices available, and I don't see how "cdev" > structures without the CDP_ACTIVE flag can appear with recently created > ones, even if the name is the same. It cannot simply because it is not synchronized with the device creation/destruction. > > > > >> > >>> Entry can be random, since after the populate loop is ran, your code in > >>> other thread could start and create duplicate entry. There is a window > >>> in the lookup where both directory vnode lock and mount point sx locks > >>> are dropped. So running the populate does not guarantee anything. > >> > >> If there is such a race, it is already there! My patch changes nothing > >> in that area: > >> > >> Thread1: > >> Calls destroy_dev() and clears CDP_ACTIVE, after dev_unlock() it goes > >> waiting for some refs for xxx milliseconds. > >> Thread2: > >> Tries to create create a new character device having the same name like > >> the one in thread1. Device name duplication check is missed because > >> CDP_ACTIVE is cleared. Still thread1 is waiting. > >> Thread3: > >> Tries to open character device created by thread2 while thread1 is still > >> waiting for some ref held by a userspace app to go away. > >> > >> This can happen already before my patches! What do you think? > > Possibly. > > > > > >> At what level do you mean duplicate names, I don't get this fully? At > >> the directory level (DE nodes)? Or inside the list of character devices > >> (LIST_XXX)? > > It does not matter, dup at either one directory level, or dup of full > > names in the global list are equivalent (bad) things. > > Like I write above I don't see where the problem is. At the cdev level, > we are protecting the cdev's LIST with dev_lock() and only one entry > will exist having CDP_ACTIVE bit set per unique cdev name and path. Else > we will hit a panic in make_dev() and friends. > > In the directory entry level the populate loop will also ensure a > consistent view, and hence the cdev's LIST is consistent, the view > presented to userspace will also be consistent. Lookup (or any other VFS-level code) is not protected by dev_mtx, it is only dm lock which ensures that populate loop is not run in parallel, modifying direntries. > > That system functions can still call into the dangling read/write/ioctl > functions is another story, and that is why I tell, that in order to > simplify this teardown, we possibly should associate a client selectable > lock with each CDEV, for teardown purposes. Like done for several years > in the callout and USB APIs and possibly many other places. There is d_purge method which provides the tear-down semantic for drivers which needs it. Only tty uses the method AFAIK. Devfs ensures that no client code is active when cdev is removed for real. > > > > >> > >>> Let me summarize: > >>> - the extra reference on arbitrary cdev should be eliminated. The > >>> delist_dev_locked() may add the ref and set some CDP_ flag to > >>> indicate to destroy_dev() that it should do dev_rel(). > >> > >> It is possible to do this. I thought about this before doing my patch, > >> but decided to try to avoid adding yet another cdev flag. > >> > >>> - the existence of the duplicated entries should be either eliminated > >>> (I am not sure it is possible with your code), or we must ensure > >>> that only one name with CDP_ACTIVE flag set and given name exists. > >>> Then, all lookup code must be audited to take CDP_ACTIVE into account > >>> when accessing names. I see at least devfs_find() and devfs_mknod() > >>> which must be changed. I did not performed full audit. > >> > >> I will check this path out aswell. > >> > > > > It seems it is simpler for me to try to clean up after the commit. > > The patch was only lightly tested. I post the patch for discussion, > > not for you to committing it. I will expedite the change into HEAD > > after the consensus on it is made and adequate testing is performed. > > I don't see any problems about your patch, except it adds a bit more > code to the kernel. From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 10:54:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12E36BCF; Sun, 18 Jan 2015 10:54:29 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58E4AE1; Sun, 18 Jan 2015 10:54:28 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EFEF21FE023; Sun, 18 Jan 2015 11:54:26 +0100 (CET) Message-ID: <54BB9114.9010200@selasky.org> Date: Sun, 18 Jan 2015 11:55:16 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> <54BB81FC.3030501@selasky.org> In-Reply-To: <54BB81FC.3030501@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 10:54:29 -0000 See r277316. Thank you! --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 11:07:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25332E60; Sun, 18 Jan 2015 11:07:40 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF076BDE; Sun, 18 Jan 2015 11:07:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3E96B1FE023; Sun, 18 Jan 2015 12:07:36 +0100 (CET) Message-ID: <54BB942A.5070200@selasky.org> Date: Sun, 18 Jan 2015 12:08:26 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277199 - in head/sys: fs/devfs kern References: <201501142207.t0EM7Dfn041543@svn.freebsd.org> <20150115033109.GM42409@kib.kiev.ua> <54B76F2B.8040106@selasky.org> <20150115093841.GX42409@kib.kiev.ua> <54B79B25.3070707@selasky.org> <20150115115123.GA42409@kib.kiev.ua> <54B7AF2F.3080802@selasky.org> <20150116080332.GE42409@kib.kiev.ua> <54B8D31B.9030805@selasky.org> <20150118105410.GN42409@kib.kiev.ua> In-Reply-To: <20150118105410.GN42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 11:07:40 -0000 Hi Konstantin, On 01/18/15 11:54, Konstantin Belousov wrote: > On Fri, Jan 16, 2015 at 10:00:11AM +0100, Hans Petter Selasky wrote: >> Hi Konstantin, >> >> On 01/16/15 09:03, Konstantin Belousov wrote: >>> My opinion is that you should have tried to handle the issue at the driver >>> level, instead of making this devfs issue. I.e., if you already have >>> cdev node with the correct name, driver should have replaced the private >>> data to point to new device. >> >> I think this way cannot be implemented in a clean way, because of >> locking order reversal. And if you try to avoid the LOR you end up with >> the race. Chess mate sort of ;-) Let me explain: >> >> Thread 1: >> usb_sx_lock(); >> cdev = Look in freelist for existing device(); >> else >> cdev = make_dev(); >> usb_sx_unlock(); >> >> Thread 2: >> usb_sx_lock(); >> put cdev on freelist >> usb_sx_unlock(); >> >> Thread 3: >> usb_sx_lock(); >> cdev = remove first entry in freelist >> usb_sx_unlock(); >> >> /* >> * XXX because USB needs to call destroy_dev() unlocked we >> * are racing with Thread 1 again >> */ >> destroy_dev(cdev); > I do not understand the 'freelist' part. > > You have some usb (or whatever other kind) device, which is represented by > some data structure. This data structure references cdev. In reverse, > cdev points to this data structure by si_drv1 or similar driver-owned > member of struct cdev. > > The structures naming usb devices have some mapping to/from usb bus addresses. > When device is destroyed or created due to external plug event, there is > some mechanism that ensures mapping consistence. It could be lock, it > could be single-threaded process which discover the bus, or something > else, I do not know. > > While the structure notes that device with some address goes out and comes > in, it can look up the corresponding cdev and just change the si_drv1 pointer > to point to the new device. What about events for "devd" that a new character devices is present in the system or being destroyed for user-space applications? > > I find it very strange that you need sleepless operation which can > _both_ destroy and create cdev. At least one operation of creation or > destruction must sleep, at least in the current devfs design. It could > be made sleepless, by making VFS visible part even less connected to the > cdev part, but this is not how it (can) currently work. I think it would be good practice that all resources needed for creating a character device can be allocated prior to registration. That means we first should allocate all resources needed, but not register as a single function. For example: Once make_dev() has returned, we can get an "d_open" callback. But "si_drv1/2" is always set by drivers _after_ that "make_dev()" has returned! This causes a race we could simply avoid by splitting the make_dev() like I suggest. Instead of putting more logic and code inside the drivers to handle the race! >> >>> >>> This would also close a window where /dev node is non-existent or operate >>> erronously. >> >> I'm not saying I plan so, but I think "cdevs" at some point need to >> understand mutexes and locks. That means like with other API's in the >> kernel we can associate a lock with the "cdev", and this lock is then >> used to ensure an atomic shutdown of the system in a non-blocking >> fashion. In my past experience multithreaded APIs should be high level >> implemented like this: >> >> NON-BLOCKING methods: >> lock(); ** >> xxx_start(); >> xxx_stop(); >> unlock(); >> >> BLOCKING methods: >> setup(); // init >> unsetup(); // drain >> >> Any callbacks should always be called locked ** >> >> In devfs there was no non-blocking stop before I added the delist_dev() >> function. >> >>> >>> You do not understand my point. >>> >>> I object against imposing one additional global reference on all cdevs >>> just to cope with the delist hack. See the patch at the end of the message. >> >> It's fine by me. >>> >>> WRT destroy_dev_sched_cb() calling delist_dev(), even after calling >>> delist_dev(), the node still exists in the /dev. It is only removed >>> after populate loop is run sometime later. dev_sched() KPI is inheritly >>> racy, drivers must handle the races for other reasons. >> >> The populate loop is all running under the dev_lock() from what I can >> see and make_dev() is also keeping the same lock when inserting and >> removing new cdevs. The populate loop should always give a consistent > No, populate loop is not run under dev_mtx. Are you sure: > static int > devfs_populate_loop(struct devfs_mount *dm, int cleanup) > { > struct cdev_priv *cdp; > struct devfs_dirent *de; > struct devfs_dirent *dd, *dt; > struct cdev *pdev; > int de_flags, depth, j; > char *q, *s; > > sx_assert(&dm->dm_lock, SX_XLOCKED); > dev_lock(); ^^^^ what is this ? > TAILQ_FOREACH(cdp, &cdevp_list, cdp_list) { > It would not be able to > allocate memory, even in M_NOWAIT fashion. The dev_mtx is after the > vm and vnode locks. Only iteration over the cdevp_list is protected by > dev_mtx, which is dropped right after something which require an > action, is found on the list. Populate() needs some way to avoid > reading inconsistent data from the cdev layer, but there is not > guarantee that we are always up to date. > >> view of the character devices available, and I don't see how "cdev" >> structures without the CDP_ACTIVE flag can appear with recently created >> ones, even if the name is the same. > It cannot simply because it is not synchronized with the device > creation/destruction. > Lookup (or any other VFS-level code) is not protected by dev_mtx, it > is only dm lock which ensures that populate loop is not run in parallel, > modifying direntries. See comment above. > >> >> That system functions can still call into the dangling read/write/ioctl >> functions is another story, and that is why I tell, that in order to >> simplify this teardown, we possibly should associate a client selectable >> lock with each CDEV, for teardown purposes. Like done for several years >> in the callout and USB APIs and possibly many other places. > There is d_purge method which provides the tear-down semantic for > drivers which needs it. Only tty uses the method AFAIK. > > Devfs ensures that no client code is active when cdev is removed for real. --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 11:32:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B40514; Sun, 18 Jan 2015 11:32:01 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2872EE4F; Sun, 18 Jan 2015 11:32:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0IBVprB089472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jan 2015 13:31:51 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0IBVprB089472 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0IBVp81089471; Sun, 18 Jan 2015 13:31:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Jan 2015 13:31:51 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277199 - in head/sys: fs/devfs kern Message-ID: <20150118113150.GQ42409@kib.kiev.ua> References: <20150115033109.GM42409@kib.kiev.ua> <54B76F2B.8040106@selasky.org> <20150115093841.GX42409@kib.kiev.ua> <54B79B25.3070707@selasky.org> <20150115115123.GA42409@kib.kiev.ua> <54B7AF2F.3080802@selasky.org> <20150116080332.GE42409@kib.kiev.ua> <54B8D31B.9030805@selasky.org> <20150118105410.GN42409@kib.kiev.ua> <54BB942A.5070200@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BB942A.5070200@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 11:32:01 -0000 On Sun, Jan 18, 2015 at 12:08:26PM +0100, Hans Petter Selasky wrote: > Hi Konstantin, > > On 01/18/15 11:54, Konstantin Belousov wrote: > > On Fri, Jan 16, 2015 at 10:00:11AM +0100, Hans Petter Selasky wrote: > >> Hi Konstantin, > >> > >> On 01/16/15 09:03, Konstantin Belousov wrote: > >>> My opinion is that you should have tried to handle the issue at the driver > >>> level, instead of making this devfs issue. I.e., if you already have > >>> cdev node with the correct name, driver should have replaced the private > >>> data to point to new device. > >> > >> I think this way cannot be implemented in a clean way, because of > >> locking order reversal. And if you try to avoid the LOR you end up with > >> the race. Chess mate sort of ;-) Let me explain: > >> > >> Thread 1: > >> usb_sx_lock(); > >> cdev = Look in freelist for existing device(); > >> else > >> cdev = make_dev(); > >> usb_sx_unlock(); > >> > >> Thread 2: > >> usb_sx_lock(); > >> put cdev on freelist > >> usb_sx_unlock(); > >> > >> Thread 3: > >> usb_sx_lock(); > >> cdev = remove first entry in freelist > >> usb_sx_unlock(); > >> > >> /* > >> * XXX because USB needs to call destroy_dev() unlocked we > >> * are racing with Thread 1 again > >> */ > >> destroy_dev(cdev); > > I do not understand the 'freelist' part. > > > > You have some usb (or whatever other kind) device, which is represented by > > some data structure. This data structure references cdev. In reverse, > > cdev points to this data structure by si_drv1 or similar driver-owned > > member of struct cdev. > > > > The structures naming usb devices have some mapping to/from usb bus addresses. > > When device is destroyed or created due to external plug event, there is > > some mechanism that ensures mapping consistence. It could be lock, it > > could be single-threaded process which discover the bus, or something > > else, I do not know. > > > > While the structure notes that device with some address goes out and comes > > in, it can look up the corresponding cdev and just change the si_drv1 pointer > > to point to the new device. > > What about events for "devd" that a new character devices is present in > the system or being destroyed for user-space applications? It is up to the driver to decide. If wanted, it could post the pair of destroy/create itself (e.g., if there is some state which require the userspace to reset), or it could decide not to. The later is reasonable if the destroy/create is believed to be caused by a glitch rather than the actual replug. > > > > > I find it very strange that you need sleepless operation which can > > _both_ destroy and create cdev. At least one operation of creation or > > destruction must sleep, at least in the current devfs design. It could > > be made sleepless, by making VFS visible part even less connected to the > > cdev part, but this is not how it (can) currently work. > > I think it would be good practice that all resources needed for creating > a character device can be allocated prior to registration. That means we > first should allocate all resources needed, but not register as a single > function. > > For example: > > Once make_dev() has returned, we can get an "d_open" callback. But > "si_drv1/2" is always set by drivers _after_ that "make_dev()" has > returned! This causes a race we could simply avoid by splitting the > make_dev() like I suggest. Instead of putting more logic and code inside > the drivers to handle the race! I wanted to tunnel the si_drv values through the make_dev(). I.e. there could appear yet another variant of make_dev() which takes the initialization parameters for the si_* driver vars. I just did not have time/motivation to do the pass. > > >> > >>> > >>> This would also close a window where /dev node is non-existent or operate > >>> erronously. > >> > >> I'm not saying I plan so, but I think "cdevs" at some point need to > >> understand mutexes and locks. That means like with other API's in the > >> kernel we can associate a lock with the "cdev", and this lock is then > >> used to ensure an atomic shutdown of the system in a non-blocking > >> fashion. In my past experience multithreaded APIs should be high level > >> implemented like this: > >> > >> NON-BLOCKING methods: > >> lock(); ** > >> xxx_start(); > >> xxx_stop(); > >> unlock(); > >> > >> BLOCKING methods: > >> setup(); // init > >> unsetup(); // drain > >> > >> Any callbacks should always be called locked ** > >> > >> In devfs there was no non-blocking stop before I added the delist_dev() > >> function. > >> > >>> > >>> You do not understand my point. > >>> > >>> I object against imposing one additional global reference on all cdevs > >>> just to cope with the delist hack. See the patch at the end of the message. > >> > >> It's fine by me. > >>> > >>> WRT destroy_dev_sched_cb() calling delist_dev(), even after calling > >>> delist_dev(), the node still exists in the /dev. It is only removed > >>> after populate loop is run sometime later. dev_sched() KPI is inheritly > >>> racy, drivers must handle the races for other reasons. > >> > >> The populate loop is all running under the dev_lock() from what I can > >> see and make_dev() is also keeping the same lock when inserting and > >> removing new cdevs. The populate loop should always give a consistent > > No, populate loop is not run under dev_mtx. > > Are you sure: Yes, I am sure. I explained it in the next sentences which you break from the first one in the citation. > > > static int > > devfs_populate_loop(struct devfs_mount *dm, int cleanup) > > { > > struct cdev_priv *cdp; > > struct devfs_dirent *de; > > struct devfs_dirent *dd, *dt; > > struct cdev *pdev; > > int de_flags, depth, j; > > char *q, *s; > > > > sx_assert(&dm->dm_lock, SX_XLOCKED); > > dev_lock(); > ^^^^ what is this ? > > TAILQ_FOREACH(cdp, &cdevp_list, cdp_list) { > > > It would not be able to > > allocate memory, even in M_NOWAIT fashion. The dev_mtx is after the > > vm and vnode locks. Only iteration over the cdevp_list is protected by > > dev_mtx, which is dropped right after something which require an > > action, is found on the list. Populate() needs some way to avoid > > reading inconsistent data from the cdev layer, but there is not > > guarantee that we are always up to date. ^^^^^^^^^ > > > >> view of the character devices available, and I don't see how "cdev" > >> structures without the CDP_ACTIVE flag can appear with recently created > >> ones, even if the name is the same. > > It cannot simply because it is not synchronized with the device > > creation/destruction. > > > > > Lookup (or any other VFS-level code) is not protected by dev_mtx, it > > is only dm lock which ensures that populate loop is not run in parallel, > > modifying direntries. > > See comment above. > > > > >> > >> That system functions can still call into the dangling read/write/ioctl > >> functions is another story, and that is why I tell, that in order to > >> simplify this teardown, we possibly should associate a client selectable > >> lock with each CDEV, for teardown purposes. Like done for several years > >> in the callout and USB APIs and possibly many other places. > > There is d_purge method which provides the tear-down semantic for > > drivers which needs it. Only tty uses the method AFAIK. > > > > Devfs ensures that no client code is active when cdev is removed for real. > > --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 12:45:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 239C0869; Sun, 18 Jan 2015 12:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F79981E; Sun, 18 Jan 2015 12:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0ICjQLl013769; Sun, 18 Jan 2015 12:45:26 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0ICjQjG013768; Sun, 18 Jan 2015 12:45:26 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201501181245.t0ICjQjG013768@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 18 Jan 2015 12:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277318 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 12:45:27 -0000 Author: cperciva Date: Sun Jan 18 12:45:26 2015 New Revision: 277318 URL: https://svnweb.freebsd.org/changeset/base/277318 Log: When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't accidentally enable non-existent states. This bug was triggered if ACPI advertises the presence of a C2 state which we fail to parse via acpi_PkgGas due to our lack of support for FFixedHW resources, and causes an immediate panic when an attempt is made to enter the (NULL) state. One affected platform is the EC2 c4.8xlarge VM instance type; there may be others. MFC after: 1 week Thanks to: jkim, @_msw_ Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sun Jan 18 11:54:20 2015 (r277317) +++ head/sys/dev/acpica/acpi_cpu.c Sun Jan 18 12:45:26 2015 (r277318) @@ -885,7 +885,7 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); if (cpu_quirks & CPU_QUIRK_NO_C3) { - sc->cpu_cx_count = sc->cpu_non_c3 + 1; + sc->cpu_cx_count = min(sc->cpu_cx_count, sc->cpu_non_c3 + 1); } AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY, acpi_cpu_notify, sc); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 12:54:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F6DDAF7; Sun, 18 Jan 2015 12:54:27 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA2E979; Sun, 18 Jan 2015 12:54:26 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D2D821FE023; Sun, 18 Jan 2015 13:54:23 +0100 (CET) Message-ID: <54BBAD31.701@selasky.org> Date: Sun, 18 Jan 2015 13:55:13 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277199 - in head/sys: fs/devfs kern References: <20150115033109.GM42409@kib.kiev.ua> <54B76F2B.8040106@selasky.org> <20150115093841.GX42409@kib.kiev.ua> <54B79B25.3070707@selasky.org> <20150115115123.GA42409@kib.kiev.ua> <54B7AF2F.3080802@selasky.org> <20150116080332.GE42409@kib.kiev.ua> <54B8D31B.9030805@selasky.org> <20150118105410.GN42409@kib.kiev.ua> <54BB942A.5070200@selasky.org> <20150118113150.GQ42409@kib.kiev.ua> In-Reply-To: <20150118113150.GQ42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 12:54:27 -0000 Hi Konstantin, On 01/18/15 12:31, Konstantin Belousov wrote: > On Sun, Jan 18, 2015 at 12:08:26PM +0100, Hans Petter Selasky wrote: >> Hi Konstantin, >> >> On 01/18/15 11:54, Konstantin Belousov wrote: >>> On Fri, Jan 16, 2015 at 10:00:11AM +0100, Hans Petter Selasky wrote: >>>> Hi Konstantin, >> >> What about events for "devd" that a new character devices is present in >> the system or being destroyed for user-space applications? > It is up to the driver to decide. If wanted, it could post the pair of > destroy/create itself (e.g., if there is some state which require > the userspace to reset), or it could decide not to. The later is > reasonable if the destroy/create is believed to be caused by a glitch > rather than the actual replug. I would really prefer if that path is chosen, that kern_conf.c exposes an API for this. Consider the following case: You have a daemon that is started and stopped based upon "devd" DEVFS create/destroy events. The daemon is started when the create event is received. Then the kernel side calls destroy_dev(), because the application still keeps the file handle opened, the destroy_dev() never sends the destroy event, and the application then never receives the destroy event --- another example of a totally invisible deadlock. >>> >>> I find it very strange that you need sleepless operation which can >>> _both_ destroy and create cdev. At least one operation of creation or My simple argument against sleepable operation inside devfs functions which are used to register and unregister a character devices is simply that it leads to the fact we cannot make an atomic shutdown of a kernel application which involves devfs and other kernel subsystems. Let me explain. It is not enough that devfs works alone, it needs to work with together with other kernel APIs aswell. Let's make up an example. A kernel module is using three different APIs, lets say USB, the callout subsystem and devfs. Devfs is calling USB to start and stop USB transfers. The callout subsystem is calling selwakeup() and waking up devfs. The USB subsystem is calling selwakeup() and waking up devfs aswell. The USB subsystem is also calling destroy_dev(). This is a very high-level architectural thought and I hope you get it: How can you tear down a kernel application using three different subsystems in the kernel _atomically_ without having lingering callbacks? To make the shutdown sequence atomic, we might want to use a mutex. Now iff destroy_dev() is sleepable we need to drop that mutex when destroying the character device, and then woops - the shutdown sequence is no longer atomic. That's the root of the problem, and please think beyond devfs alone. The problem happens when devfs is used together with other APIs and applications in the kernel. >>> destruction must sleep, at least in the current devfs design. It could >>> be made sleepless, by making VFS visible part even less connected to the >>> cdev part, but this is not how it (can) currently work. >> >> I think it would be good practice that all resources needed for creating >> a character device can be allocated prior to registration. That means we >> first should allocate all resources needed, but not register as a single >> function. >> >> For example: >> >> Once make_dev() has returned, we can get an "d_open" callback. But >> "si_drv1/2" is always set by drivers _after_ that "make_dev()" has >> returned! This causes a race we could simply avoid by splitting the >> make_dev() like I suggest. Instead of putting more logic and code inside >> the drivers to handle the race! > I wanted to tunnel the si_drv values through the make_dev(). > I.e. there could appear yet another variant of make_dev() which takes > the initialization parameters for the si_* driver vars. > > I just did not have time/motivation to do the pass. I might be interested in giving you a hand there, but not right now. >> >>>> >>>>> >>>>> This would also close a window where /dev node is non-existent or operate >>>>> erronously. >>>> >>>> I'm not saying I plan so, but I think "cdevs" at some point need to >>>> understand mutexes and locks. That means like with other API's in the >>>> kernel we can associate a lock with the "cdev", and this lock is then >>>> used to ensure an atomic shutdown of the system in a non-blocking >>>> fashion. In my past experience multithreaded APIs should be high level >>>> implemented like this: >>>> >>>> NON-BLOCKING methods: >>>> lock(); ** >>>> xxx_start(); >>>> xxx_stop(); >>>> unlock(); >>>> >>>> BLOCKING methods: >>>> setup(); // init >>>> unsetup(); // drain >>>> >>>> Any callbacks should always be called locked ** >>>> >>>> In devfs there was no non-blocking stop before I added the delist_dev() >>>> function. >>>> >>>>> >>>>> You do not understand my point. >>>>> >>>>> I object against imposing one additional global reference on all cdevs >>>>> just to cope with the delist hack. See the patch at the end of the message. >>>> >>>> It's fine by me. >>>>> >>>>> WRT destroy_dev_sched_cb() calling delist_dev(), even after calling >>>>> delist_dev(), the node still exists in the /dev. It is only removed >>>>> after populate loop is run sometime later. dev_sched() KPI is inheritly >>>>> racy, drivers must handle the races for other reasons. >>>> >>>> The populate loop is all running under the dev_lock() from what I can >>>> see and make_dev() is also keeping the same lock when inserting and >>>> removing new cdevs. The populate loop should always give a consistent >>> No, populate loop is not run under dev_mtx. >> >> Are you sure: > Yes, I am sure. I explained it in the next sentences which you break from > the first one in the citation. "devfs_populate()" is called exclusivly locked by "dm_lock" and doesn't return until an atomic TAILQ_FOREACH() of the "devp_list" under "dev_lock()" is consistent - right? So the VFS node tree will not be inconsistent under "dm_lock" either - right? Or is there something which I don't see? void devfs_populate(struct devfs_mount *dm) { unsigned gen; sx_assert(&dm->dm_lock, SX_XLOCKED); gen = devfs_generation; if (dm->dm_generation == gen) return; >>> It would not be able to >>> allocate memory, even in M_NOWAIT fashion. The dev_mtx is after the >>> vm and vnode locks. Only iteration over the cdevp_list is protected by >>> dev_mtx, which is dropped right after something which require an >>> action, is found on the list. Populate() needs some way to avoid >>> reading inconsistent data from the cdev layer, but there is not >>> guarantee that we are always up to date. > ^^^^^^^^^ Are you taking the sleepable "dm_lock" into account? --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 13:22:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC0CEE2; Sun, 18 Jan 2015 13:22:44 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 517EED58; Sun, 18 Jan 2015 13:22:44 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 23A9925D3A92; Sun, 18 Jan 2015 13:22:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9F59EC770AE; Sun, 18 Jan 2015 13:22:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id MyryhhT2wYtr; Sun, 18 Jan 2015 13:22:36 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:8822:54a5:bf0c:ece7] (unknown [IPv6:fde9:577b:c1a9:4410:8822:54a5:bf0c:ece7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1C62AC7706F; Sun, 18 Jan 2015 13:22:34 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... From: "Bjoern A. Zeeb" In-Reply-To: <54BB9114.9010200@selasky.org> Date: Sun, 18 Jan 2015 13:22:02 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <73ED5E75-FB99-4413-985D-8BF3FF854318@FreeBSD.org> References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> <54BB81FC.3030501@selasky.org> <54BB9114.9010200@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 13:22:44 -0000 > On 18 Jan 2015, at 10:55 , Hans Petter Selasky = wrote: >=20 > See r277316. >=20 > Thank you! Thanks could you also check i386.XEN which seems to conflict on = redefined macros; here=E2=80=99s only a short excerpt: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:40: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/bit= ops.h:38:9: error: 'BITS_TO_LONGS' macro redefined = [-Werror,-Wmacro-redefined] #define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) ^ ./machine/xen/xenvar.h:99:9: note: previous definition is here #define BITS_TO_LONGS(bits) \ ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:40: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/bit= ops.h:297:9: error: 'test_bit' macro redefined = [-Werror,-Wmacro-redefined] #define test_bit(i, a) = \ ^ ./machine/xen/xen-os.h:224:9: note: previous definition is here #define test_bit(nr,addr) \ ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:40: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/bit= ops.h:302:1: error: conflicting types for 'test_and_clear_bit' test_and_clear_bit(long bit, long *var) ^ ./machine/xen/xen-os.h:197:21: note: previous definition is here static __inline int test_and_clear_bit(int nr, volatile void * addr) ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:43: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kth= read.h:39: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/sla= b.h:37: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/typ= es.h:63:9: error: 'DECLARE_BITMAP' macro redefined = [-Werror,-Wmacro-redefined] #define DECLARE_BITMAP(n, bits) = \ ^ =E2=80=A6 In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:46: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/wai= t.h:32: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/spi= nlock.h:51:9: error: 'spin_lock_irqsave' macro redefined = [-Werror,-Wmacro-redefined] #define spin_lock_irqsave(lock, flags) = \ ^ ./machine/xen/xen-os.h:141:9: note: previous definition is here = = = =20 #define spin_lock_irqsave mtx_lock_irqsave ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:49: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/kob= ject.h:34: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/ker= nel.h:46: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/wai= t.h:32: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/spi= nlock.h:53:9: error: 'spin_unlock_irqrestore' macro redefined = [-Werror,-Wmacro-redefined] #define spin_unlock_irqrestore(lock, flags) = \ ^ ./machine/xen/xen-os.h:142:9: note: previous definition is here #define spin_unlock_irqrestore mtx_unlock_irqrestore ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:50: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/dev= ice.h:41: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/asm/atomi= c.h:39:3: error: typedef redefinition with different types ('struct = atomic_t' vs 'struct atomic_t') } atomic_t; ^ ./machine/xen/xen-os.h:157:42: note: previous definition is here typedef struct { volatile int counter; } atomic_t; ^ In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/lin= ux_compat.c:50: In file included from = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/linux/dev= ice.h:41: = /scratch/tmp/bz/head.svn/sys/modules/linuxapi/../../ofed/include/asm/atomi= c.h:75:1: error: conflicting types for 'atomic_inc' atomic_inc(atomic_t *v) ^ ./machine/xen/xen-os.h:273:24: note: previous definition is here static __inline__ void atomic_inc(atomic_t *v) ^ =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:04:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 126DF790; Sun, 18 Jan 2015 14:04:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2AD4136; Sun, 18 Jan 2015 14:04:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IE4t4w051206; Sun, 18 Jan 2015 14:04:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IE4tO9051205; Sun, 18 Jan 2015 14:04:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501181404.t0IE4tO9051205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 18 Jan 2015 14:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277319 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 14:04:56 -0000 Author: hselasky Date: Sun Jan 18 14:04:55 2015 New Revision: 277319 URL: https://svnweb.freebsd.org/changeset/base/277319 Log: Make the linuxapi module only build when WITH_OFED=YES is specified. There needs to be some more testing done before it is ready for all platforms and architectures. MFC after: 1 month Sponsored by: Mellanox Technologies Reported by: bz@ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jan 18 12:45:26 2015 (r277318) +++ head/sys/modules/Makefile Sun Jan 18 14:04:55 2015 (r277319) @@ -502,7 +502,9 @@ _ipoib= ipoib _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux +.if ${MK_OFED} != "no" _linuxapi= linuxapi +.endif _ndis= ndis .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:05:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51E918E4; Sun, 18 Jan 2015 14:05:39 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D4FB13E; Sun, 18 Jan 2015 14:05:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 90F9A1FE023; Sun, 18 Jan 2015 15:05:36 +0100 (CET) Message-ID: <54BBBDE2.6010306@selasky.org> Date: Sun, 18 Jan 2015 15:06:26 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r277302 - in head/sys: conf modules modules/ibcore modules/ipoib modules/linuxapi modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/i... References: <201501171636.t0HGadsf039591@svn.freebsd.org> <47909EEB-D9BF-43A1-B485-43680A86E170@FreeBSD.org> <54BB81FC.3030501@selasky.org> <54BB9114.9010200@selasky.org> <73ED5E75-FB99-4413-985D-8BF3FF854318@FreeBSD.org> In-Reply-To: <73ED5E75-FB99-4413-985D-8BF3FF854318@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 14:05:39 -0000 On 01/18/15 14:22, Bjoern A. Zeeb wrote: > >> On 18 Jan 2015, at 10:55 , Hans Petter Selasky wrote: >> >> See r277316. >> >> Thank you! > > Thanks could you also check i386.XEN which seems to conflict on redefined macros; here’s only a short excerpt: See r277319. I see this needs some more testing and CPU time. Until further I will simply make it build only when WITH_OFED=YES . --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:14:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5E54B83; Sun, 18 Jan 2015 14:14:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC7F2229; Sun, 18 Jan 2015 14:14:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IEErXt055880; Sun, 18 Jan 2015 14:14:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IEEmYI055850; Sun, 18 Jan 2015 14:14:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501181414.t0IEEmYI055850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 18 Jan 2015 14:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277320 - in head: . contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/Target contrib/llvm/lib/Analysis contrib/llvm/lib/MC contrib/llvm/lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 14:14:54 -0000 Author: dim Date: Sun Jan 18 14:14:47 2015 New Revision: 277320 URL: https://svnweb.freebsd.org/changeset/base/277320 Log: Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix only release, no new features have been added. Please note that this version requires C++11 support to build; see UPDATING for more information. Release notes for llvm and clang can be found here: MFC after: 1 month X-MFC-With: 276479 Added: head/contrib/llvm/lib/Target/Mips/MipsABIInfo.cpp - copied unchanged from r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsABIInfo.h - copied unchanged from r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.h head/contrib/llvm/lib/Target/Mips/MipsCCState.cpp - copied unchanged from r277223, vendor/llvm/dist/lib/Target/Mips/MipsCCState.cpp head/contrib/llvm/lib/Target/Mips/MipsCCState.h - copied unchanged from r277223, vendor/llvm/dist/lib/Target/Mips/MipsCCState.h head/contrib/llvm/patches/patch-07-llvm-r216989-r216990-fix-movw-armv6.diff - copied unchanged from r277318, head/contrib/llvm/patches/patch-08-llvm-r216989-r216990-fix-movw-armv6.diff head/contrib/llvm/patches/patch-08-clang-r217410-i386-garbage-float.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-09-clang-r217410-i386-garbage-float.diff head/contrib/llvm/patches/patch-09-llvm-r221709-debug-oom.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-10-llvm-r221709-debug-oom.diff head/contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-11-llvm-r222562-loop-rotate.diff head/contrib/llvm/patches/patch-11-add-llvm-gvn-option.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-12-add-llvm-gvn-option.diff head/contrib/llvm/patches/patch-12-llvm-r218241-dwarf2-warning.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-13-llvm-r218241-dwarf2-warning.diff head/contrib/llvm/patches/patch-13-llvm-r215352-aarch64-dyn-loader.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-14-llvm-r215352-aarch64-dyn-loader.diff head/contrib/llvm/patches/patch-14-llvm-r216571-dynamiclib-usability.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-15-llvm-r216571-dynamiclib-usability.diff head/contrib/llvm/patches/patch-15-clang-r221900-freebsd-aarch64.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-16-clang-r221900-freebsd-aarch64.diff head/contrib/llvm/patches/patch-16-llvm-r222856-libapr-miscompile.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-17-llvm-r222856-libapr-miscompile.diff head/contrib/llvm/patches/patch-17-llvm-r214802-armv6-cp10-cp11.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-18-llvm-r214802-armv6-cp10-cp11.diff head/contrib/llvm/patches/patch-18-llvm-r215811-arm-fpu-directive.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-19-llvm-r215811-arm-fpu-directive.diff head/contrib/llvm/patches/patch-19-enable-armv6-clrex.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-20-enable-armv6-clrex.diff head/contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-22-llvm-r223147-arm-cpu-directive.diff head/contrib/llvm/patches/patch-21-llvm-r221170-ppc-vaarg.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-23-llvm-r221170-ppc-vaarg.diff head/contrib/llvm/patches/patch-22-llvm-r221791-ppc-small-pic.diff - copied, changed from r277299, head/contrib/llvm/patches/patch-24-llvm-r221791-ppc-small-pic.diff head/contrib/llvm/patches/patch-23-llvm-r224415-ppc-local.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-25-llvm-r224415-ppc-local.diff head/contrib/llvm/patches/patch-24-llvm-r213890-ppc-eh_frame.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-26-llvm-r213890-ppc-eh_frame.diff head/contrib/llvm/patches/patch-25-llvm-r224890-ppc-ctr-tls-loop.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-28-llvm-r224890-ppc-ctr-tls-loop.diff head/contrib/llvm/patches/patch-26-clang-r213790-type_traits-crash.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-29-clang-r213790-type_traits-crash.diff head/contrib/llvm/patches/patch-27-llvm-r222587-arm-add-pc.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-30-llvm-r222587-arm-add-pc.diff head/contrib/llvm/patches/patch-28-llvm-r222292-aarch64-no-neon.diff - copied unchanged from r277299, head/contrib/llvm/patches/patch-31-llvm-r222292-aarch64-no-neon.diff Deleted: head/contrib/llvm/patches/patch-07-llvm-r213960-ppc32-tls.diff head/contrib/llvm/patches/patch-08-llvm-r216989-r216990-fix-movw-armv6.diff head/contrib/llvm/patches/patch-09-clang-r217410-i386-garbage-float.diff head/contrib/llvm/patches/patch-10-llvm-r221709-debug-oom.diff head/contrib/llvm/patches/patch-11-llvm-r222562-loop-rotate.diff head/contrib/llvm/patches/patch-12-add-llvm-gvn-option.diff head/contrib/llvm/patches/patch-13-llvm-r218241-dwarf2-warning.diff head/contrib/llvm/patches/patch-14-llvm-r215352-aarch64-dyn-loader.diff head/contrib/llvm/patches/patch-15-llvm-r216571-dynamiclib-usability.diff head/contrib/llvm/patches/patch-16-clang-r221900-freebsd-aarch64.diff head/contrib/llvm/patches/patch-17-llvm-r222856-libapr-miscompile.diff head/contrib/llvm/patches/patch-18-llvm-r214802-armv6-cp10-cp11.diff head/contrib/llvm/patches/patch-19-llvm-r215811-arm-fpu-directive.diff head/contrib/llvm/patches/patch-20-enable-armv6-clrex.diff head/contrib/llvm/patches/patch-21-llvm-r223171-fix-vectorizer.diff head/contrib/llvm/patches/patch-22-llvm-r223147-arm-cpu-directive.diff head/contrib/llvm/patches/patch-23-llvm-r221170-ppc-vaarg.diff head/contrib/llvm/patches/patch-24-llvm-r221791-ppc-small-pic.diff head/contrib/llvm/patches/patch-25-llvm-r224415-ppc-local.diff head/contrib/llvm/patches/patch-26-llvm-r213890-ppc-eh_frame.diff head/contrib/llvm/patches/patch-27-llvm-r221703-ppc-tls_get_addr.diff head/contrib/llvm/patches/patch-28-llvm-r224890-ppc-ctr-tls-loop.diff head/contrib/llvm/patches/patch-29-clang-r213790-type_traits-crash.diff head/contrib/llvm/patches/patch-30-llvm-r222587-arm-add-pc.diff head/contrib/llvm/patches/patch-31-llvm-r222292-aarch64-no-neon.diff Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/Target/TargetCallingConv.td head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp head/contrib/llvm/patches/README.TXT head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/utils/TableGen/CallingConvEmitter.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.usr.dist head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/llvm/Config/config.h head/lib/clang/libllvmmipscodegen/Makefile head/lib/libclang_rt/Makefile.inc head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jan 18 14:04:55 2015 (r277319) +++ head/ObsoleteFiles.inc Sun Jan 18 14:14:47 2015 (r277320) @@ -38,6 +38,60 @@ # xargs -n1 | sort | uniq -d; # done +# 20150118: new clang import which bumps version from 3.5.0 to 3.5.1. +OLD_FILES+=usr/include/clang/3.5.0/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.5.0/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.5.0/altivec.h +OLD_FILES+=usr/include/clang/3.5.0/ammintrin.h +OLD_FILES+=usr/include/clang/3.5.0/arm_acle.h +OLD_FILES+=usr/include/clang/3.5.0/arm_neon.h +OLD_FILES+=usr/include/clang/3.5.0/avx2intrin.h +OLD_FILES+=usr/include/clang/3.5.0/avxintrin.h +OLD_FILES+=usr/include/clang/3.5.0/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.5.0/bmiintrin.h +OLD_FILES+=usr/include/clang/3.5.0/cpuid.h +OLD_FILES+=usr/include/clang/3.5.0/emmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/f16cintrin.h +OLD_FILES+=usr/include/clang/3.5.0/fma4intrin.h +OLD_FILES+=usr/include/clang/3.5.0/fmaintrin.h +OLD_FILES+=usr/include/clang/3.5.0/ia32intrin.h +OLD_FILES+=usr/include/clang/3.5.0/immintrin.h +OLD_FILES+=usr/include/clang/3.5.0/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.5.0/mm3dnow.h +OLD_FILES+=usr/include/clang/3.5.0/mm_malloc.h +OLD_FILES+=usr/include/clang/3.5.0/mmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/module.modulemap +OLD_FILES+=usr/include/clang/3.5.0/nmmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/pmmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/popcntintrin.h +OLD_FILES+=usr/include/clang/3.5.0/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.5.0/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.5.0/rtmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/shaintrin.h +OLD_FILES+=usr/include/clang/3.5.0/smmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/tbmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/tmmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/wmmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/x86intrin.h +OLD_FILES+=usr/include/clang/3.5.0/xmmintrin.h +OLD_FILES+=usr/include/clang/3.5.0/xopintrin.h +OLD_DIRS+=usr/include/clang/3.5.0 +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.san-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.san-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/3.5.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/3.5.0/lib +OLD_DIRS+=usr/lib/clang/3.5.0 # 20150102: removal of texinfo OLD_FILES+=usr/bin/info OLD_FILES+=usr/bin/infokey Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jan 18 14:04:55 2015 (r277319) +++ head/UPDATING Sun Jan 18 14:14:47 2015 (r277320) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150118: + Clang and llvm have been upgraded to 3.5.1 release. This is a bugfix + only release, no new features have been added. Please see the 20141231 + entry below for information about prerequisites and upgrading, if you + are not already using 3.5.0. + 20150107: ELF tools addr2line, elfcopy (strip), nm, size, and strings are now taken from the ELF Tool Chain project rather than GNU binutils. They Modified: head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h Sun Jan 18 14:14:47 2015 (r277320) @@ -253,13 +253,16 @@ private: const MDNode *TBAAInfo, bool KnownMustAlias = false); void addUnknownInst(Instruction *I, AliasAnalysis &AA); - void removeUnknownInst(Instruction *I) { + void removeUnknownInst(AliasSetTracker &AST, Instruction *I) { + bool WasEmpty = UnknownInsts.empty(); for (size_t i = 0, e = UnknownInsts.size(); i != e; ++i) if (UnknownInsts[i] == I) { UnknownInsts[i] = UnknownInsts.back(); UnknownInsts.pop_back(); --i; --e; // Revisit the moved entry. } + if (!WasEmpty && UnknownInsts.empty()) + dropRef(AST); } void setVolatile() { Volatile = true; } Modified: head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Sun Jan 18 14:14:47 2015 (r277320) @@ -31,18 +31,25 @@ class TargetRegisterInfo; class CCValAssign { public: enum LocInfo { - Full, // The value fills the full location. - SExt, // The value is sign extended in the location. - ZExt, // The value is zero extended in the location. - AExt, // The value is extended with undefined upper bits. - BCvt, // The value is bit-converted in the location. - VExt, // The value is vector-widened in the location. - // FIXME: Not implemented yet. Code that uses AExt to mean - // vector-widen should be fixed to use VExt instead. - FPExt, // The floating-point value is fp-extended in the location. - Indirect // The location contains pointer to the value. + Full, // The value fills the full location. + SExt, // The value is sign extended in the location. + ZExt, // The value is zero extended in the location. + AExt, // The value is extended with undefined upper bits. + BCvt, // The value is bit-converted in the location. + VExt, // The value is vector-widened in the location. + // FIXME: Not implemented yet. Code that uses AExt to mean + // vector-widen should be fixed to use VExt instead. + FPExt, // The floating-point value is fp-extended in the location. + Indirect, // The location contains pointer to the value. + SExtUpper, // The value is in the upper bits of the location and should be + // sign extended when retrieved. + ZExtUpper, // The value is in the upper bits of the location and should be + // zero extended when retrieved. + AExtUpper // The value is in the upper bits of the location and should be + // extended with undefined upper bits when retrieved. // TODO: a subset of the value is in the location. }; + private: /// ValNo - This is the value number begin assigned (e.g. an argument number). unsigned ValNo; @@ -146,6 +153,9 @@ public: return (HTP == AExt || HTP == SExt || HTP == ZExt); } + bool isUpperBitsInLoc() const { + return HTP == AExtUpper || HTP == SExtUpper || HTP == ZExtUpper; + } }; /// CCAssignFn - This function assigns a location for Val, updating State to @@ -208,10 +218,10 @@ private: // while "%t" goes to the stack: it wouldn't be described in ByValRegs. // // Supposed use-case for this collection: - // 1. Initially ByValRegs is empty, InRegsParamsProceed is 0. + // 1. Initially ByValRegs is empty, InRegsParamsProcessed is 0. // 2. HandleByVal fillups ByValRegs. // 3. Argument analysis (LowerFormatArguments, for example). After - // some byval argument was analyzed, InRegsParamsProceed is increased. + // some byval argument was analyzed, InRegsParamsProcessed is increased. struct ByValInfo { ByValInfo(unsigned B, unsigned E, bool IsWaste = false) : Begin(B), End(E), Waste(IsWaste) {} @@ -229,9 +239,9 @@ private: }; SmallVector ByValRegs; - // InRegsParamsProceed - shows how many instances of ByValRegs was proceed + // InRegsParamsProcessed - shows how many instances of ByValRegs was proceed // during argument analysis. - unsigned InRegsParamsProceed; + unsigned InRegsParamsProcessed; protected: ParmContext CallOrPrologue; @@ -412,7 +422,7 @@ public: unsigned getInRegsParamsCount() const { return ByValRegs.size(); } // Returns count of byval in-regs arguments proceed. - unsigned getInRegsParamsProceed() const { return InRegsParamsProceed; } + unsigned getInRegsParamsProcessed() const { return InRegsParamsProcessed; } // Get information about N-th byval parameter that is stored in registers. // Here "ByValParamIndex" is N. @@ -436,20 +446,20 @@ public: // Returns false, if end is reached. bool nextInRegsParam() { unsigned e = ByValRegs.size(); - if (InRegsParamsProceed < e) - ++InRegsParamsProceed; - return InRegsParamsProceed < e; + if (InRegsParamsProcessed < e) + ++InRegsParamsProcessed; + return InRegsParamsProcessed < e; } // Clear byval registers tracking info. void clearByValRegsInfo() { - InRegsParamsProceed = 0; + InRegsParamsProcessed = 0; ByValRegs.clear(); } // Rewind byval registers tracking info. void rewindByValRegsInfo() { - InRegsParamsProceed = 0; + InRegsParamsProcessed = 0; } ParmContext getCallOrPrologue() const { return CallOrPrologue; } Modified: head/contrib/llvm/include/llvm/Target/TargetCallingConv.td ============================================================================== --- head/contrib/llvm/include/llvm/Target/TargetCallingConv.td Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/include/llvm/Target/TargetCallingConv.td Sun Jan 18 14:14:47 2015 (r277320) @@ -67,6 +67,9 @@ class CCIfSplit : CCIf<"ArgF /// the specified action. class CCIfSRet : CCIf<"ArgFlags.isSRet()", A> {} +/// CCIfVarArg - If the current function is vararg - apply the action +class CCIfVarArg : CCIf<"State.isVarArg()", A> {} + /// CCIfNotVarArg - If the current function is not vararg - apply the action class CCIfNotVarArg : CCIf<"!State.isVarArg()", A> {} @@ -119,6 +122,12 @@ class CCPromoteToType ValueType DestTy = destTy; } +/// CCPromoteToUpperBitsInType - If applied, this promotes the specified current +/// value to the specified type and shifts the value into the upper bits. +class CCPromoteToUpperBitsInType : CCAction { + ValueType DestTy = destTy; +} + /// CCBitConvertToType - If applied, this bitconverts the specified current /// value to the specified type. class CCBitConvertToType : CCAction { @@ -141,6 +150,13 @@ class CCDelegateTo : CCA /// that the target supports. class CallingConv actions> { list Actions = actions; + bit Custom = 0; +} + +/// CustomCallingConv - An instance of this is used to declare calling +/// conventions that are implemented using a custom function of the same name. +class CustomCallingConv : CallingConv<[]> { + let Custom = 1; } /// CalleeSavedRegs - A list of callee saved registers for a given calling Modified: head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -55,10 +55,13 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasTy = MayAlias; } + bool ASHadUnknownInsts = !AS.UnknownInsts.empty(); if (UnknownInsts.empty()) { // Merge call sites... - if (!AS.UnknownInsts.empty()) + if (ASHadUnknownInsts) { std::swap(UnknownInsts, AS.UnknownInsts); - } else if (!AS.UnknownInsts.empty()) { + addRef(); + } + } else if (ASHadUnknownInsts) { UnknownInsts.insert(UnknownInsts.end(), AS.UnknownInsts.begin(), AS.UnknownInsts.end()); AS.UnknownInsts.clear(); } @@ -76,6 +79,8 @@ void AliasSet::mergeSetIn(AliasSet &AS, AS.PtrListEnd = &AS.PtrList; assert(*AS.PtrListEnd == nullptr && "End of list is not null?"); } + if (ASHadUnknownInsts) + AS.dropRef(AST); } void AliasSetTracker::removeAliasSet(AliasSet *AS) { @@ -123,6 +128,8 @@ void AliasSet::addPointer(AliasSetTracke } void AliasSet::addUnknownInst(Instruction *I, AliasAnalysis &AA) { + if (UnknownInsts.empty()) + addRef(); UnknownInsts.push_back(I); if (!I->mayWriteToMemory()) { @@ -218,13 +225,14 @@ AliasSet *AliasSetTracker::findAliasSetF uint64_t Size, const MDNode *TBAAInfo) { AliasSet *FoundSet = nullptr; - for (iterator I = begin(), E = end(); I != E; ++I) { - if (I->Forward || !I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) continue; + for (iterator I = begin(), E = end(); I != E;) { + iterator Cur = I++; + if (Cur->Forward || !Cur->aliasesPointer(Ptr, Size, TBAAInfo, AA)) continue; if (!FoundSet) { // If this is the first alias set ptr can go into. - FoundSet = I; // Remember it. + FoundSet = Cur; // Remember it. } else { // Otherwise, we must merge the sets. - FoundSet->mergeSetIn(*I, *this); // Merge in contents. + FoundSet->mergeSetIn(*Cur, *this); // Merge in contents. } } @@ -246,14 +254,14 @@ bool AliasSetTracker::containsPointer(Va AliasSet *AliasSetTracker::findAliasSetForUnknownInst(Instruction *Inst) { AliasSet *FoundSet = nullptr; - for (iterator I = begin(), E = end(); I != E; ++I) { - if (I->Forward || !I->aliasesUnknownInst(Inst, AA)) + for (iterator I = begin(), E = end(); I != E;) { + iterator Cur = I++; + if (Cur->Forward || !Cur->aliasesUnknownInst(Inst, AA)) continue; - if (!FoundSet) // If this is the first alias set ptr can go into. - FoundSet = I; // Remember it. - else if (!I->Forward) // Otherwise, we must merge the sets. - FoundSet->mergeSetIn(*I, *this); // Merge in contents. + FoundSet = Cur; // Remember it. + else if (!Cur->Forward) // Otherwise, we must merge the sets. + FoundSet->mergeSetIn(*Cur, *this); // Merge in contents. } return FoundSet; } @@ -393,6 +401,8 @@ void AliasSetTracker::add(const AliasSet /// tracker. void AliasSetTracker::remove(AliasSet &AS) { // Drop all call sites. + if (!AS.UnknownInsts.empty()) + AS.dropRef(*this); AS.UnknownInsts.clear(); // Clear the alias set. @@ -489,10 +499,10 @@ void AliasSetTracker::deleteValue(Value if (Instruction *Inst = dyn_cast(PtrVal)) { if (Inst->mayReadOrWriteMemory()) { // Scan all the alias sets to see if this call site is contained. - for (iterator I = begin(), E = end(); I != E; ++I) { - if (I->Forward) continue; - - I->removeUnknownInst(Inst); + for (iterator I = begin(), E = end(); I != E;) { + iterator Cur = I++; + if (!Cur->Forward) + Cur->removeUnknownInst(*this, Inst); } } } Modified: head/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -14,7 +14,7 @@ #include "llvm/Analysis/BlockFrequencyInfoImpl.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/Support/raw_ostream.h" -#include +#include using namespace llvm; using namespace llvm::bfi_detail; @@ -123,8 +123,12 @@ static void combineWeight(Weight &W, con } assert(W.Type == OtherW.Type); assert(W.TargetNode == OtherW.TargetNode); - assert(W.Amount < W.Amount + OtherW.Amount && "Unexpected overflow"); - W.Amount += OtherW.Amount; + assert(OtherW.Amount && "Expected non-zero weight"); + if (W.Amount > W.Amount + OtherW.Amount) + // Saturate on overflow. + W.Amount = UINT64_MAX; + else + W.Amount += OtherW.Amount; } static void combineWeightsBySorting(WeightList &Weights) { // Sort so edges to the same node are adjacent. @@ -207,11 +211,19 @@ void Distribution::normalize() { Shift = 33 - countLeadingZeros(Total); // Early exit if nothing needs to be scaled. - if (!Shift) + if (!Shift) { + // If we didn't overflow then combineWeights() shouldn't have changed the + // sum of the weights, but let's double-check. + assert(Total == std::accumulate(Weights.begin(), Weights.end(), UINT64_C(0), + [](uint64_t Sum, const Weight &W) { + return Sum + W.Amount; + }) && + "Expected total to be correct"); return; + } // Recompute the total through accumulation (rather than shifting it) so that - // it's accurate after shifting. + // it's accurate after shifting and any changes combineWeights() made above. Total = 0; // Sum the weights to each node and shift right if necessary. Modified: head/contrib/llvm/lib/Analysis/ValueTracking.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ValueTracking.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Analysis/ValueTracking.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -1987,23 +1987,31 @@ bool llvm::isSafeToSpeculativelyExecute( default: return true; case Instruction::UDiv: - case Instruction::URem: - // x / y is undefined if y == 0, but calculations like x / 3 are safe. - return isKnownNonZero(Inst->getOperand(1), TD); + case Instruction::URem: { + // x / y is undefined if y == 0. + const APInt *V; + if (match(Inst->getOperand(1), m_APInt(V))) + return *V != 0; + return false; + } case Instruction::SDiv: case Instruction::SRem: { - Value *Op = Inst->getOperand(1); - // x / y is undefined if y == 0 - if (!isKnownNonZero(Op, TD)) - return false; - // x / y might be undefined if y == -1 - unsigned BitWidth = getBitWidth(Op->getType(), TD); - if (BitWidth == 0) - return false; - APInt KnownZero(BitWidth, 0); - APInt KnownOne(BitWidth, 0); - computeKnownBits(Op, KnownZero, KnownOne, TD); - return !!KnownZero; + // x / y is undefined if y == 0 or x == INT_MIN and y == -1 + const APInt *X, *Y; + if (match(Inst->getOperand(1), m_APInt(Y))) { + if (*Y != 0) { + if (*Y == -1) { + // The numerator can't be MinSignedValue if the denominator is -1. + if (match(Inst->getOperand(0), m_APInt(X))) + return !Y->isMinSignedValue(); + // The numerator *might* be MinSignedValue. + return false; + } + // The denominator is not 0 or -1, it's safe to proceed. + return true; + } + } + return false; } case Instruction::Load: { const LoadInst *LI = cast(Inst); Modified: head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -341,6 +341,8 @@ void MCObjectFileInfo::InitELFMCObjectFi break; case Triple::mips: case Triple::mipsel: + case Triple::mips64: + case Triple::mips64el: // MIPS uses indirect pointer to refer personality functions, so that the // eh_frame section can be read-only. DW.ref.personality will be generated // for relocation. Modified: head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -566,11 +566,59 @@ void ARMFrameLowering::emitPrologue(Mach AFI->setShouldRestoreSPFromFP(true); } +// Resolve TCReturn pseudo-instruction +void ARMFrameLowering::fixTCReturn(MachineFunction &MF, + MachineBasicBlock &MBB) const { + MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); + assert(MBBI->isReturn() && "Can only insert epilog into returning blocks"); + unsigned RetOpcode = MBBI->getOpcode(); + DebugLoc dl = MBBI->getDebugLoc(); + const ARMBaseInstrInfo &TII = + *MF.getTarget().getSubtarget().getInstrInfo(); + + if (!(RetOpcode == ARM::TCRETURNdi || RetOpcode == ARM::TCRETURNri)) + return; + + // Tail call return: adjust the stack pointer and jump to callee. + MBBI = MBB.getLastNonDebugInstr(); + MachineOperand &JumpTarget = MBBI->getOperand(0); + + // Jump to label or value in register. + if (RetOpcode == ARM::TCRETURNdi) { + unsigned TCOpcode = STI.isThumb() ? + (STI.isTargetMachO() ? ARM::tTAILJMPd : ARM::tTAILJMPdND) : + ARM::TAILJMPd; + MachineInstrBuilder MIB = BuildMI(MBB, MBBI, dl, TII.get(TCOpcode)); + if (JumpTarget.isGlobal()) + MIB.addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(), + JumpTarget.getTargetFlags()); + else { + assert(JumpTarget.isSymbol()); + MIB.addExternalSymbol(JumpTarget.getSymbolName(), + JumpTarget.getTargetFlags()); + } + + // Add the default predicate in Thumb mode. + if (STI.isThumb()) MIB.addImm(ARMCC::AL).addReg(0); + } else if (RetOpcode == ARM::TCRETURNri) { + BuildMI(MBB, MBBI, dl, + TII.get(STI.isThumb() ? ARM::tTAILJMPr : ARM::TAILJMPr)). + addReg(JumpTarget.getReg(), RegState::Kill); + } + + MachineInstr *NewMI = std::prev(MBBI); + for (unsigned i = 1, e = MBBI->getNumOperands(); i != e; ++i) + NewMI->addOperand(MBBI->getOperand(i)); + + // Delete the pseudo instruction TCRETURN. + MBB.erase(MBBI); + MBBI = NewMI; +} + void ARMFrameLowering::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); assert(MBBI->isReturn() && "Can only insert epilog into returning blocks"); - unsigned RetOpcode = MBBI->getOpcode(); DebugLoc dl = MBBI->getDebugLoc(); MachineFrameInfo *MFI = MF.getFrameInfo(); ARMFunctionInfo *AFI = MF.getInfo(); @@ -588,8 +636,10 @@ void ARMFrameLowering::emitEpilogue(Mach // All calls are tail calls in GHC calling conv, and functions have no // prologue/epilogue. - if (MF.getFunction()->getCallingConv() == CallingConv::GHC) + if (MF.getFunction()->getCallingConv() == CallingConv::GHC) { + fixTCReturn(MF, MBB); return; + } if (!AFI->hasStackFrame()) { if (NumBytes - ArgRegsSaveSize != 0) @@ -661,42 +711,7 @@ void ARMFrameLowering::emitEpilogue(Mach if (AFI->getGPRCalleeSavedArea1Size()) MBBI++; } - if (RetOpcode == ARM::TCRETURNdi || RetOpcode == ARM::TCRETURNri) { - // Tail call return: adjust the stack pointer and jump to callee. - MBBI = MBB.getLastNonDebugInstr(); - MachineOperand &JumpTarget = MBBI->getOperand(0); - - // Jump to label or value in register. - if (RetOpcode == ARM::TCRETURNdi) { - unsigned TCOpcode = STI.isThumb() ? - (STI.isTargetMachO() ? ARM::tTAILJMPd : ARM::tTAILJMPdND) : - ARM::TAILJMPd; - MachineInstrBuilder MIB = BuildMI(MBB, MBBI, dl, TII.get(TCOpcode)); - if (JumpTarget.isGlobal()) - MIB.addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(), - JumpTarget.getTargetFlags()); - else { - assert(JumpTarget.isSymbol()); - MIB.addExternalSymbol(JumpTarget.getSymbolName(), - JumpTarget.getTargetFlags()); - } - - // Add the default predicate in Thumb mode. - if (STI.isThumb()) MIB.addImm(ARMCC::AL).addReg(0); - } else if (RetOpcode == ARM::TCRETURNri) { - BuildMI(MBB, MBBI, dl, - TII.get(STI.isThumb() ? ARM::tTAILJMPr : ARM::TAILJMPr)). - addReg(JumpTarget.getReg(), RegState::Kill); - } - - MachineInstr *NewMI = std::prev(MBBI); - for (unsigned i = 1, e = MBBI->getNumOperands(); i != e; ++i) - NewMI->addOperand(MBBI->getOperand(i)); - - // Delete the pseudo instruction TCRETURN. - MBB.erase(MBBI); - MBBI = NewMI; - } + fixTCReturn(MF, MBB); if (ArgRegsSaveSize) emitSPUpdate(isARM, MBB, MBBI, dl, TII, ArgRegsSaveSize); Modified: head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h Sun Jan 18 14:14:47 2015 (r277320) @@ -31,6 +31,8 @@ public: void emitPrologue(MachineFunction &MF) const override; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; + void fixTCReturn(MachineFunction &MF, MachineBasicBlock &MBB) const; + bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector &CSI, Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -1521,7 +1521,7 @@ ARMTargetLowering::LowerCall(TargetLower // True if this byval aggregate will be split between registers // and memory. unsigned ByValArgsCount = CCInfo.getInRegsParamsCount(); - unsigned CurByValIdx = CCInfo.getInRegsParamsProceed(); + unsigned CurByValIdx = CCInfo.getInRegsParamsProcessed(); if (CurByValIdx < ByValArgsCount) { @@ -2962,7 +2962,7 @@ ARMTargetLowering::LowerFormalArguments( if (Flags.isByVal()) { unsigned ExtraArgRegsSize; unsigned ExtraArgRegsSaveSize; - computeRegArea(CCInfo, MF, CCInfo.getInRegsParamsProceed(), + computeRegArea(CCInfo, MF, CCInfo.getInRegsParamsProcessed(), Flags.getByValSize(), ExtraArgRegsSize, ExtraArgRegsSaveSize); @@ -3086,7 +3086,7 @@ ARMTargetLowering::LowerFormalArguments( // Since they could be overwritten by lowering of arguments in case of // a tail call. if (Flags.isByVal()) { - unsigned CurByValIndex = CCInfo.getInRegsParamsProceed(); + unsigned CurByValIndex = CCInfo.getInRegsParamsProcessed(); ByValStoreOffset = RoundUpToAlignment(ByValStoreOffset, Flags.getByValAlign()); int FrameIndex = StoreByValRegs( Modified: head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -200,14 +200,14 @@ class MipsAsmParser : public MCTargetAsm // Example: INSERT.B $w0[n], $1 => 16 > n >= 0 bool validateMSAIndex(int Val, int RegKind); - void setFeatureBits(unsigned Feature, StringRef FeatureString) { + void setFeatureBits(uint64_t Feature, StringRef FeatureString) { if (!(STI.getFeatureBits() & Feature)) { setAvailableFeatures( ComputeAvailableFeatures(STI.ToggleFeature(FeatureString))); } } - void clearFeatureBits(unsigned Feature, StringRef FeatureString) { + void clearFeatureBits(uint64_t Feature, StringRef FeatureString) { if (STI.getFeatureBits() & Feature) { setAvailableFeatures( ComputeAvailableFeatures(STI.ToggleFeature(FeatureString))); Modified: head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -250,6 +250,11 @@ static DecodeStatus DecodeMem(MCInst &In uint64_t Address, const void *Decoder); +static DecodeStatus DecodeCacheOp(MCInst &Inst, + unsigned Insn, + uint64_t Address, + const void *Decoder); + static DecodeStatus DecodeMSA128Mem(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder); @@ -267,6 +272,14 @@ static DecodeStatus DecodeFMem(MCInst &I uint64_t Address, const void *Decoder); +static DecodeStatus DecodeFMem2(MCInst &Inst, unsigned Insn, + uint64_t Address, + const void *Decoder); + +static DecodeStatus DecodeFMem3(MCInst &Inst, unsigned Insn, + uint64_t Address, + const void *Decoder); + static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst, unsigned Insn, uint64_t Address, @@ -451,7 +464,7 @@ static DecodeStatus DecodeAddiGroupBranc InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; bool HasRs = false; if (Rs >= Rt) { @@ -490,7 +503,7 @@ static DecodeStatus DecodeDaddiGroupBran InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; bool HasRs = false; if (Rs >= Rt) { @@ -530,7 +543,7 @@ static DecodeStatus DecodeBlezlGroupBran InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; bool HasRs = false; if (Rt == 0) @@ -575,7 +588,7 @@ static DecodeStatus DecodeBgtzlGroupBran InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; if (Rt == 0) return MCDisassembler::Fail; @@ -617,7 +630,7 @@ static DecodeStatus DecodeBgtzGroupBranc InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; bool HasRs = false; bool HasRt = false; @@ -666,7 +679,7 @@ static DecodeStatus DecodeBlezGroupBranc InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) << 2; + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; bool HasRs = false; if (Rt == 0) @@ -964,6 +977,23 @@ static DecodeStatus DecodeMem(MCInst &In return MCDisassembler::Success; } +static DecodeStatus DecodeCacheOp(MCInst &Inst, + unsigned Insn, + uint64_t Address, + const void *Decoder) { + int Offset = SignExtend32<16>(Insn & 0xffff); + unsigned Hint = fieldFromInstruction(Insn, 16, 5); + unsigned Base = fieldFromInstruction(Insn, 21, 5); + + Base = getReg(Decoder, Mips::GPR32RegClassID, Base); + + Inst.addOperand(MCOperand::CreateReg(Base)); + Inst.addOperand(MCOperand::CreateImm(Offset)); + Inst.addOperand(MCOperand::CreateImm(Hint)); + + return MCDisassembler::Success; +} + static DecodeStatus DecodeMSA128Mem(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) { int Offset = SignExtend32<10>(fieldFromInstruction(Insn, 16, 10)); @@ -995,15 +1025,15 @@ static DecodeStatus DecodeMSA128Mem(MCIn break; case Mips::LD_H: case Mips::ST_H: - Inst.addOperand(MCOperand::CreateImm(Offset << 1)); + Inst.addOperand(MCOperand::CreateImm(Offset * 2)); break; case Mips::LD_W: case Mips::ST_W: - Inst.addOperand(MCOperand::CreateImm(Offset << 2)); + Inst.addOperand(MCOperand::CreateImm(Offset * 4)); break; case Mips::LD_D: case Mips::ST_D: - Inst.addOperand(MCOperand::CreateImm(Offset << 3)); + Inst.addOperand(MCOperand::CreateImm(Offset * 8)); break; } @@ -1067,6 +1097,42 @@ static DecodeStatus DecodeFMem(MCInst &I return MCDisassembler::Success; } +static DecodeStatus DecodeFMem2(MCInst &Inst, + unsigned Insn, + uint64_t Address, + const void *Decoder) { + int Offset = SignExtend32<16>(Insn & 0xffff); + unsigned Reg = fieldFromInstruction(Insn, 16, 5); + unsigned Base = fieldFromInstruction(Insn, 21, 5); + + Reg = getReg(Decoder, Mips::COP2RegClassID, Reg); + Base = getReg(Decoder, Mips::GPR32RegClassID, Base); + + Inst.addOperand(MCOperand::CreateReg(Reg)); + Inst.addOperand(MCOperand::CreateReg(Base)); + Inst.addOperand(MCOperand::CreateImm(Offset)); + + return MCDisassembler::Success; +} + +static DecodeStatus DecodeFMem3(MCInst &Inst, + unsigned Insn, + uint64_t Address, + const void *Decoder) { + int Offset = SignExtend32<16>(Insn & 0xffff); + unsigned Reg = fieldFromInstruction(Insn, 16, 5); + unsigned Base = fieldFromInstruction(Insn, 21, 5); + + Reg = getReg(Decoder, Mips::COP3RegClassID, Reg); + Base = getReg(Decoder, Mips::GPR32RegClassID, Base); + + Inst.addOperand(MCOperand::CreateReg(Reg)); + Inst.addOperand(MCOperand::CreateReg(Base)); + Inst.addOperand(MCOperand::CreateImm(Offset)); + + return MCDisassembler::Success; +} + static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst, unsigned Insn, uint64_t Address, @@ -1225,7 +1291,7 @@ static DecodeStatus DecodeBranchTarget(M unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = (SignExtend32<16>(Offset) << 2) + 4; + int32_t BranchOffset = (SignExtend32<16>(Offset) * 4) + 4; Inst.addOperand(MCOperand::CreateImm(BranchOffset)); return MCDisassembler::Success; } @@ -1244,7 +1310,7 @@ static DecodeStatus DecodeBranchTarget21 unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = SignExtend32<21>(Offset) << 2; + int32_t BranchOffset = SignExtend32<21>(Offset) * 4; Inst.addOperand(MCOperand::CreateImm(BranchOffset)); return MCDisassembler::Success; @@ -1254,7 +1320,7 @@ static DecodeStatus DecodeBranchTarget26 unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = SignExtend32<26>(Offset) << 2; + int32_t BranchOffset = SignExtend32<26>(Offset) * 4; Inst.addOperand(MCOperand::CreateImm(BranchOffset)); return MCDisassembler::Success; @@ -1264,7 +1330,7 @@ static DecodeStatus DecodeBranchTargetMM unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = SignExtend32<16>(Offset) << 1; + int32_t BranchOffset = SignExtend32<16>(Offset) * 2; Inst.addOperand(MCOperand::CreateImm(BranchOffset)); return MCDisassembler::Success; } @@ -1317,12 +1383,12 @@ static DecodeStatus DecodeExtSize(MCInst static DecodeStatus DecodeSimm19Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) { - Inst.addOperand(MCOperand::CreateImm(SignExtend32<19>(Insn) << 2)); + Inst.addOperand(MCOperand::CreateImm(SignExtend32<19>(Insn) * 4)); return MCDisassembler::Success; } static DecodeStatus DecodeSimm18Lsl3(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) { - Inst.addOperand(MCOperand::CreateImm(SignExtend32<18>(Insn) << 3)); + Inst.addOperand(MCOperand::CreateImm(SignExtend32<18>(Insn) * 8)); return MCDisassembler::Success; } Modified: head/contrib/llvm/lib/Target/Mips/Mips.td ============================================================================== --- head/contrib/llvm/lib/Target/Mips/Mips.td Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/Mips.td Sun Jan 18 14:14:47 2015 (r277320) @@ -57,6 +57,8 @@ def MipsInstrInfo : InstrInfo; // Mips Subtarget features // //===----------------------------------------------------------------------===// +def FeatureNoABICalls : SubtargetFeature<"noabicalls", "NoABICalls", "true", + "Disable SVR4-style position-independent code.">; def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true", "General Purpose Registers are 64-bit wide.">; def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true", @@ -67,13 +69,13 @@ def FeatureNaN2008 : SubtargetFeatur "IEEE 754-2008 NaN encoding.">; def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat", "true", "Only supports single precision float">; -def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32", +def FeatureO32 : SubtargetFeature<"o32", "ABI", "MipsABIInfo::O32()", "Enable o32 ABI">; -def FeatureN32 : SubtargetFeature<"n32", "MipsABI", "N32", +def FeatureN32 : SubtargetFeature<"n32", "ABI", "MipsABIInfo::N32()", "Enable n32 ABI">; -def FeatureN64 : SubtargetFeature<"n64", "MipsABI", "N64", +def FeatureN64 : SubtargetFeature<"n64", "ABI", "MipsABIInfo::N64()", "Enable n64 ABI">; -def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI", +def FeatureEABI : SubtargetFeature<"eabi", "ABI", "MipsABIInfo::EABI()", "Enable eabi ABI">; def FeatureNoOddSPReg : SubtargetFeature<"nooddspreg", "UseOddSPReg", "false", "Disable odd numbered single-precision " Modified: head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp Sun Jan 18 14:14:47 2015 (r277320) @@ -241,10 +241,9 @@ Mips16TargetLowering::EmitInstrWithCusto } } -bool Mips16TargetLowering:: -isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo, - unsigned NextStackOffset, - const MipsFunctionInfo& FI) const { +bool Mips16TargetLowering::isEligibleForTailCallOptimization( + const CCState &CCInfo, unsigned NextStackOffset, + const MipsFunctionInfo &FI) const { // No tail call optimization for mips16. return false; } Modified: head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h Sun Jan 18 14:14:47 2015 (r277320) @@ -30,9 +30,9 @@ namespace llvm { MachineBasicBlock *MBB) const override; private: - bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo, - unsigned NextStackOffset, - const MipsFunctionInfo& FI) const override; + bool isEligibleForTailCallOptimization( + const CCState &CCInfo, unsigned NextStackOffset, + const MipsFunctionInfo &FI) const override; void setMips16HardFloatLibCalls(); Modified: head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td Sun Jan 18 14:04:55 2015 (r277319) +++ head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td Sun Jan 18 14:14:47 2015 (r277320) @@ -419,6 +419,10 @@ defm : SetgePats; defm : SetgeImmPats; // truncate +def : MipsPat<(trunc (assertsext GPR64:$src)), + (EXTRACT_SUBREG GPR64:$src, sub_32)>; +def : MipsPat<(trunc (assertzext GPR64:$src)), + (EXTRACT_SUBREG GPR64:$src, sub_32)>; def : MipsPat<(i32 (trunc GPR64:$src)), (SLL (EXTRACT_SUBREG GPR64:$src, sub_32), 0)>; Copied: head/contrib/llvm/lib/Target/Mips/MipsABIInfo.cpp (from r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/lib/Target/Mips/MipsABIInfo.cpp Sun Jan 18 14:14:47 2015 (r277320, copy of r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.cpp) @@ -0,0 +1,45 @@ +//===---- MipsABIInfo.cpp - Information about MIPS ABI's ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "MipsABIInfo.h" +#include "MipsRegisterInfo.h" + +using namespace llvm; + +namespace { +static const MCPhysReg O32IntRegs[4] = {Mips::A0, Mips::A1, Mips::A2, Mips::A3}; + +static const MCPhysReg Mips64IntRegs[8] = { + Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64, + Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64}; +} + +const ArrayRef MipsABIInfo::GetByValArgRegs() const { + if (IsO32()) + return makeArrayRef(O32IntRegs); + if (IsN32() || IsN64()) + return makeArrayRef(Mips64IntRegs); + llvm_unreachable("Unhandled ABI"); +} + +const ArrayRef MipsABIInfo::GetVarArgRegs() const { + if (IsO32()) + return makeArrayRef(O32IntRegs); + if (IsN32() || IsN64()) + return makeArrayRef(Mips64IntRegs); + llvm_unreachable("Unhandled ABI"); +} + +unsigned MipsABIInfo::GetCalleeAllocdArgSizeInBytes(CallingConv::ID CC) const { + if (IsO32()) + return CC != CallingConv::Fast ? 16 : 0; + if (IsN32() || IsN64() || IsEABI()) + return 0; + llvm_unreachable("Unhandled ABI"); +} Copied: head/contrib/llvm/lib/Target/Mips/MipsABIInfo.h (from r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/lib/Target/Mips/MipsABIInfo.h Sun Jan 18 14:14:47 2015 (r277320, copy of r277223, vendor/llvm/dist/lib/Target/Mips/MipsABIInfo.h) @@ -0,0 +1,61 @@ +//===---- MipsABIInfo.h - Information about MIPS ABI's --------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MIPSABIINFO_H +#define MIPSABIINFO_H + +#include "llvm/ADT/ArrayRef.h" +#include "llvm/MC/MCRegisterInfo.h" +#include "llvm/IR/CallingConv.h" + +namespace llvm { + +class MipsABIInfo { +public: + enum class ABI { Unknown, O32, N32, N64, EABI }; + +protected: + ABI ThisABI; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 15:03:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 345AC47B; Sun, 18 Jan 2015 15:03:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153BD8D5; Sun, 18 Jan 2015 15:03:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IF3R5V079512; Sun, 18 Jan 2015 15:03:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IF3RXg079509; Sun, 18 Jan 2015 15:03:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501181503.t0IF3RXg079509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Jan 2015 15:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277321 - in head/sys: fs/fifofs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 15:03:28 -0000 Author: kib Date: Sun Jan 18 15:03:26 2015 New Revision: 277321 URL: https://svnweb.freebsd.org/changeset/base/277321 Log: Make SIGSTOP working for sleeps done while waiting for fifo readers or writers in open(2), when the fifo is located on an NFS mount. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/fifofs/fifo_vnops.c head/sys/kern/kern_sig.c head/sys/sys/signalvar.h Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Sun Jan 18 14:14:47 2015 (r277320) +++ head/sys/fs/fifofs/fifo_vnops.c Sun Jan 18 15:03:26 2015 (r277321) @@ -137,7 +137,7 @@ fifo_open(ap) struct thread *td; struct fifoinfo *fip; struct pipe *fpipe; - int error; + int error, stops_deferred; vp = ap->a_vp; fp = ap->a_fp; @@ -188,8 +188,11 @@ fifo_open(ap) if ((ap->a_mode & O_NONBLOCK) == 0) { if ((ap->a_mode & FREAD) && fip->fi_writers == 0) { VOP_UNLOCK(vp, 0); + stops_deferred = sigallowstop(); error = msleep(&fip->fi_readers, PIPE_MTX(fpipe), PDROP | PCATCH | PSOCK, "fifoor", 0); + if (stops_deferred) + sigdeferstop(); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) { fip->fi_readers--; @@ -212,8 +215,11 @@ fifo_open(ap) } if ((ap->a_mode & FWRITE) && fip->fi_readers == 0) { VOP_UNLOCK(vp, 0); + stops_deferred = sigallowstop(); error = msleep(&fip->fi_writers, PIPE_MTX(fpipe), PDROP | PCATCH | PSOCK, "fifoow", 0); + if (stops_deferred) + sigdeferstop(); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error) { fip->fi_writers--; Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jan 18 14:14:47 2015 (r277320) +++ head/sys/kern/kern_sig.c Sun Jan 18 15:03:26 2015 (r277321) @@ -2587,15 +2587,18 @@ sigdeferstop(void) * not immediately suspend if a stop was posted. Instead, the thread * will suspend either via ast() or a subsequent interruptible sleep. */ -void -sigallowstop() +int +sigallowstop(void) { struct thread *td; + int prev; td = curthread; thread_lock(td); + prev = (td->td_flags & TDF_SBDRY) != 0; td->td_flags &= ~TDF_SBDRY; thread_unlock(td); + return (prev); } /* Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Sun Jan 18 14:14:47 2015 (r277320) +++ head/sys/sys/signalvar.h Sun Jan 18 15:03:26 2015 (r277321) @@ -325,7 +325,7 @@ extern struct mtx sigio_lock; int cursig(struct thread *td); int sigdeferstop(void); -void sigallowstop(void); +int sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 15:13:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C13BE7D3; Sun, 18 Jan 2015 15:13:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB94D9A2; Sun, 18 Jan 2015 15:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IFDE8M084176; Sun, 18 Jan 2015 15:13:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IFDBLu084161; Sun, 18 Jan 2015 15:13:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501181513.t0IFDBLu084161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Jan 2015 15:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277322 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 15:13:14 -0000 Author: kib Date: Sun Jan 18 15:13:11 2015 New Revision: 277322 URL: https://svnweb.freebsd.org/changeset/base/277322 Log: Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger attachment to the process. Note that the command is not intended to be a security measure, rather it is an obfuscation feature, implemented for parity with other operating systems. Discussed with: jilles, rwatson Man page fixes by: rwatson Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/sys/procctl.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c head/sys/kern/kern_fork.c head/sys/kern/kern_procctl.c head/sys/kern/kern_prot.c head/sys/kern/kern_sig.c head/sys/sys/priv.h head/sys/sys/proc.h head/sys/sys/procctl.h Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Sun Jan 18 15:03:26 2015 (r277321) +++ head/lib/libc/sys/procctl.2 Sun Jan 18 15:13:11 2015 (r277322) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2014 +.Dd December 29, 2014 .Dt PROCCTL 2 .Os .Sh NAME @@ -275,7 +275,61 @@ delivery failed, e.g. due to the permiss If no such process exist, the .Fa rk_fpid field is set to -1. +.It Dv PROC_TRACE_CTL +Enable or disable tracing of the specified process(es), according to the +value of the integer argument. +Tracing includes attachment to the process using +.Xr ptrace 2 +and +.Xr ktrace 2 , +debugging sysctls, +.Xr hwpmc 4 , +.Xr dtrace 1 +and core dumping. +Possible values for the +.Fa data +argument are: +.Bl -tag -width "Dv PROC_TRACE_CTL_DISABLE_EXEC" +.It Dv PROC_TRACE_CTL_ENABLE +Enable tracing, after it was disabled by +.Dv PROC_TRACE_CTL_DISABLE . +Only allowed for self. +.It Dv PROC_TRACE_CTL_DISABLE +Disable tracing for the specified process. +Tracing is re-enabled when the process changes the executing +program with +.Xr execve 2 +syscall. +A child inherits the trace settings from the parent on +.Xr fork 2 . +.It Dv PROC_TRACE_CTL_DISABLE_EXEC +Same as +.Dv PROC_TRACE_CTL_DISABLE , +but the setting persist for the process even after +.Xr execve 2 . +.El +.It Dv PROC_TRACE_STATUS +Returns the current tracing status for the specified process in +the integer variable pointed to by +.Fa data . +If tracing is disabled, +.Fa data +is set to -1. +If tracing is enabled, but no debugger is attached by +.Xr ptrace 2 +syscall, +.Fa data +is set to 0. +If a debugger is attached, +.Fa data +is set to the pid of the debugger process. .El +.Sh NOTES +Disabling tracing on a process should not be considered a security +feature, as it is bypassable both by the kernel and privileged processes, +and via other system mechanisms. +As such, it should not be relied on to reliably protect cryptographic +keying material or other confidential data. .Sh RETURN VALUES If an error occurs, a value of -1 is returned and .Va errno @@ -343,11 +397,34 @@ The .Dv PROC_REAP_ACQUIRE request was issued by a process that had already acquired reaper status and has not yet released it. +.It Bq Er EBUSY +The +.Dv PROC_TRACE_CTL +request was issued for a process already being traced. +.It Bq Er EPERM +The +.Dv PROC_TRACE_CTL +request to re-enable tracing of the process ( +.Dv PROC_TRACE_CTL_ENABLE ) , +or to disable persistence of the +.Dv PROC_TRACE_CTL_DISABLE +on +.Xr execve 2 +was issued for a non-current process. +.It Bq Er EINVAL +The value of the integer +.Fa data +parameter for the +.Dv PROC_TRACE_CTL +request is invalid. .El .Sh SEE ALSO +.Xr dtrace 1 , .Xr kill 2 , +.Xr ktrace 2 , .Xr ptrace 2 , .Xr wait 2 , +.Xr hwpmc 4 , .Xr init 8 .Sh HISTORY The Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jan 18 15:13:11 2015 (r277322) @@ -2969,6 +2969,7 @@ freebsd32_procctl(struct thread *td, str switch (uap->com) { case PROC_SPROTECT: + case PROC_TRACE_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); if (error != 0) return (error); @@ -2997,6 +2998,9 @@ freebsd32_procctl(struct thread *td, str return (error); data = &x.rk; break; + case PROC_TRACE_STATUS: + data = &flags; + break; default: return (EINVAL); } @@ -3012,6 +3016,10 @@ freebsd32_procctl(struct thread *td, str if (error == 0) error = error1; break; + case PROC_TRACE_STATUS: + if (error == 0) + error = copyout(&flags, uap->data, sizeof(flags)); + break; } return (error); } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/kern/kern_exec.c Sun Jan 18 15:13:11 2015 (r277322) @@ -634,6 +634,8 @@ interpret: * it that it now has its own resources back */ p->p_flag |= P_EXEC; + if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0) + p->p_flag2 &= ~P2_NOTRACE; if (p->p_flag & P_PPWAIT) { p->p_flag &= ~(P_PPWAIT | P_PPTRACE); cv_broadcast(&p->p_pwait); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/kern/kern_fork.c Sun Jan 18 15:13:11 2015 (r277322) @@ -494,7 +494,7 @@ do_fork(struct thread *td, int flags, st * Increase reference counts on shared objects. */ p2->p_flag = P_INMEM; - p2->p_flag2 = 0; + p2->p_flag2 = p1->p_flag2 & (P2_NOTRACE | P2_NOTRACE_EXEC); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/kern/kern_procctl.c Sun Jan 18 15:13:11 2015 (r277322) @@ -280,6 +280,62 @@ reap_kill(struct thread *td, struct proc return (error); } +static int +trace_ctl(struct thread *td, struct proc *p, int state) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + + /* + * Ktrace changes p_traceflag from or to zero under the + * process lock, so the test does not need to acquire ktrace + * mutex. + */ + if ((p->p_flag & P_TRACED) != 0 || p->p_traceflag != 0) + return (EBUSY); + + switch (state) { + case PROC_TRACE_CTL_ENABLE: + if (td->td_proc != p) + return (EPERM); + p->p_flag2 &= ~(P2_NOTRACE | P2_NOTRACE_EXEC); + break; + case PROC_TRACE_CTL_DISABLE_EXEC: + p->p_flag2 |= P2_NOTRACE_EXEC | P2_NOTRACE; + break; + case PROC_TRACE_CTL_DISABLE: + if ((p->p_flag2 & P2_NOTRACE_EXEC) != 0) { + KASSERT((p->p_flag2 & P2_NOTRACE) != 0, + ("dandling P2_NOTRACE_EXEC")); + if (td->td_proc != p) + return (EPERM); + p->p_flag2 &= ~P2_NOTRACE_EXEC; + } else { + p->p_flag2 |= P2_NOTRACE; + } + break; + default: + return (EINVAL); + } + return (0); +} + +static int +trace_status(struct thread *td, struct proc *p, int *data) +{ + + if ((p->p_flag2 & P2_NOTRACE) != 0) { + KASSERT((p->p_flag & P_TRACED) == 0, + ("%d traced but tracing disabled", p->p_pid)); + *data = -1; + } else if ((p->p_flag & P_TRACED) != 0) { + *data = p->p_pptr->p_pid; + } else { + *data = 0; + } + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct procctl_args { idtype_t idtype; @@ -302,6 +358,7 @@ sys_procctl(struct thread *td, struct pr switch (uap->com) { case PROC_SPROTECT: + case PROC_TRACE_CTL: error = copyin(uap->data, &flags, sizeof(flags)); if (error != 0) return (error); @@ -328,6 +385,9 @@ sys_procctl(struct thread *td, struct pr return (error); data = &x.rk; break; + case PROC_TRACE_STATUS: + data = &flags; + break; default: return (EINVAL); } @@ -342,6 +402,10 @@ sys_procctl(struct thread *td, struct pr if (error == 0) error = error1; break; + case PROC_TRACE_STATUS: + if (error == 0) + error = copyout(&flags, uap->data, sizeof(flags)); + break; } return (error); } @@ -364,6 +428,10 @@ kern_procctl_single(struct thread *td, s return (reap_getpids(td, p, data)); case PROC_REAP_KILL: return (reap_kill(td, p, data)); + case PROC_TRACE_CTL: + return (trace_ctl(td, p, *(int *)data)); + case PROC_TRACE_STATUS: + return (trace_status(td, p, data)); default: return (EINVAL); } @@ -375,6 +443,7 @@ kern_procctl(struct thread *td, idtype_t struct pgrp *pg; struct proc *p; int error, first_error, ok; + bool tree_locked; switch (com) { case PROC_REAP_ACQUIRE: @@ -382,6 +451,7 @@ kern_procctl(struct thread *td, idtype_t case PROC_REAP_STATUS: case PROC_REAP_GETPIDS: case PROC_REAP_KILL: + case PROC_TRACE_STATUS: if (idtype != P_PID) return (EINVAL); } @@ -391,11 +461,17 @@ kern_procctl(struct thread *td, idtype_t case PROC_REAP_STATUS: case PROC_REAP_GETPIDS: case PROC_REAP_KILL: + case PROC_TRACE_CTL: sx_slock(&proctree_lock); + tree_locked = true; break; case PROC_REAP_ACQUIRE: case PROC_REAP_RELEASE: sx_xlock(&proctree_lock); + tree_locked = true; + break; + case PROC_TRACE_STATUS: + tree_locked = false; break; default: return (EINVAL); @@ -456,6 +532,7 @@ kern_procctl(struct thread *td, idtype_t error = EINVAL; break; } - sx_unlock(&proctree_lock); + if (tree_locked) + sx_unlock(&proctree_lock); return (error); } Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/kern/kern_prot.c Sun Jan 18 15:13:11 2015 (r277322) @@ -1714,6 +1714,13 @@ p_candebug(struct thread *td, struct pro if ((p->p_flag & P_INEXEC) != 0) return (EBUSY); + /* Denied explicitely */ + if ((p->p_flag2 & P2_NOTRACE) != 0) { + error = priv_check(td, PRIV_DEBUG_DENIED); + if (error != 0) + return (error); + } + return (0); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/kern/kern_sig.c Sun Jan 18 15:13:11 2015 (r277322) @@ -3247,7 +3247,8 @@ coredump(struct thread *td) MPASS((p->p_flag & P_HADTHREADS) == 0 || p->p_singlethread == td); _STOPEVENT(p, S_CORE, 0); - if (!do_coredump || (!sugid_coredump && (p->p_flag & P_SUGID) != 0)) { + if (!do_coredump || (!sugid_coredump && (p->p_flag & P_SUGID) != 0) || + (p->p_flag2 & P2_NOTRACE) != 0) { PROC_UNLOCK(p); return (EFAULT); } Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/sys/priv.h Sun Jan 18 15:13:11 2015 (r277322) @@ -111,6 +111,7 @@ #define PRIV_DEBUG_DIFFCRED 80 /* Exempt debugging other users. */ #define PRIV_DEBUG_SUGID 81 /* Exempt debugging setuid proc. */ #define PRIV_DEBUG_UNPRIV 82 /* Exempt unprivileged debug limit. */ +#define PRIV_DEBUG_DENIED 83 /* Exempt P2_NOTRACE. */ /* * Dtrace privileges. Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/sys/proc.h Sun Jan 18 15:13:11 2015 (r277322) @@ -675,6 +675,8 @@ struct proc { /* These flags are kept in p_flag2. */ #define P2_INHERIT_PROTECTED 0x00000001 /* New children get P_PROTECTED. */ +#define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ +#define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ Modified: head/sys/sys/procctl.h ============================================================================== --- head/sys/sys/procctl.h Sun Jan 18 15:03:26 2015 (r277321) +++ head/sys/sys/procctl.h Sun Jan 18 15:13:11 2015 (r277322) @@ -41,6 +41,8 @@ #define PROC_REAP_STATUS 4 /* reaping status */ #define PROC_REAP_GETPIDS 5 /* get descendants */ #define PROC_REAP_KILL 6 /* kill descendants */ +#define PROC_TRACE_CTL 7 /* en/dis ptrace and coredumps */ +#define PROC_TRACE_STATUS 8 /* query tracing status */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -96,6 +98,10 @@ struct procctl_reaper_kill { #define REAPER_KILL_CHILDREN 0x00000001 #define REAPER_KILL_SUBTREE 0x00000002 +#define PROC_TRACE_CTL_ENABLE 1 +#define PROC_TRACE_CTL_DISABLE 2 +#define PROC_TRACE_CTL_DISABLE_EXEC 3 + #ifndef _KERNEL __BEGIN_DECLS int procctl(idtype_t, id_t, int, void *); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 17:25:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 602C11000; Sun, 18 Jan 2015 17:25:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC467A0; Sun, 18 Jan 2015 17:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IHPgBS046847; Sun, 18 Jan 2015 17:25:42 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IHPg98046846; Sun, 18 Jan 2015 17:25:42 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201501181725.t0IHPg98046846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 18 Jan 2015 17:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277328 - head/contrib/ee X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 17:25:42 -0000 Author: allanjude (doc committer) Date: Sun Jan 18 17:25:41 2015 New Revision: 277328 URL: https://svnweb.freebsd.org/changeset/base/277328 Log: Fix minor syntax and grammar errors in the markup of the ee(1) man page Differential Revision: https://reviews.freebsd.org/D1552 Submitted by: bcallah@openbsd.org (original) Approved by: wblock (mentor) MFC after: 1 week Sponsored by: ScaleEngine Inc. Modified: head/contrib/ee/ee.1 Modified: head/contrib/ee/ee.1 ============================================================================== --- head/contrib/ee/ee.1 Sun Jan 18 17:01:14 2015 (r277327) +++ head/contrib/ee/ee.1 Sun Jan 18 17:25:41 2015 (r277328) @@ -329,8 +329,8 @@ A window showing the keyboard operations displayed or not. .IP "\fBemacs keys\fR" Control keys may be given bindings similar to emacs, or not. -.IP "\f16 bit characters\fR" -Toggles whether sixteen bit characters are handled as one 16-bit quantities or +.IP "\fB16 bit characters\fR" +Toggles whether sixteen bit characters are handled as one 16-bit quantity or two 8-bit quantities. This works primarily with the Chinese Big 5 code set. .RE .PP @@ -461,7 +461,7 @@ Turns off display of eight bit character value inside angle brackets, e.g., "<220>"). .IP \fB16bit\fR Turns on handling of 16-bit characters. -.IP \fbno16bit\fR +.IP \fBno16bit\fR Turns off handling of 16-bit characters. .IP \fBemacs\fR Turns on emacs key bindings. From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 17:43:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BA0A363; Sun, 18 Jan 2015 17:43:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 371F5932; Sun, 18 Jan 2015 17:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IHh1Bu055924; Sun, 18 Jan 2015 17:43:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IHh1XQ055922; Sun, 18 Jan 2015 17:43:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201501181743.t0IHh1XQ055922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 18 Jan 2015 17:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277329 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 17:43:01 -0000 Author: adrian Date: Sun Jan 18 17:43:00 2015 New Revision: 277329 URL: https://svnweb.freebsd.org/changeset/base/277329 Log: Oops - use the correct argument order for ar9300_set_beacon(). (It's only an issue in AP/adhoc modes. But, still. Grr.) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Jan 18 17:25:41 2015 (r277328) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Jan 18 17:43:00 2015 (r277329) @@ -606,8 +606,8 @@ ar9300_freebsd_beacon_init(struct ath_ha uint32_t beacon_period) { - ar9300_beacon_init(ah, AH_PRIVATE(ah)->ah_opmode, - next_beacon, beacon_period); + ar9300_beacon_init(ah, next_beacon, beacon_period, + AH_PRIVATE(ah)->ah_opmode); } HAL_BOOL From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 18:06:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAD4EB1B; Sun, 18 Jan 2015 18:06:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A478CAFF; Sun, 18 Jan 2015 18:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0II6ixL066273; Sun, 18 Jan 2015 18:06:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0II6f8h066258; Sun, 18 Jan 2015 18:06:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201501181806.t0II6f8h066258@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 18 Jan 2015 18:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277331 - in head/sys: conf dev/e1000 dev/ixgbe dev/ixl net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 18:06:44 -0000 Author: adrian Date: Sun Jan 18 18:06:40 2015 New Revision: 277331 URL: https://svnweb.freebsd.org/changeset/base/277331 Log: Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific bits. The motivation here is to eventually teach netisr and potentially other networking subsystems a bit more about how RSS work queues / buckets are configured so things have a hope of auto-configuring in the future. * net/rss_config.[ch] takes care of the generic bits for doing configuration, hash function selection, etc; * topelitz.[ch] is now in net/ rather than netinet/; * (and would be in libkern if it didn't directly include RSS_KEYSIZE; that's a later thing to fix up.) * netinet/in_rss.[ch] now just contains the IPv4 specific methods; * and netinet/in6_rss.[ch] now just contains the IPv6 specific methods. This should have no functional impact on anyone currently using the RSS support. Differential Revision: D1383 Reviewed by: gnn, jfv (intel driver bits) Added: head/sys/net/rss_config.c - copied, changed from r276951, head/sys/netinet/in_rss.c head/sys/net/rss_config.h - copied, changed from r276951, head/sys/netinet/in_rss.h head/sys/net/toeplitz.c - copied, changed from r277328, head/sys/netinet/toeplitz.c head/sys/net/toeplitz.h - copied unchanged from r276951, head/sys/netinet/toeplitz.h head/sys/netinet6/in6_rss.c - copied, changed from r276951, head/sys/netinet/in_rss.c head/sys/netinet6/in6_rss.h - copied, changed from r276951, head/sys/netinet/in_rss.h Deleted: head/sys/netinet/toeplitz.c head/sys/netinet/toeplitz.h Modified: head/sys/conf/files head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixl/ixl_txrx.c head/sys/net/if_ethersubr.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcbgroup.c head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_timer.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcbgroup.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/conf/files Sun Jan 18 18:06:40 2015 (r277331) @@ -3270,9 +3270,11 @@ net/radix_mpath.c standard net/raw_cb.c standard net/raw_usrreq.c standard net/route.c standard +net/rss_config.c optional inet rss | inet6 rss net/rtsock.c standard net/slcompress.c optional netgraph_vjc | sppp | \ netgraph_sppp +net/toeplitz.c optional inet rss | inet6 rss net/vnet.c optional vimage net/zlib.c optional crypto | geom_uzip | ipsec | \ mxge | netgraph_deflate | \ @@ -3422,7 +3424,7 @@ netinet/in_pcb.c optional inet | inet6 netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup netinet/in_proto.c optional inet | inet6 netinet/in_rmx.c optional inet -netinet/in_rss.c optional inet rss | inet6 rss +netinet/in_rss.c optional inet rss netinet/ip_divert.c optional inet ipdivert ipfirewall netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 @@ -3465,7 +3467,6 @@ netinet/tcp_syncache.c optional inet | netinet/tcp_timer.c optional inet | inet6 netinet/tcp_timewait.c optional inet | inet6 netinet/tcp_usrreq.c optional inet | inet6 -netinet/toeplitz.c optional inet rss | inet6 rss netinet/udp_usrreq.c optional inet | inet6 netinet/libalias/alias.c optional libalias inet | netgraph_nat inet netinet/libalias/alias_db.c optional libalias inet | netgraph_nat inet @@ -3485,6 +3486,7 @@ netinet6/in6_pcb.c optional inet6 netinet6/in6_pcbgroup.c optional inet6 pcbgroup netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 +netinet6/in6_rss.c optional inet6 rss netinet6/in6_src.c optional inet6 netinet6/ip6_forward.c optional inet6 netinet6/ip6_gre.c optional gre inet6 Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/dev/e1000/if_igb.c Sun Jan 18 18:06:40 2015 (r277331) @@ -73,6 +73,9 @@ #include #include #include +#ifdef RSS +#include +#endif #include #include @@ -85,9 +88,6 @@ #include #include #include -#ifdef RSS -#include -#endif #include #include Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jan 18 18:06:40 2015 (r277331) @@ -39,7 +39,7 @@ #include "ixgbe.h" #ifdef RSS -#include +#include #endif /********************************************************************* Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/dev/ixl/ixl_txrx.c Sun Jan 18 18:06:40 2015 (r277331) @@ -1378,7 +1378,7 @@ static inline int ixl_ptype_to_hash(u8 ptype) { struct i40e_rx_ptype_decoded decoded; - u8 ex = 0 + u8 ex = 0; decoded = decode_rx_desc_ptype(ptype); ex = decoded.outer_frag; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/net/if_ethersubr.c Sun Jan 18 18:06:40 2015 (r277331) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -71,7 +72,6 @@ #include #include #include -#include #include #include #endif Copied and modified: head/sys/net/rss_config.c (from r276951, head/sys/netinet/in_rss.c) ============================================================================== --- head/sys/netinet/in_rss.c Sat Jan 10 23:43:39 2015 (r276951, copy source) +++ head/sys/net/rss_config.c Sun Jan 18 18:06:40 2015 (r277331) @@ -50,17 +50,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#if 0 #include #include #include #include -#include /* for software rss hash support */ #include #include #include +#endif /*- * Operating system parts of receiver-side scaling (RSS), which allows @@ -89,6 +92,7 @@ __FBSDID("$FreeBSD$"); * placement and pcbgroup expectations. */ +SYSCTL_DECL(_net_inet); SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side steering"); /* @@ -175,8 +179,6 @@ struct rss_table_entry { }; static struct rss_table_entry rss_table[RSS_TABLE_MAXLEN]; -static inline u_int rss_gethashconfig_local(void); - static void rss_init(__unused void *arg) { @@ -282,7 +284,7 @@ rss_naive_hash(u_int keylen, const uint8 return (v); } -static uint32_t +uint32_t rss_hash(u_int datalen, const uint8_t *data) { @@ -302,88 +304,6 @@ rss_hash(u_int datalen, const uint8_t *d } /* - * Hash an IPv4 2-tuple. - */ -uint32_t -rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst) -{ - uint8_t data[sizeof(src) + sizeof(dst)]; - u_int datalen; - - datalen = 0; - bcopy(&src, &data[datalen], sizeof(src)); - datalen += sizeof(src); - bcopy(&dst, &data[datalen], sizeof(dst)); - datalen += sizeof(dst); - return (rss_hash(datalen, data)); -} - -/* - * Hash an IPv4 4-tuple. - */ -uint32_t -rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, struct in_addr dst, - u_short dstport) -{ - uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) + - sizeof(dstport)]; - u_int datalen; - - datalen = 0; - bcopy(&src, &data[datalen], sizeof(src)); - datalen += sizeof(src); - bcopy(&dst, &data[datalen], sizeof(dst)); - datalen += sizeof(dst); - bcopy(&srcport, &data[datalen], sizeof(srcport)); - datalen += sizeof(srcport); - bcopy(&dstport, &data[datalen], sizeof(dstport)); - datalen += sizeof(dstport); - return (rss_hash(datalen, data)); -} - -#ifdef INET6 -/* - * Hash an IPv6 2-tuple. - */ -uint32_t -rss_hash_ip6_2tuple(const struct in6_addr *src, const struct in6_addr *dst) -{ - uint8_t data[sizeof(*src) + sizeof(*dst)]; - u_int datalen; - - datalen = 0; - bcopy(src, &data[datalen], sizeof(*src)); - datalen += sizeof(*src); - bcopy(dst, &data[datalen], sizeof(*dst)); - datalen += sizeof(*dst); - return (rss_hash(datalen, data)); -} - -/* - * Hash an IPv6 4-tuple. - */ -uint32_t -rss_hash_ip6_4tuple(const struct in6_addr *src, u_short srcport, - const struct in6_addr *dst, u_short dstport) -{ - uint8_t data[sizeof(*src) + sizeof(*dst) + sizeof(srcport) + - sizeof(dstport)]; - u_int datalen; - - datalen = 0; - bcopy(src, &data[datalen], sizeof(*src)); - datalen += sizeof(*src); - bcopy(dst, &data[datalen], sizeof(*dst)); - datalen += sizeof(*dst); - bcopy(&srcport, &data[datalen], sizeof(srcport)); - datalen += sizeof(srcport); - bcopy(&dstport, &data[datalen], sizeof(dstport)); - datalen += sizeof(dstport); - return (rss_hash(datalen, data)); -} -#endif /* INET6 */ - -/* * Query the number of RSS bits in use. */ u_int @@ -498,260 +418,6 @@ rss_m2bucket(struct mbuf *m, uint32_t *b } /* - * Calculate an appropriate ipv4 2-tuple or 4-tuple given the given - * IPv4 source/destination address, UDP or TCP source/destination ports - * and the protocol type. - * - * The protocol code may wish to do a software hash of the given - * tuple. This depends upon the currently configured RSS hash types. - * - * This assumes that the packet in question isn't a fragment. - * - * It also assumes the packet source/destination address - * are in "incoming" packet order (ie, source is "far" address.) - */ -int -rss_proto_software_hash_v4(struct in_addr s, struct in_addr d, - u_short sp, u_short dp, int proto, - uint32_t *hashval, uint32_t *hashtype) -{ - uint32_t hash; - - /* - * Next, choose the hash type depending upon the protocol - * identifier. - */ - if ((proto == IPPROTO_TCP) && - (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4)) { - hash = rss_hash_ip4_4tuple(s, sp, d, dp); - *hashval = hash; - *hashtype = M_HASHTYPE_RSS_TCP_IPV4; - return (0); - } else if ((proto == IPPROTO_UDP) && - (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4)) { - hash = rss_hash_ip4_4tuple(s, sp, d, dp); - *hashval = hash; - *hashtype = M_HASHTYPE_RSS_UDP_IPV4; - return (0); - } else if (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) { - /* RSS doesn't hash on other protocols like SCTP; so 2-tuple */ - hash = rss_hash_ip4_2tuple(s, d); - *hashval = hash; - *hashtype = M_HASHTYPE_RSS_IPV4; - return (0); - } - - /* No configured available hashtypes! */ - printf("%s: no available hashtypes!\n", __func__); - return (-1); -} - -/* - * Do a software calculation of the RSS for the given mbuf. - * - * This is typically used by the input path to recalculate the RSS after - * some form of packet processing (eg de-capsulation, IP fragment reassembly.) - * - * dir is the packet direction - RSS_HASH_PKT_INGRESS for incoming and - * RSS_HASH_PKT_EGRESS for outgoing. - * - * Returns 0 if a hash was done, -1 if no hash was done, +1 if - * the mbuf already had a valid RSS flowid. - * - * This function doesn't modify the mbuf. It's up to the caller to - * assign flowid/flowtype as appropriate. - */ -int -rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval, - uint32_t *hashtype) -{ - const struct ip *ip; - const struct tcphdr *th; - const struct udphdr *uh; - uint32_t flowid; - uint32_t flowtype; - uint8_t proto; - int iphlen; - int is_frag = 0; - - /* - * XXX For now this only handles hashing on incoming mbufs. - */ - if (dir != RSS_HASH_PKT_INGRESS) { - printf("%s: called on EGRESS packet!\n", __func__); - return (-1); - } - - /* - * First, validate that the mbuf we have is long enough - * to have an IPv4 header in it. - */ - if (m->m_pkthdr.len < (sizeof(struct ip))) { - printf("%s: short mbuf pkthdr\n", __func__); - return (-1); - } - if (m->m_len < (sizeof(struct ip))) { - printf("%s: short mbuf len\n", __func__); - return (-1); - } - - /* Ok, let's dereference that */ - ip = mtod(m, struct ip *); - proto = ip->ip_p; - iphlen = ip->ip_hl << 2; - - /* - * If this is a fragment then it shouldn't be four-tuple - * hashed just yet. Once it's reassembled into a full - * frame it should be re-hashed. - */ - if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) - is_frag = 1; - - /* - * If the mbuf flowid/flowtype matches the packet type, - * and we don't support the 4-tuple version of the given protocol, - * then signal to the owner that it can trust the flowid/flowtype - * details. - * - * This is a little picky - eg, if TCPv4 / UDPv4 hashing - * is supported but we got a TCP/UDP frame only 2-tuple hashed, - * then we shouldn't just "trust" the 2-tuple hash. We need - * a 4-tuple hash. - */ - flowid = m->m_pkthdr.flowid; - flowtype = M_HASHTYPE_GET(m); - - if (flowtype != M_HASHTYPE_NONE) { - switch (proto) { - case IPPROTO_UDP: - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) && - (flowtype == M_HASHTYPE_RSS_UDP_IPV4) && - (is_frag == 0)) { - return (1); - } - /* - * Only allow 2-tuple for UDP frames if we don't also - * support 4-tuple for UDP. - */ - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) && - ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) == 0) && - flowtype == M_HASHTYPE_RSS_IPV4) { - return (1); - } - break; - case IPPROTO_TCP: - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4) && - (flowtype == M_HASHTYPE_RSS_TCP_IPV4) && - (is_frag == 0)) { - return (1); - } - /* - * Only allow 2-tuple for TCP frames if we don't also - * support 2-tuple for TCP. - */ - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) && - ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4) == 0) && - flowtype == M_HASHTYPE_RSS_IPV4) { - return (1); - } - break; - default: - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) && - flowtype == M_HASHTYPE_RSS_IPV4) { - return (1); - } - break; - } - } - - /* - * Decode enough information to make a hash decision. - * - * XXX TODO: does the hardware hash on 4-tuple if IP - * options are present? - */ - if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4) && - (proto == IPPROTO_TCP) && - (is_frag == 0)) { - if (m->m_len < iphlen + sizeof(struct tcphdr)) { - printf("%s: short TCP frame?\n", __func__); - return (-1); - } - th = (struct tcphdr *)((caddr_t)ip + iphlen); - return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, - th->th_sport, - th->th_dport, - proto, - hashval, - hashtype); - } else if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) && - (proto == IPPROTO_UDP) && - (is_frag == 0)) { - uh = (struct udphdr *)((caddr_t)ip + iphlen); - if (m->m_len < iphlen + sizeof(struct udphdr)) { - printf("%s: short UDP frame?\n", __func__); - return (-1); - } - return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, - uh->uh_sport, - uh->uh_dport, - proto, - hashval, - hashtype); - } else if (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) { - /* Default to 2-tuple hash */ - return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, - 0, /* source port */ - 0, /* destination port */ - 0, /* IPPROTO_IP */ - hashval, - hashtype); - } else { - printf("%s: no available hashtypes!\n", __func__); - return (-1); - } -} - -/* - * Similar to rss_m2cpuid, but designed to be used by the IP NETISR - * on incoming frames. - * - * If an existing RSS hash exists and it matches what the configured - * hashing is, then use it. - * - * If there's an existing RSS hash but the desired hash is different, - * or if there's no useful RSS hash, then calculate it via - * the software path. - * - * XXX TODO: definitely want statistics here! - */ -struct mbuf * -rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) -{ - uint32_t hash_val, hash_type; - int ret; - - M_ASSERTPKTHDR(m); - - ret = rss_mbuf_software_hash_v4(m, RSS_HASH_PKT_INGRESS, - &hash_val, &hash_type); - if (ret > 0) { - /* mbuf has a valid hash already; don't need to modify it */ - *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); - } else if (ret == 0) { - /* hash was done; update */ - m->m_pkthdr.flowid = hash_val; - M_HASHTYPE_SET(m, hash_type); - *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); - } else { /* ret < 0 */ - /* no hash was done */ - *cpuid = NETISR_CPUID_NONE; - } - return (m); -} - -/* * Query the RSS hash algorithm. */ u_int @@ -799,8 +465,14 @@ rss_getnumcpus(void) return (rss_ncpus); } -static inline u_int -rss_gethashconfig_local(void) +/* + * Return the supported RSS hash configuration. + * + * NICs should query this to determine what to configure in their redirection + * matching table. + */ +inline u_int +rss_gethashconfig(void) { /* Return 4-tuple for TCP; 2-tuple for others */ @@ -829,19 +501,6 @@ rss_gethashconfig_local(void) } /* - * Return the supported RSS hash configuration. - * - * NICs should query this to determine what to configure in their redirection - * matching table. - */ -u_int -rss_gethashconfig(void) -{ - - return (rss_gethashconfig_local()); -} - -/* * XXXRW: Confirm that sysctl -a won't dump this keying material, don't want * it appearing in debugging output unnecessarily. */ Copied and modified: head/sys/net/rss_config.h (from r276951, head/sys/netinet/in_rss.h) ============================================================================== --- head/sys/netinet/in_rss.h Sat Jan 10 23:43:39 2015 (r276951, copy source) +++ head/sys/net/rss_config.h Sun Jan 18 18:06:40 2015 (r277331) @@ -29,8 +29,8 @@ * $FreeBSD$ */ -#ifndef _NETINET_IN_RSS_H_ -#define _NETINET_IN_RSS_H_ +#ifndef _NET_RSS_CONFIG_H_ +#define _NET_RSS_CONFIG_H_ #include /* in_addr_t */ @@ -107,36 +107,17 @@ u_int rss_getnumcpus(void); u_int rss_gethashconfig(void); /* - * Network stack interface to generate a hash for a protocol tuple. + * Hash calculation functions. */ -uint32_t rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, - struct in_addr dst, u_short dstport); -uint32_t rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst); -uint32_t rss_hash_ip6_4tuple(const struct in6_addr *src, u_short srcport, - const struct in6_addr *dst, u_short dstport); -uint32_t rss_hash_ip6_2tuple(const struct in6_addr *src, - const struct in6_addr *dst); +uint32_t rss_hash(u_int datalen, const uint8_t *data); /* * Network stack interface to query desired CPU affinity of a packet. */ -struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); -u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); -int rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, - uint32_t *bucket_id); -int rss_m2bucket(struct mbuf *m, uint32_t *bucket_id); - -/* - * Functions to calculate a software RSS hash for a given mbuf or - * packet detail. - */ -int rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, - uint32_t *hashval, uint32_t *hashtype); -int rss_proto_software_hash_v4(struct in_addr src, - struct in_addr dst, u_short src_port, u_short dst_port, - int proto, uint32_t *hashval, - uint32_t *hashtype); -struct mbuf * rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, - u_int *cpuid); +struct mbuf * rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); +u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); +int rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, + uint32_t *bucket_id); +int rss_m2bucket(struct mbuf *m, uint32_t *bucket_id); -#endif /* !_NETINET_IN_RSS_H_ */ +#endif /* !_NET_RSS_CONFIG_H_ */ Copied and modified: head/sys/net/toeplitz.c (from r277328, head/sys/netinet/toeplitz.c) ============================================================================== --- head/sys/netinet/toeplitz.c Sun Jan 18 17:25:41 2015 (r277328, copy source) +++ head/sys/net/toeplitz.c Sun Jan 18 18:06:40 2015 (r277331) @@ -29,8 +29,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include #include Copied: head/sys/net/toeplitz.h (from r276951, head/sys/netinet/toeplitz.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/toeplitz.h Sun Jan 18 18:06:40 2015 (r277331, copy of r276951, head/sys/netinet/toeplitz.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 David Malone + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_TOEPLITZ_H_ +#define _NETINET_TOEPLITZ_H_ + +/* + * Toeplitz (RSS) hash algorithm; possibly we should cache intermediate + * results between runs, in which case we'll need explicit init/destroy and + * state management. + */ +uint32_t toeplitz_hash(u_int keylen, const uint8_t *key, + u_int datalen, const uint8_t *data); + +#endif /* !_NETINET_TOEPLITZ_H_ */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/netinet/in_pcb.c Sun Jan 18 18:06:40 2015 (r277331) @@ -71,12 +71,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(INET) || defined(INET6) #include #include -#include #include #include #include Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/netinet/in_pcbgroup.c Sun Jan 18 18:06:40 2015 (r277331) @@ -42,7 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include + #include #include #ifdef INET6 Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jan 18 18:02:12 2015 (r277330) +++ head/sys/netinet/in_rss.c Sun Jan 18 18:06:40 2015 (r277331) @@ -50,257 +50,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include /* for software rss hash support */ #include #include #include -/*- - * Operating system parts of receiver-side scaling (RSS), which allows - * network cards to direct flows to particular receive queues based on hashes - * of header tuples. This implementation aligns RSS buckets with connection - * groups at the TCP/IP layer, so each bucket is associated with exactly one - * group. As a result, the group lookup structures (and lock) should have an - * effective affinity with exactly one CPU. - * - * Network device drivers needing to configure RSS will query this framework - * for parameters, such as the current RSS key, hashing policies, number of - * bits, and indirection table mapping hashes to buckets and CPUs. They may - * provide their own supplementary information, such as queue<->CPU bindings. - * It is the responsibility of the network device driver to inject packets - * into the stack on as close to the right CPU as possible, if playing by RSS - * rules. - * - * TODO: - * - * - Synchronization for rss_key and other future-configurable parameters. - * - Event handler drivers can register to pick up RSS configuration changes. - * - Should we allow rss_basecpu to be configured? - * - Randomize key on boot. - * - IPv6 support. - * - Statistics on how often there's a misalignment between hardware - * placement and pcbgroup expectations. - */ - -SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side steering"); - -/* - * Toeplitz is the only required hash function in the RSS spec, so use it by - * default. - */ -static u_int rss_hashalgo = RSS_HASH_TOEPLITZ; -SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RDTUN, &rss_hashalgo, 0, - "RSS hash algorithm"); - -/* - * Size of the indirection table; at most 128 entries per the RSS spec. We - * size it to at least 2 times the number of CPUs by default to allow useful - * rebalancing. If not set explicitly with a loader tunable, we tune based - * on the number of CPUs present. - * - * XXXRW: buckets might be better to use for the tunable than bits. - */ -static u_int rss_bits; -SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RDTUN, &rss_bits, 0, - "RSS bits"); - -static u_int rss_mask; -SYSCTL_INT(_net_inet_rss, OID_AUTO, mask, CTLFLAG_RD, &rss_mask, 0, - "RSS mask"); - -static const u_int rss_maxbits = RSS_MAXBITS; -SYSCTL_INT(_net_inet_rss, OID_AUTO, maxbits, CTLFLAG_RD, - __DECONST(int *, &rss_maxbits), 0, "RSS maximum bits"); - -/* - * RSS's own count of the number of CPUs it could be using for processing. - * Bounded to 64 by RSS constants. - */ -static u_int rss_ncpus; -SYSCTL_INT(_net_inet_rss, OID_AUTO, ncpus, CTLFLAG_RD, &rss_ncpus, 0, - "Number of CPUs available to RSS"); - -#define RSS_MAXCPUS (1 << (RSS_MAXBITS - 1)) -static const u_int rss_maxcpus = RSS_MAXCPUS; -SYSCTL_INT(_net_inet_rss, OID_AUTO, maxcpus, CTLFLAG_RD, - __DECONST(int *, &rss_maxcpus), 0, "RSS maximum CPUs that can be used"); - -/* - * Variable exists just for reporting rss_bits in a user-friendly way. - */ -static u_int rss_buckets; -SYSCTL_INT(_net_inet_rss, OID_AUTO, buckets, CTLFLAG_RD, &rss_buckets, 0, - "RSS buckets"); - -/* - * Base CPU number; devices will add this to all CPU numbers returned by the - * RSS indirection table. Currently unmodifable in FreeBSD. - */ -static const u_int rss_basecpu; -SYSCTL_INT(_net_inet_rss, OID_AUTO, basecpu, CTLFLAG_RD, - __DECONST(int *, &rss_basecpu), 0, "RSS base CPU"); - -/* - * RSS secret key, intended to prevent attacks on load-balancing. Its - * effectiveness may be limited by algorithm choice and available entropy - * during the boot. - * - * XXXRW: And that we don't randomize it yet! - * - * This is the default Microsoft RSS specification key which is also - * the Chelsio T5 firmware default key. - */ -static uint8_t rss_key[RSS_KEYSIZE] = { - 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, - 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, - 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, - 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, - 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa, -}; - -/* - * RSS hash->CPU table, which maps hashed packet headers to particular CPUs. - * Drivers may supplement this table with a seperate CPU<->queue table when - * programming devices. - */ -struct rss_table_entry { - uint8_t rte_cpu; /* CPU affinity of bucket. */ -}; -static struct rss_table_entry rss_table[RSS_TABLE_MAXLEN]; - -static inline u_int rss_gethashconfig_local(void); - -static void -rss_init(__unused void *arg) -{ - u_int i; - u_int cpuid; - - /* - * Validate tunables, coerce to sensible values. - */ - switch (rss_hashalgo) { - case RSS_HASH_TOEPLITZ: - case RSS_HASH_NAIVE: - break; - - default: - printf("%s: invalid RSS hashalgo %u, coercing to %u", - __func__, rss_hashalgo, RSS_HASH_TOEPLITZ); - rss_hashalgo = RSS_HASH_TOEPLITZ; - } - - /* - * Count available CPUs. - * - * XXXRW: Note incorrect assumptions regarding contiguity of this set - * elsewhere. - */ - rss_ncpus = 0; - for (i = 0; i <= mp_maxid; i++) { - if (CPU_ABSENT(i)) - continue; - rss_ncpus++; - } - if (rss_ncpus > RSS_MAXCPUS) - rss_ncpus = RSS_MAXCPUS; - - /* - * Tune RSS table entries to be no less than 2x the number of CPUs - * -- unless we're running uniprocessor, in which case there's not - * much point in having buckets to rearrange for load-balancing! - */ - if (rss_ncpus > 1) { - if (rss_bits == 0) - rss_bits = fls(rss_ncpus - 1) + 1; - - /* - * Microsoft limits RSS table entries to 128, so apply that - * limit to both auto-detected CPU counts and user-configured - * ones. - */ - if (rss_bits == 0 || rss_bits > RSS_MAXBITS) { - printf("%s: RSS bits %u not valid, coercing to %u", - __func__, rss_bits, RSS_MAXBITS); - rss_bits = RSS_MAXBITS; - } - - /* - * Figure out how many buckets to use; warn if less than the - * number of configured CPUs, although this is not a fatal - * problem. - */ - rss_buckets = (1 << rss_bits); - if (rss_buckets < rss_ncpus) - printf("%s: WARNING: rss_buckets (%u) less than " - "rss_ncpus (%u)\n", __func__, rss_buckets, - rss_ncpus); - rss_mask = rss_buckets - 1; - } else { - rss_bits = 0; - rss_buckets = 1; - rss_mask = 0; - } - - /* - * Set up initial CPU assignments: round-robin by default. - */ - cpuid = CPU_FIRST(); - for (i = 0; i < rss_buckets; i++) { - rss_table[i].rte_cpu = cpuid; - cpuid = CPU_NEXT(cpuid); - } - - /* - * Randomize rrs_key. - * - * XXXRW: Not yet. If nothing else, will require an rss_isbadkey() - * loop to check for "bad" RSS keys. - */ -} -SYSINIT(rss_init, SI_SUB_SOFTINTR, SI_ORDER_SECOND, rss_init, NULL); - -static uint32_t -rss_naive_hash(u_int keylen, const uint8_t *key, u_int datalen, - const uint8_t *data) -{ - uint32_t v; - u_int i; - - v = 0; - for (i = 0; i < keylen; i++) - v += key[i]; - for (i = 0; i < datalen; i++) - v += data[i]; - return (v); -} - -static uint32_t -rss_hash(u_int datalen, const uint8_t *data) -{ - - switch (rss_hashalgo) { - case RSS_HASH_TOEPLITZ: - return (toeplitz_hash(sizeof(rss_key), rss_key, datalen, - data)); - - case RSS_HASH_NAIVE: - return (rss_naive_hash(sizeof(rss_key), rss_key, datalen, - data)); - - default: - panic("%s: unsupported/unknown hashalgo %d", __func__, - rss_hashalgo); - } -} - /* * Hash an IPv4 2-tuple. */ @@ -341,162 +102,6 @@ rss_hash_ip4_4tuple(struct in_addr src, return (rss_hash(datalen, data)); } -#ifdef INET6 -/* - * Hash an IPv6 2-tuple. - */ -uint32_t -rss_hash_ip6_2tuple(const struct in6_addr *src, const struct in6_addr *dst) -{ - uint8_t data[sizeof(*src) + sizeof(*dst)]; - u_int datalen; - - datalen = 0; - bcopy(src, &data[datalen], sizeof(*src)); - datalen += sizeof(*src); - bcopy(dst, &data[datalen], sizeof(*dst)); - datalen += sizeof(*dst); - return (rss_hash(datalen, data)); -} - -/* - * Hash an IPv6 4-tuple. - */ -uint32_t -rss_hash_ip6_4tuple(const struct in6_addr *src, u_short srcport, - const struct in6_addr *dst, u_short dstport) -{ - uint8_t data[sizeof(*src) + sizeof(*dst) + sizeof(srcport) + - sizeof(dstport)]; - u_int datalen; - - datalen = 0; - bcopy(src, &data[datalen], sizeof(*src)); - datalen += sizeof(*src); - bcopy(dst, &data[datalen], sizeof(*dst)); - datalen += sizeof(*dst); - bcopy(&srcport, &data[datalen], sizeof(srcport)); - datalen += sizeof(srcport); - bcopy(&dstport, &data[datalen], sizeof(dstport)); - datalen += sizeof(dstport); - return (rss_hash(datalen, data)); -} -#endif /* INET6 */ - -/* - * Query the number of RSS bits in use. - */ -u_int -rss_getbits(void) -{ - - return (rss_bits); -} - -/* - * Query the RSS bucket associated with an RSS hash. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 18:25:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A433EA8; Sun, 18 Jan 2015 18:25:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56550CB3; Sun, 18 Jan 2015 18:25:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IIPDxY075820; Sun, 18 Jan 2015 18:25:13 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IIPDti075819; Sun, 18 Jan 2015 18:25:13 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201501181825.t0IIPDti075819@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 18 Jan 2015 18:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277333 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 18:25:13 -0000 Author: smh Date: Sun Jan 18 18:25:12 2015 New Revision: 277333 URL: https://svnweb.freebsd.org/changeset/base/277333 Log: Fix bsdinstall when working with geli boot disks PR: 196790 Differential Revision: https://reviews.freebsd.org/D566 Submitted by: Michael Gmelin MFC after: 2 weeks Sponsored by: Multiplay Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jan 18 18:11:54 2015 (r277332) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jan 18 18:25:12 2015 (r277333) @@ -1077,6 +1077,9 @@ zfs_create_boot() boot_vdevs="$boot_vdevs $disk$bootpart" fi zroot_vdevs="$zroot_vdevs $disk$targetpart" + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + zroot_vdevs="$zroot_vdevs.eli" + fi n=$(( $n + 1 )) done # disks From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 18:32:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1000119E; Sun, 18 Jan 2015 18:32:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE079D86; Sun, 18 Jan 2015 18:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IIWknR080247; Sun, 18 Jan 2015 18:32:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IIWipJ080231; Sun, 18 Jan 2015 18:32:44 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501181832.t0IIWipJ080231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 18 Jan 2015 18:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277334 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/ofw powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 18:32:47 -0000 Author: nwhitehorn Date: Sun Jan 18 18:32:43 2015 New Revision: 277334 URL: https://svnweb.freebsd.org/changeset/base/277334 Log: Refactor PowerPC (especially AIM) init sequence to be less baroque. MFC after: 2 months Modified: head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpc64 head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/locore.S head/sys/powerpc/include/trap.h head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/vm_machdep.c Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/conf/ldscript.powerpc Sun Jan 18 18:32:43 2015 (r277334) @@ -11,6 +11,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ . = kernbase + SIZEOF_HEADERS; + PROVIDE (begin = . - SIZEOF_HEADERS); .text : { Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/conf/ldscript.powerpc64 Sun Jan 18 18:32:43 2015 (r277334) @@ -11,6 +11,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ . = kernbase + SIZEOF_HEADERS; + PROVIDE (begin = . - SIZEOF_HEADERS); .text : { @@ -68,7 +69,7 @@ SECTIONS .toc1 : ALIGN(8) { *(.toc1) } .opd : ALIGN(8) { KEEP (*(.opd)) } .branch_lt : ALIGN(8) { *(.branch_lt) } - .got : ALIGN(8) { *(.got .toc) } + .got : ALIGN(8) { __tocbase = .; *(.got .toc) } .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/aim/locore32.S Sun Jan 18 18:32:43 2015 (r277334) @@ -76,29 +76,19 @@ .globl kernbase .set kernbase, KERNBASE -#define TMPSTKSZ 8192 /* 8K temporary stack */ - /* * Globals */ .data + .align 3 +GLOBAL(__startkernel) + .long begin +GLOBAL(__endkernel) + .long end .align 4 +#define TMPSTKSZ 8192 /* 8K temporary stack */ GLOBAL(tmpstk) .space TMPSTKSZ -GLOBAL(esym) - .long 0 /* end of symbol table */ - -#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ -GLOBAL(intrnames) - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(sintrnames) - .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 - - .align 4 -GLOBAL(intrcnt) - .space INTRCNT_COUNT * 4 * 2 -GLOBAL(sintrcnt) - .long INTRCNT_COUNT * 4 * 2 .text .globl btext @@ -142,43 +132,9 @@ __start: cmplw 8,9 blt 2b - /* Save the argument pointer and length */ - mr 20,6 - mr 21,7 - - lis 8,openfirmware_entry@ha - stw 5,openfirmware_entry@l(8) /* save client interface handler */ - lis 1,(tmpstk+TMPSTKSZ-16)@ha addi 1,1,(tmpstk+TMPSTKSZ-16)@l - mfmsr 0 - lis 9,ofmsr@ha - stwu 0,ofmsr@l(9) - - mfsprg0 0 /* save SPRG0-3 */ - stw 0,4(9) /* ofmsr[1] = sprg0 */ - mfsprg1 0 - stw 0,8(9) /* ofmsr[2] = sprg1 */ - mfsprg2 0 - stw 0,12(9) /* ofmsr[3] = sprg2 */ - mfsprg3 0 - stw 0,16(9) /* ofmsr[4] = sprg3 */ - - bl OF_initial_setup - - lis 3,kernel_text@ha - addi 3,3,kernel_text@l - - lis 4,end@ha - addi 4,4,end@l - add 4,4,3 - mr 5,4 - - /* Restore the argument pointer and length */ - mr 6,20 - mr 7,21 - bl powerpc_init mr %r1, %r3 li %r3, 0 Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/aim/locore64.S Sun Jan 18 18:32:43 2015 (r277334) @@ -68,36 +68,28 @@ /* Locate the per-CPU data structure */ #define GET_CPUINFO(r) \ mfsprg0 r - -/* - * Compiled KERNBASE location and the kernel load address - */ - .globl kernbase - .set kernbase, KERNBASE - -#define TMPSTKSZ 16384 /* 16K temporary stack */ +#define GET_TOCBASE(r) \ + li r,TRAP_TOCBASE; /* Magic address for TOC */ \ + ld r,0(r) + +/* Glue for linker script */ +.globl kernbase +.set kernbase, KERNBASE /* * Globals */ .data + .align 3 +GLOBAL(__startkernel) + .llong begin +GLOBAL(__endkernel) + .llong end + .align 4 +#define TMPSTKSZ 16384 /* 16K temporary stack */ GLOBAL(tmpstk) .space TMPSTKSZ -GLOBAL(esym) - .llong 0 /* end of symbol table */ - -#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ -GLOBAL(intrnames) - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(sintrnames) - .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 - - .align 4 -GLOBAL(intrcnt) - .space INTRCNT_COUNT * 4 * 2 -GLOBAL(sintrcnt) - .quad INTRCNT_COUNT * 4 * 2 .text .globl btext @@ -113,90 +105,52 @@ kernel_text: /* * Startup entry. Note, this must be the first thing in the text * segment! + * + * Calling convention: + * r3: Flattened Device Tree pointer (or zero) + * r4: ignored + * r5: OF client interface pointer (or zero) + * r6: Loader metadata pointer (or zero) */ .text ASENTRY_NOPROF(__start) - li 8,0 - li 9,0x100 - mtctr 9 -1: - dcbf 0,8 - icbi 0,8 - addi 8,8,0x20 - bdnz 1b - sync - isync - - /* Save the argument pointer and length */ - mr 20,6 - mr 21,7 - - lis 8,openfirmware_entry@ha - std 5,openfirmware_entry@l(8) /* save client interface handler */ - - /* Set up the stack pointer */ - lis 1,(tmpstk+TMPSTKSZ-48)@ha - addi 1,1,(tmpstk+TMPSTKSZ-48)@l - /* Set up the TOC pointer */ - lis 2,tocbase@ha - ld 2,tocbase@l(2) + b 0f + .align 3 +0: nop + bl 1f + .llong __tocbase + 0x8000 +1: mflr %r2 + ld %r2,0(%r2) - mfmsr 0 - lis 9,ofmsr@ha - stdu 0,ofmsr@l(9) - - mfsprg0 0 /* save SPRG0-3 */ - std 0,8(9) /* ofmsr[1] = sprg0 */ - mfsprg1 0 - std 0,16(9) /* ofmsr[2] = sprg1 */ - mfsprg2 0 - std 0,24(9) /* ofmsr[3] = sprg2 */ - mfsprg3 0 - std 0,32(9) /* ofmsr[4] = sprg3 */ + /* Set up the stack pointer */ + lis %r1,(tmpstk+TMPSTKSZ-48)@ha + addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l /* Switch to 64-bit mode */ - mfmsr 9 - li 8,1 - insrdi 9,8,1,0 - mtmsrd 9 + mfmsr %r9 + li %r8,1 + insrdi %r9,%r8,1,0 + mtmsrd %r9 isync - bl OF_initial_setup - nop - - lis 3,kernbase@ha - addi 3,3,kernbase@l - - lis 4,end@ha - addi 4,4,end@l - add 4,4,3 - mr 5,4 - - /* Restore the argument pointer and length */ - mr 6,20 - mr 7,21 - + /* Begin CPU init */ + mr %r4,%r2 /* Replace ignored r4 with tocbase for trap handlers */ bl powerpc_init nop + + /* Set stack pointer to new value and branch to mi_startup */ mr %r1, %r3 li %r3, 0 std %r3, 0(%r1) bl mi_startup nop + + /* If this returns (it won't), go back to firmware */ b OF_exit nop /* - * PPC64 ABI TOC base - */ - - .align 3 - .globl tocbase -tocbase: - .llong .TOC.@tocbase - -/* * int setfault() * * Similar to setjmp to setup for handling faults on accesses to user memory. Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/aim/machdep.c Sun Jan 18 18:32:43 2015 (r277334) @@ -223,7 +223,7 @@ cpu_startup(void *dummy) vm_pager_bufferinit(); } -extern char kernel_text[], _end[]; +extern vm_offset_t __startkernel, __endkernel; #ifndef __powerpc64__ /* Bits for running on 64-bit systems in 32-bit mode. */ @@ -244,13 +244,12 @@ extern void *dblow, *dbsize; extern void *imisstrap, *imisssize; extern void *dlmisstrap, *dlmisssize; extern void *dsmisstrap, *dsmisssize; -char save_trap_init[0x2f00]; /* EXC_LAST */ uintptr_t -powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, - vm_offset_t basekernel, void *mdp) +powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp) { struct pcpu *pc; + vm_offset_t startkernel, endkernel; void *generictrap; size_t trap_offset; void *kmdp; @@ -273,8 +272,12 @@ powerpc_init(vm_offset_t startkernel, vm trap_offset = 0; cacheline_warn = 0; - /* Save trap vectors. */ - ofw_save_trap_vec(save_trap_init); + /* Store boot environment state */ + OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); + + /* First guess at start/end kernel positions */ + startkernel = __startkernel; + endkernel = __endkernel; #ifdef WII /* @@ -490,6 +493,9 @@ powerpc_init(vm_offset_t startkernel, vm #else /* powerpc64 */ cpu_features |= PPC_FEATURE_64; generictrap = &trapcode; + + /* Set TOC base so that the interrupt code can get at it */ + *((register_t *)TRAP_TOCBASE) = toc; #endif bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstsize); Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/aim/trap_subr64.S Sun Jan 18 18:32:43 2015 (r277334) @@ -310,8 +310,7 @@ cpu_reset: lis %r1,(tmpstk+TMPSTKSZ-48)@ha /* get new SP */ addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l - lis %r3,tocbase@ha - ld %r2,tocbase@l(%r3) + GET_TOCBASE(%r2) bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop lis %r3,1@l @@ -445,8 +444,7 @@ kern_slbtrap: addi %r1,%r1,PC_SLBSTACK-48+1024 li %r2,~15 and %r1,%r1,%r2 - lis %r3,tocbase@ha - ld %r2,tocbase@l(%r3) + GET_TOCBASE(%r2) mflr %r3 andi. %r3,%r3,0xff80 mfdar %r4 @@ -683,8 +681,7 @@ k_trap: FRAME_SETUP(PC_TEMPSAVE) /* Call C interrupt dispatcher: */ trapagain: - lis %r3,tocbase@ha - ld %r2,tocbase@l(%r3) + GET_TOCBASE(%r2) addi %r3,%r1,48 bl CNAME(powerpc_interrupt) nop @@ -711,8 +708,7 @@ CNAME(trapexit): ori %r3,%r3,PSL_EE@l mtmsr %r3 isync - lis %r3,tocbase@ha - ld %r2,tocbase@l(%r3) + GET_TOCBASE(%r2) addi %r3,%r1,48 bl CNAME(ast) nop @@ -760,8 +756,7 @@ dbtrap: FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ - lis %r3,tocbase@ha - ld %r2,tocbase@l(%r3) + GET_TOCBASE(%r2) addi %r3,%r1,48 bl CNAME(db_trap_glue) nop Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/booke/locore.S Sun Jan 18 18:32:43 2015 (r277334) @@ -207,7 +207,7 @@ done_mapping: */ lis %r1, tmpstack@ha addi %r1, %r1, tmpstack@l - addi %r1, %r1, (TMPSTACKSZ - 8) + addi %r1, %r1, (TMPSTACKSZ - 16) /* * Initialise exception vector offsets @@ -367,7 +367,7 @@ bp_tlb1_end: */ lis %r1, tmpstack@ha addi %r1, %r1, tmpstack@l - addi %r1, %r1, (TMPSTACKSZ - 8) + addi %r1, %r1, (TMPSTACKSZ - 16) /* * Initialise exception vector offsets @@ -757,6 +757,8 @@ setfault: .align 4 tmpstack: .space TMPSTACKSZ +tmpstackbound: + .space 10240 /* XXX: this really should not be necessary */ /* * Compiled KERNBASE locations @@ -764,20 +766,4 @@ tmpstack: .globl kernbase .set kernbase, KERNBASE -/* - * Globals - */ -#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ - -GLOBAL(intrnames) - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(sintrnames) - .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 - - .align 4 -GLOBAL(intrcnt) - .space INTRCNT_COUNT * 4 * 2 -GLOBAL(sintrcnt) - .long INTRCNT_COUNT * 4 * 2 - #include Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/include/trap.h Sun Jan 18 18:32:43 2015 (r277334) @@ -123,6 +123,9 @@ /* DTrace trap opcode. */ #define EXC_DTRACE 0x7c810808 +/* Magic pointer to store TOC base for trap handlers on ppc64 */ +#define TRAP_TOCBASE 0x1f8 + #ifndef LOCORE struct trapframe; struct pcb; Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/ofw/ofw_machdep.c Sun Jan 18 18:32:43 2015 (r277334) @@ -66,8 +66,8 @@ extern register_t ofmsr[5]; extern void *openfirmware_entry; static void *fdt; int ofw_real_mode; -extern char save_trap_init[0x2f00]; /* EXC_LAST */ -char save_trap_of[0x2f00]; /* EXC_LAST */ +char save_trap_init[0x2f00]; /* EXC_LAST */ +char save_trap_of[0x2f00]; /* EXC_LAST */ int ofwcall(void *); static int openfirmware(void *args); @@ -257,18 +257,30 @@ ofw_mem_regions(struct mem_region *memp, void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *)) { + ofmsr[0] = mfmsr(); + #ifdef __powerpc64__ + ofmsr[0] &= ~PSL_SF; + #endif + __asm __volatile("mfsprg0 %0" : "=&r"(ofmsr[1])); + __asm __volatile("mfsprg1 %0" : "=&r"(ofmsr[2])); + __asm __volatile("mfsprg2 %0" : "=&r"(ofmsr[3])); + __asm __volatile("mfsprg3 %0" : "=&r"(ofmsr[4])); + if (ofmsr[0] & PSL_DR) ofw_real_mode = 0; else ofw_real_mode = 1; fdt = fdt_ptr; + openfirmware_entry = openfirm; #ifdef FDT_DTB_STATIC /* Check for a statically included blob */ if (fdt == NULL) fdt = &fdt_static_dtb; #endif + + ofw_save_trap_vec(save_trap_init); } boolean_t Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/powerpc/intr_machdep.c Sun Jan 18 18:32:43 2015 (r277334) @@ -127,6 +127,11 @@ static u_int nirqs = 0; /* Allocated IR #endif static u_int stray_count; +u_long intrcnt[INTR_VECTORS]; +char intrnames[INTR_VECTORS * MAXCOMLEN]; +size_t sintrcnt = sizeof(intrcnt); +size_t sintrnames = sizeof(intrnames); + device_t root_pic; #ifdef SMP Modified: head/sys/powerpc/powerpc/vm_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/vm_machdep.c Sun Jan 18 18:25:12 2015 (r277333) +++ head/sys/powerpc/powerpc/vm_machdep.c Sun Jan 18 18:32:43 2015 (r277334) @@ -99,11 +99,6 @@ #include #include -#ifdef __powerpc64__ -extern uintptr_t tocbase; -#endif - - /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -149,7 +144,7 @@ cpu_fork(struct thread *td1, struct proc cf = (struct callframe *)tf - 1; memset(cf, 0, sizeof(struct callframe)); #ifdef __powerpc64__ - cf->cf_toc = tocbase; + cf->cf_toc = ((register_t *)fork_return)[1]; #endif cf->cf_func = (register_t)fork_return; cf->cf_arg0 = (register_t)td2; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:00:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1708C442; Sun, 18 Jan 2015 20:00:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB86587F; Sun, 18 Jan 2015 20:00:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IK0ZPX019326; Sun, 18 Jan 2015 20:00:35 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IK0YxW019320; Sun, 18 Jan 2015 20:00:34 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501182000.t0IK0YxW019320@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 18 Jan 2015 20:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277335 - in head/sys/powerpc: aim include ofw powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 20:00:36 -0000 Author: nwhitehorn Date: Sun Jan 18 20:00:33 2015 New Revision: 277335 URL: https://svnweb.freebsd.org/changeset/base/277335 Log: Use TOC to look up all kernel globals on powerpc64 instead of doing the non-relocatable lis @ha, ori @l dance and hoping they are below 4 GB. MFC after: 2 months Modified: head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/asm.h head/sys/powerpc/ofw/ofwcall64.S head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Sun Jan 18 18:32:43 2015 (r277334) +++ head/sys/powerpc/aim/locore64.S Sun Jan 18 20:00:33 2015 (r277335) @@ -91,6 +91,8 @@ GLOBAL(__endkernel) GLOBAL(tmpstk) .space TMPSTKSZ +TOC_ENTRY(tmpstk) + .text .globl btext btext: @@ -124,8 +126,8 @@ ASENTRY_NOPROF(__start) ld %r2,0(%r2) /* Set up the stack pointer */ - lis %r1,(tmpstk+TMPSTKSZ-48)@ha - addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l + ld %r1,TOC_REF(tmpstk)(%r2) + addi %r1,%r1,TMPSTKSZ-48 /* Switch to 64-bit mode */ mfmsr %r9 Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Jan 18 18:32:43 2015 (r277334) +++ head/sys/powerpc/aim/trap_subr64.S Sun Jan 18 20:00:33 2015 (r277335) @@ -307,10 +307,11 @@ CNAME(rstcode): CNAME(rstsize) = . - CNAME(rstcode) cpu_reset: - lis %r1,(tmpstk+TMPSTKSZ-48)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l - GET_TOCBASE(%r2) + + ld %r1,TOC_REF(tmpstk)(%r2) /* get new SP */ + addi %r1,%r1,(TMPSTKSZ-48) + bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop lis %r3,1@l @@ -751,8 +752,10 @@ dbtrap: andi. %r1,%r1,0xff00 mtsprg3 %r1 - lis %r1,(tmpstk+TMPSTKSZ-48)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l + li %r1,TRAP_TOCBASE /* get new SP */ + ld %r1,0(%r1) + ld %r1,TOC_REF(tmpstk)(%r1) + addi %r1,%r1,(TMPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Jan 18 18:32:43 2015 (r277334) +++ head/sys/powerpc/include/asm.h Sun Jan 18 20:00:33 2015 (r277335) @@ -80,6 +80,12 @@ name: #ifdef __powerpc64__ +#define TOC_REF(name) __CONCAT(.L,name) +#define TOC_ENTRY(name) \ + .section ".toc","aw"; \ + TOC_REF(name): \ + .tc name[TC],name + #define _ENTRY(name) \ .section ".text"; \ .p2align 2; \ Modified: head/sys/powerpc/ofw/ofwcall64.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall64.S Sun Jan 18 18:32:43 2015 (r277334) +++ head/sys/powerpc/ofw/ofwcall64.S Sun Jan 18 20:00:33 2015 (r277335) @@ -52,6 +52,13 @@ GLOBAL(openfirmware_entry) GLOBAL(rtas_entry) .llong 0 /* RTAS entry point */ +TOC_ENTRY(ofmsr) +TOC_ENTRY(ofwstk) +TOC_ENTRY(rtasmsr) +TOC_ENTRY(openfirmware_entry) +TOC_ENTRY(rtas_entry) +TOC_ENTRY(rtas_regsave) + /* * Open Firmware Real-mode Entry Point. This is a huge pain. */ @@ -94,16 +101,20 @@ ASENTRY_NOPROF(ofwcall) mfmsr %r6 /* read client interface handler */ - lis %r4,openfirmware_entry@ha - ld %r4,openfirmware_entry@l(%r4) + ld %r4,TOC_REF(openfirmware_entry)(%r2) + ld %r4,0(%r4) + + /* Get OF stack pointer */ + ld %r7,TOC_REF(ofwstk)(%r2) + addi %r7,%r7,OFWSTKSZ-32 /* * Set the MSR to the OF value. This has the side effect of disabling * exceptions, which is important for the next few steps. */ - lis %r5,ofmsr@ha - ld %r5,ofmsr@l(%r5) + ld %r5,TOC_REF(ofmsr)(%r2) + ld %r5,0(%r5) mtmsrd %r5 isync @@ -114,8 +125,7 @@ ASENTRY_NOPROF(ofwcall) * the old MSR so we can get them back later. */ mr %r5,%r1 - lis %r1,(ofwstk+OFWSTKSZ-32)@ha - addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l + mr %r1,%r7 std %r5,8(%r1) /* Save real stack pointer */ std %r2,16(%r1) /* Save old TOC */ std %r6,24(%r1) /* Save old MSR */ @@ -212,17 +222,18 @@ ASENTRY_NOPROF(rtascall) /* Record the old MSR */ mfmsr %r6 - /* read client interface handler */ - lis %r5,rtas_entry@ha - ld %r5,rtas_entry@l(%r5) + /* Read RTAS entry and reg save area pointers */ + ld %r5,TOC_REF(rtas_entry)(%r2) + ld %r5,0(%r5) + ld %r8,TOC_REF(rtas_regsave)(%r2) /* * Set the MSR to the RTAS value. This has the side effect of disabling * exceptions, which is important for the next few steps. */ - lis %r7,rtasmsr@ha - ld %r7,rtasmsr@l(%r7) + ld %r7,TOC_REF(rtasmsr)(%r2) + ld %r7,0(%r7) mtmsrd %r7 isync @@ -233,8 +244,7 @@ ASENTRY_NOPROF(rtascall) * are below 4 GB, so this is safe. */ mr %r7,%r1 - lis %r1,rtas_regsave@ha - addi %r1,%r1,rtas_regsave@l + mr %r1,%r8 std %r7,0(%r1) /* Save 64-bit stack pointer */ std %r2,8(%r1) /* Save TOC */ std %r6,16(%r1) /* Save MSR */ Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Sun Jan 18 18:32:43 2015 (r277334) +++ head/sys/powerpc/powerpc/swtch64.S Sun Jan 18 20:00:33 2015 (r277335) @@ -65,6 +65,8 @@ #include #include +TOC_ENTRY(blocked_lock) + /* * void cpu_throw(struct thread *old, struct thread *new) */ @@ -145,8 +147,7 @@ ENTRY(cpu_switch) cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) /* Wait for the new thread to become unblocked */ - lis %r6,blocked_lock@ha - addi %r6,%r6,blocked_lock@l + ld %r6,TOC_REF(blocked_lock)(%r2) blocked_loop: ld %r7,TD_LOCK(%r13) cmpd %r6,%r7 From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:20:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F716987; Sun, 18 Jan 2015 20:20:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B64BA4C; Sun, 18 Jan 2015 20:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IKKSJm030195; Sun, 18 Jan 2015 20:20:28 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IKKSM1030194; Sun, 18 Jan 2015 20:20:28 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501182020.t0IKKSM1030194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 18 Jan 2015 20:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277337 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 20:20:28 -0000 Author: tuexen Date: Sun Jan 18 20:20:27 2015 New Revision: 277337 URL: https://svnweb.freebsd.org/changeset/base/277337 Log: Remove an unused variable. Reported by: Coverity CID: 750999 MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Jan 18 20:15:47 2015 (r277336) +++ head/sys/netinet/sctp_usrreq.c Sun Jan 18 20:20:27 2015 (r277337) @@ -4720,7 +4720,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_CONNECT_X_COMPLETE: { struct sockaddr *sa; - struct sctp_nets *net; /* FIXME MT: check correct? */ SCTP_CHECK_AND_CAST(sa, optval, struct sockaddr, optsize); @@ -4731,7 +4730,6 @@ sctp_setopt(struct socket *so, int optna stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb) { SCTP_TCB_LOCK(stcb); - net = sctp_findnet(stcb, sa); } SCTP_INP_RUNLOCK(inp); } else { @@ -4743,7 +4741,7 @@ sctp_setopt(struct socket *so, int optna * TCB.. aka NULL. */ SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, sa, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:26:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 257B6F23; Sun, 18 Jan 2015 20:26:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F830B09; Sun, 18 Jan 2015 20:26:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IKQRRK032904; Sun, 18 Jan 2015 20:26:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IKQR9Z032903; Sun, 18 Jan 2015 20:26:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501182026.t0IKQR9Z032903@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 18 Jan 2015 20:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277340 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 20:26:28 -0000 Author: pfg Date: Sun Jan 18 20:26:27 2015 New Revision: 277340 URL: https://svnweb.freebsd.org/changeset/base/277340 Log: Remove dead code. After the ext2 variant of the "orlov allocator" was implemented, the case for a negative or zero dirsize disappeared. Drop the dead code and unsign dirsize given that it can't be negative anyways. CID: 1008669 MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 18 20:25:41 2015 (r277339) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 18 20:26:27 2015 (r277340) @@ -443,11 +443,11 @@ static u_long ext2_dirpref(struct inode *pip) { struct m_ext2fs *fs; - int cg, prefcg, dirsize, cgsize; + int cg, prefcg, cgsize; u_int avgifree, avgbfree, avgndir, curdirsize; u_int minifree, minbfree, maxndir; u_int mincg, minndir; - u_int maxcontigdirs; + u_int dirsize, maxcontigdirs; mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; @@ -498,10 +498,7 @@ ext2_dirpref(struct inode *pip) curdirsize = avgndir ? (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; if (dirsize < curdirsize) dirsize = curdirsize; - if (dirsize <= 0) - maxcontigdirs = 0; /* dirsize overflowed */ - else - maxcontigdirs = min((avgbfree * fs->e2fs_bsize) / dirsize, 255); + maxcontigdirs = min((avgbfree * fs->e2fs_bsize) / dirsize, 255); maxcontigdirs = min(maxcontigdirs, fs->e2fs_ipg / AFPDIR); if (maxcontigdirs == 0) maxcontigdirs = 1; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:47:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E69F8DC; Sun, 18 Jan 2015 20:47:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A140CDD; Sun, 18 Jan 2015 20:47:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IKlMiq042863; Sun, 18 Jan 2015 20:47:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IKlMXO042862; Sun, 18 Jan 2015 20:47:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501182047.t0IKlMXO042862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 18 Jan 2015 20:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277346 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 20:47:22 -0000 Author: ian Date: Sun Jan 18 20:47:21 2015 New Revision: 277346 URL: https://svnweb.freebsd.org/changeset/base/277346 Log: Save the command-and-flags value into the shadow register when it is written. This doesn't actually change any behavior, because it just allows a 16-bit read of the command register to return the correct value, and nothing actually does a 16-bit read of that register. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jan 18 20:40:08 2015 (r277345) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jan 18 20:47:21 2015 (r277346) @@ -399,8 +399,11 @@ bcm_sdhci_write_2(device_t dev, struct s val32 |= (val << (off & 3)*8); if (off == SDHCI_TRANSFER_MODE) sc->cmd_and_mode = val32; - else + else { WR4(sc, off & ~3, val32); + if (off == SDHCI_COMMAND_FLAGS) + sc->cmd_and_mode = val32; + } } static void From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:53:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6731DA9A; Sun, 18 Jan 2015 20:53:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52BADD95; Sun, 18 Jan 2015 20:53:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IKrLne047020; Sun, 18 Jan 2015 20:53:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IKrLLi047019; Sun, 18 Jan 2015 20:53:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501182053.t0IKrLLi047019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 18 Jan 2015 20:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277347 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 20:53:21 -0000 Author: tuexen Date: Sun Jan 18 20:53:20 2015 New Revision: 277347 URL: https://svnweb.freebsd.org/changeset/base/277347 Log: Add protection code to free memory in case of processing an address which is neither IPv4 or IPv6. Reported by: Coverity CID: 749311 MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun Jan 18 20:47:21 2015 (r277346) +++ head/sys/netinet/sctp_asconf.c Sun Jan 18 20:53:20 2015 (r277347) @@ -3346,6 +3346,11 @@ sctp_asconf_send_nat_state_update(struct TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); break; #endif + default: + SCTPDBG(SCTP_DEBUG_ASCONF1, + "sctp_asconf_send_nat_state_update: unknown address family\n"); + SCTP_FREE(aa, SCTP_M_ASC_ADDR); + return; } SCTP_MALLOC(aa, struct sctp_asconf_addr *, sizeof(*aa), SCTP_M_ASC_ADDR); @@ -3379,6 +3384,11 @@ sctp_asconf_send_nat_state_update(struct TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); break; #endif + default: + SCTPDBG(SCTP_DEBUG_ASCONF1, + "sctp_asconf_send_nat_state_update: unknown address family\n"); + SCTP_FREE(aa, SCTP_M_ASC_ADDR); + return; } /* Now we must hunt the addresses and add all global addresses */ if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 21:16:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBCAFF29; Sun, 18 Jan 2015 21:16:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7702F66; Sun, 18 Jan 2015 21:16:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0ILGNXl057981; Sun, 18 Jan 2015 21:16:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0ILGNti057980; Sun, 18 Jan 2015 21:16:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501182116.t0ILGNti057980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 18 Jan 2015 21:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277348 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 21:16:24 -0000 Author: tuexen Date: Sun Jan 18 21:16:22 2015 New Revision: 277348 URL: https://svnweb.freebsd.org/changeset/base/277348 Log: Remove an unnecessary check. Reported by: Coverity CID: 749576 MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jan 18 20:53:20 2015 (r277347) +++ head/sys/netinet/sctp_input.c Sun Jan 18 21:16:22 2015 (r277348) @@ -3108,7 +3108,6 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun uint32_t cwr_tsn; cwr_tsn = ntohl(cp->tsn); - override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { @@ -3124,10 +3123,8 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, sctp_next); - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } + sctp_m_freem(chk->data); + chk->data = NULL; stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 21:18:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E390EC; Sun, 18 Jan 2015 21:18:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89ED3F75; Sun, 18 Jan 2015 21:18:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0ILITXx058274; Sun, 18 Jan 2015 21:18:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0ILITXa058273; Sun, 18 Jan 2015 21:18:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501182118.t0ILITXa058273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 18 Jan 2015 21:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277349 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 21:18:29 -0000 Author: pfg Date: Sun Jan 18 21:18:28 2015 New Revision: 277349 URL: https://svnweb.freebsd.org/changeset/base/277349 Log: ext2: fix for uninitialized pointer read. path.ep_bp was being used uninitialized in ext4_ext_find_extent(). CID: 1062344 MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun Jan 18 21:16:22 2015 (r277348) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun Jan 18 21:18:28 2015 (r277349) @@ -94,7 +94,7 @@ ext4_bmapext(struct vnode *vp, int32_t b struct inode *ip; struct m_ext2fs *fs; struct ext4_extent *ep; - struct ext4_extent_path path; + struct ext4_extent_path path = { .ep_bp = NULL }; daddr_t lbn; ip = VTOI(vp); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 22:00:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BE11C0A; Sun, 18 Jan 2015 22:00:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16FBA366; Sun, 18 Jan 2015 22:00:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IM0d7D079239; Sun, 18 Jan 2015 22:00:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IM0daZ079238; Sun, 18 Jan 2015 22:00:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501182200.t0IM0daZ079238@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 18 Jan 2015 22:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277350 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 22:00:40 -0000 Author: tuexen Date: Sun Jan 18 22:00:39 2015 New Revision: 277350 URL: https://svnweb.freebsd.org/changeset/base/277350 Log: Fix a bug which only shows up when an mbuf allocation failed. Therefore chances are low that we hit this. Reported by: Coverity CID: 1018886 MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jan 18 21:18:28 2015 (r277349) +++ head/sys/netinet/sctp_output.c Sun Jan 18 22:00:39 2015 (r277350) @@ -7420,7 +7420,7 @@ dont_do_it: SCTP_TCB_SEND_LOCK(stcb); send_lock_up = 1; } - if (chk->data == NULL) { + if (sp->data == NULL) { /* unsteal the data */ sp->data = chk->data; sp->tail_mbuf = chk->last_mbuf; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 23:15:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6AD2ACF; Sun, 18 Jan 2015 23:15:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87D6BCCE; Sun, 18 Jan 2015 23:15:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0INFoNf018505; Sun, 18 Jan 2015 23:15:50 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0INFoV3018504; Sun, 18 Jan 2015 23:15:50 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201501182315.t0INFoV3018504@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 18 Jan 2015 23:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277351 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 23:15:50 -0000 Author: smh Date: Sun Jan 18 23:15:49 2015 New Revision: 277351 URL: https://svnweb.freebsd.org/changeset/base/277351 Log: Clean ZFS spa config before syncing A number of entries that can be present in the spa config shouldn't be saved to disk so add a method to ensure this is case. Without this if the last caller to vdev_config_generate requested stats then we can end up in the cache file. Also only skip a none writable pool in the cache file generation if its active. This prevents unavailable pools incorrectly getting removed from cache file. Tested by: delphij MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Sun Jan 18 22:00:39 2015 (r277350) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Sun Jan 18 23:15:49 2015 (r277351) @@ -140,6 +140,26 @@ out: kobj_close_file(file); } +static void +spa_config_clean(nvlist_t *nvl) +{ + nvlist_t **child; + nvlist_t *nvroot = NULL; + uint_t c, children; + + if (nvlist_lookup_nvlist_array(nvl, ZPOOL_CONFIG_CHILDREN, &child, + &children) == 0) { + for (c = 0; c < children; c++) + spa_config_clean(child[c]); + } + + if (nvlist_lookup_nvlist(nvl, ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0) + spa_config_clean(nvroot); + + nvlist_remove(nvl, ZPOOL_CONFIG_VDEV_STATS, DATA_TYPE_UINT64_ARRAY); + nvlist_remove(nvl, ZPOOL_CONFIG_SCAN_STATS, DATA_TYPE_UINT64_ARRAY); +} + static int spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) { @@ -233,6 +253,7 @@ spa_config_sync(spa_t *target, boolean_t */ nvl = NULL; while ((spa = spa_next(spa)) != NULL) { + nvlist_t *nvroot = NULL; /* * Skip over our own pool if we're about to remove * ourselves from the spa namespace or any pool that @@ -241,7 +262,8 @@ spa_config_sync(spa_t *target, boolean_t * we don't allow them to be written to the cache file. */ if ((spa == target && removing) || - !spa_writeable(spa)) + (spa_state(spa) == POOL_STATE_ACTIVE && + !spa_writeable(spa))) continue; mutex_enter(&spa->spa_props_lock); @@ -260,6 +282,9 @@ spa_config_sync(spa_t *target, boolean_t VERIFY(nvlist_add_nvlist(nvl, spa->spa_name, spa->spa_config) == 0); mutex_exit(&spa->spa_props_lock); + + if (nvlist_lookup_nvlist(nvl, spa->spa_name, &nvroot) == 0) + spa_config_clean(nvroot); } error = spa_config_write(dp, nvl); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 23:25:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9718DC0 for ; Sun, 18 Jan 2015 23:25:30 +0000 (UTC) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C962DBB for ; Sun, 18 Jan 2015 23:25:29 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id k14so28961130wgh.1 for ; Sun, 18 Jan 2015 15:25:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yaWxR6qA9uk+095tPnWd6szNRqdCOmU7RKQ9j27/hhM=; b=efJX9dW3SCbJIDM2SpWalgcZ/Uxe8phI/eA1OBoDB/tAvsR9ojzTdDCGSKszwceMMj KxqF3itXGMA21fbe8UQe6kusrlNPmnZekek9TkJD0/SyyeUnERm6W5n4O1MRnRCiHUfC KW/mXzxK+gqRWc0ANcvkYl5xXQMRJxvpZpZIwuRh+o9vxQNISekpU/AWls3uEHIfIiv6 kZAXQE6tSirMe261TGF+4ZK+9LjYs65cQdSX3RzNB+WLzWoxFAEZl+fJyK9OE7L/EffJ joEceA2chPjIhFPjH0TGUu8vHJO0zJwgLG8hHBqD2Z0hn9a2HPA/tZSUnISHHC9ZGx67 HOVA== X-Gm-Message-State: ALoCoQkzH0wet+ybIONmSxNUUal1iBi+3zAl5RRMBl2w+yg0EbNEbv3Rah7AqRGlF7wPxVO4Ed2s X-Received: by 10.194.108.202 with SMTP id hm10mr54515283wjb.72.1421623522298; Sun, 18 Jan 2015 15:25:22 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id gu5sm12008122wib.24.2015.01.18.15.25.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Jan 2015 15:25:21 -0800 (PST) Message-ID: <54BC40DE.4020607@multiplay.co.uk> Date: Sun, 18 Jan 2015 23:25:18 +0000 From: Steven Hartland User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Xin Li , d@delphij.net, svn-src-head@freebsd.org Subject: Re: svn commit: r276123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201412230931.sBN9VPMK017968@svn.freebsd.org> <54A35B88.9090102@delphij.net> <54A39153.8040905@freebsd.org> <54A3ACEF.70905@delphij.net> <54A5AC21.5070802@multiplay.co.uk> <54A6DB61.9060607@delphij.net> <54BB2EBB.3090006@multiplay.co.uk> <54BB3EF9.2080701@delphij.net> In-Reply-To: <54BB3EF9.2080701@delphij.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 23:25:30 -0000 On 18/01/2015 05:04, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > > > On 1/17/15 19:55, Steven Hartland wrote: >> On 02/01/2015 17:54, Xin Li wrote: >>> Yes, this fixes the problem, thanks for working on it. I'm not >>> fully convinced with the approach though -- shouldn't we update >>> the cachefile (again) when the pool become available? >> Just been looking at this again and when I import a pool which was >> previously unavailable it does write the cache file out. > Well technically it's not an explicit import: the encrypted devices do > not exist at the time the system boots (when zfs tries to update the > cache file, it would not "see" the devices), but they would appear > before 'zfs mount -va' runs by /etc/rc.d/zfs. > >> Do you have some basic reproduction steps for your setup where it >> isn't? > Yes, it's mostly: > > - Create an encrypted GELI provider that is protected by key (or > passphrase, or both, this shouldn't matter). > - Configure in /etc/rc.conf, something like: > > geli_devices="ada1" > geli_default_flags="-k /keys/geli.key -p" > geli_autodetach="NO" > > - Create a pool with ada1.eli (the encrypted provider). > - Reboot twice. > Thanks for that Xin I managed to reproduce what your seeing. Having dug around a looking for the spa config sync triggers, it happens on boot as its root pool. It then only triggers if the config has changed, which it hasn't, and hence why its not resynced when zfs mount -va re-evaluates the availability of all pools via pool_status_check which in turn does an spa_load as the vdev is now available resulting in the pool becoming available. Given this I believe ensuring the sync is clean and doesn't skip unavailable pools is the correct fix, which I've committed as: https://svnweb.freebsd.org/changeset/base/277351 Thanks for helping test, most appreciated :) Regards Steve From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 00:33:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E3153EB; Mon, 19 Jan 2015 00:33:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08DA15E6; Mon, 19 Jan 2015 00:33:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J0XXhF056606; Mon, 19 Jan 2015 00:33:33 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J0XXqZ056601; Mon, 19 Jan 2015 00:33:33 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201501190033.t0J0XXqZ056601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 19 Jan 2015 00:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277352 - in head/usr.sbin: mountd rpc.lockd rpc.statd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 00:33:34 -0000 Author: rstone Date: Mon Jan 19 00:33:32 2015 New Revision: 277352 URL: https://svnweb.freebsd.org/changeset/base/277352 Log: When mountd is creating sockets, it iterates over all addresses specified in the "hosts" array and eventually looks up the network address with getaddrinfo(). At one point it checks for a numeric address and if it sees one, it sets a hint parameter to force getaddrinfo to interpret the host as a numeric address. However that hint is not cleared for subsequent iterations of the loop and if any hosts seen after this point are host names, getaddrinfo will fail on the name. The result of this bug is that you cannot pass a host name to the -h flag. Unfortunately, the first iteration will either process ::1 or 127.0.0.1, so the flag is set on the first iteration and all host names will fail to be processed. The same bug applies to rpc.lockd and rpc.statd, so fix them too. Differential Revision: https://reviews.freebsd.org/D1507 Reported by: Dylan Martin MFC after: 1 week Sponsored by: Sandvine Inc. Modified: head/usr.sbin/mountd/mountd.c head/usr.sbin/rpc.lockd/lockd.c head/usr.sbin/rpc.statd/statd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sun Jan 18 23:15:49 2015 (r277351) +++ head/usr.sbin/mountd/mountd.c Mon Jan 19 00:33:32 2015 (r277352) @@ -627,7 +627,6 @@ create_service(struct netconfig *nconf) /* Get mountd's address on this transport */ memset(&hints, 0, sizeof hints); - hints.ai_flags = AI_PASSIVE; hints.ai_family = si.si_af; hints.ai_socktype = si.si_socktype; hints.ai_protocol = si.si_proto; @@ -644,6 +643,8 @@ create_service(struct netconfig *nconf) sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */ mallocd_res = 0; + hints.ai_flags = AI_PASSIVE; + /* * XXX - using RPC library internal functions. */ Modified: head/usr.sbin/rpc.lockd/lockd.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd.c Sun Jan 18 23:15:49 2015 (r277351) +++ head/usr.sbin/rpc.lockd/lockd.c Mon Jan 19 00:33:32 2015 (r277352) @@ -518,7 +518,6 @@ create_service(struct netconfig *nconf) /* Get rpc.statd's address on this transport */ memset(&hints, 0, sizeof hints); - hints.ai_flags = AI_PASSIVE; hints.ai_family = si.si_af; hints.ai_socktype = si.si_socktype; hints.ai_protocol = si.si_proto; @@ -534,6 +533,7 @@ create_service(struct netconfig *nconf) out_of_mem(); sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */ mallocd_res = 0; + hints.ai_flags = AI_PASSIVE; /* * XXX - using RPC library internal functions. Modified: head/usr.sbin/rpc.statd/statd.c ============================================================================== --- head/usr.sbin/rpc.statd/statd.c Sun Jan 18 23:15:49 2015 (r277351) +++ head/usr.sbin/rpc.statd/statd.c Mon Jan 19 00:33:32 2015 (r277352) @@ -343,7 +343,6 @@ create_service(struct netconfig *nconf) /* Get rpc.statd's address on this transport */ memset(&hints, 0, sizeof hints); - hints.ai_flags = AI_PASSIVE; hints.ai_family = si.si_af; hints.ai_socktype = si.si_socktype; hints.ai_protocol = si.si_proto; @@ -359,6 +358,7 @@ create_service(struct netconfig *nconf) out_of_mem(); sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */ mallocd_res = 0; + hints.ai_flags = AI_PASSIVE; /* * XXX - using RPC library internal functions. From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 02:22:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36E5B17E; Mon, 19 Jan 2015 02:22:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA83FE8; Mon, 19 Jan 2015 02:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J2M55B008119; Mon, 19 Jan 2015 02:22:05 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J2M3gr008110; Mon, 19 Jan 2015 02:22:03 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201501190222.t0J2M3gr008110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 19 Jan 2015 02:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277353 - in head: contrib/libxo contrib/libxo/bin contrib/libxo/doc contrib/libxo/libxo contrib/libxo/packaging contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/xo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 02:22:05 -0000 Author: marcel Date: Mon Jan 19 02:22:03 2015 New Revision: 277353 URL: https://svnweb.freebsd.org/changeset/base/277353 Log: Upgrade libxo to 0.2.0. Obtained from: https://github.com/Juniper/libxo Requested by: Phil Shafer Revisions 276253 & 276273 were incorporated into 0.2.0. Revision 276260 has been merged-in. Added: head/contrib/libxo/libxo/xo_error.3 (contents, props changed) head/contrib/libxo/packaging/libxo.rb.base.in (contents, props changed) head/contrib/libxo/tests/core/saved/test_08.H.err head/contrib/libxo/tests/core/saved/test_08.H.out head/contrib/libxo/tests/core/saved/test_08.HIPx.err head/contrib/libxo/tests/core/saved/test_08.HIPx.out head/contrib/libxo/tests/core/saved/test_08.HP.err head/contrib/libxo/tests/core/saved/test_08.HP.out head/contrib/libxo/tests/core/saved/test_08.J.err head/contrib/libxo/tests/core/saved/test_08.J.out head/contrib/libxo/tests/core/saved/test_08.JP.err head/contrib/libxo/tests/core/saved/test_08.JP.out head/contrib/libxo/tests/core/saved/test_08.T.err head/contrib/libxo/tests/core/saved/test_08.T.out head/contrib/libxo/tests/core/saved/test_08.X.err head/contrib/libxo/tests/core/saved/test_08.X.out head/contrib/libxo/tests/core/saved/test_08.XP.err head/contrib/libxo/tests/core/saved/test_08.XP.out head/contrib/libxo/tests/core/saved/test_09.H.err head/contrib/libxo/tests/core/saved/test_09.H.out head/contrib/libxo/tests/core/saved/test_09.HIPx.err head/contrib/libxo/tests/core/saved/test_09.HIPx.out head/contrib/libxo/tests/core/saved/test_09.HP.err head/contrib/libxo/tests/core/saved/test_09.HP.out head/contrib/libxo/tests/core/saved/test_09.J.err head/contrib/libxo/tests/core/saved/test_09.J.out head/contrib/libxo/tests/core/saved/test_09.JP.err head/contrib/libxo/tests/core/saved/test_09.JP.out head/contrib/libxo/tests/core/saved/test_09.T.err head/contrib/libxo/tests/core/saved/test_09.T.out head/contrib/libxo/tests/core/saved/test_09.X.err head/contrib/libxo/tests/core/saved/test_09.X.out head/contrib/libxo/tests/core/saved/test_09.XP.err head/contrib/libxo/tests/core/saved/test_09.XP.out head/contrib/libxo/tests/core/test_08.c (contents, props changed) head/contrib/libxo/tests/core/test_09.c (contents, props changed) Modified: head/contrib/libxo/Makefile.am head/contrib/libxo/bin/Zaliases head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo.txt head/contrib/libxo/libxo/libxo.3 head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_attr.3 head/contrib/libxo/libxo/xo_create.3 head/contrib/libxo/libxo/xo_emit.3 head/contrib/libxo/libxo/xo_err.3 head/contrib/libxo/libxo/xo_finish.3 head/contrib/libxo/libxo/xo_flush.3 head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_no_setlocale.3 head/contrib/libxo/libxo/xo_open_container.3 head/contrib/libxo/libxo/xo_open_list.3 head/contrib/libxo/libxo/xo_parse_args.3 head/contrib/libxo/libxo/xo_set_allocator.3 head/contrib/libxo/libxo/xo_set_flags.3 head/contrib/libxo/libxo/xo_set_info.3 head/contrib/libxo/libxo/xo_set_options.3 head/contrib/libxo/libxo/xo_set_style.3 head/contrib/libxo/libxo/xo_set_writer.3 head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xoconfig.h.in head/contrib/libxo/libxo/xoversion.h head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_07.J.out head/contrib/libxo/tests/core/saved/test_07.JP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/core/test_07.c head/contrib/libxo/xo/xo.1 head/contrib/libxo/xo/xo.c head/contrib/libxo/xolint/Makefile.am head/contrib/libxo/xolint/xolint.1 head/lib/libxo/Makefile Modified: head/contrib/libxo/Makefile.am ============================================================================== --- head/contrib/libxo/Makefile.am Mon Jan 19 00:33:32 2015 (r277352) +++ head/contrib/libxo/Makefile.am Mon Jan 19 02:22:03 2015 (r277353) @@ -35,6 +35,7 @@ docs: DIST_FILES_DIR = ~/Dropbox/dist-files/ GH_PAGES_DIR = gh-pages/ +GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz upload: dist upload-docs @@ -45,10 +46,14 @@ upload-docs: docs @echo "Uploading libxo-manual.html ... " @-[ -d ${GH_PAGES_DIR} ] \ && echo "Updating manual on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER} \ && cp doc/libxo-manual.html ${GH_PAGES_DIR} \ + && cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \ && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION} \ + && git add libxo-manual.html \ && git commit -m 'new docs' \ - libxo-manual.html \ + libxo-manual.html ${PACKAGE_VERSION} \ && git push origin gh-pages ) ; true pkgconfigdir=$(libdir)/pkgconfig @@ -66,7 +71,7 @@ UPDATE_PACKAGE_FILE = \ -e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \ -e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;" -GH_PACKAGING_DIR = packaging/${PACKAGE_VERSION} +GH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR} packages: @@ -75,7 +80,6 @@ packages: && SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \ && SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \ && SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \ - && mkdir -p ${GH_PAGES_PACKAGE_DIR}/freebsd \ && echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \ && sed ${UPDATE_PACKAGE_FILE} \ packaging/${PACKAGE_NAME}.rb.base \ @@ -83,20 +87,10 @@ packages: && echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \ && cp packaging/${PACKAGE_NAME}.spec \ ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \ - && echo "... ${GH_PAGES_PACKAGE_DIR}/freebsd ..." \ - && sed ${UPDATE_PACKAGE_FILE} \ - ${srcdir}/packaging/freebsd/distinfo.base \ - > ${GH_PAGES_PACKAGE_DIR}/freebsd/distinfo \ - && cp ${srcdir}/packaging/freebsd/pkg-descr \ - ${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-descr \ - && cp ${srcdir}/packaging/freebsd/pkg-plist \ - ${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-plist \ - && cp ${srcdir}/packaging/freebsd/pkg-plist \ - ${GH_PAGES_PACKAGE_DIR}/freebsd/pkg-plist \ - && cp packaging/freebsd/port-Makefile \ - ${GH_PAGES_PACKAGE_DIR}/freebsd/Makefile \ && (cd ${GH_PAGES_DIR} \ && git add ${GH_PACKAGING_DIR} \ + && git add ${GH_PACKAGING_DIR}/libxo.rb \ + ${GH_PACKAGING_DIR}/libxo.spec \ && git commit -m 'new packaging data' \ ${GH_PACKAGING_DIR} \ && git push origin gh-pages ) ; true Modified: head/contrib/libxo/bin/Zaliases ============================================================================== --- head/contrib/libxo/bin/Zaliases Mon Jan 19 00:33:32 2015 (r277352) +++ head/contrib/libxo/bin/Zaliases Mon Jan 19 02:22:03 2015 (r277353) @@ -1,5 +1,5 @@ set top_src=`pwd` -alias Zautoreconf "(cd $top_src ; autoreconf --install)" +alias Zautoreconf "(cd $top_src ; autoreconf)" set opts=' \ --with-libslax-prefix=/Users/phil/work/root \ Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Mon Jan 19 00:33:32 2015 (r277352) +++ head/contrib/libxo/configure.ac Mon Jan 19 02:22:03 2015 (r277353) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.1.6], [phil@juniper.net]) +AC_INIT([libxo], [0.2.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. @@ -57,8 +57,10 @@ AC_CHECK_FUNCS([getpass]) AC_CHECK_FUNCS([sysctlbyname]) AC_CHECK_FUNCS([flock]) AC_CHECK_FUNCS([asprintf]) +AC_CHECK_FUNCS([__flbf]) AC_CHECK_HEADERS([dlfcn.h]) +AC_CHECK_HEADERS([stdio_ext.h]) AC_CHECK_HEADERS([tzfile.h]) AC_CHECK_HEADERS([stdtime/tzfile.h]) AC_CHECK_FUNCS([dlfunc]) @@ -164,7 +166,6 @@ AC_ARG_ENABLE([libxo-options], AC_MSG_RESULT([$LIBXO_OPTS]) AM_CONDITIONAL([NO_LIBXO_OPTIONS], [test "$LIBXO_OPTS" != "yes"]) - case $host_os in darwin*) LIBTOOL=glibtool @@ -238,6 +239,7 @@ AC_CONFIG_FILES([ tests/core/Makefile tests/xo/Makefile packaging/libxo.spec + packaging/libxo.rb.base ]) AC_OUTPUT Modified: head/contrib/libxo/doc/libxo.txt ============================================================================== --- head/contrib/libxo/doc/libxo.txt Mon Jan 19 00:33:32 2015 (r277352) +++ head/contrib/libxo/doc/libxo.txt Mon Jan 19 02:22:03 2015 (r277353) @@ -12,14 +12,15 @@ libxo - A Library for Generating Text, XML, JSON, and HTML Output -You live in the present, but you want to live in the future. You'd -love a flying car, but need to get to work today. You want to support -features like XML, JSON, and HTML rendering to allow integration with -NETCONF, REST, and web browsers, but you need to make text output for -command line users. And you don't want multiple code paths that can't -help but get out of sync. None of this "if (xml) {... } else {...}" -logic. And ifdefs are right out. But you'd really, really like all -the fancy features that modern encoding formats can provide. +You want to prepare for the future, but you need to live in the +present. You'd love a flying car, but need to get to work today. You +want to support features like XML, JSON, and HTML rendering to allow +integration with NETCONF, REST, and web browsers, but you need to make +text output for command line users. And you don't want multiple code +paths that can't help but get out of sync. None of this "if (xml) +{... } else {...}" logic. And ifdefs are right out. But you'd +really, really like all the fancy features that modern encoding +formats can provide. libxo can help. The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application @@ -83,31 +84,37 @@ The latest release of libxo is available https://github.com/Juniper/libxo/releases -We are following the branching scheme from -^http://nvie.com/posts/a-successful-git-branching-model/^ -which means we will do development under the "develop" branch, and -release from the master. To clone a developer tree, run the following +We are following the branching scheme from +^http://nvie.com/posts/a-successful-git-branching-model/^ which means +we will do development under the "develop" branch, and release from +the "master" branch. To clone a developer tree, run the following command: git clone https://github.com/Juniper/libxo.git -b develop -We're using semantic release numbering. +We're using semantic release numbering, as defined in +^http://semver.org/spec/v2.0.0.html^. + +libxo is open source, distributed under the BSD license. It +is shipped as part of FreeBSD 11.0. * Overview Most unix commands emit text output aimed at humans. It is designed -to be parsed and understood by a user. Humans are gifted at extracted -details and pattern matching. Often programmers need to extract -information from this human-oriented output. Programmers use tools -like grep, awk, and regular expressions to ferret out the pieces of -information they need. Such solutions are fragile and require -updates when output contents change or evolve, requiring testing and -validation. +to be parsed and understood by a user. Humans are gifted at +extracting details and pattern matching in such output. Often +programmers need to extract information from this human-oriented +output. Programmers use tools like grep, awk, and regular expressions +to ferret out the pieces of information they need. Such solutions are +fragile and require maintenance when output contents change or evolve, +along with testing and validation. -Modern tool developers favors encoding schemes like XML and JSON, +Modern tool developers favor encoding schemes like XML and JSON, which allow trivial parsing and extraction of data. Such formats are simple, well understood, hierarchical, easily parsed, and often -integrate easier with common tools and environments. +integrate easier with common tools and environments. Changes to +content can be done in ways that do not break existing users of the +data, which can reduce maintenance costs and increase feature velocity. In addition, modern reality means that more output ends up in web browsers than in terminals, making HTML output valuable. @@ -278,7 +285,7 @@ content. The roles are listed below; on |---+--------------+-------------------------------------------------| | M | Name | Description | |---+--------------+-------------------------------------------------| -| D | decoration | Field is non-text (e.g. colon, comma) | +| D | decoration | Field is non-text (e.g., colon, comma) | | E | error | Field is an error message | | L | label | Field is text that prefixes a value | | N | note | Field is text that follows a value | @@ -321,7 +328,7 @@ the field descriptor, or a printf-style if preceded by a slash ("/"): xo_emit("{P: }{Lwc:Cost}{:cost/%u}\n", cost); - xo_emit("{P:/30s}{Lwc:Cost}{:cost/%u}\n", "", cost); + xo_emit("{P:/%30s}{Lwc:Cost}{:cost/%u}\n", "", cost); **** The Title Role ({T:}) @@ -333,6 +340,16 @@ if preceded by a slash ("/"): xo_emit("{T:Interface Statistics}\n"); xo_emit("{T:/%20.20s}{T:/%6.6s}\n", "Item Name", "Cost"); +Title fields have an extra convenience feature; if both content and +format are specified, instead of looking to the argument list for a +value, the content is used, allowing a mixture of format and content +within the field descriptor: + + xo_emit("{T:Name/%20s}{T:Count/%6s}\n"); + +Since the incoming argument is a string, the format must be "%s" or +something suitable. + **** The Units Role ({U:}) Units are the dimension by which values are measured, such as degrees, @@ -412,6 +429,7 @@ content emitted for some output styles: | d | display | Only emit field for display styles (text/HTML) | | e | encoding | Only emit for encoding styles (XML/JSON) | | k | key | Field is a key, suitable for XPath predicates | +| l | leaf-list | Field is a leaf-list | n | no-quotes | Do not quote the field when using JSON style | | q | quotes | Quote the field when using JSON style | | w | white space | A blank (" ") is appended after the label | @@ -433,7 +451,7 @@ The colon modifier appends a single colo Name:phil The colon modifier is only used for the TEXT and HTML output -styles. It is commonly combined with the space modifier ('{w:'). +styles. It is commonly combined with the space modifier ('{w:}'). It is purely a convenience feature. **** The Display Modifier ({d:}) @@ -485,6 +503,24 @@ Currently the key modifier is only used for the HTML output style when XOF_XPATH is set, but other uses are likely in the near future. +**** The Leaf-List Modifier ({l:}) + +The leaf-list modifier is used to distinguish lists where each +instance consists of only a single value. In XML, these are +rendered as single elements, where JSON renders them as arrays. + + EXAMPLE: + for (i = 0; i < num_users; i++) { + xo_emit("Member {l:user}\n", user[i].u_name); + } + XML: + phil + pallavi + JSON: + "user": [ "phil", "pallavi" ] + +The name of the field must match the name of the leaf list. + **** The No-Quotes Modifier ({n:}) The no-quotes modifier (and its twin, the 'quotes' modifier) affect @@ -522,7 +558,7 @@ The white space modifier appends a singl Name phil The white space modifier is only used for the TEXT and HTML output -styles. It is commonly combined with the colon modifier ('{c:'). +styles. It is commonly combined with the colon modifier ('{c:}'). It is purely a convenience feature. Note that the sense of the 'w' modifier is reversed for the units role @@ -530,14 +566,15 @@ Note that the sense of the 'w' modifier *** Field Formatting -The field format is similar to the format string for printf(3). It's -used varies based on the role of the field, but generally is used to +The field format is similar to the format string for printf(3). Its +use varies based on the role of the field, but generally is used to format the field's contents. -If not provided, the format string defaults to "%s". +If the format string is not provided for a value field, it defaults to +"%s". Note a field definition can contain zero or more printf-style -'directives', which are sequences that start with a '%' and end with a +'directives', which are sequences that start with a '%' and end with one of following characters: "diouxXDOUeEfFgGaAcCsSp". Each directive is matched by one of more arguments to the xo_emit function. @@ -557,7 +594,7 @@ argument. If the width in columns of th the minumum width, the value will be padded to reach the minimum. - a period followed by one or more digits indicating the maximum number of bytes which will be examined for a string argument, or the maximum -width for a non-string argument. When handling ASCII strings this is +width for a non-string argument. When handling ASCII strings this functions as the field width but for multi-byte characters, a single character may be composed of multiple bytes. xo_emit will never dereference memory beyond the given number of bytes. @@ -630,8 +667,8 @@ ASCII data, a normal 7-bit ASCII string Unicode values. '%hs' expects a 'char *' pointer to a multi-byte string encoded with the current locale, as given by the LC_CTYPE, LANG, or LC_ALL environment varibles. The first of this list of -variables is used and if none of the variables, the locale defaults to -"UTF-8". +variables is used and if none of the variables are set, the locale +defaults to "UTF-8". For example, a function is passed a locale-base name, a hat size, and a time value. The hat size is formatted in a UTF-8 (ASCII) @@ -676,10 +713,10 @@ columns. *** Characters Outside of Field Definitions -Characters in the format string are not part of a field definition are -copied to the output for the TEXT style, and are ignored for the JSON -and XML styles. For HTML, these characters are placed in a
with -class "text". +Characters in the format string that are not part of a field +definition are copied to the output for the TEXT style, and are +ignored for the JSON and XML styles. For HTML, these characters are +placed in a
with class "text". EXAMPLE: xo_emit("The hat is {:size/%s}.\n", size_val); @@ -854,7 +891,7 @@ container, a warning will be generated. *** Lists and Instances A list is set of one or more instances that appear under the same -parent. The instances contains details about a specific object. One +parent. The instances contain details about a specific object. One can think of instances as objects or records. A call is needed to open and close the list, while a distinct call is needed to open and close each instance of the list: @@ -874,8 +911,8 @@ generation of XML and JSON data. *** DTRT Mode -Some user may find tracking the names of open containers, lists, and -instances inconvenient. libxo offers "Do The Right Thing" mode, where +Some users may find tracking the names of open containers, lists, and +instances inconvenient. libxo offers a "Do The Right Thing" mode, where libxo will track the names of open containers, lists, and instances so the close function can be called without a name. To enable DTRT mode, turn on the XOF_DTRT flag prior to making any other libxo output. @@ -889,10 +926,42 @@ will close the open container, list, or ... xo_close_container_d(); +This also works for lists and instances: + + xo_open_list("item"); + for (...) { + xo_open_instance("item"); + xo_emit(...); + xo_close_instance_d(); + } + xo_close_list_d(); + Note that the XOF_WARN flag will also cause libxo to track open -containers, lists, and instances. A warning is generated with the +containers, lists, and instances. A warning is generated when the name given to the close function and the name recorded do not match. +*** Markers + +Markers are used to protect and restore the state of open constructs. +While a marker is open, no other open constructs can be closed. When +a marker is closed, all constructs open since the marker was opened +will be closed. + +Markers use names which are not user-visible, allowing the caller to +choose appropriate internal names. + +In this example, the code whiffles through a list of fish, calling a +function to emit details about each fish. The marker "fish-guts" is +used to ensure that any constructs opened by the function are closed +properly. + + for (i = 0; fish[i]; i++) { + xo_open_instance("fish"); + xo_open_marker("fish-guts"); + dump_fish_details(i); + xo_close_marker("fish-guts"); + } + ** Handles libxo uses "handles" to control its rendering functionality. The @@ -952,7 +1021,7 @@ be passed NULL to access the default han For the typical command that is generating output on standard output, there is no need to create an explicit handle, but they are available -when needed, e.g. for daemons that generate multiple streams of +when needed, e.g., for daemons that generate multiple streams of output. *** xo_create @@ -972,7 +1041,7 @@ See also ^styles^ and ^flags^. By default, libxo writes output to standard output. A convenience function is provided for situations when output should be written to -different file: +a different file: xo_handle_t *xo_create_to_file (FILE *fp, unsigned style, unsigned flags); @@ -987,10 +1056,13 @@ which can tailor how libxo writes data. recorded and passed back to the write function, allowing the function to acquire context information. The 'close' function can release this opaque data and any other resources as needed. +The flush function can flush buffered data associated with the opaque +object. void xo_set_writer (xo_handle_t *xop, void *opaque, xo_write_func_t write_func, xo_close_func_t close_func); + xo_flush_func_t flush_func); *** xo_set_style @@ -1068,7 +1140,7 @@ XML, JSON, and HTML output. Text output The XOF_WARN flag requests that warnings will trigger diagnostic output (on standard error) when the library notices errors during -operations, or with arguments to functions. Without warning enabled, +operations, or with arguments to functions. Without warnings enabled, such conditions are ignored. Warnings allow developers to debug their interaction with libxo. @@ -1178,6 +1250,13 @@ parameter passed to xo_attr_hv(). XML: 00:14 +xo_attr is placed on the next container, instance, leaf, or leaf list +that is emitted. + +Since attributes are only emitted in XML, their use should be limited +to meta-data and additional or redundant representations of data +already emitted in other form. + *** Flushing Output (xo_flush) libxo buffers data, both for performance and consistency, but also to @@ -1188,6 +1267,10 @@ xo_flush() call is used for this: void xo_flush (void); void xo_flush_h (xo_handle_t *xop); +Calling xo_flush also triggers the flush function associated with the +handle. For the default handle, this is equivalent to +"fflush(stdio);". + *** Finishing Output (xo_finish) When the program is ready to exit or close a handle, a call to @@ -1250,7 +1333,7 @@ styles. Calls must be made to open and instance of data in that list, calls must be make to open and close that instance. -The name given to all calls must be identical, and it is strong +The name given to all calls must be identical, and it is strongly suggested that the name be singular, not plural, as a matter of style and usage expectations. @@ -1314,6 +1397,16 @@ Following the call to xo_parse_args, the remaining arguments in a normal manner. See ^command-line-arguments^ for a description of valid arguments. +*** xo_set_program + +The xo_set_program function sets name of the program as reported by +functions like xo_failure, xo_warn, xo_err, etc. The program name is +initialized by xo_parse_args, but subsequent calls to xo_set_program +can override this value. + +Note that the value is not copied, so the memory passed to +xo_set_program (and xo_parse_args) must be maintained by the caller. + *** Field Information (xo_info_t) @info@ HTML data can include additional information in attributes that @@ -1353,7 +1446,7 @@ known to the application: ... xo_set_info(NULL, info, info_count); -Third, the emitting of info must be triggered with the XOF_INFO flag +Third, the emission of info must be triggered with the XOF_INFO flag using either the xo_set_flags() function or the "--libxo=info" command line argument. @@ -1405,6 +1498,10 @@ Complete HTML output can be generated wi % env LIBXO_OPTIONS=HXI my-app +Since environment variables are inherited, child processes will have +the same options, which may be undesirable, making the use of the +"--libxo" option is preferable in most situations. + *** Errors, Warnings, and Messages Many programs make use of the standard library functions err() and @@ -1435,6 +1532,20 @@ message associated with either "errno" o if (open(filename, O_RDONLY) < 0) xo_err(1, "cannot open file '%s'", filename); +*** xo_error + +The xo_error function can be used for generic errors that should be +reported over the handle, rather than to stderr. The xo_error +function behaves like xo_err for TEXT and HTML output styles, but puts +the error into XML or JSON elements: + + EXAMPLE:: + xo_error("Does not %s", "compute"); + XML:: + Does not compute + JSON:: + "error": { "message": "Does not compute" } + *** xo_no_setlocale libxo automatically initializes the locale based on setting of the @@ -1580,7 +1691,7 @@ and errors, warning, or informational me | -X | Extract samples from xolint, suitable for testing | |------------+---------------------------------------------------| -Output message contain the source filename and line number, the +The output message will contain the source filename and line number, the class of the message, the message, and, if -p is given, the line that contains the error: @@ -1627,6 +1738,88 @@ libxo is an effort to mix the best aspec FreeBSD in a seemless way, allowing commands to make printf-like output calls without needing to care how the output is rendered. +*** Did the complex semantics of format strings evolve over time? + +The history is both long and short: libxo's functionality is based +on what JUNOS does in a data modeling language called ODL (output +definition language). In JUNOS, all subcomponents generate XML, +which is feed to the CLI, where data from the ODL files tell is +how to render that XML into text. ODL might had a set of tags +like: + + tag docsis-state { + help "State of the DOCSIS interface"; + type string; + } + + tag docsis-mode { + help "DOCSIS mode (2.0/3.0) of the DOCSIS interface"; + type string; + } + + tag docsis-upstream-speed { + help "Operational upstream speed of the interface"; + type string; + } + + tag downstream-scanning { + help "Result of scanning in downstream direction"; + type string; + } + + tag ranging { + help "Result of ranging action"; + type string; + } + + tag signal-to-noise-ratio { + help "Signal to noise ratio for all channels"; + type string; + } + + tag power { + help "Operational power of the signal on all channels"; + type string; + } + + format docsis-status-format { + picture " + State : @, Mode: @, Upstream speed: @ + Downstream scanning: @, Ranging: @ + Signal to noise ratio: @ + Power: @ +"; + line { + field docsis-state; + field docsis-mode; + field docsis-upstream-speed; + field downstream-scanning; + field ranging; + field signal-to-noise-ratio; + field power; + } + } + +These tag definitions are compiled into field definitions +that are triggered when matching XML elements are seen. ODL +also supports other means of defining output. + +The roles and modifiers describe these details. + +In moving these ideas to bsd, two things had to happen: the +formatting had to happen at the source since BSD won't have +a JUNOS-like CLI to do the rendering, and we can't depend on +external data models like ODL, which was seen as too hard a +sell to the BSD community. + +The results were that the xo_emit strings are used to encode the +roles, modifiers, names, and formats. They are dense and a bit +cryptic, but not so unlike printf format strings that developers will +be lost. + +libxo is a new implementation of these ideas and is distinct from +the previous implementation in JUNOS. + *** What makes a good field name? To make useful, consistent field names, follow these guidelines: @@ -1660,7 +1853,7 @@ Nothing's worse than writing expressions } Find someone else who is expressing similar data and follow their -field's and hierarchy. Remember the quote is not "Consistency is the +fields and hierarchy. Remember the quote is not "Consistency is the hobgoblin of little minds", but "A foolish consistency is the hobgoblin of little minds". = Think about your users @@ -1670,7 +1863,7 @@ content with xo_attr() calls (^xo_attr^) (^e-modifier^) to make the data useful. = Don't use an arbitrary number postfix What does "errors2" mean? No one will know. "errors-after-restart" -would be a better choice. Think of you users, and think of the +would be a better choice. Think of your users, and think of the future. If you make "errors2", the next guy will happily make "errors3" and before you know it, someone will be asking what's the difference between errors37 and errors63. @@ -1689,7 +1882,7 @@ After using "xolint" to find errors in y "xolint -V" to spell check your field names and to detect different names for the same data. "dropped-short" and "dropped-too-short" are both reasonable names, but using them both will lead users to ask the -difference between the two fields. If there isn't a difference, +difference between the two fields. If there is no difference, use only one of the field names. If there is a difference, change the names to make that difference more obvious. Modified: head/contrib/libxo/libxo/libxo.3 ============================================================================== --- head/contrib/libxo/libxo/libxo.3 Mon Jan 19 00:33:32 2015 (r277352) +++ head/contrib/libxo/libxo/libxo.3 Mon Jan 19 02:22:03 2015 (r277353) @@ -7,7 +7,7 @@ .\" # LICENSE. .\" # Phil Shafer, July 2014 .\" -.Dd July, 2014 +.Dd December 8, 2014 .Dt LIBXO 3 .Os .Sh NAME @@ -19,58 +19,82 @@ .In libxo/xo.h .Sh DESCRIPTION The functions defined in -.Lb libxo +.Nm are used to generate a choice of .Em TEXT , .Em XML , .Em JSON , or .Em HTML -output. A common set of functions are used, with +output. +A common set of functions are used, with command line switches passed to the library to control the details of the output. .Pp -Most commands emit text output aimed at humans. It is designed -to be parsed and understood by a user. Humans are gifted at extracted -details and pattern matching. Often programmers need to extract -information from this human-oriented output. Programmers use tools -like grep, awk, and regular expressions to ferret out the pieces of -information they need. Such solutions are fragile and require +Most commands emit text output aimed at humans. +It is designed +to be parsed and understood by a user. +Humans are gifted at extracting +details and pattern matching. +Often programmers need to extract +information from this human-oriented output. +Programmers use tools +like +.Xr grep 1 , +.Xr awk 1 , +and regular expressions to ferret out the pieces of +information they need. +Such solutions are fragile and require updates when output contents change or evolve, requiring testing and validation. .Pp -Modern tool developers favors encoding schemes like XML and JSON, -which allow trivial parsing and extraction of data. Such formats are +Modern tool developers favor encoding schemes like XML and JSON, +which allow trivial parsing and extraction of data. +Such formats are simple, well understood, hierarchical, easily parsed, and often integrate easier with common tools and environments. .Pp In addition, modern reality means that more output ends up in web browsers than in terminals, making HTML output valuable. .Pp -.Em libxo +.Nm allows a single set of function calls in source code to generate -traditional text output, as well as XML and JSON formatted data. HTML +traditional text output, as well as XML and JSON formatted data. +HTML can also be generated; "
" elements surround the traditional text output, with attributes that detail how to render the data. .Pp -There are four encoding styles supported by libxo: TEXT, HTML, JSON, -and XML. JSON and XML are suitable for encoding data, while TEXT and -HTML are suited for display to the user. TEXT output can be display +There are four encoding styles supported by +.Nm : +TEXT, HTML, JSON, +and XML. +JSON and XML are suitable for encoding data, while TEXT and +HTML are suited for display to the user. +TEXT output can be display on a terminal session, allowing compatibility with traditional usage. HTML can be matched with a small CSS file to permit rendering in any -HTML5 browser. XML output is suitable for tools like XPath and -protocols like NETCONF. JSON output can be used for RESTful APIs. +HTML5 browser. +XML output is suitable for tools like XPath and +protocols like NETCONF. +JSON output can be used for RESTful APIs. .Pp The -.Em libxo +.Nm library allows an application to generate text, XML, JSON, -and HTML output using a common set of function calls. The application -decides at run time which output style should be produced. The +and HTML output using a common set of function calls. +The application +decides at run time which output style should be produced. +The application calls a function -.Fn xo_emit +.Xr xo_emit 3 to product output that is -described in a format string. A "field descriptor" tells libxo what -the field is and what it means. Each field descriptor is placed in +described in a format string. +A +.Dq field descriptor +tells +.Nm +what the field is and what it means. +Each field descriptor is placed in braces with a printf-like format string: .Bd -literal -offset indent xo_emit(" {:lines/%7ju} {:words/%7ju} " @@ -79,55 +103,199 @@ braces with a printf-like format string: .Ed .Pp Each field can have a role, with the 'value' role being the default, -and the role tells libxo how and when to render that field, as well as +and the role tells +.Nm +how and when to render that field, as well as a -.Xr printf 3 -like +.Xr printf 3 Ns -like format string. .Pp Output can then be generated in various style, using the "--libxo" option. .Sh DEFAULT HANDLE -Handles give an abstraction for libxo that encapsulates the state of a -stream of output. Handles have the data type "xo_handle_t" and are +Handles give an abstraction for +.Nm +that encapsulates the state of a +stream of output. +Handles have the data type "xo_handle_t" and are opaque to the caller. - +.Pp The library has a default handle that is automatically initialized. By default, this handle will send text style output to standard output. -The xo_set_style and xo_set_flags functions can be used to change this +The +.Xr xo_set_style 3 +and +.Xr xo_set_flags 3 +functions can be used to change this behavior. - -Many libxo functions take a handle as their first parameter; most that -do not use the default handle. Any function taking a handle can -be passed NULL to access the default handle. - +.Pp +Many +.Nm +functions take a handle as their first parameter; most that +do not use the default handle. +Any function taking a handle can +be passed +.Dv NULL +to access the default handle. +.Pp For the typical command that is generating output on standard output, there is no need to create an explicit handle, but they are available -when needed, e.g. for daemons that generate multiple streams of +when needed, e.g., for daemons that generate multiple streams of output. +.Sh FUNCTION OVERVIEW +The +.Nm +library includes the following functions: +.Bl -tag -width "xo_close_container_hd" +.It Sy "Function Description" +.It Fn xo_attr +.It Fn xo_attr_h +.It Fn xo_attr_hv +Allows the caller to emit XML attributes with the next open element. +.It Fn xo_create +.It Fn xo_create_to_file +Allow the caller to create a new handle. +Note that +.Nm +has a default handle that allows the caller to avoid use of an +explicitly created handle. +Only callers writing to files other than +.Dv stdout +would need to call +.Fn xo_create . +.It Fn xo_destroy +Frees any resources associated with the handle, including the handle +itself. +.It Fn xo_emit +.It Fn xo_emit_h +.It Fn xo_emit_hv +Emit formatted output. +The +.Fa fmt +string controls the conversion of the remaining arguments into +formatted output. +See +.Xr xo_format 5 +for details. +.It Fn xo_warn +.It Fn xo_warnx +.It Fn xo_warn_c +.It Fn xo_warn_hc +.It Fn xo_err +.It Fn xo_errc +.It Fn xo_errx +.It Fn xo_message +.It Fn xo_message_c +.It Fn xo_message_hc +.It Fn xo_message_hcv +These functions are meant to be compatible with their standard libc namesakes. +.It Fn xo_finish +.It Fn xo_finish_h +Flush output, close open construct, and complete any pending +operations. +.It Fn xo_flush +.It Fn xo_flush_h +Allow the caller to flush any pending output for a handle. +.It Fn xo_no_setlocale +Direct +.Nm +to avoid initializing the locale. +This function should be called before any other +.Nm +function is called. +.It Fn xo_open_container +.It Fn xo_open_container_h +.It Fn xo_open_container_hd +.It Fn xo_open_container_d +.It Fn xo_close_container +.It Fn xo_close_container_h +.It Fn xo_close_container_hd +.It Fn xo_close_container_d +Containers a singleton levels of hierarchy, typically used to organize +related content. +.It Fn xo_open_list_h +.It Fn xo_open_list +.It Fn xo_open_list_hd +.It Fn xo_open_list_d +.It Fn xo_open_instance_h +.It Fn xo_open_instance +.It Fn xo_open_instance_hd +.It Fn xo_open_instance_d +.It Fn xo_close_instance_h +.It Fn xo_close_instance +.It Fn xo_close_instance_hd +.It Fn xo_close_instance_d +.It Fn xo_close_list_h +.It Fn xo_close_list +.It Fn xo_close_list_hd +.It Fn xo_close_list_d +Lists are levels of hierarchy that can appear multiple times within +the same parent. +Two calls are needed to encapsulate them, one for +the list and one for each instance of that list. +Typically +.Fn xo_open_list +and +.Fn xo_close_list +are called outside a +for-loop, where +.Fn xo_open_instance +it called at the top of the loop, and +.Fn xo_close_instance +is called at the bottom of the loop. +.It Fn xo_parse_args +Inspects command line arguments for directions to +.Nm . +This function should be called before +.Va argv +is inspected by the application. +.It Fn xo_set_allocator +Instructs +.Nm +to use an alternative memory allocator and deallocator. +.It Fn xo_set_flags +.It Fn xo_clear_flags +Change the flags set for a handle. +.It Fn xo_set_info +Provides additional information about elements for use with HTML +rendering. +.It Fn xo_set_options +Changes formatting options used by handle. +.It Fn xo_set_style +.It Fn xo_set_style_name +Changes the output style used by a handle. +.It Fn xo_set_writer +Instructs +.Nm +to use an alternative set of low-level output functions. +.El .Sh ADDITIONAL DOCUMENTATION -.Pp Complete documentation can be found on github: .Bd -literal -offset indent http://juniper.github.io/libxo/libxo-manual.html .Ed .Pp -libxo lives on github as: +.Nm +lives on github as: .Bd -literal -offset indent https://github.com/Juniper/libxo .Ed .Pp -The latest release of libxo is available at: +The latest release of +.Nm +is available at: .Bd -literal -offset indent https://github.com/Juniper/libxo/releases .Ed .Sh SEE ALSO +.Xr xo 1 , +.Xr xolint 1 , .Xr xo_attr 3 , .Xr xo_create 3 , .Xr xo_emit 3 , .Xr xo_err 3 , .Xr xo_finish 3 , .Xr xo_flush 3 , -.Xr xo_format 5 , .Xr xo_no_setlocale 3 , .Xr xo_open_container 3 , .Xr xo_open_list 3 , @@ -138,12 +306,11 @@ https://github.com/Juniper/libxo/release .Xr xo_set_options 3 , .Xr xo_set_style 3 , .Xr xo_set_writer 3 , -.Xr xo 1 , -and -.Xr xolint 1 . +.Xr xo_format 5 .Sh HISTORY The -.Fa libxo -library was added in FreeBSD 11.0. +.Nm *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 03:30:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A365A7A; Mon, 19 Jan 2015 03:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F042E8DC; Mon, 19 Jan 2015 03:30:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J3Uli7038381; Mon, 19 Jan 2015 03:30:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J3Ukww038374; Mon, 19 Jan 2015 03:30:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501190330.t0J3Ukww038374@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 19 Jan 2015 03:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277354 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 03:30:48 -0000 Author: pfg Date: Mon Jan 19 03:30:45 2015 New Revision: 277354 URL: https://svnweb.freebsd.org/changeset/base/277354 Log: ext2: Garbage-collect some unused variables Reported by: clang static analysis MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 19 03:30:45 2015 (r277354) @@ -145,7 +145,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t struct buf *bp; struct ext2mount *ump; struct mount *mp; - struct vnode *devvp; struct indir a[NIADDR+1], *ap; daddr_t daddr; e2fs_lbn_t metalbn; @@ -156,7 +155,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t ip = VTOI(vp); mp = vp->v_mount; ump = VFSTOEXT2(mp); - devvp = ump->um_devvp; bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Jan 19 03:30:45 2015 (r277354) @@ -131,13 +131,11 @@ struct ext4_extent_path * ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *ip, daddr_t lbn, struct ext4_extent_path *path) { - struct vnode *vp; struct ext4_extent_header *ehp; uint16_t i; int error, size; daddr_t nblk; - vp = ITOV(ip); ehp = (struct ext4_extent_header *)(char *)ip->i_db; if (ehp->eh_magic != EXT4_EXT_MAGIC) Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_htree.c Mon Jan 19 03:30:45 2015 (r277354) @@ -395,7 +395,7 @@ ext2_htree_append_block(struct vnode *vp int error; cursize = roundup(dp->i_size, blksize); - newsize = roundup(dp->i_size, blksize) + blksize; + newsize = cursize + blksize; auio.uio_offset = cursize; auio.uio_resid = blksize; @@ -771,7 +771,7 @@ ext2_htree_add_entry(struct vnode *dvp, dst_node->h_fake_dirent.e2d_reclen = blksize; cursize = roundup(ip->i_size, blksize); - dirsize = roundup(ip->i_size, blksize) + blksize; + dirsize = cursize + blksize; blknum = dirsize / blksize - 1; error = ext2_htree_append_block(dvp, newidxblock, Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 03:30:45 2015 (r277354) @@ -115,7 +115,6 @@ ext2_truncate(struct vnode *vp, off_t le struct inode *oip; int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; uint32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; - struct bufobj *bo; struct m_ext2fs *fs; struct buf *bp; int offset, size, level; @@ -124,7 +123,6 @@ ext2_truncate(struct vnode *vp, off_t le off_t osize; oip = VTOI(ovp); - bo = &ovp->v_bufobj; ASSERT_VOP_LOCKED(vp, "ext2_truncate"); Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_lookup.c Mon Jan 19 03:30:45 2015 (r277354) @@ -343,7 +343,6 @@ restart: * we watch for a place to put the new file in * case it doesn't already exist. */ - ino = 0; i_diroff = dp->i_diroff; ss.slotstatus = FOUND; ss.slotfreespace = ss.slotsize = ss.slotneeded = 0; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 19 03:30:45 2015 (r277354) @@ -902,7 +902,6 @@ ext2_vget(struct mount *mp, ino_t ino, i struct ext2mount *ump; struct buf *bp; struct vnode *vp; - struct cdev *dev; struct thread *td; int i, error; int used_blocks; @@ -913,7 +912,6 @@ ext2_vget(struct mount *mp, ino_t ino, i return (error); ump = VFSTOEXT2(mp); - dev = ump->um_dev; ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 19 03:30:45 2015 (r277354) @@ -1223,7 +1223,6 @@ ext2_rmdir(struct vop_rmdir_args *ap) * the current directory and thus be * non-empty.) */ - error = 0; if (ip->i_nlink != 2 || !ext2_dirempty(ip, dp->i_number, cnp->cn_cred)) { error = ENOTEMPTY; goto out; @@ -1329,12 +1328,10 @@ ext2_strategy(struct vop_strategy_args * { struct buf *bp = ap->a_bp; struct vnode *vp = ap->a_vp; - struct inode *ip; struct bufobj *bo; daddr_t blkno; int error; - ip = VTOI(vp); if (vp->v_type == VBLK || vp->v_type == VCHR) panic("ext2_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 04:56:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94F238C0; Mon, 19 Jan 2015 04:56:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81CD59C; Mon, 19 Jan 2015 04:56:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J4uIuB079620; Mon, 19 Jan 2015 04:56:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J4uIAs079619; Mon, 19 Jan 2015 04:56:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501190456.t0J4uIAs079619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 19 Jan 2015 04:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277355 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 04:56:18 -0000 Author: ian Date: Mon Jan 19 04:56:17 2015 New Revision: 277355 URL: https://svnweb.freebsd.org/changeset/base/277355 Log: For armv6 builds, add -mfloat-abi=softfp. This tells the compiler it can use floating point hardware instructions (because all armv6/7 systems we support have fp hardware), but it passes args using a soft-float compatible ABI. This should give noticible performance improvement (but not as much as using the armv6hf arch). Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Jan 19 03:30:45 2015 (r277354) +++ head/share/mk/bsd.cpu.mk Mon Jan 19 04:56:17 2015 (r277355) @@ -251,6 +251,10 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 CFLAGS += -G0 .endif +.if ${MACHINE_ARCH} == "armv6" +_CPUCFLAGS += -mfloat-abi=softfp +.endif + # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 05:14:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18BC8B2A; Mon, 19 Jan 2015 05:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC795215; Mon, 19 Jan 2015 05:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J5E7Ea088792; Mon, 19 Jan 2015 05:14:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J5E7rT088791; Mon, 19 Jan 2015 05:14:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501190514.t0J5E7rT088791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 19 Jan 2015 05:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277356 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 05:14:08 -0000 Author: nwhitehorn Date: Mon Jan 19 05:14:07 2015 New Revision: 277356 URL: https://svnweb.freebsd.org/changeset/base/277356 Log: Provide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap PVO pool size. The default errs on the exceedingly large side, so absent any intelligent automatic tuning, at least let the user set it to save RAM on memory-constrained systems. MFC after: 2 weeks Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jan 19 04:56:17 2015 (r277355) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jan 19 05:14:07 2015 (r277356) @@ -221,9 +221,10 @@ struct pvo_head *moea64_pvo_table; /* p uma_zone_t moea64_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea64_mpvo_zone; /* zone for pvo entries for managed pages */ -#define BPVO_POOL_SIZE 327680 static struct pvo_entry *moea64_bpvo_pool; static int moea64_bpvo_pool_index = 0; +static int moea64_bpvo_pool_size = 327680; +TUNABLE_INT("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size); SYSCTL_INT(_machdep, OID_AUTO, moea64_allocated_bpvo_entries, CTLFLAG_RD, &moea64_bpvo_pool_index, 0, ""); @@ -647,7 +648,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_o off = (vm_offset_t)(moea64_pvo_table); for (pa = off; pa < off + size; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); - size = BPVO_POOL_SIZE*sizeof(struct pvo_entry); + size = moea64_bpvo_pool_size*sizeof(struct pvo_entry); off = (vm_offset_t)(moea64_bpvo_pool); for (pa = off; pa < off + size; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); @@ -815,7 +816,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offs * Initialise the unmanaged pvo pool. */ moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( - BPVO_POOL_SIZE*sizeof(struct pvo_entry), 0); + moea64_bpvo_pool_size*sizeof(struct pvo_entry), 0); moea64_bpvo_pool_index = 0; /* @@ -2282,10 +2283,10 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u * If we aren't overwriting a mapping, try to allocate. */ if (bootstrap) { - if (moea64_bpvo_pool_index >= BPVO_POOL_SIZE) { + if (moea64_bpvo_pool_index >= moea64_bpvo_pool_size) { panic("moea64_enter: bpvo pool exhausted, %d, %d, %zd", - moea64_bpvo_pool_index, BPVO_POOL_SIZE, - BPVO_POOL_SIZE * sizeof(struct pvo_entry)); + moea64_bpvo_pool_index, moea64_bpvo_pool_size, + moea64_bpvo_pool_size * sizeof(struct pvo_entry)); } pvo = &moea64_bpvo_pool[moea64_bpvo_pool_index]; moea64_bpvo_pool_index++; From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:10:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11E452B0; Mon, 19 Jan 2015 06:10:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F213588E; Mon, 19 Jan 2015 06:10:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J6A1K9012756; Mon, 19 Jan 2015 06:10:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J6A1li012755; Mon, 19 Jan 2015 06:10:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501190610.t0J6A1li012755@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 19 Jan 2015 06:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277357 - head/contrib/netbsd-tests/bin/expr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 06:10:02 -0000 Author: ngie Date: Mon Jan 19 06:10:01 2015 New Revision: 277357 URL: https://svnweb.freebsd.org/changeset/base/277357 Log: Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent overflow checks like NetBSD's expr does MFC after: 3 days PR: 196867 Modified: head/contrib/netbsd-tests/bin/expr/t_expr.sh Modified: head/contrib/netbsd-tests/bin/expr/t_expr.sh ============================================================================== --- head/contrib/netbsd-tests/bin/expr/t_expr.sh Mon Jan 19 05:14:07 2015 (r277356) +++ head/contrib/netbsd-tests/bin/expr/t_expr.sh Mon Jan 19 06:10:01 2015 (r277357) @@ -54,6 +54,9 @@ overflow_head() { atf_set "descr" "Test overflow cases" } overflow_body() { + # Begin FreeBSD + atf_expect_fail "FreeBSD's expr does not check overflow to the same degree NetBSD's expr does; see bug 196867 for more details" + # End FreeBSD test_expr '4611686018427387904 + 4611686018427387903' \ '9223372036854775807' test_expr '4611686018427387904 + 4611686018427387904' \ From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:13:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48C4B528; Mon, 19 Jan 2015 06:13:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC9794C; Mon, 19 Jan 2015 06:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J6D8bC016606; Mon, 19 Jan 2015 06:13:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J6D87R016603; Mon, 19 Jan 2015 06:13:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501190613.t0J6D87R016603@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 19 Jan 2015 06:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277358 - in head: bin/expr bin/expr/tests etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 06:13:09 -0000 Author: ngie Date: Mon Jan 19 06:13:07 2015 New Revision: 277358 URL: https://svnweb.freebsd.org/changeset/base/277358 Log: Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/tests MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/bin/expr/tests/ head/bin/expr/tests/Makefile (contents, props changed) Modified: head/bin/expr/Makefile head/etc/mtree/BSD.tests.dist Modified: head/bin/expr/Makefile ============================================================================== --- head/bin/expr/Makefile Mon Jan 19 06:10:01 2015 (r277357) +++ head/bin/expr/Makefile Mon Jan 19 06:13:07 2015 (r277358) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + PROG= expr SRCS= expr.y YFLAGS= NO_WMISSING_VARIABLE_DECLARATIONS= +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/bin/expr/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/expr/tests/Makefile Mon Jan 19 06:13:07 2015 (r277358) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR}/../../.. +SRCTOP= ${.CURDIR}/../../.. +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/expr + +TESTSDIR= ${TESTSBASE}/bin/expr + +NETBSD_ATF_TESTS_SH= expr_test + +ATF_TESTS_SH_SED_expr_test+= -e 's/eval expr/eval expr --/g' +ATF_TESTS_SH_SED_expr_test+= -e 's/"expr: integer overflow or underflow occurred for operation.*"/"expr: overflow"/g' + +.include + +.include Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Jan 19 06:10:01 2015 (r277357) +++ head/etc/mtree/BSD.tests.dist Mon Jan 19 06:13:07 2015 (r277358) @@ -12,6 +12,8 @@ .. date .. + expr + .. mv .. pax From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:51:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0EFFBA1; Mon, 19 Jan 2015 06:51:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 919F4CD6; Mon, 19 Jan 2015 06:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J6p5jt032868; Mon, 19 Jan 2015 06:51:05 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J6p5TV032866; Mon, 19 Jan 2015 06:51:05 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501190651.t0J6p5TV032866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 19 Jan 2015 06:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277359 - head/lib/libvmmapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 06:51:05 -0000 Author: neel Date: Mon Jan 19 06:51:04 2015 New Revision: 277359 URL: https://svnweb.freebsd.org/changeset/base/277359 Log: Fix a bug in libvmmapi 'vm_copy_setup()' where it would return success even if the 'gpa' was in the guest MMIO region. This would manifest as a segmentation fault in 'vm_map_copyin()' or 'vm_map_copyout()' because 'vm_map_gpa()' would return NULL for this 'gpa'. Fix this by calling 'vm_map_gpa()' in 'vm_copy_setup' and returning a failure if the 'gpa' cannot be mapped. This matches the behavior of 'vm_copy_setup()' in vmm.ko. MFC after: 1 week Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Jan 19 06:13:07 2015 (r277358) +++ head/lib/libvmmapi/vmmapi.c Mon Jan 19 06:51:04 2015 (r277359) @@ -987,6 +987,7 @@ int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) { + void *va; uint64_t gpa; int error, fault, i, n, off; @@ -1006,7 +1007,11 @@ vm_copy_setup(struct vmctx *ctx, int vcp off = gpa & PAGE_MASK; n = min(len, PAGE_SIZE - off); - iov->iov_base = (void *)gpa; + va = vm_map_gpa(ctx, gpa, n); + if (va == NULL) + return (-1); + + iov->iov_base = va; iov->iov_len = n; iov++; iovcnt--; @@ -1018,19 +1023,24 @@ vm_copy_setup(struct vmctx *ctx, int vcp } void +vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, int iovcnt) +{ + + return; +} + +void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *iov, void *vp, size_t len) { const char *src; char *dst; - uint64_t gpa; size_t n; dst = vp; while (len) { assert(iov->iov_len); - gpa = (uint64_t)iov->iov_base; n = min(len, iov->iov_len); - src = vm_map_gpa(ctx, gpa, n); + src = iov->iov_base; bcopy(src, dst, n); iov++; @@ -1045,15 +1055,13 @@ vm_copyout(struct vmctx *ctx, int vcpu, { const char *src; char *dst; - uint64_t gpa; size_t n; src = vp; while (len) { assert(iov->iov_len); - gpa = (uint64_t)iov->iov_base; n = min(len, iov->iov_len); - dst = vm_map_gpa(ctx, gpa, n); + dst = iov->iov_base; bcopy(src, dst, n); iov++; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Jan 19 06:13:07 2015 (r277358) +++ head/lib/libvmmapi/vmmapi.h Mon Jan 19 06:51:04 2015 (r277359) @@ -137,6 +137,8 @@ void vm_copyin(struct vmctx *ctx, int vc void *host_dst, size_t len); void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, struct iovec *guest_iov, size_t len); +void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, + int iovcnt); /* RTC */ int vm_rtc_write(struct vmctx *ctx, int offset, uint8_t value); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:53:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D0AFCEA; Mon, 19 Jan 2015 06:53:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77D6ECE3; Mon, 19 Jan 2015 06:53:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J6rWBK034999; Mon, 19 Jan 2015 06:53:32 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J6rWZO034997; Mon, 19 Jan 2015 06:53:32 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501190653.t0J6rWZO034997@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 19 Jan 2015 06:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277360 - in head/sys/amd64: include vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 06:53:32 -0000 Author: neel Date: Mon Jan 19 06:53:31 2015 New Revision: 277360 URL: https://svnweb.freebsd.org/changeset/base/277360 Log: MOVS instruction emulation. These instructions are emitted by 'bus_space_read_region()' when accessing MMIO regions. Since MOVS can be used with a repeat prefix start decoding the REPZ and REPNZ prefixes. Also start decoding the segment override prefix since MOVS allows overriding the source operand segment register. Tested by: tychon MFC after: 1 week Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Mon Jan 19 06:51:04 2015 (r277359) +++ head/sys/amd64/include/vmm.h Mon Jan 19 06:53:31 2015 (r277360) @@ -446,8 +446,11 @@ struct vie { rex_x:1, rex_b:1, rex_present:1, + repz_present:1, /* REP/REPE/REPZ prefix */ + repnz_present:1, /* REPNE/REPNZ prefix */ opsize_override:1, /* Operand size override */ - addrsize_override:1; /* Address size override */ + addrsize_override:1, /* Address size override */ + segment_override:1; /* Segment override */ uint8_t mod:2, /* ModRM byte */ reg:4, @@ -463,6 +466,7 @@ struct vie { uint8_t scale; int base_register; /* VM_REG_GUEST_xyz */ int index_register; /* VM_REG_GUEST_xyz */ + int segment_register; /* VM_REG_GUEST_xyz */ int64_t displacement; /* optional addr displacement */ int64_t immediate; /* optional immediate operand */ Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Mon Jan 19 06:51:04 2015 (r277359) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Mon Jan 19 06:53:31 2015 (r277360) @@ -70,6 +70,7 @@ enum { VIE_OP_TYPE_PUSH, VIE_OP_TYPE_CMP, VIE_OP_TYPE_POP, + VIE_OP_TYPE_MOVS, VIE_OP_TYPE_LAST }; @@ -78,6 +79,7 @@ enum { #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ #define VIE_OP_F_MOFFSET (1 << 2) /* 16/32/64-bit immediate moffset */ #define VIE_OP_F_NO_MODRM (1 << 3) +#define VIE_OP_F_NO_GLA_VERIFICATION (1 << 4) static const struct vie_op two_byte_opcodes[256] = { [0xB6] = { @@ -133,6 +135,16 @@ static const struct vie_op one_byte_opco .op_type = VIE_OP_TYPE_MOV, .op_flags = VIE_OP_F_MOFFSET | VIE_OP_F_NO_MODRM, }, + [0xA4] = { + .op_byte = 0xA4, + .op_type = VIE_OP_TYPE_MOVS, + .op_flags = VIE_OP_F_NO_MODRM | VIE_OP_F_NO_GLA_VERIFICATION + }, + [0xA5] = { + .op_byte = 0xA5, + .op_type = VIE_OP_TYPE_MOVS, + .op_flags = VIE_OP_F_NO_MODRM | VIE_OP_F_NO_GLA_VERIFICATION + }, [0xC6] = { /* XXX Group 11 extended opcode - not just MOV */ .op_byte = 0xC6, @@ -559,6 +571,217 @@ emulate_movx(void *vm, int vcpuid, uint6 return (error); } +/* + * Helper function to calculate and validate a linear address. + * + * Returns 0 on success and 1 if an exception was injected into the guest. + */ +static int +get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, + int opsize, int addrsize, int prot, enum vm_reg_name seg, + enum vm_reg_name gpr, uint64_t *gla) +{ + struct seg_desc desc; + uint64_t cr0, val, rflags; + int error; + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_CR0, &cr0); + KASSERT(error == 0, ("%s: error %d getting cr0", __func__, error)); + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, &rflags); + KASSERT(error == 0, ("%s: error %d getting rflags", __func__, error)); + + error = vm_get_seg_desc(vm, vcpuid, seg, &desc); + KASSERT(error == 0, ("%s: error %d getting segment descriptor %d", + __func__, error, seg)); + + error = vie_read_register(vm, vcpuid, gpr, &val); + KASSERT(error == 0, ("%s: error %d getting register %d", __func__, + error, gpr)); + + if (vie_calculate_gla(paging->cpu_mode, seg, &desc, val, opsize, + addrsize, prot, gla)) { + if (seg == VM_REG_GUEST_SS) + vm_inject_ss(vm, vcpuid, 0); + else + vm_inject_gp(vm, vcpuid); + return (1); + } + + if (vie_canonical_check(paging->cpu_mode, *gla)) { + if (seg == VM_REG_GUEST_SS) + vm_inject_ss(vm, vcpuid, 0); + else + vm_inject_gp(vm, vcpuid); + return (1); + } + + if (vie_alignment_check(paging->cpl, opsize, cr0, rflags, *gla)) { + vm_inject_ac(vm, vcpuid, 0); + return (1); + } + + return (0); +} + +static int +emulate_movs(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + struct vm_guest_paging *paging, mem_region_read_t memread, + mem_region_write_t memwrite, void *arg) +{ +#ifdef _KERNEL + struct vm_copyinfo copyinfo[2]; +#else + struct iovec copyinfo[2]; +#endif + uint64_t dstaddr, srcaddr, val; + uint64_t rcx, rdi, rsi, rflags; + int error, opsize, seg, repeat; + + opsize = (vie->op.op_byte == 0xA4) ? 1 : vie->opsize; + val = 0; + error = 0; + + /* + * XXX although the MOVS instruction is only supposed to be used with + * the "rep" prefix some guests like FreeBSD will use "repnz" instead. + * + * Empirically the "repnz" prefix has identical behavior to "rep" + * and the zero flag does not make a difference. + */ + repeat = vie->repz_present | vie->repnz_present; + + if (repeat) { + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RCX, &rcx); + KASSERT(!error, ("%s: error %d getting rcx", __func__, error)); + + /* + * The count register is %rcx, %ecx or %cx depending on the + * address size of the instruction. + */ + if ((rcx & vie_size2mask(vie->addrsize)) == 0) + return (0); + } + + /* + * Source Destination Comments + * -------------------------------------------- + * (1) memory memory n/a + * (2) memory mmio emulated + * (3) mmio memory emulated + * (4) mmio mmio not emulated + * + * At this point we don't have sufficient information to distinguish + * between (2), (3) and (4). We use 'vm_copy_setup()' to tease this + * out because it will succeed only when operating on regular memory. + * + * XXX the emulation doesn't properly handle the case where 'gpa' + * is straddling the boundary between the normal memory and MMIO. + */ + + seg = vie->segment_override ? vie->segment_register : VM_REG_GUEST_DS; + error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, + PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr); + if (error) + goto done; + + error = vm_copy_setup(vm, vcpuid, paging, srcaddr, opsize, PROT_READ, + copyinfo, nitems(copyinfo)); + if (error == 0) { + /* + * case (2): read from system memory and write to mmio. + */ + vm_copyin(vm, vcpuid, copyinfo, &val, opsize); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + error = memwrite(vm, vcpuid, gpa, val, opsize, arg); + goto done; + } else if (error > 0) { + /* + * Resume guest execution to handle fault. + */ + goto done; + } else { + /* + * 'vm_copy_setup()' is expected to fail for cases (3) and (4) + * if 'srcaddr' is in the mmio space. + */ + } + + error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, + PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr); + if (error) + goto done; + + error = vm_copy_setup(vm, vcpuid, paging, dstaddr, opsize, + PROT_WRITE, copyinfo, nitems(copyinfo)); + if (error == 0) { + /* + * case (3): read from MMIO and write to system memory. + * + * A MMIO read can have side-effects so we commit to it + * only after vm_copy_setup() is successful. If a page-fault + * needs to be injected into the guest then it will happen + * before the MMIO read is attempted. + */ + error = memread(vm, vcpuid, gpa, &val, opsize, arg); + if (error) + goto done; + + vm_copyout(vm, vcpuid, &val, copyinfo, opsize); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + } else if (error > 0) { + /* + * Resume guest execution to handle fault. + */ + goto done; + } else { + goto done; + } + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RSI, &rsi); + KASSERT(error == 0, ("%s: error %d getting rsi", __func__, error)); + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RDI, &rdi); + KASSERT(error == 0, ("%s: error %d getting rdi", __func__, error)); + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, &rflags); + KASSERT(error == 0, ("%s: error %d getting rflags", __func__, error)); + + if (rflags & PSL_D) { + rsi -= opsize; + rdi -= opsize; + } else { + rsi += opsize; + rdi += opsize; + } + + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RSI, rsi, + vie->addrsize); + KASSERT(error == 0, ("%s: error %d updating rsi", __func__, error)); + + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RDI, rdi, + vie->addrsize); + KASSERT(error == 0, ("%s: error %d updating rdi", __func__, error)); + + if (repeat) { + rcx = rcx - 1; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RCX, + rcx, vie->addrsize); + KASSERT(!error, ("%s: error %d updating rcx", __func__, error)); + + /* + * Repeat the instruction if the count register is not zero. + */ + if ((rcx & vie_size2mask(vie->addrsize)) != 0) + vm_restart_instruction(vm, vcpuid); + } +done: + if (error < 0) + return (EFAULT); + else + return (0); +} + static int emulate_and(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -926,9 +1149,7 @@ emulate_stack_op(void *vm, int vcpuid, u error = memwrite(vm, vcpuid, mmio_gpa, val, size, arg); rsp += size; } -#ifdef _KERNEL vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); -#endif if (error == 0) { error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RSP, rsp, @@ -1012,6 +1233,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_movx(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_MOVS: + error = emulate_movs(vm, vcpuid, gpa, vie, paging, memread, + memwrite, memarg); + break; case VIE_OP_TYPE_AND: error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); @@ -1193,6 +1418,7 @@ vie_init(struct vie *vie, const char *in vie->base_register = VM_REG_LAST; vie->index_register = VM_REG_LAST; + vie->segment_register = VM_REG_LAST; if (inst_length) { bcopy(inst_bytes, vie->inst, inst_length); @@ -1458,6 +1684,35 @@ vie_advance(struct vie *vie) vie->num_processed++; } +static bool +segment_override(uint8_t x, int *seg) +{ + + switch (x) { + case 0x2E: + *seg = VM_REG_GUEST_CS; + break; + case 0x36: + *seg = VM_REG_GUEST_SS; + break; + case 0x3E: + *seg = VM_REG_GUEST_DS; + break; + case 0x26: + *seg = VM_REG_GUEST_ES; + break; + case 0x64: + *seg = VM_REG_GUEST_FS; + break; + case 0x65: + *seg = VM_REG_GUEST_GS; + break; + default: + return (false); + } + return (true); +} + static int decode_prefixes(struct vie *vie, enum vm_cpu_mode cpu_mode, int cs_d) { @@ -1471,6 +1726,12 @@ decode_prefixes(struct vie *vie, enum vm vie->opsize_override = 1; else if (x == 0x67) vie->addrsize_override = 1; + else if (x == 0xF3) + vie->repz_present = 1; + else if (x == 0xF2) + vie->repnz_present = 1; + else if (segment_override(x, &vie->segment_register)) + vie->segment_override = 1; else break; @@ -1923,8 +2184,10 @@ vmm_decode_instruction(struct vm *vm, in if (verify_inst_length(vie)) return (-1); - if (verify_gla(vm, cpuid, gla, vie)) - return (-1); + if ((vie->op.op_flags & VIE_OP_F_NO_GLA_VERIFICATION) == 0) { + if (verify_gla(vm, cpuid, gla, vie)) + return (-1); + } vie->decoded = 1; /* success */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 07:10:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55AD15BD; Mon, 19 Jan 2015 07:10:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41D36E17; Mon, 19 Jan 2015 07:10:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J7A9i6042837; Mon, 19 Jan 2015 07:10:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J7A9wx042836; Mon, 19 Jan 2015 07:10:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501190710.t0J7A9wx042836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 19 Jan 2015 07:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277365 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 07:10:09 -0000 Author: ngie Date: Mon Jan 19 07:10:08 2015 New Revision: 277365 URL: https://svnweb.freebsd.org/changeset/base/277365 Log: Fix the build when INVARIANTS is defined by restoring `bo`'s definition in ext2_truncate(..) and by putting it under INVARIANTS ifdefs X-MFC with: r277354 MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_inode.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 07:06:15 2015 (r277364) +++ head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 07:10:08 2015 (r277365) @@ -121,8 +121,14 @@ ext2_truncate(struct vnode *vp, off_t le e4fs_daddr_t count, nblocks, blocksreleased = 0; int error, i, allerror; off_t osize; +#ifdef INVARIANTS + struct bufobj *bo; +#endif oip = VTOI(ovp); +#ifdef INVARIANTS + bo = &ovp->v_bufobj; +#endif ASSERT_VOP_LOCKED(vp, "ext2_truncate"); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 07:29:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D401FA6; Mon, 19 Jan 2015 07:29:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0906BFDF; Mon, 19 Jan 2015 07:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0J7T7ao050635; Mon, 19 Jan 2015 07:29:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0J7T73O050634; Mon, 19 Jan 2015 07:29:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501190729.t0J7T73O050634@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Jan 2015 07:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277372 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 07:29:08 -0000 Author: hselasky Date: Mon Jan 19 07:29:07 2015 New Revision: 277372 URL: https://svnweb.freebsd.org/changeset/base/277372 Log: Minor refactoring of code block. MFC after: 1 day Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jan 19 07:24:18 2015 (r277371) +++ head/sys/cam/scsi/scsi_da.c Mon Jan 19 07:29:07 2015 (r277372) @@ -3101,11 +3101,10 @@ dadone(struct cam_periph *periph, union * give them an 'illegal' value we'll avoid that * here. */ - if (block_size == 0 && maxsector == 0) { - block_size = 512; - maxsector = -1; - } else if (block_size == 0) { + if (block_size == 0) { block_size = 512; + if (maxsector == 0) + maxsector = -1; } if (block_size >= MAXPHYS) { xpt_print(periph->path, From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 11:06:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31499BEE; Mon, 19 Jan 2015 11:06:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DAACA99; Mon, 19 Jan 2015 11:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JB6uOD054008; Mon, 19 Jan 2015 11:06:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JB6u4L054007; Mon, 19 Jan 2015 11:06:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201501191106.t0JB6u4L054007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 19 Jan 2015 11:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277378 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 11:06:57 -0000 Author: andrew Date: Mon Jan 19 11:06:56 2015 New Revision: 277378 URL: https://svnweb.freebsd.org/changeset/base/277378 Log: Make the clock-frequency property optional as it may not be present on FDT systems. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Mon Jan 19 11:02:23 2015 (r277377) +++ head/sys/dev/ofw/ofw_cpu.c Mon Jan 19 11:06:56 2015 (r277378) @@ -1,7 +1,11 @@ /*- * Copyright (C) 2009 Nathan Whitehorn + * Copyright (C) 2015 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Andrew Turner + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -193,10 +197,11 @@ ofw_cpu_attach(device_t dev) } sc->sc_cpu_pcpu = pcpu_find(cell); if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) { - device_printf(dev, "missing 'clock-frequency' property\n"); - return (ENXIO); - } - sc->sc_nominal_mhz = cell / 1000000; /* convert to MHz */ + if (bootverbose) + device_printf(dev, + "missing 'clock-frequency' property\n"); + } else + sc->sc_nominal_mhz = cell / 1000000; /* convert to MHz */ bus_generic_probe(dev); return (bus_generic_attach(dev)); @@ -214,8 +219,11 @@ ofw_cpu_read_ivar(device_t dev, device_t *result = (uintptr_t)sc->sc_cpu_pcpu; return (0); case CPU_IVAR_NOMINAL_MHZ: - *result = (uintptr_t)sc->sc_nominal_mhz; - return (0); + if (sc->sc_nominal_mhz > 0) { + *result = (uintptr_t)sc->sc_nominal_mhz; + return (0); + } + break; } return (ENOENT); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 11:52:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 980CB4FC; Mon, 19 Jan 2015 11:52:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8485FF17; Mon, 19 Jan 2015 11:52:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JBq9Kf076612; Mon, 19 Jan 2015 11:52:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JBq9rt076611; Mon, 19 Jan 2015 11:52:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501191152.t0JBq9rt076611@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 19 Jan 2015 11:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277380 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 11:52:09 -0000 Author: tuexen Date: Mon Jan 19 11:52:08 2015 New Revision: 277380 URL: https://svnweb.freebsd.org/changeset/base/277380 Log: Code cleanup. Reported by: Coverity CID: 749578 MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Mon Jan 19 11:07:29 2015 (r277379) +++ head/sys/netinet/sctp_timer.c Mon Jan 19 11:52:08 2015 (r277380) @@ -337,7 +337,7 @@ sctp_find_alternate_net(struct sctp_tcb return (NULL); } } - do { + for (;;) { alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { once++; @@ -356,7 +356,6 @@ sctp_find_alternate_net(struct sctp_tcb } alt->src_addr_selected = 0; } - /* sa_ignore NO_NULL_CHK */ if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && (alt->ro.ro_rt != NULL) && (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) { @@ -364,14 +363,14 @@ sctp_find_alternate_net(struct sctp_tcb break; } mnet = alt; - } while (alt != NULL); + } if (alt == NULL) { /* Case where NO insv network exists (dormant state) */ /* we rotate destinations */ once = 0; mnet = net; - do { + for (;;) { if (mnet == NULL) { return (TAILQ_FIRST(&stcb->asoc.nets)); } @@ -382,15 +381,17 @@ sctp_find_alternate_net(struct sctp_tcb break; } alt = TAILQ_FIRST(&stcb->asoc.nets); + if (alt == NULL) { + break; + } } - /* sa_ignore NO_NULL_CHK */ if ((!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && (alt != net)) { /* Found an alternate address */ break; } mnet = alt; - } while (alt != NULL); + } } if (alt == NULL) { return (net); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 15:52:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E1B437A; Mon, 19 Jan 2015 15:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A708F3B; Mon, 19 Jan 2015 15:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JFqXvp093692; Mon, 19 Jan 2015 15:52:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JFqXhj093691; Mon, 19 Jan 2015 15:52:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501191552.t0JFqXhj093691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 19 Jan 2015 15:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277385 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 15:52:33 -0000 Author: mav Date: Mon Jan 19 15:52:32 2015 New Revision: 277385 URL: https://svnweb.freebsd.org/changeset/base/277385 Log: Remove extra mtx_unlock(). Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Jan 19 15:35:19 2015 (r277384) +++ head/sys/cam/cam_xpt.c Mon Jan 19 15:52:32 2015 (r277385) @@ -893,7 +893,6 @@ xpt_init(void *dummy) if ((status = xpt_create_path(&path, NULL, CAM_XPT_PATH_ID, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD)) != CAM_REQ_CMP) { - mtx_unlock(&xsoftc.xpt_lock); printf("xpt_init: xpt_create_path failed with status %#x," " failing attach\n", status); return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:24:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12EC4ED5; Mon, 19 Jan 2015 17:24:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F31EFC44; Mon, 19 Jan 2015 17:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JHOrsL039326; Mon, 19 Jan 2015 17:24:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JHOrro039324; Mon, 19 Jan 2015 17:24:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501191724.t0JHOrro039324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Jan 2015 17:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277390 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 17:24:54 -0000 Author: kib Date: Mon Jan 19 17:24:52 2015 New Revision: 277390 URL: https://svnweb.freebsd.org/changeset/base/277390 Log: Ignore devfs directory entries for devices either being destroyed or delisted. The check is racy. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Mon Jan 19 17:02:30 2015 (r277389) +++ head/sys/fs/devfs/devfs_devs.c Mon Jan 19 17:24:52 2015 (r277390) @@ -192,6 +192,16 @@ devfs_find(struct devfs_dirent *dd, cons continue; if (type != 0 && type != de->de_dirent->d_type) continue; + + /* + * The race with finding non-active name is not + * completely closed by the check, but it is similar + * to the devfs_allocv() in making it unlikely enough. + */ + if (de->de_dirent->d_type == DT_CHR && + (de->de_cdp->cdp_flags & CDP_ACTIVE) == 0) + continue; + if (bcmp(name, de->de_dirent->d_name, namelen) != 0) continue; break; Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Jan 19 17:02:30 2015 (r277389) +++ head/sys/fs/devfs/devfs_vnops.c Mon Jan 19 17:24:52 2015 (r277390) @@ -1045,6 +1045,9 @@ devfs_mknod(struct vop_mknod_args *ap) TAILQ_FOREACH(de, &dd->de_dlist, de_list) { if (cnp->cn_namelen != de->de_dirent->d_namlen) continue; + if (de->de_dirent->d_type == DT_CHR && + (de->de_cdp->cdp_flags & CDP_ACTIVE) == 0) + continue; if (bcmp(cnp->cn_nameptr, de->de_dirent->d_name, de->de_dirent->d_namlen) != 0) continue; From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:36:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7F56403; Mon, 19 Jan 2015 17:36:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4377D79; Mon, 19 Jan 2015 17:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JHar0Q044491; Mon, 19 Jan 2015 17:36:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JHarYf044488; Mon, 19 Jan 2015 17:36:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501191736.t0JHarYf044488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Jan 2015 17:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277391 - in head/sys: fs/devfs kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 17:36:54 -0000 Author: kib Date: Mon Jan 19 17:36:52 2015 New Revision: 277391 URL: https://svnweb.freebsd.org/changeset/base/277391 Log: Stop enforcing additional reference on all cdevs, which was introduced in r277199. Acquire the neccessary reference in delist_dev_locked() and inform destroy_devl() about it using CDP_UNREF_DTR flag. Fix some style nits, add asserts. Discussed with: hselasky Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_int.h head/sys/kern/kern_conf.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Mon Jan 19 17:24:52 2015 (r277390) +++ head/sys/fs/devfs/devfs_devs.c Mon Jan 19 17:36:52 2015 (r277391) @@ -137,12 +137,6 @@ devfs_alloc(int flags) vfs_timestamp(&ts); cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts; cdev->si_cred = NULL; - /* - * Avoid race with dev_rel() by setting the initial - * reference count to 1. This last reference is taken - * by the destroy_dev() function. - */ - cdev->si_refcount = 1; return (cdev); } Modified: head/sys/fs/devfs/devfs_int.h ============================================================================== --- head/sys/fs/devfs/devfs_int.h Mon Jan 19 17:24:52 2015 (r277390) +++ head/sys/fs/devfs/devfs_int.h Mon Jan 19 17:36:52 2015 (r277391) @@ -56,6 +56,7 @@ struct cdev_priv { u_int cdp_flags; #define CDP_ACTIVE (1 << 0) #define CDP_SCHED_DTR (1 << 1) +#define CDP_UNREF_DTR (1 << 2) u_int cdp_inuse; u_int cdp_maxdirent; Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Mon Jan 19 17:24:52 2015 (r277390) +++ head/sys/kern/kern_conf.c Mon Jan 19 17:36:52 2015 (r277391) @@ -116,6 +116,8 @@ dev_free_devlocked(struct cdev *cdev) mtx_assert(&devmtx, MA_OWNED); cdp = cdev2priv(cdev); + KASSERT((cdp->cdp_flags & CDP_UNREF_DTR) == 0, + ("destroy_dev() was not called after delist_dev(%p)", cdev)); TAILQ_INSERT_HEAD(&cdevp_free_list, cdp, cdp_list); } @@ -1035,6 +1037,7 @@ destroy_devl(struct cdev *dev) { struct cdevsw *csw; struct cdev_privdata *p; + struct cdev_priv *cdp; mtx_assert(&devmtx, MA_OWNED); KASSERT(dev->si_flags & SI_NAMED, @@ -1043,7 +1046,18 @@ destroy_devl(struct cdev *dev) ("WARNING: Driver mistake: destroy_dev on eternal %d\n", dev2unit(dev))); - devfs_destroy(dev); + cdp = cdev2priv(dev); + if ((cdp->cdp_flags & CDP_UNREF_DTR) == 0) { + /* + * Avoid race with dev_rel(), e.g. from the populate + * loop. If CDP_UNREF_DTR flag is set, the reference + * to be dropped at the end of destroy_devl() was + * already taken by delist_dev_locked(). + */ + dev_refl(dev); + + devfs_destroy(dev); + } /* Remove name marking */ dev->si_flags &= ~SI_NAMED; @@ -1103,19 +1117,27 @@ destroy_devl(struct cdev *dev) } } dev->si_flags &= ~SI_ALIAS; - dev->si_refcount--; /* Avoid race with dev_rel() */ + cdp->cdp_flags &= ~CDP_UNREF_DTR; + dev->si_refcount--; - if (dev->si_refcount > 0) { + if (dev->si_refcount > 0) LIST_INSERT_HEAD(&dead_cdevsw.d_devs, dev, si_list); - } else { + else dev_free_devlocked(dev); - } } static void delist_dev_locked(struct cdev *dev) { + struct cdev_priv *cdp; struct cdev *child; + + mtx_assert(&devmtx, MA_OWNED); + cdp = cdev2priv(dev); + if ((cdp->cdp_flags & CDP_UNREF_DTR) != 0) + return; + cdp->cdp_flags |= CDP_UNREF_DTR; + dev_refl(dev); devfs_destroy(dev); LIST_FOREACH(child, &dev->si_children, si_siblings) delist_dev_locked(child); @@ -1124,6 +1146,7 @@ delist_dev_locked(struct cdev *dev) void delist_dev(struct cdev *dev) { + dev_lock(); delist_dev_locked(dev); dev_unlock(); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:58:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE763C35; Mon, 19 Jan 2015 17:58:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1572F9A; Mon, 19 Jan 2015 17:58:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JHw2ex054657; Mon, 19 Jan 2015 17:58:02 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JHw2bG054654; Mon, 19 Jan 2015 17:58:02 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501191758.t0JHw2bG054654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 19 Jan 2015 17:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277392 - in head/sys/powerpc: aim powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 17:58:03 -0000 Author: nwhitehorn Date: Mon Jan 19 17:58:01 2015 New Revision: 277392 URL: https://svnweb.freebsd.org/changeset/base/277392 Log: Add some initial infrastructure for relocating the kernel in place. MFC after: 2 months Differential revision: D1554 Modified: head/sys/powerpc/aim/locore64.S head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Mon Jan 19 17:36:52 2015 (r277391) +++ head/sys/powerpc/aim/locore64.S Mon Jan 19 17:58:01 2015 (r277392) @@ -121,13 +121,33 @@ ASENTRY_NOPROF(__start) .align 3 0: nop bl 1f - .llong __tocbase + 0x8000 + .llong __tocbase + 0x8000 - . 1: mflr %r2 - ld %r2,0(%r2) + ld %r1,0(%r2) + add %r2,%r1,%r2 /* Set up the stack pointer */ ld %r1,TOC_REF(tmpstk)(%r2) - addi %r1,%r1,TMPSTKSZ-48 + addi %r1,%r1,TMPSTKSZ-96 + + /* Relocate kernel */ + std %r3,48(%r1) + std %r4,56(%r1) + std %r5,64(%r1) + std %r6,72(%r1) + bl 1f + .llong _DYNAMIC-. +1: mflr %r3 + ld %r4,0(%r3) + add %r3,%r4,%r3 + ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */ + subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */ + bl elf_reloc_self + nop + ld %r3,48(%r1) + ld %r4,56(%r1) + ld %r5,64(%r1) + ld %r6,72(%r1) /* Switch to 64-bit mode */ mfmsr %r9 Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Mon Jan 19 17:36:52 2015 (r277391) +++ head/sys/powerpc/powerpc/elf64_machdep.c Mon Jan 19 17:58:01 2015 (r277392) @@ -119,6 +119,8 @@ SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_AN (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_oinfo); +void elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase); + void elf64_dump_thread(struct thread *td, void *dst, size_t *off) { @@ -198,6 +200,37 @@ elf_reloc_internal(linker_file_t lf, Elf return(0); } +void +elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase) +{ + Elf_Rela *rela = 0, *relalim; + Elf_Addr relasz = 0; + Elf_Addr *where; + + /* + * Extract the rela/relasz values from the dynamic section + */ + for (; dynp->d_tag != DT_NULL; dynp++) { + switch (dynp->d_tag) { + case DT_RELA: + rela = (Elf_Rela *)(relocbase+dynp->d_un.d_ptr); + break; + case DT_RELASZ: + relasz = dynp->d_un.d_val; + break; + } + } + + /* + * Relocate these values + */ + relalim = (Elf_Rela *)((caddr_t)rela + relasz); + for (; rela < relalim; rela++) { + where = (Elf_Addr *)(relocbase + rela->r_offset); + *where = (Elf_Addr)(relocbase + rela->r_addend); + } +} + int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 20:39:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A33A34F8; Mon, 19 Jan 2015 20:39:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E76B650; Mon, 19 Jan 2015 20:39:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JKdpCx033582; Mon, 19 Jan 2015 20:39:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JKdnYG033571; Mon, 19 Jan 2015 20:39:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501192039.t0JKdnYG033571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Jan 2015 20:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277396 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 20:39:51 -0000 Author: hselasky Date: Mon Jan 19 20:39:48 2015 New Revision: 277396 URL: https://svnweb.freebsd.org/changeset/base/277396 Log: Add more functions to the Linux kernel compatibility layer. Add some missing includes which are needed when the header files are not included in a particular order. MFC after: 1 month Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/bitops.h head/sys/ofed/include/linux/cache.h head/sys/ofed/include/linux/dma-mapping.h head/sys/ofed/include/linux/etherdevice.h head/sys/ofed/include/linux/gfp.h head/sys/ofed/include/linux/io.h head/sys/ofed/include/linux/kernel.h head/sys/ofed/include/linux/ktime.h head/sys/ofed/include/linux/slab.h Modified: head/sys/ofed/include/linux/bitops.h ============================================================================== --- head/sys/ofed/include/linux/bitops.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/bitops.h Mon Jan 19 20:39:48 2015 (r277396) @@ -288,9 +288,15 @@ bitmap_empty(unsigned long *addr, int si #define NBLONG (NBBY * sizeof(long)) +#define __set_bit(i, a) \ + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define set_bit(i, a) \ atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) +#define __clear_bit(i, a) \ + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define clear_bit(i, a) \ atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) Modified: head/sys/ofed/include/linux/cache.h ============================================================================== --- head/sys/ofed/include/linux/cache.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/cache.h Mon Jan 19 20:39:48 2015 (r277396) @@ -30,8 +30,7 @@ #ifndef _LINUX_CACHE_H_ #define _LINUX_CACHE_H_ - #define cache_line_size() CACHE_LINE_SIZE - +#define L1_CACHE_BYTES CACHE_LINE_SIZE #endif /* _LINUX_CACHE_H_ */ Modified: head/sys/ofed/include/linux/dma-mapping.h ============================================================================== --- head/sys/ofed/include/linux/dma-mapping.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/dma-mapping.h Mon Jan 19 20:39:48 2015 (r277396) @@ -139,6 +139,14 @@ dma_alloc_coherent(struct device *dev, s *dma_handle = 0; return (mem); } + +static inline void * +dma_zalloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, + gfp_t flag) +{ + + return (dma_alloc_coherent(dev, size, dma_handle, flag | __GFP_ZERO)); +} static inline void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, Modified: head/sys/ofed/include/linux/etherdevice.h ============================================================================== --- head/sys/ofed/include/linux/etherdevice.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/etherdevice.h Mon Jan 19 20:39:48 2015 (r277396) @@ -89,6 +89,9 @@ static inline bool is_valid_ether_addr(c return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); } - +static inline void ether_addr_copy(u8 *dst, const u8 *src) +{ + memcpy(dst, src, 6); +} #endif /* _LINUX_ETHERDEVICE */ Modified: head/sys/ofed/include/linux/gfp.h ============================================================================== --- head/sys/ofed/include/linux/gfp.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/gfp.h Mon Jan 19 20:39:48 2015 (r277396) @@ -30,6 +30,8 @@ #ifndef _LINUX_GFP_H_ #define _LINUX_GFP_H_ +#include +#include #include #include Modified: head/sys/ofed/include/linux/io.h ============================================================================== --- head/sys/ofed/include/linux/io.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/io.h Mon Jan 19 20:39:48 2015 (r277396) @@ -31,6 +31,7 @@ #define _LINUX_IO_H_ #include +#include static inline uint32_t __raw_readl(const volatile void *addr) @@ -89,6 +90,20 @@ writew(uint16_t b, void *addr) *(volatile uint16_t *)addr = b; } +#undef ioread32be +static inline uint32_t +ioread32be(const volatile void *addr) +{ + return be32toh(*(const volatile uint32_t *)addr); +} + +#undef iowrite32be +static inline void +iowrite32be(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = htobe32(v); +} + void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) Modified: head/sys/ofed/include/linux/kernel.h ============================================================================== --- head/sys/ofed/include/linux/kernel.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/kernel.h Mon Jan 19 20:39:48 2015 (r277396) @@ -29,6 +29,8 @@ #ifndef _LINUX_KERNEL_H_ #define _LINUX_KERNEL_H_ +#include +#include #include #include #include @@ -57,6 +59,8 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" +#define BUILD_BUG_ON(x) CTASSERT(x) + #define BUG() panic("BUG") #define BUG_ON(condition) do { if (condition) BUG(); } while(0) #define WARN_ON BUG_ON @@ -84,6 +88,7 @@ #endif #define udelay(t) DELAY(t) +#define usleep_range(min,max) DELAY(min) #ifndef pr_fmt #define pr_fmt(fmt) fmt Modified: head/sys/ofed/include/linux/ktime.h ============================================================================== --- head/sys/ofed/include/linux/ktime.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/ktime.h Mon Jan 19 20:39:48 2015 (r277396) @@ -288,4 +288,13 @@ static inline s64 ktime_to_ns(const ktim #endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ +static inline s64 ktime_get_ns(void) +{ + struct timespec ts; + ktime_t kt; + ktime_get_ts(&ts); + kt = timespec_to_ktime(ts); + return (ktime_to_ns(kt)); +} + #endif /* _LINUX_KTIME_H */ Modified: head/sys/ofed/include/linux/slab.h ============================================================================== --- head/sys/ofed/include/linux/slab.h Mon Jan 19 18:42:10 2015 (r277395) +++ head/sys/ofed/include/linux/slab.h Mon Jan 19 20:39:48 2015 (r277396) @@ -40,6 +40,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) +#define kvmalloc(size) kmalloc((size), 0) #define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) #define kzalloc_node(size, flags, node) kzalloc(size, flags) #define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) @@ -47,6 +48,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kcalloc(n, size, flags) kmalloc((n) * (size), flags | M_ZERO) #define vzalloc(size) kzalloc(size, GFP_KERNEL | __GFP_NOWARN) #define vfree(arg) kfree(arg) +#define kvfree(arg) kfree(arg) #define vmalloc(size) kmalloc(size, GFP_KERNEL) #define vmalloc_node(size, node) kmalloc(size, GFP_KERNEL) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 21:53:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46CAEEF; Mon, 19 Jan 2015 21:53:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 278A1E9F; Mon, 19 Jan 2015 21:53:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0JLr46u071679; Mon, 19 Jan 2015 21:53:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0JLr1Vq071668; Mon, 19 Jan 2015 21:53:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501192153.t0JLr1Vq071668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Jan 2015 21:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277402 - in head/sys: contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/dri... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 21:53:04 -0000 Author: hselasky Date: Mon Jan 19 21:53:00 2015 New Revision: 277402 URL: https://svnweb.freebsd.org/changeset/base/277402 Log: Add missing linuxapi module dependencies and always use the FreeBSD "MODULE_VERSION" macro definition. Remove the redefinition of the "MODULE_VERSION" macro from the Linux kernel compatibility API. MFC after: 1 month Reported by: np@ Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c head/sys/dev/cxgbe/iw_cxgbe/device.c head/sys/ofed/drivers/infiniband/core/device.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/main.c head/sys/ofed/include/linux/module.h Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/contrib/rdma/krping/krping.c Mon Jan 19 21:53:00 2015 (r277402) @@ -60,6 +60,8 @@ extern int krping_debug; MODULE_AUTHOR("Steve Wise"); MODULE_DESCRIPTION("RDMA ping client/server"); MODULE_LICENSE("Dual BSD/GPL"); +MODULE_VERSION(krping, 1); +MODULE_DEPEND(krping, linuxapi, 1, 1, 1); static __inline uint64_t get_cycles(void) Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Mon Jan 19 21:53:00 2015 (r277402) @@ -251,9 +251,6 @@ iwch_mod_unload(void) } #endif /* TCP_OFFLOAD */ -#undef MODULE_VERSION -#include - static int iwch_modevent(module_t mod, int cmd, void *arg) { @@ -299,3 +296,5 @@ MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1); MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1); MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1); MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1); +MODULE_DEPEND(iw_cxgb, linuxapi, 1, 1, 1); + Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/dev/cxgbe/iw_cxgbe/device.c Mon Jan 19 21:53:00 2015 (r277402) @@ -321,8 +321,6 @@ c4iw_mod_unload(void) } #endif -#undef MODULE_VERSION -#include /* * t4_tom won't load on kernels without TCP_OFFLOAD and this module's dependency @@ -366,4 +364,5 @@ MODULE_VERSION(iw_cxgbe, 1); MODULE_DEPEND(iw_cxgbe, t4nex, 1, 1, 1); MODULE_DEPEND(iw_cxgbe, t4_tom, 1, 1, 1); MODULE_DEPEND(iw_cxgbe, ibcore, 1, 1, 1); +MODULE_DEPEND(iw_cxgbe, linuxapi, 1, 1, 1); DECLARE_MODULE(iw_cxgbe, c4iw_mod_data, SI_SUB_EXEC, SI_ORDER_ANY); Modified: head/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/device.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/infiniband/core/device.c Mon Jan 19 21:53:00 2015 (r277402) @@ -754,8 +754,6 @@ static void __exit ib_core_cleanup(void) module_init(ib_core_init); module_exit(ib_core_cleanup); -#undef MODULE_VERSION -#include static int ibcore_evhand(module_t mod, int event, void *arg) { Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Mon Jan 19 21:53:00 2015 (r277402) @@ -67,7 +67,9 @@ MODULE_AUTHOR("Roland Dreier"); MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver"); MODULE_LICENSE("Dual BSD/GPL"); +#ifdef __linux__ MODULE_VERSION(DRV_VERSION); +#endif int mlx4_ib_sm_guid_assign = 1; @@ -2404,8 +2406,6 @@ static void __exit mlx4_ib_cleanup(void) module_init_order(mlx4_ib_init, SI_ORDER_MIDDLE); module_exit(mlx4_ib_cleanup); -#undef MODULE_VERSION -#include static int mlx4ib_evhand(module_t mod, int event, void *arg) { Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Mon Jan 19 21:53:00 2015 (r277402) @@ -47,7 +47,9 @@ MODULE_AUTHOR("Roland Dreier"); MODULE_DESCRIPTION("Mellanox InfiniBand HCA low-level driver"); MODULE_LICENSE("Dual BSD/GPL"); -MODULE_VERSION(DRV_VERSION); +MODULE_VERSION(mthca, 1); +MODULE_DEPEND(mthca, linuxapi, 1, 1, 1); +MODULE_DEPEND(mthca, ibcore, 1, 1, 1); #ifdef CONFIG_INFINIBAND_MTHCA_DEBUG Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Jan 19 21:53:00 2015 (r277402) @@ -1527,8 +1527,6 @@ ipoib_resolvemulti(struct ifnet *ifp, st module_init(ipoib_init_module); module_exit(ipoib_cleanup_module); -#undef MODULE_VERSION -#include static int ipoib_evhand(module_t mod, int event, void *arg) { Modified: head/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_main.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/net/mlx4/en_main.c Mon Jan 19 21:53:00 2015 (r277402) @@ -45,7 +45,9 @@ MODULE_AUTHOR("Liran Liss, Yevgeny Petrilin"); MODULE_DESCRIPTION("Mellanox ConnectX HCA Ethernet driver"); MODULE_LICENSE("Dual BSD/GPL"); +#ifdef __linux__ MODULE_VERSION(DRV_VERSION " ("DRV_RELDATE")"); +#endif static const char mlx4_en_version[] = DRV_NAME ": Mellanox ConnectX HCA Ethernet driver v" @@ -336,8 +338,6 @@ static void __exit mlx4_en_cleanup(void) module_init(mlx4_en_init); module_exit(mlx4_en_cleanup); -#undef MODULE_VERSION -#include static int mlxen_evhand(module_t mod, int event, void *arg) { Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/drivers/net/mlx4/main.c Mon Jan 19 21:53:00 2015 (r277402) @@ -34,10 +34,6 @@ */ #include -/* - * kmod.h must be included before module.h since it includes (indirectly) sys/module.h - * To use the FBSD macro sys/module.h should define MODULE_VERSION before linux/module does. -*/ #include #include #include @@ -3783,7 +3779,6 @@ static void __exit mlx4_cleanup(void) module_init_order(mlx4_init, SI_ORDER_MIDDLE); module_exit(mlx4_cleanup); -#include static int mlx4_evhand(module_t mod, int event, void *arg) { Modified: head/sys/ofed/include/linux/module.h ============================================================================== --- head/sys/ofed/include/linux/module.h Mon Jan 19 21:47:18 2015 (r277401) +++ head/sys/ofed/include/linux/module.h Mon Jan 19 21:53:00 2015 (r277402) @@ -29,6 +29,10 @@ #ifndef _LINUX_MODULE_H_ #define _LINUX_MODULE_H_ +#include +#include +#include + #include #include #include @@ -39,10 +43,6 @@ #define MODULE_DESCRIPTION(name) #define MODULE_LICENSE(name) -#ifndef MODULE_VERSION -#define MODULE_VERSION(name) -#endif - #define THIS_MODULE ((struct module *)0) #define EXPORT_SYMBOL(name) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 21:59:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 776DE3AA; Mon, 19 Jan 2015 21:59:58 +0000 (UTC) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF78EEE0; Mon, 19 Jan 2015 21:59:57 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id x3so282872wes.5; Mon, 19 Jan 2015 13:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OqGUK+HaG2oSiUFc1f6pby1kFA+zeJ4rgWObrk7OoY8=; b=RPQLeANiZNJ0YB96QTiWQ0fb3LLE3Mnr6ohIOkeq5ekGBSZvTob6fdGwy47xNWCsej UEM9DcDSFuFuVK2RgdU4eYstbDZ2fkl+7SlrQ6e5YwSMEB70thSknIXnKPtyWmJqCijH pRtjpUUEbt3f1Es8dS5u3V4uGV0KfacW6CIFT2+BqJbKq5WxLzPhvC9uwrflub4eG33j 6+ZN1vb2nV2g+qgSYdWwg4JksLiiNiRT5y5Ry2dIfJkvHWgehawginaB7YBnvQDJYBMf iu/RPgem0Ye5/ra2pJ5d4U3ZOmKQFNU5ktUQBHZ37vrkP3st7P5q78paGNuUW8pbnwVp OgVg== MIME-Version: 1.0 X-Received: by 10.194.24.103 with SMTP id t7mr38037495wjf.15.1421704796249; Mon, 19 Jan 2015 13:59:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Mon, 19 Jan 2015 13:59:56 -0800 (PST) In-Reply-To: <201501151532.t0FFWV2Y037455@svn.freebsd.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> Date: Mon, 19 Jan 2015 13:59:56 -0800 X-Google-Sender-Auth: LPq4w2lIoMTlWqYEnMnswLzFcmI Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 21:59:58 -0000 Hi, Would you please check what the results of this are with CPU specific callwheels? I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on ixgbe) and with this setup, the per-CPU TCP callwheel stuff is enabled. But all the callwheels are now back on clock(0) and so is the lock contention. :( Thanks, -adrian On 15 January 2015 at 07:32, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Jan 15 15:32:30 2015 > New Revision: 277213 > URL: https://svnweb.freebsd.org/changeset/base/277213 > > Log: > Major callout subsystem cleanup and rewrite: > - Close a migration race where callout_reset() failed to set the > CALLOUT_ACTIVE flag. > - Callout callback functions are now allowed to be protected by > spinlocks. > - Switching the callout CPU number cannot always be done on a > per-callout basis. See the updated timeout(9) manual page for more > information. > - The timeout(9) manual page has been updated to reflect how all the > functions inside the callout API are working. The manual page has > been made function oriented to make it easier to deduce how each of > the functions making up the callout API are working without having > to first read the whole manual page. Group all functions into a > handful of sections which should give a quick top-level overview > when the different functions should be used. > - The CALLOUT_SHAREDLOCK flag and its functionality has been removed > to reduce the complexity in the callout code and to avoid problems > about atomically stopping callouts via callout_stop(). If someone > needs it, it can be re-added. From my quick grep there are no > CALLOUT_SHAREDLOCK clients in the kernel. > - A new callout API function named "callout_drain_async()" has been > added. See the updated timeout(9) manual page for a complete > description. > - Update the callout clients in the "kern/" folder to use the callout > API properly, like cv_timedwait(). Previously there was some custom > sleepqueue code in the callout subsystem, which has been removed, > because we now allow callouts to be protected by spinlocks. This > allows us to tear down the callout like done with regular mutexes, > and a "td_slpmutex" has been added to "struct thread" to atomically > teardown the "td_slpcallout". Further the "TDF_TIMOFAIL" and > "SWT_SLEEPQTIMO" states can now be completely removed. Currently > they are marked as available and will be cleaned up in a follow up > commit. > - Bump the __FreeBSD_version to indicate kernel modules need > recompilation. > - There has been several reports that this patch "seems to squash a > serious bug leading to a callout timeout and panic". > > Kernel build testing: all architectures were built > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D1438 > Sponsored by: Mellanox Technologies > Reviewed by: jhb, adrian, sbruno and emaste > > Modified: > head/share/man/man9/Makefile > head/share/man/man9/timeout.9 > head/sys/kern/init_main.c > head/sys/kern/kern_condvar.c > head/sys/kern/kern_lock.c > head/sys/kern/kern_switch.c > head/sys/kern/kern_synch.c > head/sys/kern/kern_thread.c > head/sys/kern/kern_timeout.c > head/sys/kern/subr_sleepqueue.c > head/sys/ofed/include/linux/completion.h > head/sys/sys/_callout.h > head/sys/sys/callout.h > head/sys/sys/param.h > head/sys/sys/proc.h > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Thu Jan 15 14:47:48 2015 (r277212) > +++ head/share/man/man9/Makefile Thu Jan 15 15:32:30 2015 (r277213) > @@ -1570,6 +1570,7 @@ MLINKS+=timeout.9 callout.9 \ > timeout.9 callout_active.9 \ > timeout.9 callout_deactivate.9 \ > timeout.9 callout_drain.9 \ > + timeout.9 callout_drain_async.9 \ > timeout.9 callout_handle_init.9 \ > timeout.9 callout_init.9 \ > timeout.9 callout_init_mtx.9 \ > > Modified: head/share/man/man9/timeout.9 > ============================================================================== > --- head/share/man/man9/timeout.9 Thu Jan 15 14:47:48 2015 (r277212) > +++ head/share/man/man9/timeout.9 Thu Jan 15 15:32:30 2015 (r277213) > @@ -29,13 +29,14 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 8, 2014 > +.Dd January 14, 2015 > .Dt TIMEOUT 9 > .Os > .Sh NAME > .Nm callout_active , > .Nm callout_deactivate , > .Nm callout_drain , > +.Nm callout_drain_async , > .Nm callout_handle_init , > .Nm callout_init , > .Nm callout_init_mtx , > @@ -63,279 +64,232 @@ > .In sys/systm.h > .Bd -literal > typedef void timeout_t (void *); > +typedef void callout_func_t (void *); > .Ed > -.Ft int > -.Fn callout_active "struct callout *c" > -.Ft void > -.Fn callout_deactivate "struct callout *c" > -.Ft int > -.Fn callout_drain "struct callout *c" > -.Ft void > -.Fn callout_handle_init "struct callout_handle *handle" > -.Bd -literal > -struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); > -.Ed > -.Ft void > -.Fn callout_init "struct callout *c" "int mpsafe" > -.Ft void > -.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" > -.Ft void > -.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" > -.Ft void > -.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" > -.Ft int > -.Fn callout_pending "struct callout *c" > -.Ft int > -.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" > -.Ft int > -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ > -"void *arg" > -.Ft int > -.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ > -"void *arg" "int cpu" > -.Ft int > -.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" > -.Ft int > -.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" > -.Ft int > -.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" > -.Ft int > -.Fn callout_schedule "struct callout *c" "int ticks" > -.Ft int > -.Fn callout_schedule_curcpu "struct callout *c" "int ticks" > -.Ft int > -.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" > -.Ft int > -.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int flags" > -.Ft int > -.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int flags" > -.Ft int > -.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int cpu" "int flags" > -.Ft int > -.Fn callout_stop "struct callout *c" > -.Ft struct callout_handle > -.Fn timeout "timeout_t *func" "void *arg" "int ticks" > -.Ft void > -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" > .Sh DESCRIPTION > The > .Nm callout > API is used to schedule a call to an arbitrary function at a specific > -time in the future. > -Consumers of this API are required to allocate a callout structure > +time in the future in a single-shot fashion. > +Consumers of this API are required to allocate a > .Pq struct callout > -for each pending function invocation. > -This structure stores state about the pending function invocation including > -the function to be called and the time at which the function should be invoked. > -Pending function calls can be cancelled or rescheduled to a different time. > -In addition, > -a callout structure may be reused to schedule a new function call after a > -scheduled call is completed. > -.Pp > -Callouts only provide a single-shot mode. > -If a consumer requires a periodic timer, > -it must explicitly reschedule each function call. > -This is normally done by rescheduling the subsequent call within the called > -function. > +structure for each pending function invocation. > +The > +.Pq struct callout > +structure stores the full state about any pending function call and > +should be drained by a call to > +.Fn callout_drain > +or > +.Fn callout_drain_async > +before freeing. > +.Sh INITIALISATION > +.Ft void > +.Fn callout_handle_init "struct callout_handle *handle" > +This function is deprecated and is used to prepare a > +.Pq struct callout_handle > +structure before it can be used the first time. > +If this function is called on a pending timeout, the pending timeout > +cannot be cancelled and the > +.Fn untimeout > +function will return as if there was no timeout pending. > .Pp > -Callout functions must not sleep. > -They may not acquire sleepable locks, > -wait on condition variables, > -perform blocking allocation requests, > -or invoke any other action that might sleep. > +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > +This macro is deprecated and can be used instead of > +.Fn callout_handle_init > +to assign the default state to the > +.Pq struct callout_handle > +structure when declaring static timeouts. > .Pp > -Each callout structure must be initialized by > -.Fn callout_init , > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -or > -.Fn callout_init_rw > -before it is passed to any of the other callout functions. > -The > -.Fn callout_init > -function initializes a callout structure in > -.Fa c > -that is not associated with a specific lock. > +.Ft void > +.Fn callout_init "struct callout *c" "int mpsafe" > +This function prepares a > +.Pq struct callout > +structure before it can be used. > +This function should not be used when the callout is pending a timeout. > If the > .Fa mpsafe > -argument is zero, > -the callout structure is not considered to be > -.Dq multi-processor safe ; > -and the Giant lock will be acquired before calling the callout function > -and released when the callout function returns. > +argument is non-zero, the callback function will be running unlocked. > +Else the Giant mutex will be locked before calling the callback function. > .Pp > +.Ft void > +.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" > +This function prepares a > +.Pq struct callout > +structure before it can be used. > +This function should not be used when the callout is pending a timeout. > The > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -and > -.Fn callout_init_rw > -functions initialize a callout structure in > -.Fa c > -that is associated with a specific lock. > -The lock is specified by the > -.Fa mtx , > -.Fa rm , > -or > -.Fa rw > -parameter. > -The associated lock must be held while stopping or rescheduling the > -callout. > -The callout subsystem acquires the associated lock before calling the > -callout function and releases it after the function returns. > -If the callout was cancelled while the callout subsystem waited for the > -associated lock, > -the callout function is not called, > -and the associated lock is released. > -This ensures that stopping or rescheduling the callout will abort any > -previously scheduled invocation. > -.Pp > -Only regular mutexes may be used with > -.Fn callout_init_mtx ; > -spin mutexes are not supported. > -A sleepable read-mostly lock > -.Po > -one initialized with the > -.Dv RM_SLEEPABLE > -flag > -.Pc > -may not be used with > -.Fn callout_init_rm . > -Similarly, other sleepable lock types such as > -.Xr sx 9 > -and > -.Xr lockmgr 9 > -cannot be used with callouts because sleeping is not permitted in > -the callout subsystem. > -.Pp > -These > +.Fa mtx > +argument should be non-zero and should specify a pointer to a valid > +spinlock type of mutex or a valid regular non-sleepable mutex which > +the callback subsystem should lock before calling the callback > +function. > +Valid > .Fa flags > -may be specified for > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -or > -.Fn callout_init_rw : > +are: > .Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" > .It Dv CALLOUT_RETURNUNLOCKED > -The callout function will release the associated lock itself, > -so the callout subsystem should not attempt to unlock it > -after the callout function returns. > -.It Dv CALLOUT_SHAREDLOCK > -The lock is only acquired in read mode when running the callout handler. > -This flag is ignored by > -.Fn callout_init_mtx . > +It is assumed that the callout function has released the specified > +mutex before returning. > +Else the callout subsystem will release the specified mutex after the > +callout function has returned. > .El > .Pp > -The function > -.Fn callout_stop > -cancels a callout > -.Fa c > -if it is currently pending. > -If the callout is pending, then > -.Fn callout_stop > -returns a non-zero value. > -If the callout is not set, > -has already been serviced, > -or is currently being serviced, > -then zero will be returned. > -If the callout has an associated lock, > -then that lock must be held when this function is called. > -.Pp > -The function > -.Fn callout_drain > -is identical to > -.Fn callout_stop > -except that it will wait for the callout > -.Fa c > -to complete if it is already in progress. > -This function MUST NOT be called while holding any > -locks on which the callout might block, or deadlock will result. > -Note that if the callout subsystem has already begun processing this > -callout, then the callout function may be invoked before > -.Fn callout_drain > -returns. > -However, the callout subsystem does guarantee that the callout will be > -fully stopped before > -.Fn callout_drain > -returns. > -.Pp > -The > -.Fn callout_reset > -and > -.Fn callout_schedule > -function families schedule a future function invocation for callout > -.Fa c . > -If > -.Fa c > -already has a pending callout, > -it is cancelled before the new invocation is scheduled. > -These functions return a non-zero value if a pending callout was cancelled > -and zero if there was no pending callout. > -If the callout has an associated lock, > -then that lock must be held when any of these functions are called. > +.Ft void > +.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" > +This function is the same like the > +.Fn callout_init_mtx > +function except it accepts a read-mostly type of lock. > +The read-mostly lock must not be initialised with the > +.Dv RM_SLEEPABLE > +flag. > .Pp > -The time at which the callout function will be invoked is determined by > -either the > -.Fa ticks > -argument or the > -.Fa sbt , > -.Fa pr , > -and > -.Fa flags > -arguments. > -When > -.Fa ticks > -is used, > -the callout is scheduled to execute after > +.Ft void > +.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" > +This function is the same like the > +.Fn callout_init_mtx > +function except it accepts a reader-writer type of lock. > +.Sh SCHEDULING CALLOUTS > +.Ft struct callout_handle > +.Fn timeout "timeout_t *func" "void *arg" "int ticks" > +This function is deprecated and schedules a call to the function given by the argument > +.Fa func > +to take place after > .Fa ticks Ns No /hz > seconds. > Non-positive values of > .Fa ticks > are silently converted to the value > .Sq 1 . > -.Pp > The > -.Fa sbt , > -.Fa pr , > -and > -.Fa flags > -arguments provide more control over the scheduled time including > -support for higher resolution times, > -specifying the precision of the scheduled time, > -and setting an absolute deadline instead of a relative timeout. > -The callout is scheduled to execute in a time window which begins at > -the time specified in > +.Fa func > +argument should be a valid pointer to a function that takes a single > +.Fa void * > +argument. > +Upon invocation, the > +.Fa func > +function will receive > +.Fa arg > +as its only argument. > +The Giant lock is locked when the > +.Fa arg > +function is invoked and should not be unlocked by this function. > +The returned value from > +.Fn timeout > +is a > +.Ft struct callout_handle > +structure which can be used in conjunction with the > +.Fn untimeout > +function to request that a scheduled timeout be cancelled. > +As handles are recycled by the system, it is possible, although unlikely, > +that a handle from one invocation of > +.Fn timeout > +may match the handle of another invocation of > +.Fn timeout > +if both calls used the same function pointer and argument, and the first > +timeout is expired or canceled before the second call. > +Please ensure that the function and argument pointers are unique when using this function. > +.Pp > +.Ft int > +.Fn callout_reset "struct callout *c" "int ticks" "callout_func_t *func" "void *arg" > +This function is used to schedule or re-schedule a callout. > +This function at first stops the callout given by the > +.Fa c > +argument, if any. > +Then it will start the callout given by the > +.Fa c > +argument. > +The relative time until the timeout callback happens is given by the > +.Fa ticks > +argument. > +The number of ticks in a second is defined by > +.Dv hz > +and can vary from system to system. > +This function returns a non-zero value if the given callout was pending and > +the callback function was prevented from being called. > +Else a value of zero is returned. > +If a lock is associated with the callout given by the > +.Fa c > +argument and it is exclusivly locked when this function is called this > +function will always ensure that previous callback function, if any, > +is never reached. > +In other words the callout will be atomically restarted. > +Else there is no such guarantee. > +The callback function is given by the > +.Fa func > +argument and its function argument is given by the > +.Fa arg > +argument. > +.Pp > +.Ft int > +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "callout_func_t *func" \ > +"void *arg" > +This function works the same like the > +.Fn callout_reset > +function except the callback function given by the > +.Fa func > +argument will be executed on the same CPU which called this function. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_on "struct callout *c" "int ticks" "callout_func_t *func" \ > +"void *arg" "int cpu" > +This function works the same like the > +.Fn callout_reset > +function except the callback function given by the > +.Fa func > +argument will be executed on the CPU given by the > +.Fa cpu > +argument. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" > +This function works the same like the > +.Fn callout_reset > +function except the relative or absolute time after which the timeout > +callback should happen is given by the > .Fa sbt > -and extends for the amount of time specified in > -.Fa pr . > -If > +argument and extends for the amount of time specified in the > +.Fa pr > +argument. > +This function is used when you need high precision timeouts. > +If the > .Fa sbt > -specifies a time in the past, > +argument specifies a time in the past, > the window is adjusted to start at the current time. > A non-zero value for > .Fa pr > allows the callout subsystem to coalesce callouts scheduled close to each > other into fewer timer interrupts, > reducing processing overhead and power consumption. > -These > +The > .Fa flags > -may be specified to adjust the interpretation of > +argument may be non-zero to adjust the interpretation of the > .Fa sbt > -and > -.Fa pr : > +and the > +.Fa pr > +arguments: > .Bl -tag -width ".Dv C_DIRECT_EXEC" > .It Dv C_ABSOLUTE > Handle the > .Fa sbt > argument as an absolute time since boot. > -By default, > +By default, the > .Fa sbt > -is treated as a relative amount of time, > +argument is treated like a relative amount of time, > similar to > .Fa ticks . > .It Dv C_DIRECT_EXEC > @@ -347,7 +301,7 @@ Callout functions run in this context ma > and should be as small as possible because they run with absolute priority. > .It Fn C_PREL > Specifies relative event time precision as binary logarithm of time interval > -divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. > +divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4 and so on. > Note that the larger of > .Fa pr > or this value is used as the length of the time window. > @@ -360,65 +314,215 @@ Align the timeouts to > calls if possible. > .El > .Pp > -The > -.Fn callout_reset > -functions accept a > +.Ft int > +.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except the callback function given by the > .Fa func > -argument which identifies the function to be called when the time expires. > -It must be a pointer to a function that takes a single > -.Fa void * > +argument will be executed on the same CPU which called this function. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int cpu" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except the callback function given by the > +.Fa func > +argument will be executed on the CPU given by the > +.Fa cpu > argument. > -Upon invocation, > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > .Fa func > -will receive > -.Fa arg > -as its only argument. > -The > -.Fn callout_schedule > -functions reuse the > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_schedule "struct callout *c" "int ticks" > +This function works the same like the > +.Fn callout_reset > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_curcpu "struct callout *c" "int ticks" > +This function works the same like the > +.Fn callout_reset_curcpu > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" > +This function works the same like the > +.Fn callout_reset_on > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt_curcpu > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int cpu" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt_on > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Sh CHECKING THE STATE OF CALLOUTS > +.Ft int > +.Fn callout_pending "struct callout *c" > +This function returns non-zero if the callout pointed to by the > +.Fa c > +argument is pending for callback. > +Else this function returns zero. > +This function returns zero when inside the callout function if the > +callout is not re-scheduled. > +.Pp > +.Ft int > +.Fn callout_active "struct callout *c" > +This function is deprecated and returns non-zero if the callout > +pointed to by the > +.Fa c > +argument was scheduled in the past. > +Else this function returns zero. > +This function also returns zero after the > +.Fn callout_deactivate > +or the > +.Fn callout_stop > +or the > +.Fn callout_drain > +or the > +.Fn callout_drain_async > +function is called on the same callout as given by the > +.Fa c > +argument. > +.Pp > +.Ft void > +.Fn callout_deactivate "struct callout *c" > +This function is deprecated and ensures that subsequent calls to the > +.Fn callout_activate > +function returns zero until the callout is scheduled again. > +.Sh STOPPING CALLOUTS > +.Ft void > +.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" > +This function is deprecated and cancels the timeout associated with the > +.Fa handle > +argument using the function pointed to by the > .Fa func > -and > +argument and having the > .Fa arg > -arguments from the previous callout. > -Note that one of the > -.Fn callout_reset > -functions must always be called to initialize > +arguments to validate the handle. > +If the handle does not correspond to a timeout with > +the function > .Fa func > -and > +taking the argument > .Fa arg > -before one of the > -.Fn callout_schedule > -functions can be used. > +no action is taken. The > +.Fa handle > +must be initialised by a previous call to > +.Fn timeout , > +.Fn callout_handle_init > +or assigned the value of > +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > +before being passed to > +.Fn untimeout . > +The behavior of calling > +.Fn untimeout > +with an uninitialised handle > +is undefined. > .Pp > -The callout subsystem provides a softclock thread for each CPU in the system. > -Callouts are assigned to a single CPU and are executed by the softclock thread > -for that CPU. > -Initially, > -callouts are assigned to CPU 0. > -The > -.Fn callout_reset_on , > -.Fn callout_reset_sbt_on , > -.Fn callout_schedule_on > -and > -.Fn callout_schedule_sbt_on > -functions assign the callout to CPU > -.Fa cpu . > -The > -.Fn callout_reset_curcpu , > -.Fn callout_reset_sbt_curpu , > -.Fn callout_schedule_curcpu > -and > -.Fn callout_schedule_sbt_curcpu > -functions assign the callout to the current CPU. > -The > -.Fn callout_reset , > -.Fn callout_reset_sbt , > -.Fn callout_schedule > -and > -.Fn callout_schedule_sbt > -functions schedule the callout to execute in the softclock thread of the CPU > -to which it is currently assigned. > +.Ft int > +.Fn callout_stop "struct callout *c" > +This function is used to stop a timeout function invocation associated with the callout pointed to by the > +.Fa c > +argument, in a non-blocking fashion. > +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialised. > +This function returns a non-zero value if the given callout was pending and > +the callback function was prevented from being called. > +Else a value of zero is returned. > +If a lock is associated with the callout given by the > +.Fa c > +argument and it is exclusivly locked when this function is called, the > +.Fn callout_stop > +function will always ensure that the callback function is never reached. > +In other words the callout will be atomically stopped. > +Else there is no such guarantee. > +.Sh DRAINING CALLOUTS > +.Ft int > +.Fn callout_drain "struct callout *c" > +This function works the same like the > +.Fn callout_stop > +function except it ensures that all callback functions have returned and there are no more references to the callout pointed to by the > +.Fa c > +argument inside the callout subsystem before it returns. > +Also this function ensures that the lock, if any, associated with the > +callout is no longer being used. > +When this function returns, it is safe to free the callout structure pointed to by the > +.Fa c > +argument. > .Pp > +.Ft int > +.Fn callout_drain_async "struct callout *c" "callout_func_t *fn" "void *arg" > +This function is non-blocking and works the same like the > +.Fn callout_stop > +function except if it returns non-zero it means the callback function pointed to by the > +.Fa fn > +argument will be called back with the > +.Fa arg > +argument when all references to the callout pointed to by the > +.Fa c > +argument are gone. > +If this function returns zero, it is safe to free the callout structure pointed to by the > +.Fa c > +argument right away. > +.Sh CALLOUT FUNCTION RESTRICTIONS > +Callout functions must not sleep. > +They may not acquire sleepable locks, wait on condition variables, > +perform blocking allocation requests, or invoke any other action that > +might sleep. > +.Sh CALLOUT SUBSYSTEM INTERNALS > +The callout subsystem has its own set of spinlocks to protect its internal state. > +The callout subsystem provides a softclock thread for each CPU in the > +system. > +Callouts are assigned to a single CPU and are executed by the > +softclock thread for that CPU. > +Initially, callouts are assigned to CPU 0. > Softclock threads are not pinned to their respective CPUs by default. > The softclock thread for CPU 0 can be pinned to CPU 0 by setting the > .Va kern.pin_default_swi > @@ -427,50 +531,7 @@ Softclock threads for CPUs other than ze > respective CPUs by setting the > .Va kern.pin_pcpu_swi > loader tunable to a non-zero value. > -.Pp > -The macros > -.Fn callout_pending , > -.Fn callout_active > -and > -.Fn callout_deactivate > -provide access to the current state of the callout. > -The > -.Fn callout_pending > -macro checks whether a callout is > -.Em pending ; > -a callout is considered > -.Em pending > -when a timeout has been set but the time has not yet arrived. > -Note that once the timeout time arrives and the callout subsystem > -starts to process this callout, > -.Fn callout_pending > -will return > -.Dv FALSE > -even though the callout function may not have finished > -.Pq or even begun > -executing. > -The > -.Fn callout_active > -macro checks whether a callout is marked as > -.Em active , > -and the > -.Fn callout_deactivate > -macro clears the callout's > -.Em active > -flag. > -The callout subsystem marks a callout as > -.Em active > -when a timeout is set and it clears the > -.Em active > -flag in > -.Fn callout_stop > -and > -.Fn callout_drain , > -but it > -.Em does not > -clear it when a callout expires normally via the execution of the > -callout function. > -.Ss "Avoiding Race Conditions" > +.Sh "AVOIDING RACE CONDITIONS" > The callout subsystem invokes callout functions from its own thread > context. > Without some kind of synchronization, > @@ -487,7 +548,7 @@ synchronization concerns. > The first approach is preferred as it is the simplest: > .Bl -enum -offset indent > .It > -Callouts can be associated with a specific lock when they are initialized > +Callouts can be associated with a specific lock when they are initialised > by > .Fn callout_init_mtx , > .Fn callout_init_rm , > @@ -508,7 +569,7 @@ or > .Fn callout_schedule > functions to provide this safety. > .Pp > -A callout initialized via > +A callout initialised via > .Fn callout_init > with > .Fa mpsafe > @@ -531,9 +592,8 @@ function families > .Pc > indicates whether or not the callout was removed. > If it is known that the callout was set and the callout function has > -not yet executed, then a return value of > -.Dv FALSE > -indicates that the callout function is about to be called. > +not yet executed, then a return value of zero indicates that the > +callout function is about to be called. > For example: > .Bd -literal -offset indent > if (sc->sc_flags & SCFLG_CALLOUT_RUNNING) { > @@ -589,16 +649,14 @@ The callout function should first check > .Em pending > flag and return without action if > .Fn callout_pending > -returns > -.Dv TRUE . > +returns non-zero. > This indicates that the callout was rescheduled using > .Fn callout_reset > just before the callout function was invoked. > If > .Fn callout_active > -returns > -.Dv FALSE > -then the callout function should also return without action. > +returns zero then the callout function should also return without > +action. > This indicates that the callout has been stopped. > Finally, the callout function should call > .Fn callout_deactivate > @@ -668,129 +726,13 @@ a callout should always be drained prior > or releasing the storage for the callout structure. > .Sh LEGACY API > .Bf Sy > -The functions below are a legacy API that will be removed in a future release. > -New code should not use these routines. > -.Ef > -.Pp > -The function > -.Fn timeout > -schedules a call to the function given by the argument > -.Fa func > -to take place after > -.Fa ticks Ns No /hz > -seconds. > -Non-positive values of > -.Fa ticks > -are silently converted to the value > -.Sq 1 . > -.Fa func > -should be a pointer to a function that takes a > -.Fa void * > -argument. > -Upon invocation, > -.Fa func > -will receive > -.Fa arg > -as its only argument. > -The return value from > +The > .Fn timeout > -is a > -.Ft struct callout_handle > -which can be used in conjunction with the > -.Fn untimeout > -function to request that a scheduled timeout be canceled. > -.Pp > -The function > -.Fn callout_handle_init > -can be used to initialize a handle to a state which will cause > -any calls to > -.Fn untimeout > -with that handle to return with no side > -effects. > -.Pp > -Assigning a callout handle the value of > -.Fn CALLOUT_HANDLE_INITIALIZER > -performs the same function as > -.Fn callout_handle_init > -and is provided for use on statically declared or global callout handles. > -.Pp > -The function > -.Fn untimeout > -cancels the timeout associated with > -.Fa handle > -using the > -.Fa func > and > -.Fa arg > -arguments to validate the handle. > -If the handle does not correspond to a timeout with > -the function > -.Fa func > -taking the argument > -.Fa arg > -no action is taken. > -.Fa handle > -must be initialized by a previous call to > -.Fn timeout , > -.Fn callout_handle_init , > -or assigned the value of > -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > -before being passed to > -.Fn untimeout . > -The behavior of calling > .Fn untimeout > -with an uninitialized handle > -is undefined. > -.Pp > -As handles are recycled by the system, it is possible (although unlikely) > -that a handle from one invocation of > -.Fn timeout > -may match the handle of another invocation of > -.Fn timeout > -if both calls used the same function pointer and argument, and the first > -timeout is expired or canceled before the second call. > -The timeout facility offers O(1) running time for > -.Fn timeout > -and > -.Fn untimeout . > -Timeouts are executed from > -.Fn softclock > -with the > -.Va Giant > -lock held. > -Thus they are protected from re-entrancy. > -.Sh RETURN VALUES > -The > -.Fn callout_active > -macro returns the state of a callout's > -.Em active > -flag. > -.Pp > -The > -.Fn callout_pending > -macro returns the state of a callout's > -.Em pending > -flag. > -.Pp > -The > -.Fn callout_reset > -and > -.Fn callout_schedule > -function families return non-zero if the callout was pending before the new > -function invocation was scheduled. > -.Pp > -The > -.Fn callout_stop > -and > -.Fn callout_drain > -functions return non-zero if the callout was still pending when it was > -called or zero otherwise. > -The > -.Fn timeout > -function returns a > -.Ft struct callout_handle > -that can be passed to > -.Fn untimeout . > +functions are a legacy API that will be removed in a future release. > +New code should not use these routines. > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 22:22:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0910480D; Mon, 19 Jan 2015 22:22:36 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6386A1F0; Mon, 19 Jan 2015 22:22:35 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id bs8so19717787wib.0; Mon, 19 Jan 2015 14:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=45UDXa6DzCoX4I9C/z34AOPh4UEKLoHjNm1oU9VtQGM=; b=wg/e16sp2imSStKET/v7qXUwBM1wyvtWeuBXBFQxKhHEAUcXmV3C2l7oHIgESiAbje j8qjrjbPl5sZeX6EI/kd9rg7tWS5tEh3nSbQzTbZjYoxCuDhMWum20J+Jt3HvhXn4tLn 3VG2EG2tIgGxmA35UhCE4l/2ncvT+pstuBrO2ck1G8HH+0kkAc8BQQ7Mhjg9/oyj2BAU KfFZA37JV8cyIk8/lZUvi5rnKxr1VXkKZWAXBwr9U6jVERq4t5UnhRzO+vOkRTnsBho6 O4YiGhUq3O6BcbRkpGOWDLYOBzMTy4T2TyO8/OD+cPFzUUleLGZLqE/E5uJ2FXVBBKpA YypQ== MIME-Version: 1.0 X-Received: by 10.180.80.163 with SMTP id s3mr39162973wix.59.1421706153864; Mon, 19 Jan 2015 14:22:33 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Mon, 19 Jan 2015 14:22:33 -0800 (PST) In-Reply-To: References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> Date: Mon, 19 Jan 2015 14:22:33 -0800 X-Google-Sender-Auth: kfLwCYfQ6429D8Z_TFTJ6h51Zg0 Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 22:22:36 -0000 Yeah, it looks like you set c_cpu to timeout_cpu in _callout_init_locked(), but then you only handle the case of the CPU being changed in certain circumstances. You aren't handling the CPU being initialised when the callout is first added. And, callout_restart_async() calls callout_lock(), which calls CC_LOCK() on the callout CPU, which initially is zero. Then, it never seems to be 'moved' into the correct CPU, even though it's being called with a CPU id. So, if I am reading this all correctly, you aren't really handling multi CPU callwheels at all. ;) In my instance, I'm seeing quite a lot of lock contention between the userland threads, the network RX threads and the clock thread, all contending on a single callout wheel being used for TCP timers. One of the early goals for fixing up the RSS stuff in -HEAD was to make per-CPU (Well, per-RSS-bucket really) TCP timers not contend with the NIC RX processing path, and now it does. :( -adrian On 19 January 2015 at 13:59, Adrian Chadd wrote: > Hi, > > Would you please check what the results of this are with CPU specific > callwheels? > > I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > enabled. But all the callwheels are now back on clock(0) and so is the > lock contention. :( > > Thanks, > > > > -adrian > > > On 15 January 2015 at 07:32, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Thu Jan 15 15:32:30 2015 >> New Revision: 277213 >> URL: https://svnweb.freebsd.org/changeset/base/277213 >> >> Log: >> Major callout subsystem cleanup and rewrite: >> - Close a migration race where callout_reset() failed to set the >> CALLOUT_ACTIVE flag. >> - Callout callback functions are now allowed to be protected by >> spinlocks. >> - Switching the callout CPU number cannot always be done on a >> per-callout basis. See the updated timeout(9) manual page for more >> information. >> - The timeout(9) manual page has been updated to reflect how all the >> functions inside the callout API are working. The manual page has >> been made function oriented to make it easier to deduce how each of >> the functions making up the callout API are working without having >> to first read the whole manual page. Group all functions into a >> handful of sections which should give a quick top-level overview >> when the different functions should be used. >> - The CALLOUT_SHAREDLOCK flag and its functionality has been removed >> to reduce the complexity in the callout code and to avoid problems >> about atomically stopping callouts via callout_stop(). If someone >> needs it, it can be re-added. From my quick grep there are no >> CALLOUT_SHAREDLOCK clients in the kernel. >> - A new callout API function named "callout_drain_async()" has been >> added. See the updated timeout(9) manual page for a complete >> description. >> - Update the callout clients in the "kern/" folder to use the callout >> API properly, like cv_timedwait(). Previously there was some custom >> sleepqueue code in the callout subsystem, which has been removed, >> because we now allow callouts to be protected by spinlocks. This >> allows us to tear down the callout like done with regular mutexes, >> and a "td_slpmutex" has been added to "struct thread" to atomically >> teardown the "td_slpcallout". Further the "TDF_TIMOFAIL" and >> "SWT_SLEEPQTIMO" states can now be completely removed. Currently >> they are marked as available and will be cleaned up in a follow up >> commit. >> - Bump the __FreeBSD_version to indicate kernel modules need >> recompilation. >> - There has been several reports that this patch "seems to squash a >> serious bug leading to a callout timeout and panic". >> >> Kernel build testing: all architectures were built >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D1438 >> Sponsored by: Mellanox Technologies >> Reviewed by: jhb, adrian, sbruno and emaste >> >> Modified: >> head/share/man/man9/Makefile >> head/share/man/man9/timeout.9 >> head/sys/kern/init_main.c >> head/sys/kern/kern_condvar.c >> head/sys/kern/kern_lock.c >> head/sys/kern/kern_switch.c >> head/sys/kern/kern_synch.c >> head/sys/kern/kern_thread.c >> head/sys/kern/kern_timeout.c >> head/sys/kern/subr_sleepqueue.c >> head/sys/ofed/include/linux/completion.h >> head/sys/sys/_callout.h >> head/sys/sys/callout.h >> head/sys/sys/param.h >> head/sys/sys/proc.h >> >> Modified: head/share/man/man9/Makefile >> ============================================================================== >> --- head/share/man/man9/Makefile Thu Jan 15 14:47:48 2015 (r277212) >> +++ head/share/man/man9/Makefile Thu Jan 15 15:32:30 2015 (r277213) >> @@ -1570,6 +1570,7 @@ MLINKS+=timeout.9 callout.9 \ >> timeout.9 callout_active.9 \ >> timeout.9 callout_deactivate.9 \ >> timeout.9 callout_drain.9 \ >> + timeout.9 callout_drain_async.9 \ >> timeout.9 callout_handle_init.9 \ >> timeout.9 callout_init.9 \ >> timeout.9 callout_init_mtx.9 \ >> >> Modified: head/share/man/man9/timeout.9 >> ============================================================================== >> --- head/share/man/man9/timeout.9 Thu Jan 15 14:47:48 2015 (r277212) >> +++ head/share/man/man9/timeout.9 Thu Jan 15 15:32:30 2015 (r277213) >> @@ -29,13 +29,14 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd October 8, 2014 >> +.Dd January 14, 2015 >> .Dt TIMEOUT 9 >> .Os >> .Sh NAME >> .Nm callout_active , >> .Nm callout_deactivate , >> .Nm callout_drain , >> +.Nm callout_drain_async , >> .Nm callout_handle_init , >> .Nm callout_init , >> .Nm callout_init_mtx , >> @@ -63,279 +64,232 @@ >> .In sys/systm.h >> .Bd -literal >> typedef void timeout_t (void *); >> +typedef void callout_func_t (void *); >> .Ed >> -.Ft int >> -.Fn callout_active "struct callout *c" >> -.Ft void >> -.Fn callout_deactivate "struct callout *c" >> -.Ft int >> -.Fn callout_drain "struct callout *c" >> -.Ft void >> -.Fn callout_handle_init "struct callout_handle *handle" >> -.Bd -literal >> -struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); >> -.Ed >> -.Ft void >> -.Fn callout_init "struct callout *c" "int mpsafe" >> -.Ft void >> -.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" >> -.Ft void >> -.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" >> -.Ft void >> -.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" >> -.Ft int >> -.Fn callout_pending "struct callout *c" >> -.Ft int >> -.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" >> -.Ft int >> -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ >> -"void *arg" >> -.Ft int >> -.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ >> -"void *arg" "int cpu" >> -.Ft int >> -.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" >> -.Ft int >> -.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" >> -.Ft int >> -.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" >> -.Ft int >> -.Fn callout_schedule "struct callout *c" "int ticks" >> -.Ft int >> -.Fn callout_schedule_curcpu "struct callout *c" "int ticks" >> -.Ft int >> -.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" >> -.Ft int >> -.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "int flags" >> -.Ft int >> -.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "int flags" >> -.Ft int >> -.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ >> -"sbintime_t pr" "int cpu" "int flags" >> -.Ft int >> -.Fn callout_stop "struct callout *c" >> -.Ft struct callout_handle >> -.Fn timeout "timeout_t *func" "void *arg" "int ticks" >> -.Ft void >> -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" >> .Sh DESCRIPTION >> The >> .Nm callout >> API is used to schedule a call to an arbitrary function at a specific >> -time in the future. >> -Consumers of this API are required to allocate a callout structure >> +time in the future in a single-shot fashion. >> +Consumers of this API are required to allocate a >> .Pq struct callout >> -for each pending function invocation. >> -This structure stores state about the pending function invocation including >> -the function to be called and the time at which the function should be invoked. >> -Pending function calls can be cancelled or rescheduled to a different time. >> -In addition, >> -a callout structure may be reused to schedule a new function call after a >> -scheduled call is completed. >> -.Pp >> -Callouts only provide a single-shot mode. >> -If a consumer requires a periodic timer, >> -it must explicitly reschedule each function call. >> -This is normally done by rescheduling the subsequent call within the called >> -function. >> +structure for each pending function invocation. >> +The >> +.Pq struct callout >> +structure stores the full state about any pending function call and >> +should be drained by a call to >> +.Fn callout_drain >> +or >> +.Fn callout_drain_async >> +before freeing. >> +.Sh INITIALISATION >> +.Ft void >> +.Fn callout_handle_init "struct callout_handle *handle" >> +This function is deprecated and is used to prepare a >> +.Pq struct callout_handle >> +structure before it can be used the first time. >> +If this function is called on a pending timeout, the pending timeout >> +cannot be cancelled and the >> +.Fn untimeout >> +function will return as if there was no timeout pending. >> .Pp >> -Callout functions must not sleep. >> -They may not acquire sleepable locks, >> -wait on condition variables, >> -perform blocking allocation requests, >> -or invoke any other action that might sleep. >> +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" >> +This macro is deprecated and can be used instead of >> +.Fn callout_handle_init >> +to assign the default state to the >> +.Pq struct callout_handle >> +structure when declaring static timeouts. >> .Pp >> -Each callout structure must be initialized by >> -.Fn callout_init , >> -.Fn callout_init_mtx , >> -.Fn callout_init_rm , >> -or >> -.Fn callout_init_rw >> -before it is passed to any of the other callout functions. >> -The >> -.Fn callout_init >> -function initializes a callout structure in >> -.Fa c >> -that is not associated with a specific lock. >> +.Ft void >> +.Fn callout_init "struct callout *c" "int mpsafe" >> +This function prepares a >> +.Pq struct callout >> +structure before it can be used. >> +This function should not be used when the callout is pending a timeout. >> If the >> .Fa mpsafe >> -argument is zero, >> -the callout structure is not considered to be >> -.Dq multi-processor safe ; >> -and the Giant lock will be acquired before calling the callout function >> -and released when the callout function returns. >> +argument is non-zero, the callback function will be running unlocked. >> +Else the Giant mutex will be locked before calling the callback function. >> .Pp >> +.Ft void >> +.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" >> +This function prepares a >> +.Pq struct callout >> +structure before it can be used. >> +This function should not be used when the callout is pending a timeout. >> The >> -.Fn callout_init_mtx , >> -.Fn callout_init_rm , >> -and >> -.Fn callout_init_rw >> -functions initialize a callout structure in >> -.Fa c >> -that is associated with a specific lock. >> -The lock is specified by the >> -.Fa mtx , >> -.Fa rm , >> -or >> -.Fa rw >> -parameter. >> -The associated lock must be held while stopping or rescheduling the >> -callout. >> -The callout subsystem acquires the associated lock before calling the >> -callout function and releases it after the function returns. >> -If the callout was cancelled while the callout subsystem waited for the >> -associated lock, >> -the callout function is not called, >> -and the associated lock is released. >> -This ensures that stopping or rescheduling the callout will abort any >> -previously scheduled invocation. >> -.Pp >> -Only regular mutexes may be used with >> -.Fn callout_init_mtx ; >> -spin mutexes are not supported. >> -A sleepable read-mostly lock >> -.Po >> -one initialized with the >> -.Dv RM_SLEEPABLE >> -flag >> -.Pc >> -may not be used with >> -.Fn callout_init_rm . >> -Similarly, other sleepable lock types such as >> -.Xr sx 9 >> -and >> -.Xr lockmgr 9 >> -cannot be used with callouts because sleeping is not permitted in >> -the callout subsystem. >> -.Pp >> -These >> +.Fa mtx >> +argument should be non-zero and should specify a pointer to a valid >> +spinlock type of mutex or a valid regular non-sleepable mutex which >> +the callback subsystem should lock before calling the callback >> +function. >> +Valid >> .Fa flags >> -may be specified for >> -.Fn callout_init_mtx , >> -.Fn callout_init_rm , >> -or >> -.Fn callout_init_rw : >> +are: >> .Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" >> .It Dv CALLOUT_RETURNUNLOCKED >> -The callout function will release the associated lock itself, >> -so the callout subsystem should not attempt to unlock it >> -after the callout function returns. >> -.It Dv CALLOUT_SHAREDLOCK >> -The lock is only acquired in read mode when running the callout handler. >> -This flag is ignored by >> -.Fn callout_init_mtx . >> +It is assumed that the callout function has released the specified >> +mutex before returning. >> +Else the callout subsystem will release the specified mutex after the >> +callout function has returned. >> .El >> .Pp >> -The function >> -.Fn callout_stop >> -cancels a callout >> -.Fa c >> -if it is currently pending. >> -If the callout is pending, then >> -.Fn callout_stop >> -returns a non-zero value. >> -If the callout is not set, >> -has already been serviced, >> -or is currently being serviced, >> -then zero will be returned. >> -If the callout has an associated lock, >> -then that lock must be held when this function is called. >> -.Pp >> -The function >> -.Fn callout_drain >> -is identical to >> -.Fn callout_stop >> -except that it will wait for the callout >> -.Fa c >> -to complete if it is already in progress. >> -This function MUST NOT be called while holding any >> -locks on which the callout might block, or deadlock will result. >> -Note that if the callout subsystem has already begun processing this >> -callout, then the callout function may be invoked before >> -.Fn callout_drain >> -returns. >> -However, the callout subsystem does guarantee that the callout will be >> -fully stopped before >> -.Fn callout_drain >> -returns. >> -.Pp >> -The >> -.Fn callout_reset >> -and >> -.Fn callout_schedule >> -function families schedule a future function invocation for callout >> -.Fa c . >> -If >> -.Fa c >> -already has a pending callout, >> -it is cancelled before the new invocation is scheduled. >> -These functions return a non-zero value if a pending callout was cancelled >> -and zero if there was no pending callout. >> -If the callout has an associated lock, >> -then that lock must be held when any of these functions are called. >> +.Ft void >> +.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" >> +This function is the same like the >> +.Fn callout_init_mtx >> +function except it accepts a read-mostly type of lock. >> +The read-mostly lock must not be initialised with the >> +.Dv RM_SLEEPABLE >> +flag. >> .Pp >> -The time at which the callout function will be invoked is determined by >> -either the >> -.Fa ticks >> -argument or the >> -.Fa sbt , >> -.Fa pr , >> -and >> -.Fa flags >> -arguments. >> -When >> -.Fa ticks >> -is used, >> -the callout is scheduled to execute after >> +.Ft void >> +.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" >> +This function is the same like the >> +.Fn callout_init_mtx >> +function except it accepts a reader-writer type of lock. >> +.Sh SCHEDULING CALLOUTS >> +.Ft struct callout_handle >> +.Fn timeout "timeout_t *func" "void *arg" "int ticks" >> +This function is deprecated and schedules a call to the function given by the argument >> +.Fa func >> +to take place after >> .Fa ticks Ns No /hz >> seconds. >> Non-positive values of >> .Fa ticks >> are silently converted to the value >> .Sq 1 . >> -.Pp >> The >> -.Fa sbt , >> -.Fa pr , >> -and >> -.Fa flags >> -arguments provide more control over the scheduled time including >> -support for higher resolution times, >> -specifying the precision of the scheduled time, >> -and setting an absolute deadline instead of a relative timeout. >> -The callout is scheduled to execute in a time window which begins at >> -the time specified in >> +.Fa func >> +argument should be a valid pointer to a function that takes a single >> +.Fa void * >> +argument. >> +Upon invocation, the >> +.Fa func >> +function will receive >> +.Fa arg >> +as its only argument. >> +The Giant lock is locked when the >> +.Fa arg >> +function is invoked and should not be unlocked by this function. >> +The returned value from >> +.Fn timeout >> +is a >> +.Ft struct callout_handle >> +structure which can be used in conjunction with the >> +.Fn untimeout >> +function to request that a scheduled timeout be cancelled. >> +As handles are recycled by the system, it is possible, although unlikely, >> +that a handle from one invocation of >> +.Fn timeout >> +may match the handle of another invocation of >> +.Fn timeout >> +if both calls used the same function pointer and argument, and the first >> +timeout is expired or canceled before the second call. >> +Please ensure that the function and argument pointers are unique when using this function. >> +.Pp >> +.Ft int >> +.Fn callout_reset "struct callout *c" "int ticks" "callout_func_t *func" "void *arg" >> +This function is used to schedule or re-schedule a callout. >> +This function at first stops the callout given by the >> +.Fa c >> +argument, if any. >> +Then it will start the callout given by the >> +.Fa c >> +argument. >> +The relative time until the timeout callback happens is given by the >> +.Fa ticks >> +argument. >> +The number of ticks in a second is defined by >> +.Dv hz >> +and can vary from system to system. >> +This function returns a non-zero value if the given callout was pending and >> +the callback function was prevented from being called. >> +Else a value of zero is returned. >> +If a lock is associated with the callout given by the >> +.Fa c >> +argument and it is exclusivly locked when this function is called this >> +function will always ensure that previous callback function, if any, >> +is never reached. >> +In other words the callout will be atomically restarted. >> +Else there is no such guarantee. >> +The callback function is given by the >> +.Fa func >> +argument and its function argument is given by the >> +.Fa arg >> +argument. >> +.Pp >> +.Ft int >> +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "callout_func_t *func" \ >> +"void *arg" >> +This function works the same like the >> +.Fn callout_reset >> +function except the callback function given by the >> +.Fa func >> +argument will be executed on the same CPU which called this function. >> +A change in the CPU selection can happen if the callout has a lock >> +associated with it and is locked when this function is called. >> +A change in the CPU selection cannot happen if this function is >> +re-scheduled inside a callout function. >> +Else the callback function given by the >> +.Fa func >> +argument will be executed on the same CPU like previously done. >> +.Pp >> +.Ft int >> +.Fn callout_reset_on "struct callout *c" "int ticks" "callout_func_t *func" \ >> +"void *arg" "int cpu" >> +This function works the same like the >> +.Fn callout_reset >> +function except the callback function given by the >> +.Fa func >> +argument will be executed on the CPU given by the >> +.Fa cpu >> +argument. >> +A change in the CPU selection can happen if the callout has a lock >> +associated with it and is locked when this function is called. >> +A change in the CPU selection cannot happen if this function is >> +re-scheduled inside a callout function. >> +Else the callback function given by the >> +.Fa func >> +argument will be executed on the same CPU like previously done. >> +.Pp >> +.Ft int >> +.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" >> +This function works the same like the >> +.Fn callout_reset >> +function except the relative or absolute time after which the timeout >> +callback should happen is given by the >> .Fa sbt >> -and extends for the amount of time specified in >> -.Fa pr . >> -If >> +argument and extends for the amount of time specified in the >> +.Fa pr >> +argument. >> +This function is used when you need high precision timeouts. >> +If the >> .Fa sbt >> -specifies a time in the past, >> +argument specifies a time in the past, >> the window is adjusted to start at the current time. >> A non-zero value for >> .Fa pr >> allows the callout subsystem to coalesce callouts scheduled close to each >> other into fewer timer interrupts, >> reducing processing overhead and power consumption. >> -These >> +The >> .Fa flags >> -may be specified to adjust the interpretation of >> +argument may be non-zero to adjust the interpretation of the >> .Fa sbt >> -and >> -.Fa pr : >> +and the >> +.Fa pr >> +arguments: >> .Bl -tag -width ".Dv C_DIRECT_EXEC" >> .It Dv C_ABSOLUTE >> Handle the >> .Fa sbt >> argument as an absolute time since boot. >> -By default, >> +By default, the >> .Fa sbt >> -is treated as a relative amount of time, >> +argument is treated like a relative amount of time, >> similar to >> .Fa ticks . >> .It Dv C_DIRECT_EXEC >> @@ -347,7 +301,7 @@ Callout functions run in this context ma >> and should be as small as possible because they run with absolute priority. >> .It Fn C_PREL >> Specifies relative event time precision as binary logarithm of time interval >> -divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. >> +divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4 and so on. >> Note that the larger of >> .Fa pr >> or this value is used as the length of the time window. >> @@ -360,65 +314,215 @@ Align the timeouts to >> calls if possible. >> .El >> .Pp >> -The >> -.Fn callout_reset >> -functions accept a >> +.Ft int >> +.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" >> +This function works the same like the >> +.Fn callout_reset_sbt >> +function except the callback function given by the >> .Fa func >> -argument which identifies the function to be called when the time expires. >> -It must be a pointer to a function that takes a single >> -.Fa void * >> +argument will be executed on the same CPU which called this function. >> +A change in the CPU selection can happen if the callout has a lock >> +associated with it and is locked when this function is called. >> +A change in the CPU selection cannot happen if this function is >> +re-scheduled inside a callout function. >> +Else the callback function given by the >> +.Fa func >> +argument will be executed on the same CPU like previously done. >> +.Pp >> +.Ft int >> +.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "callout_func_t *func" "void *arg" "int cpu" "int flags" >> +This function works the same like the >> +.Fn callout_reset_sbt >> +function except the callback function given by the >> +.Fa func >> +argument will be executed on the CPU given by the >> +.Fa cpu >> argument. >> -Upon invocation, >> +A change in the CPU selection can happen if the callout has a lock >> +associated with it and is locked when this function is called. >> +A change in the CPU selection cannot happen if this function is >> +re-scheduled inside a callout function. >> +Else the callback function given by the >> .Fa func >> -will receive >> -.Fa arg >> -as its only argument. >> -The >> -.Fn callout_schedule >> -functions reuse the >> +argument will be executed on the same CPU like previously done. >> +.Pp >> +.Ft int >> +.Fn callout_schedule "struct callout *c" "int ticks" >> +This function works the same like the >> +.Fn callout_reset >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Pp >> +.Ft int >> +.Fn callout_schedule_curcpu "struct callout *c" "int ticks" >> +This function works the same like the >> +.Fn callout_reset_curcpu >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Pp >> +.Ft int >> +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" >> +This function works the same like the >> +.Fn callout_reset_on >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Pp >> +.Ft int >> +.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "int flags" >> +This function works the same like the >> +.Fn callout_reset_sbt >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Pp >> +.Ft int >> +.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "int flags" >> +This function works the same like the >> +.Fn callout_reset_sbt_curcpu >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Pp >> +.Ft int >> +.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ >> +"sbintime_t pr" "int cpu" "int flags" >> +This function works the same like the >> +.Fn callout_reset_sbt_on >> +function except it re-uses the callback function and the callback argument >> +already stored in the >> +.Pq struct callout >> +structure. >> +.Sh CHECKING THE STATE OF CALLOUTS >> +.Ft int >> +.Fn callout_pending "struct callout *c" >> +This function returns non-zero if the callout pointed to by the >> +.Fa c >> +argument is pending for callback. >> +Else this function returns zero. >> +This function returns zero when inside the callout function if the >> +callout is not re-scheduled. >> +.Pp >> +.Ft int >> +.Fn callout_active "struct callout *c" >> +This function is deprecated and returns non-zero if the callout >> +pointed to by the >> +.Fa c >> +argument was scheduled in the past. >> +Else this function returns zero. >> +This function also returns zero after the >> +.Fn callout_deactivate >> +or the >> +.Fn callout_stop >> +or the >> +.Fn callout_drain >> +or the >> +.Fn callout_drain_async >> +function is called on the same callout as given by the >> +.Fa c >> +argument. >> +.Pp >> +.Ft void >> +.Fn callout_deactivate "struct callout *c" >> +This function is deprecated and ensures that subsequent calls to the >> +.Fn callout_activate >> +function returns zero until the callout is scheduled again. >> +.Sh STOPPING CALLOUTS >> +.Ft void >> +.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" >> +This function is deprecated and cancels the timeout associated with the >> +.Fa handle >> +argument using the function pointed to by the >> .Fa func >> -and >> +argument and having the >> .Fa arg >> -arguments from the previous callout. >> -Note that one of the >> -.Fn callout_reset >> -functions must always be called to initialize >> +arguments to validate the handle. >> +If the handle does not correspond to a timeout with >> +the function >> .Fa func >> -and >> +taking the argument >> .Fa arg >> -before one of the >> -.Fn callout_schedule >> -functions can be used. >> +no action is taken. The >> +.Fa handle >> +must be initialised by a previous call to >> +.Fn timeout , >> +.Fn callout_handle_init >> +or assigned the value of >> +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" >> +before being passed to >> +.Fn untimeout . >> +The behavior of calling >> +.Fn untimeout >> +with an uninitialised handle >> +is undefined. >> .Pp >> -The callout subsystem provides a softclock thread for each CPU in the system. >> -Callouts are assigned to a single CPU and are executed by the softclock thread >> -for that CPU. >> -Initially, >> -callouts are assigned to CPU 0. >> -The >> -.Fn callout_reset_on , >> -.Fn callout_reset_sbt_on , >> -.Fn callout_schedule_on >> -and >> -.Fn callout_schedule_sbt_on >> -functions assign the callout to CPU >> -.Fa cpu . >> -The >> -.Fn callout_reset_curcpu , >> -.Fn callout_reset_sbt_curpu , >> -.Fn callout_schedule_curcpu >> -and >> -.Fn callout_schedule_sbt_curcpu >> -functions assign the callout to the current CPU. >> -The >> -.Fn callout_reset , >> -.Fn callout_reset_sbt , >> -.Fn callout_schedule >> -and >> -.Fn callout_schedule_sbt >> -functions schedule the callout to execute in the softclock thread of the CPU >> -to which it is currently assigned. >> +.Ft int >> +.Fn callout_stop "struct callout *c" >> +This function is used to stop a timeout function invocation associated with the callout pointed to by the >> +.Fa c >> +argument, in a non-blocking fashion. >> +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialised. >> +This function returns a non-zero value if the given callout was pending and >> +the callback function was prevented from being called. >> +Else a value of zero is returned. >> +If a lock is associated with the callout given by the >> +.Fa c >> +argument and it is exclusivly locked when this function is called, the >> +.Fn callout_stop >> +function will always ensure that the callback function is never reached. >> +In other words the callout will be atomically stopped. >> +Else there is no such guarantee. >> +.Sh DRAINING CALLOUTS >> +.Ft int >> +.Fn callout_drain "struct callout *c" >> +This function works the same like the >> +.Fn callout_stop >> +function except it ensures that all callback functions have returned and there are no more references to the callout pointed to by the >> +.Fa c >> +argument inside the callout subsystem before it returns. >> +Also this function ensures that the lock, if any, associated with the >> +callout is no longer being used. >> +When this function returns, it is safe to free the callout structure pointed to by the >> +.Fa c >> +argument. >> .Pp >> +.Ft int >> +.Fn callout_drain_async "struct callout *c" "callout_func_t *fn" "void *arg" >> +This function is non-blocking and works the same like the >> +.Fn callout_stop >> +function except if it returns non-zero it means the callback function pointed to by the >> +.Fa fn >> +argument will be called back with the >> +.Fa arg >> +argument when all references to the callout pointed to by the >> +.Fa c >> +argument are gone. >> +If this function returns zero, it is safe to free the callout structure pointed to by the >> +.Fa c >> +argument right away. >> +.Sh CALLOUT FUNCTION RESTRICTIONS >> +Callout functions must not sleep. >> +They may not acquire sleepable locks, wait on condition variables, >> +perform blocking allocation requests, or invoke any other action that >> +might sleep. >> +.Sh CALLOUT SUBSYSTEM INTERNALS >> +The callout subsystem has its own set of spinlocks to protect its internal state. >> +The callout subsystem provides a softclock thread for each CPU in the >> +system. >> +Callouts are assigned to a single CPU and are executed by the >> +softclock thread for that CPU. >> +Initially, callouts are assigned to CPU 0. >> Softclock threads are not pinned to their respective CPUs by default. >> The softclock thread for CPU 0 can be pinned to CPU 0 by setting the >> .Va kern.pin_default_swi >> @@ -427,50 +531,7 @@ Softclock threads for CPUs other than ze >> respective CPUs by setting the >> .Va kern.pin_pcpu_swi >> loader tunable to a non-zero value. >> -.Pp >> -The macros >> -.Fn callout_pending , >> -.Fn callout_active >> -and >> -.Fn callout_deactivate >> -provide access to the current state of the callout. >> -The >> -.Fn callout_pending >> -macro checks whether a callout is >> -.Em pending ; >> -a callout is considered >> -.Em pending >> -when a timeout has been set but the time has not yet arrived. >> -Note that once the timeout time arrives and the callout subsystem >> -starts to process this callout, >> -.Fn callout_pending >> -will return >> -.Dv FALSE >> -even though the callout function may not have finished >> -.Pq or even begun >> -executing. >> -The >> -.Fn callout_active >> -macro checks whether a callout is marked as >> -.Em active , >> -and the >> -.Fn callout_deactivate >> -macro clears the callout's >> -.Em active >> -flag. >> -The callout subsystem marks a callout as >> -.Em active >> -when a timeout is set and it clears the >> -.Em active >> -flag in >> -.Fn callout_stop >> -and >> -.Fn callout_drain , >> -but it >> -.Em does not >> -clear it when a callout expires normally via the execution of the >> -callout function. >> -.Ss "Avoiding Race Conditions" >> +.Sh "AVOIDING RACE CONDITIONS" >> The callout subsystem invokes callout functions from its own thread >> context. >> Without some kind of synchronization, >> @@ -487,7 +548,7 @@ synchronization concerns. >> The first approach is preferred as it is the simplest: >> .Bl -enum -offset indent >> .It >> -Callouts can be associated with a specific lock when they are initialized >> +Callouts can be associated with a specific lock when they are initialised >> by >> .Fn callout_init_mtx , >> .Fn callout_init_rm , >> @@ -508,7 +569,7 @@ or >> .Fn callout_schedule >> functions to provide this safety. >> .Pp >> -A callout initialized via >> +A callout initialised via >> .Fn callout_init >> with >> .Fa mpsafe >> @@ -531,9 +592,8 @@ function families >> .Pc >> indicates whether or not the callout was removed. >> If it is known that the callout was set and the callout function has >> -not yet executed, then a return value of >> -.Dv FALSE >> -indicates that the callout function is about to be called. >> +not yet executed, then a return value of zero indicates that the >> +callout function is about to be called. >> For example: >> .Bd -literal -offset indent >> if (sc->sc_flags & SCFLG_CALLOUT_RUNNING) { >> @@ -589,16 +649,14 @@ The callout function should first check >> .Em pending >> flag and return without action if >> .Fn callout_pending >> -returns >> -.Dv TRUE . >> +returns non-zero. >> This indicates that the callout was rescheduled using >> .Fn callout_reset >> just before the callout function was invoked. >> If >> .Fn callout_active >> -returns >> -.Dv FALSE >> -then the callout function should also return without action. >> +returns zero then the callout function should also return without >> +action. >> This indicates that the callout has been stopped. >> Finally, the callout function should call >> .Fn callout_deactivate >> @@ -668,129 +726,13 @@ a callout should always be drained prior >> or releasing the storage for the callout structure. >> .Sh LEGACY API >> .Bf Sy >> -The functions below are a legacy API that will be removed in a future release. >> -New code should not use these routines. >> -.Ef >> -.Pp >> -The function >> -.Fn timeout >> -schedules a call to the function given by the argument >> -.Fa func >> -to take place after >> -.Fa ticks Ns No /hz >> -seconds. >> -Non-positive values of >> -.Fa ticks >> -are silently converted to the value >> -.Sq 1 . >> -.Fa func >> -should be a pointer to a function that takes a >> -.Fa void * >> -argument. >> -Upon invocation, >> -.Fa func >> -will receive >> -.Fa arg >> -as its only argument. >> -The return value from >> +The >> .Fn timeout >> -is a >> -.Ft struct callout_handle >> -which can be used in conjunction with the >> -.Fn untimeout >> -function to request that a scheduled timeout be canceled. >> -.Pp >> -The function >> -.Fn callout_handle_init >> -can be used to initialize a handle to a state which will cause >> -any calls to >> -.Fn untimeout >> -with that handle to return with no side >> -effects. >> -.Pp >> -Assigning a callout handle the value of >> -.Fn CALLOUT_HANDLE_INITIALIZER >> -performs the same function as >> -.Fn callout_handle_init >> -and is provided for use on statically declared or global callout handles. >> -.Pp >> -The function >> -.Fn untimeout >> -cancels the timeout associated with >> -.Fa handle >> -using the >> -.Fa func >> and >> -.Fa arg >> -arguments to validate the handle. >> -If the handle does not correspond to a timeout with >> -the function >> -.Fa func >> -taking the argument >> -.Fa arg >> -no action is taken. >> -.Fa handle >> -must be initialized by a previous call to >> -.Fn timeout , >> -.Fn callout_handle_init , >> -or assigned the value of >> -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" >> -before being passed to >> -.Fn untimeout . >> -The behavior of calling >> .Fn untimeout >> -with an uninitialized handle >> -is undefined. >> -.Pp >> -As handles are recycled by the system, it is possible (although unlikely) >> -that a handle from one invocation of >> -.Fn timeout >> -may match the handle of another invocation of >> -.Fn timeout >> -if both calls used the same function pointer and argument, and the first >> -timeout is expired or canceled before the second call. >> -The timeout facility offers O(1) running time for >> -.Fn timeout >> -and >> -.Fn untimeout . >> -Timeouts are executed from >> -.Fn softclock >> -with the >> -.Va Giant >> -lock held. >> -Thus they are protected from re-entrancy. >> -.Sh RETURN VALUES >> -The >> -.Fn callout_active >> -macro returns the state of a callout's >> -.Em active >> -flag. >> -.Pp >> -The >> -.Fn callout_pending >> -macro returns the state of a callout's >> -.Em pending >> -flag. >> -.Pp >> -The >> -.Fn callout_reset >> -and >> -.Fn callout_schedule >> -function families return non-zero if the callout was pending before the new >> -function invocation was scheduled. >> -.Pp >> -The >> -.Fn callout_stop >> -and >> -.Fn callout_drain >> -functions return non-zero if the callout was still pending when it was >> -called or zero otherwise. >> -The >> -.Fn timeout >> -function returns a >> -.Ft struct callout_handle >> -that can be passed to >> -.Fn untimeout . >> +functions are a legacy API that will be removed in a future release. >> +New code should not use these routines. >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:24:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 253D943F; Tue, 20 Jan 2015 02:24:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1083ED40; Tue, 20 Jan 2015 02:24:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K2O8fM000386; Tue, 20 Jan 2015 02:24:08 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K2O8C0000384; Tue, 20 Jan 2015 02:24:08 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501200224.t0K2O8C0000384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 20 Jan 2015 02:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277405 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 02:24:09 -0000 Author: gonzo Date: Tue Jan 20 02:24:08 2015 New Revision: 277405 URL: https://svnweb.freebsd.org/changeset/base/277405 Log: Properly clear IRQ status in order to fix "Spurious IRQ" message from AINT. This register is not documented in TRM but that's what linux driver does Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Mon Jan 19 22:18:00 2015 (r277404) +++ head/sys/arm/ti/am335x/am335x_lcd.c Tue Jan 20 02:24:08 2015 (r277405) @@ -150,6 +150,7 @@ __FBSDID("$FreeBSD$"); #define IRQ_SYNC_LOST (1 << 2) #define IRQ_RASTER_DONE (1 << 1) #define IRQ_FRAME_DONE (1 << 0) +#define LCD_END_OF_INT_IND 0x68 #define LCD_CLKC_ENABLE 0x6C #define CLKC_ENABLE_DMA (1 << 2) #define CLKC_ENABLE_LDID (1 << 1) @@ -397,6 +398,8 @@ am335x_lcd_intr(void *arg) if (reg & IRQ_ACB) { /* TODO: Handle ACB */ } + + LCD_WRITE4(sc, LCD_END_OF_INT_IND, 0); } static int From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 03:54:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8C5ADE; Tue, 20 Jan 2015 03:54:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 899349CC; Tue, 20 Jan 2015 03:54:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K3sWYA043258; Tue, 20 Jan 2015 03:54:32 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K3sVNJ043252; Tue, 20 Jan 2015 03:54:31 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501200354.t0K3sVNJ043252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Tue, 20 Jan 2015 03:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277406 - in head/sys: kern sys x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 03:54:32 -0000 Author: neel Date: Tue Jan 20 03:54:30 2015 New Revision: 277406 URL: https://svnweb.freebsd.org/changeset/base/277406 Log: Update the vdso timehands only via tc_windup(). Prior to this change CLOCK_MONOTONIC could go backwards when the timecounter hardware was changed via 'sysctl kern.timecounter.hardware'. This happened because the vdso timehands update was missing the special treatment in tc_windup() when changing timecounters. Reviewed by: kib Modified: head/sys/kern/kern_tc.c head/sys/kern/subr_dummy_vdso_tc.c head/sys/sys/vdso.h head/sys/x86/x86/tsc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Tue Jan 20 02:24:08 2015 (r277405) +++ head/sys/kern/kern_tc.c Tue Jan 20 03:54:30 2015 (r277406) @@ -1424,7 +1424,15 @@ sysctl_kern_timecounter_hardware(SYSCTL_ (void)newtc->tc_get_timecount(newtc); timecounter = newtc; - timekeep_push_vdso(); + + /* + * The vdso timehands update is deferred until the next + * 'tc_windup()'. + * + * This is prudent given that 'timekeep_push_vdso()' does not + * use any locking and that it can be called in hard interrupt + * context via 'tc_windup()'. + */ return (0); } return (EINVAL); @@ -1982,7 +1990,6 @@ sysctl_fast_gettime(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); vdso_th_enable = old_vdso_th_enable; - timekeep_push_vdso(); return (0); } SYSCTL_PROC(_kern_timecounter, OID_AUTO, fast_gettime, @@ -2002,7 +2009,7 @@ tc_fill_vdso_timehands(struct vdso_timeh vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; vdso_th->th_boottime = boottimebin; - enabled = cpu_fill_vdso_timehands(vdso_th); + enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); if (!vdso_th_enable) enabled = 0; return (enabled); @@ -2024,7 +2031,7 @@ tc_fill_vdso_timehands32(struct vdso_tim *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; vdso_th32->th_boottime.sec = boottimebin.sec; *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin.frac; - enabled = cpu_fill_vdso_timehands32(vdso_th32); + enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); if (!vdso_th_enable) enabled = 0; return (enabled); Modified: head/sys/kern/subr_dummy_vdso_tc.c ============================================================================== --- head/sys/kern/subr_dummy_vdso_tc.c Tue Jan 20 02:24:08 2015 (r277405) +++ head/sys/kern/subr_dummy_vdso_tc.c Tue Jan 20 03:54:30 2015 (r277406) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) { return (0); @@ -41,7 +41,8 @@ cpu_fill_vdso_timehands(struct vdso_time #ifdef COMPAT_FREEBSD32 uint32_t -cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) +cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) { return (0); Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Tue Jan 20 02:24:08 2015 (r277405) +++ head/sys/sys/vdso.h Tue Jan 20 03:54:30 2015 (r277406) @@ -69,6 +69,8 @@ int __vdso_gettimekeep(struct vdso_timek #ifdef _KERNEL +struct timecounter; + void timekeep_push_vdso(void); uint32_t tc_fill_vdso_timehands(struct vdso_timehands *vdso_th); @@ -81,7 +83,8 @@ uint32_t tc_fill_vdso_timehands(struct v * global sysctl enable override is handled by machine-independed code * after cpu_fill_vdso_timehands() call is made. */ -uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th); +uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); #define VDSO_TH_NUM 4 @@ -110,7 +113,8 @@ struct vdso_timekeep32 { }; uint32_t tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32); -uint32_t cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32); +uint32_t cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); #endif #endif Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Jan 20 02:24:08 2015 (r277405) +++ head/sys/x86/x86/tsc.c Tue Jan 20 03:54:30 2015 (r277406) @@ -720,21 +720,22 @@ tsc_get_timecount_low_mfence(struct time } uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) { - vdso_th->th_x86_shift = (int)(intptr_t)timecounter->tc_priv; + vdso_th->th_x86_shift = (int)(intptr_t)tc->tc_priv; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (timecounter == &tsc_timecounter); + return (tc == &tsc_timecounter); } #ifdef COMPAT_FREEBSD32 uint32_t -cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) +cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) { - vdso_th32->th_x86_shift = (int)(intptr_t)timecounter->tc_priv; + vdso_th32->th_x86_shift = (int)(intptr_t)tc->tc_priv; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); - return (timecounter == &tsc_timecounter); + return (tc == &tsc_timecounter); } #endif From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 04:29:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE9C76BD; Tue, 20 Jan 2015 04:29:39 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89B35CA6; Tue, 20 Jan 2015 04:29:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 681741FE023; Tue, 20 Jan 2015 05:29:35 +0100 (CET) Message-ID: <54BDD9E1.6090505@selasky.org> Date: Tue, 20 Jan 2015 05:30:25 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 04:29:39 -0000 On 01/19/15 22:59, Adrian Chadd wrote: > Hi, > > Would you please check what the results of this are with CPU specific > callwheels? > > I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > enabled. But all the callwheels are now back on clock(0) and so is the > lock contention. :( > > Thanks, > Hi, Like stated in the manual page, callout_reset_curcpu/on() does not work with MPSAFE callouts any more! You need to use callout_init_{mtx,rm,rw} and remove the custom locking inside the callback in the TCP stack to get it working like before! Thank you! --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 04:30:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C647831; Tue, 20 Jan 2015 04:30:41 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2C1D5A; Tue, 20 Jan 2015 04:30:41 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 443FB1FE023; Tue, 20 Jan 2015 05:30:38 +0100 (CET) Message-ID: <54BDDA21.2060100@selasky.org> Date: Tue, 20 Jan 2015 05:31:29 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 04:30:41 -0000 On 01/19/15 23:22, Adrian Chadd wrote: > In my instance, I'm seeing quite a lot of lock contention between the > userland threads, the network RX threads and the clock thread, all > contending on a single callout wheel being used for TCP timers. One of > the early goals for fixing up the RSS stuff in -HEAD was to make > per-CPU (Well, per-RSS-bucket really) TCP timers not contend with the > NIC RX processing path, and now it does.:( man 9 callout --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 05:04:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A646367; Tue, 20 Jan 2015 05:04:33 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 395A474; Tue, 20 Jan 2015 05:04:33 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id fb4so13799553wid.2; Mon, 19 Jan 2015 21:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=czhgGz5403SzAbh15qquXvwwHMNt+DZ4MsP/p3I5GVw=; b=viGf661lOmJF3EE6ilaJAeSpDoaFlcWjtlIzCNdeTC1V6TDQONtnCJ0c53mwzjlHTZ d15L1QQLv+2zJhELtGLk+cjo0B/L1mGcgVkip/Ttdm9Uh7acGLfUyZpf7aankVN2MaQU bewEa2jzKTiw8AH4uVKdn9G85Le6yvEDJ4dSSxeXyVplu/UcvjvLnXpsOQUkqheMklYn bifTRXL8RTiqylJiAgn3/5IaraynGHE8C5HzpO99lOASV5lIFLvcbakgdlCkrH3Sfc9y zZLp7lqpcI3Jb+s0/oG52iYgFkqzFPh3UNT/QfYLN0bEPjbh4qjtlovn14r9dARqAcOg AIbg== MIME-Version: 1.0 X-Received: by 10.180.7.198 with SMTP id l6mr42846795wia.26.1421730271618; Mon, 19 Jan 2015 21:04:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Mon, 19 Jan 2015 21:04:31 -0800 (PST) In-Reply-To: <54BDD9E1.6090505@selasky.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> Date: Mon, 19 Jan 2015 21:04:31 -0800 X-Google-Sender-Auth: No8D9uoRNMe-hDm43Ka3ACuKFV0 Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:04:33 -0000 On 19 January 2015 at 20:30, Hans Petter Selasky wrote: > On 01/19/15 22:59, Adrian Chadd wrote: >> >> Hi, >> >> Would you please check what the results of this are with CPU specific >> callwheels? >> >> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on >> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >> enabled. But all the callwheels are now back on clock(0) and so is the >> lock contention. :( >> >> Thanks, >> > > Hi, > > Like stated in the manual page, callout_reset_curcpu/on() does not work with > MPSAFE callouts any more! Hm! How many places in the kernel did you leave like this? :P I mean, I'm glad to have stuff be forced to be cleaned up, but you didn't even leave a KASSERT or a debug warning that something unsupported is being done. I'm sure I'm not going to be the first person to be caught out like this. > You need to use callout_init_{mtx,rm,rw} and remove the custom locking > inside the callback in the TCP stack to get it working like before! Would you please give me a hand with this? I've sunk a lot of (unpaid, personal) spare time into getting the RSS stuff into shape and now a lot of it just plainly doesn't do anything. :( -adrian From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 05:19:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 381C2B92; Tue, 20 Jan 2015 05:19:27 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E705522E; Tue, 20 Jan 2015 05:19:26 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 77D501FE023; Tue, 20 Jan 2015 06:19:24 +0100 (CET) Message-ID: <54BDE58F.3070909@selasky.org> Date: Tue, 20 Jan 2015 06:20:15 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:19:27 -0000 On 01/20/15 06:04, Adrian Chadd wrote: > On 19 January 2015 at 20:30, Hans Petter Selasky wrote: >> On 01/19/15 22:59, Adrian Chadd wrote: >>> >>> Hi, >>> >>> Would you please check what the results of this are with CPU specific >>> callwheels? >>> >>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on >>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >>> enabled. But all the callwheels are now back on clock(0) and so is the >>> lock contention. :( >>> >>> Thanks, >>> >> >> Hi, >> >> Like stated in the manual page, callout_reset_curcpu/on() does not work with >> MPSAFE callouts any more! > > Hm! > Hi Adrian, > How many places in the kernel did you leave like this? :P :-) > > I mean, I'm glad to have stuff be forced to be cleaned up, but you > didn't even leave a KASSERT or a debug warning that something > unsupported is being done. I'm sure I'm not going to be the first > person to be caught out like this. MPSAFE is still valid and fully useable and can be used with callout_reset_curcpu/on(), but the callout CPU will remain at zero. There is no need for a KASSERT() yet. > >> You need to use callout_init_{mtx,rm,rw} and remove the custom locking >> inside the callback in the TCP stack to get it working like before! > > Would you please give me a hand with this? I've sunk a lot of (unpaid, > personal) spare time into getting the RSS stuff into shape and now a > lot of it just plainly doesn't do anything. :( I'll send you a patch in an hours time from now for 11-current. This should be fairly trivial and then you can test and review it! --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 05:22:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADE01CE4; Tue, 20 Jan 2015 05:22:44 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 520F2304; Tue, 20 Jan 2015 05:22:44 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id l15so11247798wiw.0; Mon, 19 Jan 2015 21:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=EqLmoYzCG7hgRy3y1Rdnst7MlwIYzBzeZB/yf18XSz8=; b=DOBg0I0F2cnuZ1shIyPVWgo9rrySXqSm1H9WRUyDNMTN9olyYqjREfi/B+xEMqSiZg g+wjCf1TuEquepJx5rQpPL4WNtAuNgV/LKjJKvrSc4RdQk3RoXJX78wuBErP2Ccahsjq 7hsX8FUwP745U8lOGbBFE8FztB0QRWW6Ou9QJZn7UFu5ftsMUmdPrV3mo4doTMDmREo0 S/K3BYvcvJA515XxCLP9fnyo24piV2/V5n0GbhlA24vKWXRF6q5XEeHa/0yZD7F5xnyk oKuKBMhsj5eC82iz4YHNaHiO45uiUYBwzB2Jlt/RoSrdCrCtDwL2tjJfFgj8WZykNax8 0bPA== MIME-Version: 1.0 X-Received: by 10.194.108.9 with SMTP id hg9mr66751006wjb.68.1421731362795; Mon, 19 Jan 2015 21:22:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Mon, 19 Jan 2015 21:22:42 -0800 (PST) In-Reply-To: <54BDE58F.3070909@selasky.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <54BDE58F.3070909@selasky.org> Date: Mon, 19 Jan 2015 21:22:42 -0800 X-Google-Sender-Auth: t5EneEEpnWlTRAvgbYf0SIPqb8Y Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:22:44 -0000 On 19 January 2015 at 21:20, Hans Petter Selasky wrote: > On 01/20/15 06:04, Adrian Chadd wrote: >> >> On 19 January 2015 at 20:30, Hans Petter Selasky wrote: >>> >>> On 01/19/15 22:59, Adrian Chadd wrote: >>>> >>>> >>>> Hi, >>>> >>>> Would you please check what the results of this are with CPU specific >>>> callwheels? >>>> >>>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on >>>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >>>> enabled. But all the callwheels are now back on clock(0) and so is the >>>> lock contention. :( >>>> >>>> Thanks, >>>> >>> >>> Hi, >>> >>> Like stated in the manual page, callout_reset_curcpu/on() does not work >>> with >>> MPSAFE callouts any more! >> >> >> Hm! >> > > Hi Adrian, > >> How many places in the kernel did you leave like this? :P > > > :-) > >> >> I mean, I'm glad to have stuff be forced to be cleaned up, but you >> didn't even leave a KASSERT or a debug warning that something >> unsupported is being done. I'm sure I'm not going to be the first >> person to be caught out like this. > > > MPSAFE is still valid and fully useable and can be used with > callout_reset_curcpu/on(), but the callout CPU will remain at zero. > There is no need for a KASSERT() yet. Right, but people won't know that their callout won't be scheduled on the CPU they've asked for and there's no way to get notified of that. So something debug-y may be useful, even to make it easy to track down situations where sometimes it succeeds and sometimes it fails (because well, there's lots of places in the kernel where locking is .. suboptimal.) >> >>> You need to use callout_init_{mtx,rm,rw} and remove the custom locking >>> inside the callback in the TCP stack to get it working like before! >> >> >> Would you please give me a hand with this? I've sunk a lot of (unpaid, >> personal) spare time into getting the RSS stuff into shape and now a >> lot of it just plainly doesn't do anything. :( > > > I'll send you a patch in an hours time from now for 11-current. This should > be fairly trivial and then you can test and review it! Sweet, thanks. I'l test it, but anything that changes the locking to TCP is going to need a more thorough review. The "there be dragons" disclaimer is appropriate. :) -adrian From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 05:28:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29705E76; Tue, 20 Jan 2015 05:28:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F155A328; Tue, 20 Jan 2015 05:28:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K5S39J086700; Tue, 20 Jan 2015 05:28:03 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K5S3kJ086699; Tue, 20 Jan 2015 05:28:03 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501200528.t0K5S3kJ086699@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 20 Jan 2015 05:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277411 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:28:04 -0000 Author: nwhitehorn Date: Tue Jan 20 05:28:03 2015 New Revision: 277411 URL: https://svnweb.freebsd.org/changeset/base/277411 Log: Zero BSS explicitly if not started by loader(8). Add a check for the magic values that ePAPR-compliant loaders (like skiboot) put in the register loader uses for the metadata pointer to avoid confusing them. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Jan 20 05:14:07 2015 (r277410) +++ head/sys/powerpc/aim/machdep.c Tue Jan 20 05:28:03 2015 (r277411) @@ -224,6 +224,10 @@ cpu_startup(void *dummy) } extern vm_offset_t __startkernel, __endkernel; +extern unsigned char __bss_start[]; +extern unsigned char __sbss_start[]; +extern unsigned char __sbss_end[]; +extern unsigned char _end[]; #ifndef __powerpc64__ /* Bits for running on 64-bit systems in 32-bit mode. */ @@ -272,9 +276,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ trap_offset = 0; cacheline_warn = 0; - /* Store boot environment state */ - OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); - /* First guess at start/end kernel positions */ startkernel = __startkernel; endkernel = __endkernel; @@ -289,6 +290,10 @@ powerpc_init(vm_offset_t fdt, vm_offset_ mdp = NULL; #endif + /* Check for ePAPR loader, which puts a magic value into r6 */ + if (mdp == (void *)0x65504150) + mdp = NULL; + /* * Parse metadata if present and fetch parameters. Must be done * before console is inited so cninit gets the right value of @@ -308,8 +313,14 @@ powerpc_init(vm_offset_t fdt, vm_offset_ db_fetch_ksymtab(ksym_start, ksym_end); #endif } + } else { + bzero(__sbss_start, __sbss_end - __sbss_start); + bzero(__bss_start, _end - __bss_start); } + /* Store boot environment state */ + OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); + /* * Init params/tunables that can be overridden by the loader */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 05:44:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03BE81C2; Tue, 20 Jan 2015 05:44:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3D306C5; Tue, 20 Jan 2015 05:44:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K5iLpl095580; Tue, 20 Jan 2015 05:44:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K5iLdf095579; Tue, 20 Jan 2015 05:44:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501200544.t0K5iLdf095579@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 20 Jan 2015 05:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277412 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:44:22 -0000 Author: nwhitehorn Date: Tue Jan 20 05:44:21 2015 New Revision: 277412 URL: https://svnweb.freebsd.org/changeset/base/277412 Log: Remove space in the FDT reservation map from the available memory regions in ofw_mem_regions(). This function is actually MI and should move to dev/ofw at some point in the near future so that ARM and MIPS can use the same code. Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Tue Jan 20 05:28:03 2015 (r277411) +++ head/sys/powerpc/ofw/ofw_machdep.c Tue Jan 20 05:44:21 2015 (r277412) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -211,12 +212,89 @@ parse_ofw_memory(phandle_t node, const c return (sz); } +static int +excise_fdt_reserved(struct mem_region *avail, int asz) +{ + struct { + uint64_t address; + uint64_t size; + } fdtmap[16]; + ssize_t fdtmapsize; + phandle_t chosen; + int i, j, k; + + chosen = OF_finddevice("/chosen"); + fdtmapsize = OF_getprop(chosen, "fdtmemreserv", fdtmap, sizeof(fdtmap)); + + for (j = 0; j < fdtmapsize/sizeof(fdtmap[0]); j++) { + fdtmap[j].address = be64toh(fdtmap[j].address); + fdtmap[j].size = be64toh(fdtmap[j].size); + } + + for (i = 0; i < asz; i++) { + for (j = 0; j < fdtmapsize/sizeof(fdtmap[0]); j++) { + /* + * Case 1: Exclusion region encloses complete + * available entry. Drop it and move on. + */ + if (fdtmap[j].address <= avail[i].mr_start && + fdtmap[j].address + fdtmap[j].size >= + avail[i].mr_start + avail[i].mr_size) { + for (k = i+1; k < asz; k++) + avail[k-1] = avail[k]; + asz--; + i--; /* Repeat some entries */ + continue; + } + + /* + * Case 2: Exclusion region starts in available entry. + * Trim it to where the entry begins and append + * a new available entry with the region after + * the excluded region, if any. + */ + if (fdtmap[j].address >= avail[i].mr_start && + fdtmap[j].address < avail[i].mr_start + + avail[i].mr_size) { + if (fdtmap[j].address + fdtmap[j].size < + avail[i].mr_start + avail[i].mr_size) { + avail[asz].mr_start = + roundup2(fdtmap[j].address + + fdtmap[j].size, PAGE_SIZE); + avail[asz].mr_size = avail[i].mr_start + + avail[i].mr_size - + avail[asz].mr_start; + asz++; + } + + avail[i].mr_size = + rounddown2(fdtmap[j].address, PAGE_MASK) - + avail[i].mr_start; + } + + /* + * Case 3: Exclusion region ends in available entry. + * Move start point to where the exclusion zone ends. + * The case of a contained exclusion zone has already + * been caught in case 2. + */ + if (fdtmap[j].address + fdtmap[j].size >= + avail[i].mr_start && fdtmap[j].address + + fdtmap[j].size < avail[i].mr_start + + avail[i].mr_size) { + avail[i].mr_start = + roundup2(fdtmap[j].address + fdtmap[j].size, PAGE_MASK); + } + } + } + + return (asz); +} + /* * This is called during powerpc_init, before the system is really initialized. * It shall provide the total and the available regions of RAM. - * Both lists must have a zero-size entry as terminator. - * The available regions need not take the kernel into account, but needs - * to provide space for two additional entry beyond the terminating one. + * The available regions need not take the kernel into account. */ void ofw_mem_regions(struct mem_region *memp, int *memsz, @@ -236,7 +314,8 @@ ofw_mem_regions(struct mem_region *memp, phandle = OF_peer(phandle)) { if (OF_getprop(phandle, "name", name, sizeof(name)) <= 0) continue; - if (strncmp(name, "memory", sizeof(name)) != 0) + if (strncmp(name, "memory", sizeof(name)) != 0 && + strncmp(name, "memory@", strlen("memory@")) != 0) continue; res = parse_ofw_memory(phandle, "reg", &memp[msz]); @@ -249,6 +328,10 @@ ofw_mem_regions(struct mem_region *memp, asz += res/sizeof(struct mem_region); } + phandle = OF_finddevice("/chosen"); + if (OF_hasprop(phandle, "fdtmemreserv")) + asz = excise_fdt_reserved(availp, asz); + *memsz = msz; *availsz = asz; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 07:27:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D228E19B; Tue, 20 Jan 2015 07:27:27 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F183DD; Tue, 20 Jan 2015 07:27:27 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6078A1FE023; Tue, 20 Jan 2015 08:27:25 +0100 (CET) Message-ID: <54BE0390.40601@selasky.org> Date: Tue, 20 Jan 2015 08:28:16 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <54BDE58F.3070909@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 07:27:27 -0000 Hi, Have a look here: https://reviews.freebsd.org/D1563 Give me a hand and test and review this patch properly! --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 07:34:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6976457B; Tue, 20 Jan 2015 07:34:15 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 263E81C5; Tue, 20 Jan 2015 07:34:15 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 411AB1FE023; Tue, 20 Jan 2015 08:34:13 +0100 (CET) Message-ID: <54BE0528.2050503@selasky.org> Date: Tue, 20 Jan 2015 08:35:04 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <54BDE58F.3070909@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 07:34:15 -0000 On 01/20/15 06:22, Adrian Chadd wrote: > Sweet, thanks. I'l test it, but anything that changes the locking to > TCP is going to need a more thorough review. The "there be dragons" > disclaimer is appropriate.:) No changes in locking - simply some minor code reordering. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 07:51:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 009CF77A; Tue, 20 Jan 2015 07:51:32 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64933380; Tue, 20 Jan 2015 07:51:32 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0K7pR1u081002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2015 09:51:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0K7pR1u081002 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0K7pQ2G081001; Tue, 20 Jan 2015 09:51:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jan 2015 09:51:26 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150120075126.GA42409@kib.kiev.ua> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BDD9E1.6090505@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 07:51:33 -0000 On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: > On 01/19/15 22:59, Adrian Chadd wrote: > > Hi, > > > > Would you please check what the results of this are with CPU specific > > callwheels? > > > > I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > > ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > > enabled. But all the callwheels are now back on clock(0) and so is the > > lock contention. :( > > > > Thanks, > > > > Hi, > > Like stated in the manual page, callout_reset_curcpu/on() does not work > with MPSAFE callouts any more! I.e. you 'fixed' some undeterminate bugs in callout migration by not doing migration at all anymore. > > You need to use callout_init_{mtx,rm,rw} and remove the custom locking > inside the callback in the TCP stack to get it working like before! No, you need to do this, if you think that whole callout KPI must be rototiled. It is up to the person who modifies the KPI, to ensure that existing code is not broken. As I understand, currently we are back to the one-cpu callouts. Do other people consider this situation acceptable ? From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 07:57:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE7AAA4F; Tue, 20 Jan 2015 07:57:46 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 790DF3D9; Tue, 20 Jan 2015 07:57:45 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 92B601FE023; Tue, 20 Jan 2015 08:57:43 +0100 (CET) Message-ID: <54BE0AAA.4050104@selasky.org> Date: Tue, 20 Jan 2015 08:58:34 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> In-Reply-To: <20150120075126.GA42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 07:57:46 -0000 On 01/20/15 08:51, Konstantin Belousov wrote: > On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: >> On 01/19/15 22:59, Adrian Chadd wrote: >>> Hi, >>> >>> Would you please check what the results of this are with CPU specific >>> callwheels? >>> >>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on >>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >>> enabled. But all the callwheels are now back on clock(0) and so is the >>> lock contention. :( >>> >>> Thanks, >>> >> >> Hi, >> >> Like stated in the manual page, callout_reset_curcpu/on() does not work >> with MPSAFE callouts any more! > I.e. you 'fixed' some undeterminate bugs in callout migration by not > doing migration at all anymore. > >> >> You need to use callout_init_{mtx,rm,rw} and remove the custom locking >> inside the callback in the TCP stack to get it working like before! > > No, you need to do this, if you think that whole callout KPI must be > rototiled. It is up to the person who modifies the KPI, to ensure that > existing code is not broken. > > As I understand, currently we are back to the one-cpu callouts. > Do other people consider this situation acceptable ? > Hi Konstantin, Please read the callout 9 manual page first. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 09:01:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08EFEADE; Tue, 20 Jan 2015 09:01:06 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4D0C0D; Tue, 20 Jan 2015 09:01:05 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0K90xjc096301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2015 11:00:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0K90xjc096301 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0K90v8T096290; Tue, 20 Jan 2015 11:00:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jan 2015 11:00:57 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150120090057.GD42409@kib.kiev.ua> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BE0AAA.4050104@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 09:01:06 -0000 On Tue, Jan 20, 2015 at 08:58:34AM +0100, Hans Petter Selasky wrote: > On 01/20/15 08:51, Konstantin Belousov wrote: > > On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: > >> On 01/19/15 22:59, Adrian Chadd wrote: > >>> Hi, > >>> > >>> Would you please check what the results of this are with CPU specific > >>> callwheels? > >>> > >>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > >>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > >>> enabled. But all the callwheels are now back on clock(0) and so is the > >>> lock contention. :( > >>> > >>> Thanks, > >>> > >> > >> Hi, > >> > >> Like stated in the manual page, callout_reset_curcpu/on() does not work > >> with MPSAFE callouts any more! > > I.e. you 'fixed' some undeterminate bugs in callout migration by not > > doing migration at all anymore. > > > >> > >> You need to use callout_init_{mtx,rm,rw} and remove the custom locking > >> inside the callback in the TCP stack to get it working like before! > > > > No, you need to do this, if you think that whole callout KPI must be > > rototiled. It is up to the person who modifies the KPI, to ensure that > > existing code is not broken. > > > > As I understand, currently we are back to the one-cpu callouts. > > Do other people consider this situation acceptable ? > > > > Hi Konstantin, > > Please read the callout 9 manual page first. Assume I read it. How this changes any of my points above ? """ A change in the CPU selection cannot happen if this function is re-scheduled inside a callout function. Else the callback function given by the func argument will be executed on the same CPU like previously done. """ You cannot do this without fixing consumers. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 09:07:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEA69CC4; Tue, 20 Jan 2015 09:07:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD293CE8; Tue, 20 Jan 2015 09:07:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K97ViZ088132; Tue, 20 Jan 2015 09:07:31 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K97TNV088122; Tue, 20 Jan 2015 09:07:29 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201501200907.t0K97TNV088122@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Tue, 20 Jan 2015 09:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277413 - in head/sys: arm/conf arm/rockchip boot/fdt/dts/arm dev/mmc/host X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 09:07:32 -0000 Author: ganbold Date: Tue Jan 20 09:07:28 2015 New Revision: 277413 URL: https://svnweb.freebsd.org/changeset/base/277413 Log: Enable Synopsys DesignWare Mobile Storage Host Controller driver on Rockchip boards. It currently supports PIO mode and dma mode needs external dma controller to be used. Submitted by: jmcneill Approved by: stas (mentor) Modified: head/sys/arm/conf/RK3188 head/sys/arm/rockchip/files.rk30xx head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts head/sys/boot/fdt/dts/arm/rk3188-radxa.dts head/sys/boot/fdt/dts/arm/rk3188.dtsi head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc.h Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/arm/conf/RK3188 Tue Jan 20 09:07:28 2015 (r277413) @@ -76,8 +76,9 @@ options DIAGNOSTIC options ROOTDEVNAME=\"ufs:/dev/da0s2\" # MMC/SD/SDIO Card slot support -#device mmc # mmc/sd bus -#device mmcsd # mmc/sd flash cards +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device dwmmc # Console and misc device uart Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/arm/rockchip/files.rk30xx Tue Jan 20 09:07:28 2015 (r277413) @@ -19,3 +19,5 @@ arm/rockchip/rk30xx_grf.c standard arm/rockchip/rk30xx_wdog.c standard arm/rockchip/rk30xx_gpio.c optional gpio arm/rockchip/rk30xx_mp.c optional smp + +dev/mmc/host/dwmmc.c optional dwmmc Modified: head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts Tue Jan 20 09:07:28 2015 (r277413) @@ -48,6 +48,10 @@ status = "okay"; }; + mmc@10214000 { + status = "okay"; + }; + }; chosen { Modified: head/sys/boot/fdt/dts/arm/rk3188-radxa.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188-radxa.dts Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/boot/fdt/dts/arm/rk3188-radxa.dts Tue Jan 20 09:07:28 2015 (r277413) @@ -48,6 +48,10 @@ status = "okay"; }; + mmc@10214000 { + status = "okay"; + }; + }; chosen { Modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Jan 20 09:07:28 2015 (r277413) @@ -231,22 +231,26 @@ }; mmc@10214000 { - compatible = "rockchip,rk30xx-mmc"; + compatible = "rockchip,rk2928-dw-mshc"; reg = <0x10214000 0x1000>; interrupts = <55>; #address-cells = <1>; #size-cells = <0>; - clock-frequency = <24000000>; /* TODO: verify freq */ + bus-frequency = <48000000>; /* TODO: verify freq */ + fifo-depth = <0x40>; + num-slots = <1>; status = "disabled"; }; mmc@10218000 { - compatible = "rockchip,rk30xx-mmc"; + compatible = "rockchip,rk2928-dw-mshc"; reg = <0x10218000 0x1000>; interrupts = <56>; #address-cells = <1>; #size-cells = <0>; - clock-frequency = <24000000>; /* TODO: verify freq */ + bus-frequency = <48000000>; /* TODO: verify freq */ + fifo-depth = <0x40>; + num-slots = <1>; status = "disabled"; }; }; Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/dev/mmc/host/dwmmc.c Tue Jan 20 09:07:28 2015 (r277413) @@ -129,6 +129,8 @@ struct dwmmc_softc { uint32_t flags; uint32_t hwtype; uint32_t use_auto_stop; + uint32_t use_pio; + uint32_t pwren_inverted; bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -152,6 +154,8 @@ static void dwmmc_next_operation(struct static int dwmmc_setup_bus(struct dwmmc_softc *, int); static int dma_done(struct dwmmc_softc *, struct mmc_command *); static int dma_stop(struct dwmmc_softc *); +static void pio_read(struct dwmmc_softc *, struct mmc_command *); +static void pio_write(struct dwmmc_softc *, struct mmc_command *); static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -163,6 +167,7 @@ enum { HWTYPE_NONE, HWTYPE_ALTERA, HWTYPE_EXYNOS, + HWTYPE_ROCKCHIP, }; #define HWTYPE_MASK (0x0000ffff) @@ -171,6 +176,7 @@ enum { static struct ofw_compat_data compat_data[] = { {"altr,socfpga-dw-mshc", HWTYPE_ALTERA}, {"samsung,exynos5420-dw-mshc", HWTYPE_EXYNOS}, + {"rockchip,rk2928-dw-mshc", HWTYPE_ROCKCHIP}, {NULL, HWTYPE_NONE}, }; @@ -395,8 +401,10 @@ dwmmc_intr(void *arg) dprintf("data err 0x%08x cmd 0x%08x\n", reg, cmd->opcode); cmd->error = MMC_ERR_FAILED; - dma_done(sc, cmd); - dma_stop(sc); + if (!sc->use_pio) { + dma_done(sc, cmd); + dma_stop(sc); + } } if (reg & SDMMC_INTMASK_CMD_DONE) { @@ -421,15 +429,24 @@ dwmmc_intr(void *arg) } } - /* Now handle DMA interrupts */ - reg = READ4(sc, SDMMC_IDSTS); - if (reg) { - dprintf("dma intr 0x%08x\n", reg); - if (reg & (SDMMC_IDINTEN_TI | SDMMC_IDINTEN_RI)) { - WRITE4(sc, SDMMC_IDSTS, (SDMMC_IDINTEN_TI | - SDMMC_IDINTEN_RI)); - WRITE4(sc, SDMMC_IDSTS, SDMMC_IDINTEN_NI); - dma_done(sc, cmd); + if (sc->use_pio) { + if (reg & (SDMMC_INTMASK_RXDR|SDMMC_INTMASK_DTO)) { + pio_read(sc, cmd); + } + if (reg & (SDMMC_INTMASK_TXDR|SDMMC_INTMASK_DTO)) { + pio_write(sc, cmd); + } + } else { + /* Now handle DMA interrupts */ + reg = READ4(sc, SDMMC_IDSTS); + if (reg) { + dprintf("dma intr 0x%08x\n", reg); + if (reg & (SDMMC_IDINTEN_TI | SDMMC_IDINTEN_RI)) { + WRITE4(sc, SDMMC_IDSTS, (SDMMC_IDINTEN_TI | + SDMMC_IDINTEN_RI)); + WRITE4(sc, SDMMC_IDSTS, SDMMC_IDINTEN_NI); + dma_done(sc, cmd); + } } } @@ -560,17 +577,29 @@ dwmmc_attach(device_t dev) device_printf(dev, "Hardware version ID is %04x\n", READ4(sc, SDMMC_VERID) & 0xffff); - WRITE4(sc, EMMCP_MPSBEGIN0, 0); - WRITE4(sc, EMMCP_SEND0, 0); - WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT | - MPSCTRL_SECURE_WRITE_BIT | - MPSCTRL_NON_SECURE_READ_BIT | - MPSCTRL_NON_SECURE_WRITE_BIT | - MPSCTRL_VALID)); + sc->use_pio = 0; + sc->pwren_inverted = 0; + + if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { + sc->use_pio = 1; + sc->pwren_inverted = 1; + } else { + WRITE4(sc, EMMCP_MPSBEGIN0, 0); + WRITE4(sc, EMMCP_SEND0, 0); + WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT | + MPSCTRL_SECURE_WRITE_BIT | + MPSCTRL_NON_SECURE_READ_BIT | + MPSCTRL_NON_SECURE_WRITE_BIT | + MPSCTRL_VALID)); + } /* XXX: we support operation for slot index 0 only */ slot = 0; - WRITE4(sc, SDMMC_PWREN, (1 << slot)); + if (sc->pwren_inverted) { + WRITE4(sc, SDMMC_PWREN, (0 << slot)); + } else { + WRITE4(sc, SDMMC_PWREN, (1 << slot)); + } /* Reset all */ if (dwmmc_ctrl_reset(sc, (SDMMC_CTRL_RESET | @@ -580,17 +609,19 @@ dwmmc_attach(device_t dev) dwmmc_setup_bus(sc, sc->host.f_min); - if (dma_setup(sc)) - return (ENXIO); - - /* Install desc base */ - WRITE4(sc, SDMMC_DBADDR, sc->desc_ring_paddr); - - /* Enable DMA interrupts */ - WRITE4(sc, SDMMC_IDSTS, SDMMC_IDINTEN_MASK); - WRITE4(sc, SDMMC_IDINTEN, (SDMMC_IDINTEN_NI | - SDMMC_IDINTEN_RI | - SDMMC_IDINTEN_TI)); + if (!sc->use_pio) { + if (dma_setup(sc)) + return (ENXIO); + + /* Install desc base */ + WRITE4(sc, SDMMC_DBADDR, sc->desc_ring_paddr); + + /* Enable DMA interrupts */ + WRITE4(sc, SDMMC_IDSTS, SDMMC_IDINTEN_MASK); + WRITE4(sc, SDMMC_IDINTEN, (SDMMC_IDINTEN_NI | + SDMMC_IDINTEN_RI | + SDMMC_IDINTEN_TI)); + } /* Clear and disable interrups for a while */ WRITE4(sc, SDMMC_RINTSTS, 0xffffffff); @@ -797,6 +828,79 @@ dma_prepare(struct dwmmc_softc *sc, stru return (0); } +static int +pio_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) +{ + struct mmc_data *data; + int reg; + + data = cmd->data; + data->xfer_len = 0; + + reg = (DEF_MSIZE << SDMMC_FIFOTH_MSIZE_S); + reg |= ((sc->fifo_depth / 2) - 1) << SDMMC_FIFOTH_RXWMARK_S; + reg |= (sc->fifo_depth / 2) << SDMMC_FIFOTH_TXWMARK_S; + + WRITE4(sc, SDMMC_FIFOTH, reg); + wmb(); + + return (0); +} + +static void +pio_read(struct dwmmc_softc *sc, struct mmc_command *cmd) +{ + struct mmc_data *data; + uint32_t *p, status; + + if (cmd == NULL || cmd->data == NULL) + return; + + data = cmd->data; + if ((data->flags & MMC_DATA_READ) == 0) + return; + + KASSERT((data->xfer_len & 3) == 0, ("xfer_len not aligned")); + p = (uint32_t *)data->data + (data->xfer_len >> 2); + + while (data->xfer_len < data->len) { + status = READ4(sc, SDMMC_STATUS); + if (status & SDMMC_STATUS_FIFO_EMPTY) + break; + *p++ = READ4(sc, SDMMC_DATA); + data->xfer_len += 4; + } + + WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_RXDR); +} + +static void +pio_write(struct dwmmc_softc *sc, struct mmc_command *cmd) +{ + struct mmc_data *data; + uint32_t *p, status; + + if (cmd == NULL || cmd->data == NULL) + return; + + data = cmd->data; + if ((data->flags & MMC_DATA_WRITE) == 0) + return; + + KASSERT((data->xfer_len & 3) == 0, ("xfer_len not aligned")); + p = (uint32_t *)data->data + (data->xfer_len >> 2); + + while (data->xfer_len < data->len) { + status = READ4(sc, SDMMC_STATUS); + if (status & SDMMC_STATUS_FIFO_FULL) + break; + WRITE4(sc, SDMMC_DATA, *p++); + data->xfer_len += 4; + } + + WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_TXDR); +} + static void dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_command *cmd) { @@ -807,6 +911,9 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, sc->curcmd = cmd; data = cmd->data; + if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) + dwmmc_setup_bus(sc, sc->host.ios.clock); + /* XXX Upper layers don't always set this */ cmd->mrq = sc->req; @@ -861,7 +968,11 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, data->len : MMC_SECTOR_SIZE; WRITE4(sc, SDMMC_BLKSIZ, blksz); - dma_prepare(sc, cmd); + if (sc->use_pio) { + pio_prepare(sc, cmd); + } else { + dma_prepare(sc, cmd); + } wmb(); } Modified: head/sys/dev/mmc/host/dwmmc.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc.h Tue Jan 20 05:44:21 2015 (r277412) +++ head/sys/dev/mmc/host/dwmmc.h Tue Jan 20 09:07:28 2015 (r277413) @@ -91,6 +91,8 @@ #define SDMMC_RINTSTS 0x44 /* Raw Interrupt Status Register */ #define SDMMC_STATUS 0x48 /* Status Register */ #define SDMMC_STATUS_DATA_BUSY (1 << 9) /* card_data[0] */ +#define SDMMC_STATUS_FIFO_FULL (1 << 3) /* FIFO full */ +#define SDMMC_STATUS_FIFO_EMPTY (1 << 2) /* FIFO empty */ #define SDMMC_FIFOTH 0x4C /* FIFO Threshold Watermark Register */ #define SDMMC_FIFOTH_MSIZE_S 28 /* Burst size of multiple transaction */ #define SDMMC_FIFOTH_RXWMARK_S 16 /* FIFO threshold watermark level */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 09:37:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B73741FA; Tue, 20 Jan 2015 09:37:05 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6BEFD9; Tue, 20 Jan 2015 09:37:04 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 494321FE023; Tue, 20 Jan 2015 10:37:01 +0100 (CET) Message-ID: <54BE21F0.6010602@selasky.org> Date: Tue, 20 Jan 2015 10:37:52 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> In-Reply-To: <20150120090057.GD42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 09:37:05 -0000 On 01/20/15 10:00, Konstantin Belousov wrote: > On Tue, Jan 20, 2015 at 08:58:34AM +0100, Hans Petter Selasky wrote: >> On 01/20/15 08:51, Konstantin Belousov wrote: >>> On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: >>>> On 01/19/15 22:59, Adrian Chadd wrote: >>>>> Hi, >>>>> >>>>> Would you please check what the results of this are with CPU specific >>>>> callwheels? >>>>> >>>>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on >>>>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >>>>> enabled. But all the callwheels are now back on clock(0) and so is the >>>>> lock contention. :( >>>>> >>>>> Thanks, >>>>> >>>> >>>> Hi, >>>> >>>> Like stated in the manual page, callout_reset_curcpu/on() does not work >>>> with MPSAFE callouts any more! >>> I.e. you 'fixed' some undeterminate bugs in callout migration by not >>> doing migration at all anymore. >>> >>>> >>>> You need to use callout_init_{mtx,rm,rw} and remove the custom locking >>>> inside the callback in the TCP stack to get it working like before! >>> >>> No, you need to do this, if you think that whole callout KPI must be >>> rototiled. It is up to the person who modifies the KPI, to ensure that >>> existing code is not broken. Hi, It is not very hard to update existing callout clients and you can do it too, if you need the extra bits of performance. Are there more API's than the TCP stack which you think needs an update and are performance critical? >>> >>> As I understand, currently we are back to the one-cpu callouts. >>> Do other people consider this situation acceptable ? For the TCP stack - yes, but not for other clients like cv_timedwait() and such. If you think you have a better way to solve the callout problems, please tell me! In order for a callout to change its CPU you need a lock to protect which CPU the callout is on. Instead of introducing a third lock in the callout path, which will be a congestion point, to protect against changing the CPU number, I decided that we will use the client's mutex and the MPSAFE implies the client doesn't have any mutex. So it won't work with callout clients which use the CALLOUT_MPSAFE flag. Honestly CALLOUT_MPSAFE should not be used, because it leads to extra complexity in the clients catching the race when tearing down the callouts and any pending callbacks. >> >> Please read the callout 9 manual page first. > > Assume I read it. How this changes any of my points above ? > """ > A change in the CPU selection cannot happen if this function is > re-scheduled inside a callout function. Else the callback function given > by the func argument will be executed on the same CPU like previously > done. > """ > You cannot do this without fixing consumers. > The code simply needs an update. It is not broken in any ways - right? If it is not broken, fixing it is not that urgent. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:10:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F987E1; Tue, 20 Jan 2015 11:10:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87648D07; Tue, 20 Jan 2015 11:10:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KBAQtZ047011; Tue, 20 Jan 2015 11:10:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KBAPaY047005; Tue, 20 Jan 2015 11:10:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <201501201110.t0KBAPaY047005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 20 Jan 2015 11:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277414 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 11:10:26 -0000 Author: br Date: Tue Jan 20 11:10:25 2015 New Revision: 277414 URL: https://svnweb.freebsd.org/changeset/base/277414 Log: Add 128-byte cache flushing routines. Leave CNMIPS untouched as these functions depends on config2 register. Modified: head/sys/mips/include/cache_mipsNN.h head/sys/mips/mips/cache.c head/sys/mips/mips/cache_mipsNN.c Modified: head/sys/mips/include/cache_mipsNN.h ============================================================================== --- head/sys/mips/include/cache_mipsNN.h Tue Jan 20 09:07:28 2015 (r277413) +++ head/sys/mips/include/cache_mipsNN.h Tue Jan 20 11:10:25 2015 (r277414) @@ -57,7 +57,6 @@ void mipsNN_pdcache_inv_range_16(vm_offs void mipsNN_pdcache_inv_range_32(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_16(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_32(vm_offset_t, vm_size_t); -#ifdef CPU_CNMIPS void mipsNN_icache_sync_all_128(void); void mipsNN_icache_sync_range_128(vm_offset_t, vm_size_t); void mipsNN_icache_sync_range_index_128(vm_offset_t, vm_size_t); @@ -66,7 +65,6 @@ void mipsNN_pdcache_wbinv_range_128(vm_o void mipsNN_pdcache_wbinv_range_index_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_128(vm_offset_t, vm_size_t); -#endif void mipsNN_sdcache_wbinv_all_32(void); void mipsNN_sdcache_wbinv_range_32(vm_offset_t, vm_size_t); void mipsNN_sdcache_wbinv_range_index_32(vm_offset_t, vm_size_t); Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Tue Jan 20 09:07:28 2015 (r277413) +++ head/sys/mips/mips/cache.c Tue Jan 20 11:10:25 2015 (r277414) @@ -104,7 +104,6 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_icache_sync_range_index = mipsNN_icache_sync_range_index_32; break; -#ifdef CPU_CNMIPS case 128: mips_cache_ops.mco_icache_sync_all = mipsNN_icache_sync_all_128; mips_cache_ops.mco_icache_sync_range = @@ -112,7 +111,6 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_icache_sync_range_index = mipsNN_icache_sync_range_index_128; break; -#endif #ifdef MIPS_DISABLE_L1_CACHE case 0: @@ -172,7 +170,6 @@ mips_config_cache(struct mips_cpuinfo * mipsNN_pdcache_wb_range_32; #endif break; -#ifdef CPU_CNMIPS case 128: mips_cache_ops.mco_pdcache_wbinv_all = mips_cache_ops.mco_intern_pdcache_wbinv_all = @@ -188,7 +185,6 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_intern_pdcache_wb_range = mipsNN_pdcache_wb_range_128; break; -#endif #ifdef MIPS_DISABLE_L1_CACHE case 0: mips_cache_ops.mco_pdcache_wbinv_all = Modified: head/sys/mips/mips/cache_mipsNN.c ============================================================================== --- head/sys/mips/mips/cache_mipsNN.c Tue Jan 20 09:07:28 2015 (r277413) +++ head/sys/mips/mips/cache_mipsNN.c Tue Jan 20 11:10:25 2015 (r277414) @@ -647,6 +647,225 @@ mipsNN_pdcache_wb_range_128(vm_offset_t SYNC; } +#else + +void +mipsNN_icache_sync_all_128(void) +{ + vm_offset_t va, eva; + + va = MIPS_PHYS_TO_KSEG0(0); + eva = va + picache_size; + + /* + * Since we're hitting the whole thing, we don't have to + * worry about the N different "ways". + */ + + mips_intern_dcache_wbinv_all(); + + while (va < eva) { + cache_r4k_op_32lines_128(va, CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += (32 * 128); + } + + SYNC; +} + +void +mipsNN_icache_sync_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line128(va + size); + va = trunc_line128(va); + + mips_intern_dcache_wb_range(va, (eva - va)); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, CACHE_R4K_I|CACHEOP_R4K_HIT_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_I|CACHEOP_R4K_HIT_INV); + va += 128; + } + + SYNC; +} + +void +mipsNN_icache_sync_range_index_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva, tmpva; + int i, stride, loopcount; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & picache_way_mask); + + eva = round_line128(va + size); + va = trunc_line128(va); + + /* + * GCC generates better code in the loops if we reference local + * copies of these global variables. + */ + stride = picache_stride; + loopcount = picache_loopcount; + + mips_intern_dcache_wbinv_range_index(va, (eva - va)); + + while ((eva - va) >= (32 * 128)) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_r4k_op_32lines_128(tmpva, + CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += 32 * 128; + } + + while (va < eva) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_op_r4k_line(tmpva, + CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += 128; + } +} + +void +mipsNN_pdcache_wbinv_all_128(void) +{ + vm_offset_t va, eva; + + va = MIPS_PHYS_TO_KSEG0(0); + eva = va + pdcache_size; + + /* + * Since we're hitting the whole thing, we don't have to + * worry about the N different "ways". + */ + + while (va < eva) { + cache_r4k_op_32lines_128(va, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 128); + } + + SYNC; +} + + +void +mipsNN_pdcache_wbinv_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line128(va + size); + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, + CACHE_R4K_D|CACHEOP_R4K_HIT_WB_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB_INV); + va += 128; + } + + SYNC; +} + +void +mipsNN_pdcache_wbinv_range_index_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva, tmpva; + int i, stride, loopcount; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & pdcache_way_mask); + + eva = round_line128(va + size); + va = trunc_line128(va); + + /* + * GCC generates better code in the loops if we reference local + * copies of these global variables. + */ + stride = pdcache_stride; + loopcount = pdcache_loopcount; + + while ((eva - va) >= (32 * 128)) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_r4k_op_32lines_128(tmpva, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += 32 * 128; + } + + while (va < eva) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_op_r4k_line(tmpva, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += 128; + } +} + +void +mipsNN_pdcache_inv_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line128(va + size); + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, CACHE_R4K_D|CACHEOP_R4K_HIT_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_INV); + va += 128; + } + + SYNC; +} + +void +mipsNN_pdcache_wb_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line128(va + size); + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB); + va += 128; + } + + SYNC; +} + #endif void From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:11:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F33F948; Tue, 20 Jan 2015 11:11:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFFADAD; Tue, 20 Jan 2015 11:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KBBXDJ048046; Tue, 20 Jan 2015 11:11:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KBBXU6048027; Tue, 20 Jan 2015 11:11:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201501201111.t0KBBXU6048027@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 20 Jan 2015 11:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277415 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 11:11:33 -0000 Author: andrew Date: Tue Jan 20 11:11:32 2015 New Revision: 277415 URL: https://svnweb.freebsd.org/changeset/base/277415 Log: Add the User and PL1 read only and reqd write thread ID registers. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Tue Jan 20 11:10:25 2015 (r277414) +++ head/sys/arm/include/cpu-v6.h Tue Jan 20 11:11:32 2015 (r277415) @@ -179,6 +179,13 @@ _WF1(cp15_pminten_set, CP15_PMINTENSET(% _WF1(cp15_pminten_clr, CP15_PMINTENCLR(%0)) #endif +_RF0(cp15_tpidrurw_get, CP15_TPIDRURW(%0)) +_WF1(cp15_tpidrurw_set, CP15_TPIDRURW(%0)) +_RF0(cp15_tpidruro_get, CP15_TPIDRURO(%0)) +_WF1(cp15_tpidruro_set, CP15_TPIDRURO(%0)) +_RF0(cp15_tpidrpwr_get, CP15_TPIDRPRW(%0)) +_WF1(cp15_tpidrpwr_set, CP15_TPIDRPRW(%0)) + #undef _FX #undef _RF0 #undef _WF0 From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:32:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E56A9CDC; Tue, 20 Jan 2015 11:32:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D19ECFC6; Tue, 20 Jan 2015 11:32:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KBWnGk057712; Tue, 20 Jan 2015 11:32:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KBWnbW057711; Tue, 20 Jan 2015 11:32:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201501201132.t0KBWnbW057711@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 20 Jan 2015 11:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277416 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 11:32:50 -0000 Author: andrew Date: Tue Jan 20 11:32:48 2015 New Revision: 277416 URL: https://svnweb.freebsd.org/changeset/base/277416 Log: Remove the SMP code from locore-v4. These will never use the SMP code as there is no multi-core hardware prior to ARMv6. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/locore-v4.S Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Tue Jan 20 11:11:32 2015 (r277415) +++ head/sys/arm/arm/locore-v4.S Tue Jan 20 11:32:48 2015 (r277416) @@ -218,9 +218,6 @@ Lunmapped: bl build_pagetables #endif -#if defined(SMP) - orr r0, r0, #2 /* Set TTB shared memory flag */ -#endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ @@ -338,9 +335,6 @@ translate_va_to_pa: build_pagetables: /* Set the required page attributed */ ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SMP) - orr r4, #(L1_SHARED) -#endif orr r1, r4 /* Move the virtual address to the correct bit location */ @@ -394,92 +388,6 @@ pagetable: .Lcpufuncs: .word _C_LABEL(cpufuncs) -#if defined(SMP) - -.Lmpvirt_done: - .word mpvirt_done -VA_TO_PA_POINTER(Lstartup_pagetable_secondary, temp_pagetable) - -ASENTRY_NP(mpentry) - - /* Make sure interrupts are disabled. */ - mrs r7, cpsr - orr r7, r7, #(PSR_I | PSR_F) - msr cpsr_c, r7 - - /* Disable MMU. It should be disabled already, but make sure. */ - mrc p15, 0, r2, c1, c0, 0 - bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ - CPU_CONTROL_WBUF_ENABLE) - bic r2, r2, #(CPU_CONTROL_IC_ENABLE) - bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r2, c1, c0, 0 - nop - nop - nop - CPWAIT(r0) - -#if ARM_MMU_V6 - bl armv6_idcache_inv_all /* Modifies r0 only */ -#elif ARM_MMU_V7 - bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ -#endif - - /* Load the page table physical address */ - adr r0, Lstartup_pagetable_secondary - bl translate_va_to_pa - /* Load the address the secondary page table */ - ldr r0, [r0] - - orr r0, r0, #2 /* Set TTB shared memory flag */ - mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ - mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ - - mov r0, #0 - mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ - - /* Set the Domain Access register. Very important! */ - mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) - mcr p15, 0, r0, c3, c0, 0 - /* Enable MMU */ - mrc p15, 0, r0, c1, c0, 0 - orr r0, r0, #CPU_CONTROL_V6_EXTPAGE - orr r0, r0, #CPU_CONTROL_AF_ENABLE - orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ - CPU_CONTROL_WBUF_ENABLE) - orr r0, r0, #(CPU_CONTROL_IC_ENABLE) - orr r0, r0, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r0, c1, c0, 0 - nop - nop - nop - CPWAIT(r0) - - adr r1, .Lstart - ldmia r1, {r1, r2, sp} /* Set initial stack and */ - mrc p15, 0, r0, c0, c0, 5 - and r0, r0, #15 - mov r1, #2048 - mul r2, r1, r0 - sub sp, sp, r2 - str r1, [sp] - ldr pc, .Lmpvirt_done - -mpvirt_done: - - mov fp, #0 /* trace back starts here */ - bl _C_LABEL(init_secondary) /* Off we go */ - - adr r0, .Lmpreturned - b _C_LABEL(panic) - /* NOTREACHED */ - -.Lmpreturned: - .asciz "init_secondary() returned" - .align 2 -END(mpentry) -#endif - ENTRY_NP(cpu_halt) mrs r2, cpsr bic r2, r2, #(PSR_MODE) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:43:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EDB5ED3; Tue, 20 Jan 2015 11:43:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A96B112; Tue, 20 Jan 2015 11:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KBhH7R062378; Tue, 20 Jan 2015 11:43:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KBhHKN062377; Tue, 20 Jan 2015 11:43:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501201143.t0KBhHKN062377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Jan 2015 11:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277417 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 11:43:17 -0000 Author: hselasky Date: Tue Jan 20 11:43:16 2015 New Revision: 277417 URL: https://svnweb.freebsd.org/changeset/base/277417 Log: Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular the value returned in the "udp_port_level" field. Reported by: Uffe Jakobsen MFC after: 1 week Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Tue Jan 20 11:32:48 2015 (r277416) +++ head/sys/dev/usb/usb_generic.c Tue Jan 20 11:43:16 2015 (r277417) @@ -1849,14 +1849,13 @@ ugen_get_port_path(struct usb_fifo *f, s if (nlevel > USB_DEVICE_PORT_PATH_MAX) goto error; + /* store total level of ports */ + dpp->udp_port_level = nlevel; + /* store port index array */ next = udev; while (next->parent_hub != NULL) { - nlevel--; - - dpp->udp_port_no[nlevel] = next->port_no; - dpp->udp_port_level = nlevel; - + dpp->udp_port_no[--nlevel] = next->port_no; next = next->parent_hub; } return (0); /* success */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 12:28:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 615E61A3; Tue, 20 Jan 2015 12:28:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32F1B804; Tue, 20 Jan 2015 12:28:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KCSPC8082944; Tue, 20 Jan 2015 12:28:25 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KCSOPR082941; Tue, 20 Jan 2015 12:28:24 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201501201228.t0KCSOPR082941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 20 Jan 2015 12:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277418 - in head/sys: boot/i386/libi386 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 12:28:25 -0000 Author: royger Date: Tue Jan 20 12:28:24 2015 New Revision: 277418 URL: https://svnweb.freebsd.org/changeset/base/277418 Log: loader: fix the size of MODINFOMD_MODULEP The data in MODINFOMD_MODULEP is packed by the loader as a 4 byte type, but the amd64 kernel expects a vm_paddr_t, which is of size 8 bytes. Fix this by saving it as 8 bytes in the loader and retrieving it using the proper type in the kernel. Sponsored by: Citrix Systems R&D Modified: head/sys/boot/i386/libi386/bootinfo64.c head/sys/x86/xen/pv.c Modified: head/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo64.c Tue Jan 20 11:43:16 2015 (r277417) +++ head/sys/boot/i386/libi386/bootinfo64.c Tue Jan 20 12:28:24 2015 (r277418) @@ -185,6 +185,7 @@ bi_load64(char *args, vm_offset_t addr, struct file_metadata *md; u_int64_t kernend; u_int64_t envp; + u_int64_t module; vm_offset_t size; char *rootdevname; int howto; @@ -222,7 +223,7 @@ bi_load64(char *args, vm_offset_t addr, addr = roundup(addr, PAGE_SIZE); /* place the metadata before anything */ - *modulep = addr; + module = *modulep = addr; kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) @@ -233,7 +234,7 @@ bi_load64(char *args, vm_offset_t addr, file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof modulep, modulep); + file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module); if (add_smap != 0) bios_addsmapdata(kfp); Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Jan 20 11:43:16 2015 (r277417) +++ head/sys/x86/xen/pv.c Tue Jan 20 12:28:24 2015 (r277418) @@ -402,7 +402,7 @@ xen_pv_parse_preload_data(u_int64_t modu * then calculating the offset with mod_start, * which contains the relocated modulep address. */ - metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, int); + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); off = HYPERVISOR_start_info->mod_start - metadata; preload_bootstrap_relocate(off); From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 13:09:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31B26CE7; Tue, 20 Jan 2015 13:09:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D9DEC24; Tue, 20 Jan 2015 13:09:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KD9CsC002764; Tue, 20 Jan 2015 13:09:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KD9Cid002762; Tue, 20 Jan 2015 13:09:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501201309.t0KD9Cid002762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 20 Jan 2015 13:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277419 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 13:09:13 -0000 Author: mav Date: Tue Jan 20 13:09:12 2015 New Revision: 277419 URL: https://svnweb.freebsd.org/changeset/base/277419 Log: Allow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space(). dsl_dir_transfer_space() is mostly called after dsl_dir_diduse_space(), which already calls dmu_buf_will_dirty() for the same dbuf and tx, so its duplicate call in those cases will change nothing, only spend time. Skipping this call by four times reduces time spent in dbuf_write_done() and descendants, updating dataset statistics with several congested lock acquisitions. When rewriting 8K zvol blocks at 1GB/s rate, this reduces CPU time spent inside dbuf_write_done(), according to profiling, from 45% of 683K samples to 18% of 422K. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jan 20 12:28:24 2015 (r277418) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jan 20 13:09:12 2015 (r277419) @@ -136,7 +136,7 @@ dsl_dataset_block_born(dsl_dataset_t *ds dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, compressed, uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, used - delta, - DD_USED_REFRSRV, DD_USED_HEAD, tx); + DD_USED_REFRSRV, DD_USED_HEAD, NULL); } int @@ -179,7 +179,7 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, -compressed, -uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, -used - delta, - DD_USED_REFRSRV, DD_USED_HEAD, tx); + DD_USED_REFRSRV, DD_USED_HEAD, NULL); } else { dprintf_bp(bp, "putting on dead list: %s", ""); if (async) { @@ -2837,7 +2837,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat origin_head->ds_dir->dd_origin_txg, UINT64_MAX, &odl_used, &odl_comp, &odl_uncomp); dsl_dir_transfer_space(origin_head->ds_dir, cdl_used - odl_used, - DD_USED_HEAD, DD_USED_SNAP, tx); + DD_USED_HEAD, DD_USED_SNAP, NULL); } /* swap ds_*_bytes */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Jan 20 12:28:24 2015 (r277418) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Jan 20 13:09:12 2015 (r277419) @@ -1389,7 +1389,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u accounted_delta, compressed, uncompressed, tx); dsl_dir_transfer_space(dd->dd_parent, used - accounted_delta, - DD_USED_CHILD_RSRV, DD_USED_CHILD, tx); + DD_USED_CHILD_RSRV, DD_USED_CHILD, NULL); } } @@ -1397,7 +1397,7 @@ void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx) { - ASSERT(dmu_tx_is_syncing(tx)); + ASSERT(tx == NULL || dmu_tx_is_syncing(tx)); ASSERT(oldtype < DD_USED_NUM); ASSERT(newtype < DD_USED_NUM); @@ -1405,7 +1405,8 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in !(dsl_dir_phys(dd)->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - dmu_buf_will_dirty(dd->dd_dbuf, tx); + if (tx != NULL) + dmu_buf_will_dirty(dd->dd_dbuf, tx); mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dsl_dir_phys(dd)->dd_used_breakdown[oldtype] >= delta : From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 14:23:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A693D276; Tue, 20 Jan 2015 14:23:00 +0000 (UTC) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3D375B; Tue, 20 Jan 2015 14:23:00 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id z107so8026204qgd.10; Tue, 20 Jan 2015 06:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lfr3EybwKOYWDbx+x7IcH1zlf3Dcy+kRKgbQhGwerME=; b=UUcOLAY9MhHeWjOxMoZ/ucf/PxVv1w+Yo+4jqh+qdV7B30Nd6wEurNVVJGF4GYSBLb HsRTslhc8ogTfKwbYVtgaZSv9bQRUtX0ubS9JNUjF2VEha6EaErZnRgqj/6Cszjq2Q00 qme1KZBCVcVbKjo2bh0rXsZXKKIqmbhEOtewQID9RvtKQxrkKHAtzfyNt0sWJ2wbrAal Jkrb5SGpBg9H+HHfB3ePFLTkVFl2aDZcjDB2yjbEuKjQjTLE5ymSytBgeo9x/Kxcl1mw gyCgxMPO3vQS+S/Nc+PajtJKsTgXKv9TWLtVH7/VFl1ETAdplJ9GjhwMGKmp6kWsxn/o AGwg== X-Received: by 10.140.37.39 with SMTP id q36mr43991733qgq.89.1421763779603; Tue, 20 Jan 2015 06:22:59 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.140.38.100 with HTTP; Tue, 20 Jan 2015 06:22:38 -0800 (PST) In-Reply-To: <54B80CB6.5030102@FreeBSD.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54B7E287.80406@FreeBSD.org> <54B7E566.8050601@selasky.org> <20150115171430.GO15484@FreeBSD.org> <20150115171539.GP15484@FreeBSD.org> <54B80CB6.5030102@FreeBSD.org> From: Ed Maste Date: Tue, 20 Jan 2015 09:22:38 -0500 X-Google-Sender-Auth: 8TQitBMbn65T3dShiwazSdjQNfw Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Sean Bruno , Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 14:23:00 -0000 On 15 January 2015 at 13:53, John Baldwin wrote: > > I think it's been a > clear practice with all other changes reviewed in phabric to date that > the committer only lists people in 'Reviewed by' who actually signed off > on the patch, not just the list of people asked to review it. This point is worth repeating. Phabricator is an add-on tool to aid in pre-commit review, but is not a required part of our process and doesn't change the meaning of commit message metadata fields. "Reviewed by" in a commit message means exactly what it always has: that those listed have reasonably carefully reviewed the change and are willing to put their name on it. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 14:26:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 249803EC; Tue, 20 Jan 2015 14:26:03 +0000 (UTC) Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [IPv6:2607:f8b0:400d:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD4AD782; Tue, 20 Jan 2015 14:26:02 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id i8so22246190qcq.3; Tue, 20 Jan 2015 06:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Cel6iHVTbRcb5Uc6EL1LpsV0yjIEhxeCED8AR6Nzlp8=; b=nRk6AgMjcltXJEKAlYVYjESSrJv8T9p20zf7oemY9t6bkCU2BMMCY0NjuEUXsu82PM HNDQ2l7MDD6ovnGOeEbZzyh6IAZIS1Xf5XG42QMWn/ySdNtccxG5G14OCQYhKx57tvET 8Ay1kIEr8DYGtiq4G+FPAjh7hFO8OHXft7wapSGGuo1fDXkWvXADYgIxbso/ocEWQLc6 /nN49CEHOmca/IQ4hbJvocNcpvgJwVOQRqpwb6N4BHTJZNQo93VdNRZTVRTfzeGCYZ81 TnsVWQWYXePcv7FSpmsLPQbJ6gRiLcrlfIusnh/JObwvOW8eAiYCx4/1R9v9GRovgz57 yJNg== X-Received: by 10.224.45.195 with SMTP id g3mr58155148qaf.59.1421763961913; Tue, 20 Jan 2015 06:26:01 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.140.38.100 with HTTP; Tue, 20 Jan 2015 06:25:41 -0800 (PST) In-Reply-To: <54BE21F0.6010602@selasky.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> From: Ed Maste Date: Tue, 20 Jan 2015 09:25:41 -0500 X-Google-Sender-Auth: mUzyHe_VsvSQbwSj-yWJpvq-ySU Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 14:26:03 -0000 On 20 January 2015 at 04:37, Hans Petter Selasky wrote: > > It is not very hard to update existing callout clients and you can do it > too, if you need the extra bits of performance. Hi Hans Petter, The issue here is that the onus is on the one changing a KPI to support its consumers through the transition. This doesn't necessarily mean doing all of the work. But the KPI changes, and techniques for adapting to them, need to be communicated very well in advance of the change arriving. I appreciate that you have a patch for TCP in review now - but having Adrian encounter a huge TCP performance regression is an unfortunate way to discover this issue. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 15:01:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 482D9B60; Tue, 20 Jan 2015 15:01:36 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44CABA2; Tue, 20 Jan 2015 15:01:35 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0KF1Tax077303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2015 17:01:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0KF1Tax077303 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0KF1TMR077302; Tue, 20 Jan 2015 17:01:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jan 2015 17:01:29 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150120150129.GF42409@kib.kiev.ua> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BE21F0.6010602@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 15:01:36 -0000 On Tue, Jan 20, 2015 at 10:37:52AM +0100, Hans Petter Selasky wrote: > On 01/20/15 10:00, Konstantin Belousov wrote: > > On Tue, Jan 20, 2015 at 08:58:34AM +0100, Hans Petter Selasky wrote: > >> On 01/20/15 08:51, Konstantin Belousov wrote: > >>> On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: > >>>> On 01/19/15 22:59, Adrian Chadd wrote: > >>>>> Hi, > >>>>> > >>>>> Would you please check what the results of this are with CPU specific > >>>>> callwheels? > >>>>> > >>>>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > >>>>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > >>>>> enabled. But all the callwheels are now back on clock(0) and so is the > >>>>> lock contention. :( > >>>>> > >>>>> Thanks, > >>>>> > >>>> > >>>> Hi, > >>>> > >>>> Like stated in the manual page, callout_reset_curcpu/on() does not work > >>>> with MPSAFE callouts any more! > >>> I.e. you 'fixed' some undeterminate bugs in callout migration by not > >>> doing migration at all anymore. > >>> > >>>> > >>>> You need to use callout_init_{mtx,rm,rw} and remove the custom locking > >>>> inside the callback in the TCP stack to get it working like before! > >>> > >>> No, you need to do this, if you think that whole callout KPI must be > >>> rototiled. It is up to the person who modifies the KPI, to ensure that > >>> existing code is not broken. > > Hi, > > It is not very hard to update existing callout clients and you can do it > too, if you need the extra bits of performance. I want to avoid regressions, and avoid breaking other' people work. > > Are there more API's than the TCP stack which you think needs an update > and are performance critical? I did not performed any analysis. More, I naturally expect that such analysis and demonstration that there is no regression, is the duty of the person who proposes the change. > > >>> > >>> As I understand, currently we are back to the one-cpu callouts. > >>> Do other people consider this situation acceptable ? > > For the TCP stack - yes, but not for other clients like cv_timedwait() > and such. > > If you think you have a better way to solve the callout problems, please > tell me! In order for a callout to change its CPU you need a lock to > protect which CPU the callout is on. Instead of introducing a third lock > in the callout path, which will be a congestion point, to protect > against changing the CPU number, I decided that we will use the client's > mutex and the MPSAFE implies the client doesn't have any mutex. So it > won't work with callout clients which use the CALLOUT_MPSAFE flag. > Honestly CALLOUT_MPSAFE should not be used, because it leads to extra > complexity in the clients catching the race when tearing down the > callouts and any pending callbacks. This is your opinion. I did fixed some bugs in the callout migration code, and I am not sure that requiring rototiling of almost all KPI consumers (and leaving unconverted consumers to pre-cpu state) is the only possible solution. But again, since it is you who brought the change into the tree, it is your duty to present a valid proof why this is the only possible way to solve bugs (which bugs ?). > > >> > >> Please read the callout 9 manual page first. > > > > Assume I read it. How this changes any of my points above ? > > """ > > A change in the CPU selection cannot happen if this function is > > re-scheduled inside a callout function. Else the callback function given > > by the func argument will be executed on the same CPU like previously > > done. > > """ > > You cannot do this without fixing consumers. > > > > The code simply needs an update. It is not broken in any ways - right? > If it is not broken, fixing it is not that urgent. Isn't it obvious ? If callouts no longer migrate to non-BSP, this is the regression. I am sorry for you attitude. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 15:45:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D31174CE; Tue, 20 Jan 2015 15:45:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B43A18E; Tue, 20 Jan 2015 15:45:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KFjAiW078043; Tue, 20 Jan 2015 15:45:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KFjAkc078042; Tue, 20 Jan 2015 15:45:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201501201545.t0KFjAkc078042@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 20 Jan 2015 15:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277420 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 15:45:11 -0000 Author: br Date: Tue Jan 20 15:45:09 2015 New Revision: 277420 URL: https://svnweb.freebsd.org/changeset/base/277420 Log: o Do notify USB host each time we receive 'set packet filter' request. This makes Mac OS X happy when it returns back from suspending. o Switch notify state after data is transferred, but not before. o Consider there is also Super Speed mode. o Do not set stall bit on any pipes in device mode as Mac OS X seems don't support it. In collaboration with: hselasky@ Modified: head/sys/dev/usb/net/if_cdce.c Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Tue Jan 20 13:09:12 2015 (r277419) +++ head/sys/dev/usb/net/if_cdce.c Tue Jan 20 15:45:09 2015 (r277420) @@ -857,9 +857,12 @@ tr_setup: if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + } else { + goto tr_setup; + } } break; } @@ -1024,10 +1027,12 @@ cdce_bulk_read_callback(struct usb_xfer if (error != USB_ERR_CANCELLED) { tr_stall: - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - usbd_xfer_set_frames(xfer, 0); - usbd_transfer_submit(xfer); + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } break; } @@ -1040,6 +1045,7 @@ tr_stall: static void cdce_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) { + struct cdce_softc *sc = usbd_xfer_softc(xfer); int actlen; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -1061,8 +1067,10 @@ tr_setup: default: /* Error */ if (error != USB_ERR_CANCELLED) { /* start clear stall */ - usbd_xfer_set_stall(xfer); - goto tr_setup; + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) + usbd_xfer_set_stall(xfer); + else + goto tr_setup; } break; } @@ -1084,6 +1092,17 @@ cdce_intr_write_callback(struct usb_xfer DPRINTF("Transferred %d bytes\n", actlen); + switch (sc->sc_notify_state) { + case (CDCE_NOTIFY_NETWORK_CONNECTION): + sc->sc_notify_state = CDCE_NOTIFY_SPEED_CHANGE; + break; + case (CDCE_NOTIFY_SPEED_CHANGE): + sc->sc_notify_state = CDCE_NOTIFY_DONE; + break; + default: + break; + } + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: @@ -1105,7 +1124,6 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); usbd_xfer_set_frames(xfer, 1); usbd_transfer_submit(xfer); - sc->sc_notify_state = CDCE_NOTIFY_SPEED_CHANGE; } else if (sc->sc_notify_state == CDCE_NOTIFY_SPEED_CHANGE) { req.bmRequestType = UCDC_NOTIFICATION; @@ -1116,7 +1134,7 @@ tr_setup: USETW(req.wLength, 8); /* Peak theoretical bulk trasfer rate in bits/s */ - if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_HIGH) + if (usbd_get_speed(sc->sc_ue.ue_udev) != USB_SPEED_FULL) speed = (13 * 512 * 8 * 1000 * 8); else speed = (19 * 64 * 1 * 1000 * 8); @@ -1129,15 +1147,17 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); usbd_xfer_set_frames(xfer, 1); usbd_transfer_submit(xfer); - sc->sc_notify_state = CDCE_NOTIFY_DONE; } break; default: /* Error */ if (error != USB_ERR_CANCELLED) { - /* start clear stall */ - usbd_xfer_set_stall(xfer); - goto tr_setup; + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + /* start clear stall */ + usbd_xfer_set_stall(xfer); + } else { + goto tr_setup; + } } break; } @@ -1145,9 +1165,30 @@ tr_setup: static int cdce_handle_request(device_t dev, - const void *req, void **pptr, uint16_t *plen, + const void *preq, void **pptr, uint16_t *plen, uint16_t offset, uint8_t *pstate) { + struct cdce_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + /* + * When Mac OS X resumes after suspending it expects + * to be notified again after this request. + */ + if (req->bmRequestType == UT_WRITE_CLASS_INTERFACE && \ + req->bRequest == UCDC_NCM_SET_ETHERNET_PACKET_FILTER) { + + if (is_complete == 1) { + mtx_lock(&sc->sc_mtx); + sc->sc_notify_state = CDCE_NOTIFY_SPEED_CHANGE; + usbd_transfer_start(sc->sc_xfer[CDCE_INTR_TX]); + mtx_unlock(&sc->sc_mtx); + } + + return (0); + } + return (ENXIO); /* use builtin handler */ } @@ -1363,10 +1404,12 @@ cdce_ncm_bulk_write_callback(struct usb_ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - usbd_xfer_set_frames(xfer, 0); - usbd_transfer_submit(xfer); + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } } break; } @@ -1524,10 +1567,12 @@ tr_setup: if (error != USB_ERR_CANCELLED) { tr_stall: - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - usbd_xfer_set_frames(xfer, 0); - usbd_transfer_submit(xfer); + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } } break; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 16:15:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A3A2F00; Tue, 20 Jan 2015 16:15:44 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B54A657; Tue, 20 Jan 2015 16:15:44 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id rd18so8668480iec.7; Tue, 20 Jan 2015 08:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xYGnGAFcRA4ktvpmrbqFLTzHK721ReOACainDZZE1Po=; b=LOEHENLydM0TzBo9d5DuDADDV2FEgXTuJj33vibNTrWl5dDaYcV7AlIipNFq5Tcykp Ch755qFYqPzS0ItSQx7F76NYdBanjsQO3PIoKLGMfdsgswS2IJMSMFutRiev63oAgEju fJKLmm2Nsk5uEF7HDBwcr9dj5Y/I5b56R4coJBwqUBCcZqcvzyODYzwA7Q0MJwBeWa8b JkGZsJnUesDyZqpkmbDLPzawHqk0Isq5WQ2ef1UxdqGLFbvkumtWMemrXkW8YUePFJVe oNi79tt7DEoIP9T6807Jl7UoRoScc7YT08unQ+bLP8C6yWstJK9wTNn+HKUBFyXoPJ53 +vTg== MIME-Version: 1.0 X-Received: by 10.50.66.171 with SMTP id g11mr27491766igt.49.1421770543726; Tue, 20 Jan 2015 08:15:43 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Tue, 20 Jan 2015 08:15:43 -0800 (PST) In-Reply-To: References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> Date: Tue, 20 Jan 2015 08:15:43 -0800 X-Google-Sender-Auth: bZMODHJ8mWDEhNVY-glu9_jdLBE Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Ed Maste Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Konstantin Belousov , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 16:15:44 -0000 On 20 January 2015 at 06:25, Ed Maste wrote: > On 20 January 2015 at 04:37, Hans Petter Selasky wrote: >> >> It is not very hard to update existing callout clients and you can do it >> too, if you need the extra bits of performance. > > Hi Hans Petter, > > The issue here is that the onus is on the one changing a KPI to > support its consumers through the transition. This doesn't necessarily > mean doing all of the work. But the KPI changes, and techniques for > adapting to them, need to be communicated very well in advance of the > change arriving. > > I appreciate that you have a patch for TCP in review now - but having > Adrian encounter a huge TCP performance regression is an unfortunate > way to discover this issue. I'm +1 on the "think it's the right, clean solution for the callout stuff" as I've done this stuff in userland a few times and it gets hairy very quickly when you try to support multiple ways to schedule, cancel and migrate events from arbitrary CPUs. I'm -1 on the rapid change without fixing other consumers, but I'm definitely +1 on the quick help from Hans on it. The TCP patch will need some closer review by people who have recently worked on the TCP stack and locking. I'll try to get the Verisign developers looped in as they touched this stuff recently. I do think we could do with a debugging print for now to catch situations which need migrating. The callout API doesn't tell you that it did or didn't migrate an event to another CPU and it could make for some performance unpredictability. -a From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 16:22:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CA0622E; Tue, 20 Jan 2015 16:22:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED01079C; Tue, 20 Jan 2015 16:21:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KGLxPa096725; Tue, 20 Jan 2015 16:21:59 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KGLx26096724; Tue, 20 Jan 2015 16:21:59 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501201621.t0KGLx26096724@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 20 Jan 2015 16:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277421 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 16:22:00 -0000 Author: nwhitehorn Date: Tue Jan 20 16:21:59 2015 New Revision: 277421 URL: https://svnweb.freebsd.org/changeset/base/277421 Log: There does not seem to be any reason to acquire GIANT here. Follow amd64 in removing it. MFC after: 1 month Modified: head/sys/powerpc/powerpc/mem.c Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 (r277420) +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 (r277421) @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, cnt = 0; error = 0; - GIANT_REQUIRED; - while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; if (iov->iov_len == 0) { From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 16:30:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2B2B6A0; Tue, 20 Jan 2015 16:30:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF780837; Tue, 20 Jan 2015 16:30:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KGU3bs097971; Tue, 20 Jan 2015 16:30:03 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KGU31c097969; Tue, 20 Jan 2015 16:30:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201501201630.t0KGU31c097969@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 20 Jan 2015 16:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277422 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 16:30:04 -0000 Author: br Date: Tue Jan 20 16:30:02 2015 New Revision: 277422 URL: https://svnweb.freebsd.org/changeset/base/277422 Log: o Restore 'goto tr_setup;' when operating in host mode mistakenly removed in r277414. o Remove extra parentheses around cases. Modified: head/sys/dev/usb/net/if_cdce.c Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Tue Jan 20 16:21:59 2015 (r277421) +++ head/sys/dev/usb/net/if_cdce.c Tue Jan 20 16:30:02 2015 (r277422) @@ -860,9 +860,8 @@ tr_setup: if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { /* try to clear stall first */ usbd_xfer_set_stall(xfer); - } else { - goto tr_setup; } + goto tr_setup; } break; } @@ -1069,8 +1068,7 @@ tr_setup: /* start clear stall */ if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) usbd_xfer_set_stall(xfer); - else - goto tr_setup; + goto tr_setup; } break; } @@ -1093,10 +1091,10 @@ cdce_intr_write_callback(struct usb_xfer DPRINTF("Transferred %d bytes\n", actlen); switch (sc->sc_notify_state) { - case (CDCE_NOTIFY_NETWORK_CONNECTION): + case CDCE_NOTIFY_NETWORK_CONNECTION: sc->sc_notify_state = CDCE_NOTIFY_SPEED_CHANGE; break; - case (CDCE_NOTIFY_SPEED_CHANGE): + case CDCE_NOTIFY_SPEED_CHANGE: sc->sc_notify_state = CDCE_NOTIFY_DONE; break; default: @@ -1155,9 +1153,8 @@ tr_setup: if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { /* start clear stall */ usbd_xfer_set_stall(xfer); - } else { - goto tr_setup; } + goto tr_setup; } break; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 17:00:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE902E9B; Tue, 20 Jan 2015 17:00:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA9AEB78; Tue, 20 Jan 2015 17:00:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KH0TOo012517; Tue, 20 Jan 2015 17:00:29 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KH0TiR012516; Tue, 20 Jan 2015 17:00:29 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201501201700.t0KH0TiR012516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 20 Jan 2015 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277423 - head/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 17:00:29 -0000 Author: sbruno Date: Tue Jan 20 17:00:28 2015 New Revision: 277423 URL: https://svnweb.freebsd.org/changeset/base/277423 Log: Allow clang to be built for mips/mips64 backend types by adding our mips triple ids This only allows testing and does not change the defaults for mips/mips64. They still build/use gcc by default. Differential Revision: https://reviews.freebsd.org/D1190 Reviewed by: dim Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Tue Jan 20 16:30:02 2015 (r277422) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Tue Jan 20 17:00:28 2015 (r277423) @@ -6587,6 +6587,17 @@ void freebsd::Link::ConstructJob(Compila CmdArgs.push_back("elf32ppc_fbsd"); } + if (Arg *A = Args.getLastArg(options::OPT_G)) { + if (ToolChain.getArch() == llvm::Triple::mips || + ToolChain.getArch() == llvm::Triple::mipsel || + ToolChain.getArch() == llvm::Triple::mips64 || + ToolChain.getArch() == llvm::Triple::mips64el) { + StringRef v = A->getValue(); + CmdArgs.push_back(Args.MakeArgString("-G" + v)); + A->claim(); + } + } + if (Output.isFilename()) { CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:02:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BCD65F3; Tue, 20 Jan 2015 19:02:45 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11333BCE; Tue, 20 Jan 2015 19:02:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F3C1DB990; Tue, 20 Jan 2015 14:02:43 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Date: Tue, 20 Jan 2015 11:07:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> In-Reply-To: <54BE21F0.6010602@selasky.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201501201107.53553.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Jan 2015 14:02:44 -0500 (EST) Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 19:02:45 -0000 On Tuesday, January 20, 2015 4:37:52 am Hans Petter Selasky wrote: > On 01/20/15 10:00, Konstantin Belousov wrote: > > On Tue, Jan 20, 2015 at 08:58:34AM +0100, Hans Petter Selasky wrote: > >> On 01/20/15 08:51, Konstantin Belousov wrote: > >>> On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky wrote: > >>>> On 01/19/15 22:59, Adrian Chadd wrote: > >>>>> Hi, > >>>>> > >>>>> Would you please check what the results of this are with CPU specific > >>>>> callwheels? > >>>>> > >>>>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled (on > >>>>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is > >>>>> enabled. But all the callwheels are now back on clock(0) and so is the > >>>>> lock contention. :( > >>>>> > >>>>> Thanks, > >>>>> > >>>> > >>>> Hi, > >>>> > >>>> Like stated in the manual page, callout_reset_curcpu/on() does not work > >>>> with MPSAFE callouts any more! > >>> I.e. you 'fixed' some undeterminate bugs in callout migration by not > >>> doing migration at all anymore. > >>> > >>>> > >>>> You need to use callout_init_{mtx,rm,rw} and remove the custom locking > >>>> inside the callback in the TCP stack to get it working like before! > >>> > >>> No, you need to do this, if you think that whole callout KPI must be > >>> rototiled. It is up to the person who modifies the KPI, to ensure that > >>> existing code is not broken. > > Hi, > > It is not very hard to update existing callout clients and you can do it > too, if you need the extra bits of performance. > > Are there more API's than the TCP stack which you think needs an update > and are performance critical? > > >>> > >>> As I understand, currently we are back to the one-cpu callouts. > >>> Do other people consider this situation acceptable ? > > For the TCP stack - yes, but not for other clients like cv_timedwait() > and such. > > If you think you have a better way to solve the callout problems, please > tell me! In order for a callout to change its CPU you need a lock to > protect which CPU the callout is on. Instead of introducing a third lock > in the callout path, which will be a congestion point, to protect > against changing the CPU number, I decided that we will use the client's > mutex and the MPSAFE implies the client doesn't have any mutex. So it > won't work with callout clients which use the CALLOUT_MPSAFE flag. > Honestly CALLOUT_MPSAFE should not be used, because it leads to extra > complexity in the clients catching the race when tearing down the > callouts and any pending callbacks. > > >> > >> Please read the callout 9 manual page first. > > > > Assume I read it. How this changes any of my points above ? > > """ > > A change in the CPU selection cannot happen if this function is > > re-scheduled inside a callout function. Else the callback function given > > by the func argument will be executed on the same CPU like previously > > done. > > """ > > You cannot do this without fixing consumers. > > > > The code simply needs an update. It is not broken in any ways - right? > If it is not broken, fixing it is not that urgent. This is not at all acceptable. TCP callouts were the largest potential user of multi-cpu callouts and you've just broken them. Your proposed change to handle inp locks is not necessarily correct either since dropping the inp lock inside a callout introduces new races (now callout_stop doesn't have quite the same semantics as it does for other callout_init_*()). Given this, it seems that your fix just mostly disabled multi-CPU callouts, so it is not at all clear that you've actually fixed anything. :( -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:08:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74D31A5E; Tue, 20 Jan 2015 19:08:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46FC2C2D; Tue, 20 Jan 2015 19:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KJ8u9C072965; Tue, 20 Jan 2015 19:08:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KJ8ulY072964; Tue, 20 Jan 2015 19:08:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201501201908.t0KJ8ulY072964@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 20 Jan 2015 19:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277424 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 19:08:56 -0000 Author: tuexen Date: Tue Jan 20 19:08:55 2015 New Revision: 277424 URL: https://svnweb.freebsd.org/changeset/base/277424 Log: Remove comparisons which are not necessary. Reported by: Coverity CID: 1237826, 1237844, 1237847 MFC after: 1 week Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Jan 20 17:00:28 2015 (r277423) +++ head/sys/netinet/sctp_sysctl.c Tue Jan 20 19:08:55 2015 (r277424) @@ -569,8 +569,12 @@ sctp_sysctl_handle_udp_tunneling(SYSCTL_ error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_UDP_TUNNELING_PORT_MIN == 0) + if (new > SCTPCTL_UDP_TUNNELING_PORT_MAX) { +#else if ((new < SCTPCTL_UDP_TUNNELING_PORT_MIN) || (new > SCTPCTL_UDP_TUNNELING_PORT_MAX)) { +#endif error = EINVAL; } else { SCTP_INP_INFO_WLOCK(); @@ -598,9 +602,14 @@ sctp_sysctl_handle_auth(SYSCTL_HANDLER_A error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_AUTH_ENABLE_MIN == 0) + if ((new > SCTPCTL_AUTH_ENABLE_MAX) || + ((new == 0) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { +#else if ((new < SCTPCTL_AUTH_ENABLE_MIN) || (new > SCTPCTL_AUTH_ENABLE_MAX) || ((new == 0) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { +#endif error = EINVAL; } else { SCTP_BASE_SYSCTL(sctp_auth_enable) = new; @@ -619,9 +628,14 @@ sctp_sysctl_handle_asconf(SYSCTL_HANDLER error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_ASCONF_ENABLE_MIN == 0) + if ((new > SCTPCTL_ASCONF_ENABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_auth_enable) == 0))) { +#else if ((new < SCTPCTL_ASCONF_ENABLE_MIN) || (new > SCTPCTL_ASCONF_ENABLE_MAX) || ((new == 1) && (SCTP_BASE_SYSCTL(sctp_auth_enable) == 0))) { +#endif error = EINVAL; } else { SCTP_BASE_SYSCTL(sctp_asconf_enable) = new; From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:14:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED4BED5F; Tue, 20 Jan 2015 19:14:43 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F5D2D08; Tue, 20 Jan 2015 19:14:43 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0KJEc14042390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2015 21:14:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0KJEc14042390 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0KJEcbi042389; Tue, 20 Jan 2015 21:14:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jan 2015 21:14:38 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc Message-ID: <20150120191438.GL42409@kib.kiev.ua> References: <201501201621.t0KGLx26096724@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501201621.t0KGLx26096724@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 19:14:44 -0000 On Tue, Jan 20, 2015 at 04:21:59PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Jan 20 16:21:59 2015 > New Revision: 277421 > URL: https://svnweb.freebsd.org/changeset/base/277421 > > Log: > There does not seem to be any reason to acquire GIANT here. Follow amd64 > in removing it. > > MFC after: 1 month > > Modified: > head/sys/powerpc/powerpc/mem.c > > Modified: head/sys/powerpc/powerpc/mem.c > ============================================================================== > --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 (r277420) > +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 (r277421) > @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, > cnt = 0; > error = 0; > > - GIANT_REQUIRED; > - This is not an acquisition, to be pedantic. Really, it is cdevsw which has D_NEEDGIANT flag which acquires Giant. After architectures get rid of GIANT_REQUIRED, flag can be removed. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 20:33:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86472DB6; Tue, 20 Jan 2015 20:33:33 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C0BE898; Tue, 20 Jan 2015 20:33:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 28E1CB94A; Tue, 20 Jan 2015 15:33:32 -0500 (EST) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc Date: Tue, 20 Jan 2015 15:26:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201501201621.t0KGLx26096724@svn.freebsd.org> <20150120191438.GL42409@kib.kiev.ua> In-Reply-To: <20150120191438.GL42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201501201526.39169.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Jan 2015 15:33:32 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 20:33:33 -0000 On Tuesday, January 20, 2015 2:14:38 pm Konstantin Belousov wrote: > This is not an acquisition, to be pedantic. Really, it is cdevsw which > has D_NEEDGIANT flag which acquires Giant. After architectures get > rid of GIANT_REQUIRED, flag can be removed. We could #ifdef the flag, but only if it is a meaningful difference for a real world use case. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 20:36:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75FA3F17; Tue, 20 Jan 2015 20:36:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 570F78AC; Tue, 20 Jan 2015 20:36:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KKabqL016054; Tue, 20 Jan 2015 20:36:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KKaati016052; Tue, 20 Jan 2015 20:36:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501202036.t0KKaati016052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 20 Jan 2015 20:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277433 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 20:36:37 -0000 Author: delphij Date: Tue Jan 20 20:36:36 2015 New Revision: 277433 URL: https://svnweb.freebsd.org/changeset/base/277433 Log: MFV r277432: Plug various memory leaks in libzfs import implementation. Illumos issue: 5518 Memory leaks in libzfs import implementation MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Jan 20 20:18:59 2015 (r277432) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Jan 20 20:36:36 2015 (r277433) @@ -18,10 +18,11 @@ * * CDDL HEADER END */ + /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* @@ -198,8 +199,10 @@ fix_paths(nvlist_t *nv, name_entry_t *na if ((devid = get_devid(best->ne_name)) == NULL) { (void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID); } else { - if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) + if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) { + devid_str_free(devid); return (-1); + } devid_str_free(devid); } @@ -665,8 +668,10 @@ get_configs(libzfs_handle_t *hdl, pool_l nvlist_add_uint64(holey, ZPOOL_CONFIG_ID, c) != 0 || nvlist_add_uint64(holey, - ZPOOL_CONFIG_GUID, 0ULL) != 0) + ZPOOL_CONFIG_GUID, 0ULL) != 0) { + nvlist_free(holey); goto nomem; + } child[c] = holey; } } @@ -1118,8 +1123,10 @@ zpool_clear_label(int fd) for (l = 0; l < VDEV_LABELS; l++) { if (pwrite64(fd, label, sizeof (vdev_label_t), - label_offset(size, l)) != sizeof (vdev_label_t)) + label_offset(size, l)) != sizeof (vdev_label_t)) { + free(label); return (-1); + } } free(label); @@ -1137,7 +1144,6 @@ static nvlist_t * zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg) { int i, dirs = iarg->paths; - DIR *dirp = NULL; struct dirent64 *dp; char path[MAXPATHLEN]; char *end, **dir = iarg->path; @@ -1167,6 +1173,8 @@ zpool_find_import_impl(libzfs_handle_t * tpool_t *t; char *rdsk; int dfd; + boolean_t config_failed = B_FALSE; + DIR *dirp; /* use realpath to normalize the path */ if (realpath(dir[i], path) == 0) { @@ -1191,6 +1199,8 @@ zpool_find_import_impl(libzfs_handle_t * if ((dfd = open64(rdsk, O_RDONLY)) < 0 || (dirp = fdopendir(dfd)) == NULL) { + if (dfd >= 0) + (void) close(dfd); zfs_error_aux(hdl, strerror(errno)); (void) zfs_error_fmt(hdl, EZFS_BADPATH, dgettext(TEXT_DOMAIN, "cannot open '%s'"), @@ -1272,7 +1282,7 @@ skipdir: cookie = NULL; while ((slice = avl_destroy_nodes(&slice_cache, &cookie)) != NULL) { - if (slice->rn_config != NULL) { + if (slice->rn_config != NULL && !config_failed) { nvlist_t *config = slice->rn_config; boolean_t matched = B_TRUE; @@ -1293,13 +1303,16 @@ skipdir: } if (!matched) { nvlist_free(config); - config = NULL; - continue; + } else { + /* + * use the non-raw path for the config + */ + (void) strlcpy(end, slice->rn_name, + pathleft); + if (add_config(hdl, &pools, path, + config) != 0) + config_failed = B_TRUE; } - /* use the non-raw path for the config */ - (void) strlcpy(end, slice->rn_name, pathleft); - if (add_config(hdl, &pools, path, config) != 0) - goto error; } free(slice->rn_name); free(slice); @@ -1307,7 +1320,9 @@ skipdir: avl_destroy(&slice_cache); (void) closedir(dirp); - dirp = NULL; + + if (config_failed) + goto error; } ret = get_configs(hdl, &pools, iarg->can_be_active); @@ -1330,14 +1345,10 @@ error: for (ne = pools.names; ne != NULL; ne = nenext) { nenext = ne->ne_next; - if (ne->ne_name) - free(ne->ne_name); + free(ne->ne_name); free(ne); } - if (dirp) - (void) closedir(dirp); - return (ret); } @@ -1695,9 +1706,9 @@ zpool_in_use(libzfs_handle_t *hdl, int f cb.cb_type = ZPOOL_CONFIG_SPARES; if (zpool_iter(hdl, find_aux, &cb) == 1) { name = (char *)zpool_get_name(cb.cb_zhp); - ret = TRUE; + ret = B_TRUE; } else { - ret = FALSE; + ret = B_FALSE; } break; @@ -1711,9 +1722,9 @@ zpool_in_use(libzfs_handle_t *hdl, int f cb.cb_type = ZPOOL_CONFIG_L2CACHE; if (zpool_iter(hdl, find_aux, &cb) == 1) { name = (char *)zpool_get_name(cb.cb_zhp); - ret = TRUE; + ret = B_TRUE; } else { - ret = FALSE; + ret = B_FALSE; } break; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jan 20 20:18:59 2015 (r277432) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jan 20 20:36:36 2015 (r277433) @@ -20,8 +20,8 @@ */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1715,7 +1715,7 @@ zpool_import_props(libzfs_handle_t *hdl, thename = origname; } - if (props) { + if (props != NULL) { uint64_t version; prop_flags_t flags = { .create = B_FALSE, .import = B_TRUE }; @@ -1723,12 +1723,13 @@ zpool_import_props(libzfs_handle_t *hdl, &version) == 0); if ((props = zpool_valid_proplist(hdl, origname, - props, version, flags, errbuf)) == NULL) { + props, version, flags, errbuf)) == NULL) return (-1); - } else if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) { + if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) { nvlist_free(props); return (-1); } + nvlist_free(props); } (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name)); @@ -1737,11 +1738,11 @@ zpool_import_props(libzfs_handle_t *hdl, &zc.zc_guid) == 0); if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) { - nvlist_free(props); + zcmd_free_nvlists(&zc); return (-1); } if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) { - nvlist_free(props); + zcmd_free_nvlists(&zc); return (-1); } @@ -1757,6 +1758,9 @@ zpool_import_props(libzfs_handle_t *hdl, error = errno; (void) zcmd_read_dst_nvlist(hdl, &zc, &nv); + + zcmd_free_nvlists(&zc); + zpool_get_rewind_policy(config, &policy); if (error) { @@ -1862,9 +1866,6 @@ zpool_import_props(libzfs_handle_t *hdl, return (0); } - zcmd_free_nvlists(&zc); - nvlist_free(props); - return (ret); } @@ -3332,8 +3333,10 @@ devid_to_path(char *devid_str) if (ret != 0) return (NULL); - if ((path = strdup(list[0].devname)) == NULL) - return (NULL); + /* + * In a case the strdup() fails, we will just return NULL below. + */ + path = strdup(list[0].devname); devid_free_nmlist(list); From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:02:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80A0DF07; Tue, 20 Jan 2015 21:02:42 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 54DB3BA4; Tue, 20 Jan 2015 21:02:42 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t0KL2ft6067905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2015 13:02:41 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t0KL2fUB067904; Tue, 20 Jan 2015 13:02:41 -0800 (PST) (envelope-from jmg) Date: Tue, 20 Jan 2015 13:02:41 -0800 From: John-Mark Gurney To: Nathan Whitehorn Subject: Re: svn commit: r277254 - head/sys/powerpc/conf Message-ID: <20150120210241.GT1949@funkthat.com> References: <201501161741.t0GHfMH2088828@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501161741.t0GHfMH2088828@svn.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 20 Jan 2015 13:02:41 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 21:02:42 -0000 Nathan Whitehorn wrote this message on Fri, Jan 16, 2015 at 17:41 +0000: > Author: nwhitehorn > Date: Fri Jan 16 17:41:21 2015 > New Revision: 277254 > URL: https://svnweb.freebsd.org/changeset/base/277254 > > Log: > Make netbooting work again by disabling BOOTP_NFSV3. Investigate why this > causes bad RPC errors later. Ahh, thanks! :) That's probably what I was seeing at the hack-a-thon.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:11:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6993036B; Tue, 20 Jan 2015 21:11:43 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58534C8D; Tue, 20 Jan 2015 21:11:40 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0KLBbEx074355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 00:11:37 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0KLBb9F074354; Wed, 21 Jan 2015 00:11:37 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Jan 2015 00:11:37 +0300 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150120211137.GY15484@FreeBSD.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150120075126.GA42409@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Hans Petter Selasky , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 21:11:43 -0000 On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin Belousov wrote: K> > Like stated in the manual page, callout_reset_curcpu/on() does not work K> > with MPSAFE callouts any more! K> I.e. you 'fixed' some undeterminate bugs in callout migration by not K> doing migration at all anymore. K> K> > K> > You need to use callout_init_{mtx,rm,rw} and remove the custom locking K> > inside the callback in the TCP stack to get it working like before! K> K> No, you need to do this, if you think that whole callout KPI must be K> rototiled. It is up to the person who modifies the KPI, to ensure that K> existing code is not broken. K> K> As I understand, currently we are back to the one-cpu callouts. K> Do other people consider this situation acceptable ? I think this isn't acceptable. The commit to a complex subsystem lacked a review from persons involved in the system before. The commit to subsystem broke consumers of the subsystem and this was even done not accidentially, but due to Hans not caring about it. As for me this is enough to request a backout, and let the change back in only after proper review. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:14:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1FC55B6; Tue, 20 Jan 2015 21:14:19 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2A5BCB4; Tue, 20 Jan 2015 21:14:18 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0KLEGbM074370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 00:14:16 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0KLEGwI074369; Wed, 21 Jan 2015 00:14:16 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Jan 2015 00:14:16 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150120211416.GZ15484@FreeBSD.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BE21F0.6010602@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 21:14:20 -0000 Hans, On Tue, Jan 20, 2015 at 10:37:52AM +0100, Hans Petter Selasky wrote: H> It is not very hard to update existing callout clients and you can do it H> too, if you need the extra bits of performance. If it is not very hard, then you should have done that as part of your change. H> Are there more API's than the TCP stack which you think needs an update H> and are performance critical? This is the question that you should have invetigated yourself before pushing the change in. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:15:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 629A26FE; Tue, 20 Jan 2015 21:15:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3499BCC1; Tue, 20 Jan 2015 21:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KLFYIX036131; Tue, 20 Jan 2015 21:15:34 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KLFYZ2036130; Tue, 20 Jan 2015 21:15:34 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501202115.t0KLFYZ2036130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 20 Jan 2015 21:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277440 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 21:15:34 -0000 Author: will Date: Tue Jan 20 21:15:33 2015 New Revision: 277440 URL: https://svnweb.freebsd.org/changeset/base/277440 Log: Restore the CAM XPT peripheral generation counter, and export it via sysctl. Define it as an atomic uint32_t. These increments happen infrequently enough for the atomic overhead to be a problem, and since they're now independent atomics, they won't contend with xpt_lock_buses(). This counter is useful as a means of cheaply identifying whether any changes have been made to the CAM peripheral list. Userland programs have no guarantee that the counter won't change on them while being returned or while processing the information, so they must be written accordingly. Discussed with: ken, mav (in general) MFC after: 1 week Sponsored by: Spectra Logic Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jan 20 21:09:39 2015 (r277439) +++ head/sys/cam/cam_xpt.c Tue Jan 20 21:15:33 2015 (r277440) @@ -93,6 +93,8 @@ struct xpt_task { }; struct xpt_softc { + uint32_t xpt_generation; + /* number of high powered commands that can go through right now */ struct mtx xpt_highpower_lock; STAILQ_HEAD(highpowerlist, cam_ed) highpowerq; @@ -151,6 +153,8 @@ static struct xpt_softc xsoftc; SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); +SYSCTL_UINT(_kern_cam, OID_AUTO, xpt_generation, CTLFLAG_RD, + &xsoftc.xpt_generation, 0, "CAM peripheral generation count"); struct cam_doneq { struct mtx_padalign cam_doneq_mtx; @@ -976,6 +980,7 @@ xpt_add_periph(struct cam_periph *periph device->generation++; SLIST_INSERT_HEAD(&device->periphs, periph, periph_links); mtx_unlock(&device->target->bus->eb_mtx); + atomic_add_32(&xsoftc.xpt_generation, 1); } return (status); @@ -992,6 +997,7 @@ xpt_remove_periph(struct cam_periph *per device->generation++; SLIST_REMOVE(&device->periphs, periph, cam_periph, periph_links); mtx_unlock(&device->target->bus->eb_mtx); + atomic_add_32(&xsoftc.xpt_generation, 1); } } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:49:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 205FC467; Tue, 20 Jan 2015 21:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C40C90; Tue, 20 Jan 2015 21:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KLnoSA051627; Tue, 20 Jan 2015 21:49:50 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KLnoWx051626; Tue, 20 Jan 2015 21:49:50 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201501202149.t0KLnoWx051626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Tue, 20 Jan 2015 21:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277444 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 21:49:51 -0000 Author: jbeich (ports committer) Date: Tue Jan 20 21:49:50 2015 New Revision: 277444 URL: https://svnweb.freebsd.org/changeset/base/277444 Log: - Add jbeich as a ports committer - List bapt and flo as his mentors Differential Revision: https://reviews.freebsd.org/D1562 Approved by: flo (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jan 20 21:48:42 2015 (r277443) +++ head/share/misc/committers-ports.dot Tue Jan 20 21:49:50 2015 (r277444) @@ -116,6 +116,7 @@ itetcu [label="Ion-Mihai Tetcu\nitetcu@F jacula [label="Giuseppe Pilichi\njacula@FreeBSD.org\n2010/04/05"] jadawin [label="Philippe Audeoud\njadawin@FreeBSD.org\n2008/03/02"] jase [label="Jase Thew\njase@FreeBSD.org\n2012/05/30"] +jbeich [label="Jan Beich\njbeich@FreeBSD.org\n2015/01/19"] jgh [label="Jason Helfman\njgh@FreeBSD.org\n2011/12/16"] jhale [label="Jason E. Hale\njhale@FreeBSD.org\n2012/09/10"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12"] @@ -267,6 +268,7 @@ bapt -> bdrewery bapt -> bofh bapt -> eadler bapt -> grembo +bapt -> jbeich bapt -> jlaffaye bapt -> marius bapt -> marino @@ -350,6 +352,7 @@ fjoe -> osa flo -> bar flo -> jase +flo -> jbeich flo -> grembo flz -> garga From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:27:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8891022A; Tue, 20 Jan 2015 22:27:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E0F6EA; Tue, 20 Jan 2015 22:27:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMRkYp071459; Tue, 20 Jan 2015 22:27:46 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMRkt5071458; Tue, 20 Jan 2015 22:27:46 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501202227.t0KMRkt5071458@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 20 Jan 2015 22:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277448 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:27:46 -0000 Author: will Date: Tue Jan 20 22:27:45 2015 New Revision: 277448 URL: https://svnweb.freebsd.org/changeset/base/277448 Log: Remove unused strdup() #define. Modified: head/sys/cddl/compat/opensolaris/sys/sunddi.h Modified: head/sys/cddl/compat/opensolaris/sys/sunddi.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/sunddi.h Tue Jan 20 22:15:36 2015 (r277447) +++ head/sys/cddl/compat/opensolaris/sys/sunddi.h Tue Jan 20 22:27:45 2015 (r277448) @@ -35,7 +35,6 @@ #include #include -#define strdup(ptr) strdup((ptr), M_SOLARIS) #define ddi_driver_major(zfs_dip) (0) #define ddi_copyin(from, to, size, flag) \ (copyin((from), (to), (size)), 0) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:29:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB8E4382; Tue, 20 Jan 2015 22:29:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C722A758; Tue, 20 Jan 2015 22:29:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMTRfe071740; Tue, 20 Jan 2015 22:29:27 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMTReZ071739; Tue, 20 Jan 2015 22:29:27 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501202229.t0KMTReZ071739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 20 Jan 2015 22:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277449 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:29:28 -0000 Author: will Date: Tue Jan 20 22:29:27 2015 New Revision: 277449 URL: https://svnweb.freebsd.org/changeset/base/277449 Log: NSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec) Modified: head/sys/cddl/compat/opensolaris/sys/time.h Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Tue Jan 20 22:27:45 2015 (r277448) +++ head/sys/cddl/compat/opensolaris/sys/time.h Tue Jan 20 22:29:27 2015 (r277449) @@ -51,7 +51,7 @@ typedef longlong_t hrtime_t; #endif #define SEC_TO_TICK(sec) ((sec) * hz) -#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) +#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / hz)) #ifdef _KERNEL static __inline hrtime_t From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:29:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D4184C3; Tue, 20 Jan 2015 22:29:39 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6DB75D; Tue, 20 Jan 2015 22:29:38 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 25EAB1FE023; Tue, 20 Jan 2015 23:29:30 +0100 (CET) Message-ID: <54BED6FB.8060401@selasky.org> Date: Tue, 20 Jan 2015 23:30:19 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Gleb Smirnoff , Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> In-Reply-To: <20150120211137.GY15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Jason Wolfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:29:39 -0000 On 01/20/15 22:11, Gleb Smirnoff wrote: > On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin Belousov wrote: > K> > Like stated in the manual page, callout_reset_curcpu/on() does not work > K> > with MPSAFE callouts any more! > K> I.e. you 'fixed' some undeterminate bugs in callout migration by not > K> doing migration at all anymore. > K> > K> > > K> > You need to use callout_init_{mtx,rm,rw} and remove the custom locking > K> > inside the callback in the TCP stack to get it working like before! > K> > K> No, you need to do this, if you think that whole callout KPI must be > K> rototiled. It is up to the person who modifies the KPI, to ensure that > K> existing code is not broken. > K> > K> As I understand, currently we are back to the one-cpu callouts. > K> Do other people consider this situation acceptable ? > > I think this isn't acceptable. The commit to a complex subsystem > lacked a review from persons involved in the system before. The > commit to subsystem broke consumers of the subsystem and this > was even done not accidentially, but due to Hans not caring about > it. > > As for me this is enough to request a backout, and let the change > back in only after proper review. > Hi Gleb, Backing out my callout API patch means we will for sure re-introduce an unknown callout spinlock hang, as noted to me by several people. What do you think about that? Maybe "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t precision, void (*ftn)(void *), void *arg, int cpu, int flags) { sbintime_t to_sbt, pr; struct callout_cpu *cc; int cancelled, direct; + cpu = timeout_cpu; /* XXX test code XXX */ cancelled = 0; And see if he observes a callout spinlock hang or not on his test setup. The patch above should force all callouts to the same thread basically. Then we could maybe see if single threading the callouts has anything to do with solving the spinlock hang. The "rewritten" callout API still has all the features and capabilities the old one had, when used as described in "man 9 callout". At the present moment I'm not technically convinced a backout is correct. Gleb: I think we would see far better results with high speed internet links using TCP if we could extend the LRO (large receive offload) code to accumulate more than 64KBytes worth of data per call to the TCP stack instead of complaining about some callouts ending up on the same thread! Actually I have a patch for that. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:31:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7059652; Tue, 20 Jan 2015 22:31:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B23CC805; Tue, 20 Jan 2015 22:31:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMVRXe075053; Tue, 20 Jan 2015 22:31:27 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMVRUg075052; Tue, 20 Jan 2015 22:31:27 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501202231.t0KMVRUg075052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 20 Jan 2015 22:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277450 - head/sys/cddl/contrib/opensolaris/uts/common/fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:31:27 -0000 Author: will Date: Tue Jan 20 22:31:26 2015 New Revision: 277450 URL: https://svnweb.freebsd.org/changeset/base/277450 Log: Use the "zfs_gfs" tag for GFS vnodes to make them easier to identify. MFC after: 1 week Sponsored by: Spectra Logic Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Tue Jan 20 22:29:27 2015 (r277449) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Tue Jan 20 22:31:26 2015 (r277450) @@ -489,7 +489,7 @@ gfs_file_create(size_t size, vnode_t *pv * Allocate vnode and internal data structure */ fp = kmem_zalloc(size, KM_SLEEP); - error = getnewvnode("zfs", vfsp, ops, &vp); + error = getnewvnode("zfs_gfs", vfsp, ops, &vp); ASSERT(error == 0); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vp->v_data = (caddr_t)fp; From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:39:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEB52C06; Tue, 20 Jan 2015 22:39:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA98D858; Tue, 20 Jan 2015 22:39:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMdALg077110; Tue, 20 Jan 2015 22:39:10 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMdAmT077109; Tue, 20 Jan 2015 22:39:10 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501202239.t0KMdAmT077109@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Tue, 20 Jan 2015 22:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277452 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:39:11 -0000 Author: will Date: Tue Jan 20 22:39:10 2015 New Revision: 277452 URL: https://svnweb.freebsd.org/changeset/base/277452 Log: Fix arc__shrink DTrace probe's to_free argument. Remove the unnecessary #ifdef _KERNEL, which did not differ in the true or false cases. Actually set the value of to_free before using it. MFC after: 1 week Sponsored by: Spectra Logic Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jan 20 22:33:27 2015 (r277451) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jan 20 22:39:10 2015 (r277452) @@ -2540,13 +2540,9 @@ arc_shrink(void) if (arc_c > arc_c_min) { uint64_t to_free; + to_free = arc_c >> arc_shrink_shift; DTRACE_PROBE4(arc__shrink, uint64_t, arc_c, uint64_t, arc_c_min, uint64_t, arc_p, uint64_t, to_free); -#ifdef _KERNEL - to_free = arc_c >> arc_shrink_shift; -#else - to_free = arc_c >> arc_shrink_shift; -#endif if (arc_c > arc_c_min + to_free) atomic_add_64(&arc_c, -to_free); else From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:43:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E889DAD; Tue, 20 Jan 2015 22:43:27 +0000 (UTC) Received: from mail-yk0-x22d.google.com (mail-yk0-x22d.google.com [IPv6:2607:f8b0:4002:c07::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFC3B918; Tue, 20 Jan 2015 22:43:26 +0000 (UTC) Received: by mail-yk0-f173.google.com with SMTP id 142so2899349ykq.4; Tue, 20 Jan 2015 14:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=w1mGmvnti1vdI4eGWpqluVvcfh+oid55ZzhC/D8s3yM=; b=AIciQCv2rjFhO8Xs0lOwSuOz7TBOyB0JNQ2zLv590yp+0pfQyb/1TBSmWtESs4x1B8 XuN9+mmYc1pRbY/nAfovGbA8Qp7aP+5kFxUWxm/HDM2vWUdhZZ0dxESqLNyYhf4xKt/t fO5IOB55ZmcuZKoh+LZR9YaUp9SRjFYaa2iWjx68jSWsMcwb3HKp5OVZDmnTYmsVMcNe RYi6clQ0fCI9k0qL9perLruC/OTo5Pswl3K+x8nwUPKeD08nkBrVLNeWUPRcFlMghLIA a24W6/izD2gwoACEr/E138fLCXWVm1EOx5o3STpgChyqq7IYsCyUck/2h+ymy04xHykp 0tsg== MIME-Version: 1.0 X-Received: by 10.236.40.116 with SMTP id e80mr21942262yhb.186.1421793805896; Tue, 20 Jan 2015 14:43:25 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 14:43:25 -0800 (PST) In-Reply-To: <201501151532.t0FFWV2Y037455@svn.freebsd.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> Date: Tue, 20 Jan 2015 14:43:25 -0800 X-Google-Sender-Auth: nK1zISttqpPlp6lZRXNBMFraSnk Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:43:27 -0000 Please back this out now. It was a substantial interface change without review. This should not be up for debate. I hope the others have the fortitude to insist upon this. -K On Thu, Jan 15, 2015 at 7:32 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Jan 15 15:32:30 2015 > New Revision: 277213 > URL: https://svnweb.freebsd.org/changeset/base/277213 > > Log: > Major callout subsystem cleanup and rewrite: > - Close a migration race where callout_reset() failed to set the > CALLOUT_ACTIVE flag. > - Callout callback functions are now allowed to be protected by > spinlocks. > - Switching the callout CPU number cannot always be done on a > per-callout basis. See the updated timeout(9) manual page for more > information. > - The timeout(9) manual page has been updated to reflect how all the > functions inside the callout API are working. The manual page has > been made function oriented to make it easier to deduce how each of > the functions making up the callout API are working without having > to first read the whole manual page. Group all functions into a > handful of sections which should give a quick top-level overview > when the different functions should be used. > - The CALLOUT_SHAREDLOCK flag and its functionality has been removed > to reduce the complexity in the callout code and to avoid problems > about atomically stopping callouts via callout_stop(). If someone > needs it, it can be re-added. From my quick grep there are no > CALLOUT_SHAREDLOCK clients in the kernel. > - A new callout API function named "callout_drain_async()" has been > added. See the updated timeout(9) manual page for a complete > description. > - Update the callout clients in the "kern/" folder to use the callout > API properly, like cv_timedwait(). Previously there was some custom > sleepqueue code in the callout subsystem, which has been removed, > because we now allow callouts to be protected by spinlocks. This > allows us to tear down the callout like done with regular mutexes, > and a "td_slpmutex" has been added to "struct thread" to atomically > teardown the "td_slpcallout". Further the "TDF_TIMOFAIL" and > "SWT_SLEEPQTIMO" states can now be completely removed. Currently > they are marked as available and will be cleaned up in a follow up > commit. > - Bump the __FreeBSD_version to indicate kernel modules need > recompilation. > - There has been several reports that this patch "seems to squash a > serious bug leading to a callout timeout and panic". > > Kernel build testing: all architectures were built > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D1438 > Sponsored by: Mellanox Technologies > Reviewed by: jhb, adrian, sbruno and emaste > > Modified: > head/share/man/man9/Makefile > head/share/man/man9/timeout.9 > head/sys/kern/init_main.c > head/sys/kern/kern_condvar.c > head/sys/kern/kern_lock.c > head/sys/kern/kern_switch.c > head/sys/kern/kern_synch.c > head/sys/kern/kern_thread.c > head/sys/kern/kern_timeout.c > head/sys/kern/subr_sleepqueue.c > head/sys/ofed/include/linux/completion.h > head/sys/sys/_callout.h > head/sys/sys/callout.h > head/sys/sys/param.h > head/sys/sys/proc.h > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Thu Jan 15 14:47:48 2015 (r277212) > +++ head/share/man/man9/Makefile Thu Jan 15 15:32:30 2015 (r277213) > @@ -1570,6 +1570,7 @@ MLINKS+=timeout.9 callout.9 \ > timeout.9 callout_active.9 \ > timeout.9 callout_deactivate.9 \ > timeout.9 callout_drain.9 \ > + timeout.9 callout_drain_async.9 \ > timeout.9 callout_handle_init.9 \ > timeout.9 callout_init.9 \ > timeout.9 callout_init_mtx.9 \ > > Modified: head/share/man/man9/timeout.9 > ============================================================================== > --- head/share/man/man9/timeout.9 Thu Jan 15 14:47:48 2015 (r277212) > +++ head/share/man/man9/timeout.9 Thu Jan 15 15:32:30 2015 (r277213) > @@ -29,13 +29,14 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 8, 2014 > +.Dd January 14, 2015 > .Dt TIMEOUT 9 > .Os > .Sh NAME > .Nm callout_active , > .Nm callout_deactivate , > .Nm callout_drain , > +.Nm callout_drain_async , > .Nm callout_handle_init , > .Nm callout_init , > .Nm callout_init_mtx , > @@ -63,279 +64,232 @@ > .In sys/systm.h > .Bd -literal > typedef void timeout_t (void *); > +typedef void callout_func_t (void *); > .Ed > -.Ft int > -.Fn callout_active "struct callout *c" > -.Ft void > -.Fn callout_deactivate "struct callout *c" > -.Ft int > -.Fn callout_drain "struct callout *c" > -.Ft void > -.Fn callout_handle_init "struct callout_handle *handle" > -.Bd -literal > -struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); > -.Ed > -.Ft void > -.Fn callout_init "struct callout *c" "int mpsafe" > -.Ft void > -.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" > -.Ft void > -.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" > -.Ft void > -.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" > -.Ft int > -.Fn callout_pending "struct callout *c" > -.Ft int > -.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" > -.Ft int > -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ > -"void *arg" > -.Ft int > -.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ > -"void *arg" "int cpu" > -.Ft int > -.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" > -.Ft int > -.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" > -.Ft int > -.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" > -.Ft int > -.Fn callout_schedule "struct callout *c" "int ticks" > -.Ft int > -.Fn callout_schedule_curcpu "struct callout *c" "int ticks" > -.Ft int > -.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" > -.Ft int > -.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int flags" > -.Ft int > -.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int flags" > -.Ft int > -.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ > -"sbintime_t pr" "int cpu" "int flags" > -.Ft int > -.Fn callout_stop "struct callout *c" > -.Ft struct callout_handle > -.Fn timeout "timeout_t *func" "void *arg" "int ticks" > -.Ft void > -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" > .Sh DESCRIPTION > The > .Nm callout > API is used to schedule a call to an arbitrary function at a specific > -time in the future. > -Consumers of this API are required to allocate a callout structure > +time in the future in a single-shot fashion. > +Consumers of this API are required to allocate a > .Pq struct callout > -for each pending function invocation. > -This structure stores state about the pending function invocation including > -the function to be called and the time at which the function should be invoked. > -Pending function calls can be cancelled or rescheduled to a different time. > -In addition, > -a callout structure may be reused to schedule a new function call after a > -scheduled call is completed. > -.Pp > -Callouts only provide a single-shot mode. > -If a consumer requires a periodic timer, > -it must explicitly reschedule each function call. > -This is normally done by rescheduling the subsequent call within the called > -function. > +structure for each pending function invocation. > +The > +.Pq struct callout > +structure stores the full state about any pending function call and > +should be drained by a call to > +.Fn callout_drain > +or > +.Fn callout_drain_async > +before freeing. > +.Sh INITIALISATION > +.Ft void > +.Fn callout_handle_init "struct callout_handle *handle" > +This function is deprecated and is used to prepare a > +.Pq struct callout_handle > +structure before it can be used the first time. > +If this function is called on a pending timeout, the pending timeout > +cannot be cancelled and the > +.Fn untimeout > +function will return as if there was no timeout pending. > .Pp > -Callout functions must not sleep. > -They may not acquire sleepable locks, > -wait on condition variables, > -perform blocking allocation requests, > -or invoke any other action that might sleep. > +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > +This macro is deprecated and can be used instead of > +.Fn callout_handle_init > +to assign the default state to the > +.Pq struct callout_handle > +structure when declaring static timeouts. > .Pp > -Each callout structure must be initialized by > -.Fn callout_init , > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -or > -.Fn callout_init_rw > -before it is passed to any of the other callout functions. > -The > -.Fn callout_init > -function initializes a callout structure in > -.Fa c > -that is not associated with a specific lock. > +.Ft void > +.Fn callout_init "struct callout *c" "int mpsafe" > +This function prepares a > +.Pq struct callout > +structure before it can be used. > +This function should not be used when the callout is pending a timeout. > If the > .Fa mpsafe > -argument is zero, > -the callout structure is not considered to be > -.Dq multi-processor safe ; > -and the Giant lock will be acquired before calling the callout function > -and released when the callout function returns. > +argument is non-zero, the callback function will be running unlocked. > +Else the Giant mutex will be locked before calling the callback function. > .Pp > +.Ft void > +.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" > +This function prepares a > +.Pq struct callout > +structure before it can be used. > +This function should not be used when the callout is pending a timeout. > The > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -and > -.Fn callout_init_rw > -functions initialize a callout structure in > -.Fa c > -that is associated with a specific lock. > -The lock is specified by the > -.Fa mtx , > -.Fa rm , > -or > -.Fa rw > -parameter. > -The associated lock must be held while stopping or rescheduling the > -callout. > -The callout subsystem acquires the associated lock before calling the > -callout function and releases it after the function returns. > -If the callout was cancelled while the callout subsystem waited for the > -associated lock, > -the callout function is not called, > -and the associated lock is released. > -This ensures that stopping or rescheduling the callout will abort any > -previously scheduled invocation. > -.Pp > -Only regular mutexes may be used with > -.Fn callout_init_mtx ; > -spin mutexes are not supported. > -A sleepable read-mostly lock > -.Po > -one initialized with the > -.Dv RM_SLEEPABLE > -flag > -.Pc > -may not be used with > -.Fn callout_init_rm . > -Similarly, other sleepable lock types such as > -.Xr sx 9 > -and > -.Xr lockmgr 9 > -cannot be used with callouts because sleeping is not permitted in > -the callout subsystem. > -.Pp > -These > +.Fa mtx > +argument should be non-zero and should specify a pointer to a valid > +spinlock type of mutex or a valid regular non-sleepable mutex which > +the callback subsystem should lock before calling the callback > +function. > +Valid > .Fa flags > -may be specified for > -.Fn callout_init_mtx , > -.Fn callout_init_rm , > -or > -.Fn callout_init_rw : > +are: > .Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" > .It Dv CALLOUT_RETURNUNLOCKED > -The callout function will release the associated lock itself, > -so the callout subsystem should not attempt to unlock it > -after the callout function returns. > -.It Dv CALLOUT_SHAREDLOCK > -The lock is only acquired in read mode when running the callout handler. > -This flag is ignored by > -.Fn callout_init_mtx . > +It is assumed that the callout function has released the specified > +mutex before returning. > +Else the callout subsystem will release the specified mutex after the > +callout function has returned. > .El > .Pp > -The function > -.Fn callout_stop > -cancels a callout > -.Fa c > -if it is currently pending. > -If the callout is pending, then > -.Fn callout_stop > -returns a non-zero value. > -If the callout is not set, > -has already been serviced, > -or is currently being serviced, > -then zero will be returned. > -If the callout has an associated lock, > -then that lock must be held when this function is called. > -.Pp > -The function > -.Fn callout_drain > -is identical to > -.Fn callout_stop > -except that it will wait for the callout > -.Fa c > -to complete if it is already in progress. > -This function MUST NOT be called while holding any > -locks on which the callout might block, or deadlock will result. > -Note that if the callout subsystem has already begun processing this > -callout, then the callout function may be invoked before > -.Fn callout_drain > -returns. > -However, the callout subsystem does guarantee that the callout will be > -fully stopped before > -.Fn callout_drain > -returns. > -.Pp > -The > -.Fn callout_reset > -and > -.Fn callout_schedule > -function families schedule a future function invocation for callout > -.Fa c . > -If > -.Fa c > -already has a pending callout, > -it is cancelled before the new invocation is scheduled. > -These functions return a non-zero value if a pending callout was cancelled > -and zero if there was no pending callout. > -If the callout has an associated lock, > -then that lock must be held when any of these functions are called. > +.Ft void > +.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" > +This function is the same like the > +.Fn callout_init_mtx > +function except it accepts a read-mostly type of lock. > +The read-mostly lock must not be initialised with the > +.Dv RM_SLEEPABLE > +flag. > .Pp > -The time at which the callout function will be invoked is determined by > -either the > -.Fa ticks > -argument or the > -.Fa sbt , > -.Fa pr , > -and > -.Fa flags > -arguments. > -When > -.Fa ticks > -is used, > -the callout is scheduled to execute after > +.Ft void > +.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" > +This function is the same like the > +.Fn callout_init_mtx > +function except it accepts a reader-writer type of lock. > +.Sh SCHEDULING CALLOUTS > +.Ft struct callout_handle > +.Fn timeout "timeout_t *func" "void *arg" "int ticks" > +This function is deprecated and schedules a call to the function given by the argument > +.Fa func > +to take place after > .Fa ticks Ns No /hz > seconds. > Non-positive values of > .Fa ticks > are silently converted to the value > .Sq 1 . > -.Pp > The > -.Fa sbt , > -.Fa pr , > -and > -.Fa flags > -arguments provide more control over the scheduled time including > -support for higher resolution times, > -specifying the precision of the scheduled time, > -and setting an absolute deadline instead of a relative timeout. > -The callout is scheduled to execute in a time window which begins at > -the time specified in > +.Fa func > +argument should be a valid pointer to a function that takes a single > +.Fa void * > +argument. > +Upon invocation, the > +.Fa func > +function will receive > +.Fa arg > +as its only argument. > +The Giant lock is locked when the > +.Fa arg > +function is invoked and should not be unlocked by this function. > +The returned value from > +.Fn timeout > +is a > +.Ft struct callout_handle > +structure which can be used in conjunction with the > +.Fn untimeout > +function to request that a scheduled timeout be cancelled. > +As handles are recycled by the system, it is possible, although unlikely, > +that a handle from one invocation of > +.Fn timeout > +may match the handle of another invocation of > +.Fn timeout > +if both calls used the same function pointer and argument, and the first > +timeout is expired or canceled before the second call. > +Please ensure that the function and argument pointers are unique when using this function. > +.Pp > +.Ft int > +.Fn callout_reset "struct callout *c" "int ticks" "callout_func_t *func" "void *arg" > +This function is used to schedule or re-schedule a callout. > +This function at first stops the callout given by the > +.Fa c > +argument, if any. > +Then it will start the callout given by the > +.Fa c > +argument. > +The relative time until the timeout callback happens is given by the > +.Fa ticks > +argument. > +The number of ticks in a second is defined by > +.Dv hz > +and can vary from system to system. > +This function returns a non-zero value if the given callout was pending and > +the callback function was prevented from being called. > +Else a value of zero is returned. > +If a lock is associated with the callout given by the > +.Fa c > +argument and it is exclusivly locked when this function is called this > +function will always ensure that previous callback function, if any, > +is never reached. > +In other words the callout will be atomically restarted. > +Else there is no such guarantee. > +The callback function is given by the > +.Fa func > +argument and its function argument is given by the > +.Fa arg > +argument. > +.Pp > +.Ft int > +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "callout_func_t *func" \ > +"void *arg" > +This function works the same like the > +.Fn callout_reset > +function except the callback function given by the > +.Fa func > +argument will be executed on the same CPU which called this function. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_on "struct callout *c" "int ticks" "callout_func_t *func" \ > +"void *arg" "int cpu" > +This function works the same like the > +.Fn callout_reset > +function except the callback function given by the > +.Fa func > +argument will be executed on the CPU given by the > +.Fa cpu > +argument. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" > +This function works the same like the > +.Fn callout_reset > +function except the relative or absolute time after which the timeout > +callback should happen is given by the > .Fa sbt > -and extends for the amount of time specified in > -.Fa pr . > -If > +argument and extends for the amount of time specified in the > +.Fa pr > +argument. > +This function is used when you need high precision timeouts. > +If the > .Fa sbt > -specifies a time in the past, > +argument specifies a time in the past, > the window is adjusted to start at the current time. > A non-zero value for > .Fa pr > allows the callout subsystem to coalesce callouts scheduled close to each > other into fewer timer interrupts, > reducing processing overhead and power consumption. > -These > +The > .Fa flags > -may be specified to adjust the interpretation of > +argument may be non-zero to adjust the interpretation of the > .Fa sbt > -and > -.Fa pr : > +and the > +.Fa pr > +arguments: > .Bl -tag -width ".Dv C_DIRECT_EXEC" > .It Dv C_ABSOLUTE > Handle the > .Fa sbt > argument as an absolute time since boot. > -By default, > +By default, the > .Fa sbt > -is treated as a relative amount of time, > +argument is treated like a relative amount of time, > similar to > .Fa ticks . > .It Dv C_DIRECT_EXEC > @@ -347,7 +301,7 @@ Callout functions run in this context ma > and should be as small as possible because they run with absolute priority. > .It Fn C_PREL > Specifies relative event time precision as binary logarithm of time interval > -divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. > +divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4 and so on. > Note that the larger of > .Fa pr > or this value is used as the length of the time window. > @@ -360,65 +314,215 @@ Align the timeouts to > calls if possible. > .El > .Pp > -The > -.Fn callout_reset > -functions accept a > +.Ft int > +.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except the callback function given by the > .Fa func > -argument which identifies the function to be called when the time expires. > -It must be a pointer to a function that takes a single > -.Fa void * > +argument will be executed on the same CPU which called this function. > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > +.Fa func > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "callout_func_t *func" "void *arg" "int cpu" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except the callback function given by the > +.Fa func > +argument will be executed on the CPU given by the > +.Fa cpu > argument. > -Upon invocation, > +A change in the CPU selection can happen if the callout has a lock > +associated with it and is locked when this function is called. > +A change in the CPU selection cannot happen if this function is > +re-scheduled inside a callout function. > +Else the callback function given by the > .Fa func > -will receive > -.Fa arg > -as its only argument. > -The > -.Fn callout_schedule > -functions reuse the > +argument will be executed on the same CPU like previously done. > +.Pp > +.Ft int > +.Fn callout_schedule "struct callout *c" "int ticks" > +This function works the same like the > +.Fn callout_reset > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_curcpu "struct callout *c" "int ticks" > +This function works the same like the > +.Fn callout_reset_curcpu > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" > +This function works the same like the > +.Fn callout_reset_on > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt_curcpu > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Pp > +.Ft int > +.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ > +"sbintime_t pr" "int cpu" "int flags" > +This function works the same like the > +.Fn callout_reset_sbt_on > +function except it re-uses the callback function and the callback argument > +already stored in the > +.Pq struct callout > +structure. > +.Sh CHECKING THE STATE OF CALLOUTS > +.Ft int > +.Fn callout_pending "struct callout *c" > +This function returns non-zero if the callout pointed to by the > +.Fa c > +argument is pending for callback. > +Else this function returns zero. > +This function returns zero when inside the callout function if the > +callout is not re-scheduled. > +.Pp > +.Ft int > +.Fn callout_active "struct callout *c" > +This function is deprecated and returns non-zero if the callout > +pointed to by the > +.Fa c > +argument was scheduled in the past. > +Else this function returns zero. > +This function also returns zero after the > +.Fn callout_deactivate > +or the > +.Fn callout_stop > +or the > +.Fn callout_drain > +or the > +.Fn callout_drain_async > +function is called on the same callout as given by the > +.Fa c > +argument. > +.Pp > +.Ft void > +.Fn callout_deactivate "struct callout *c" > +This function is deprecated and ensures that subsequent calls to the > +.Fn callout_activate > +function returns zero until the callout is scheduled again. > +.Sh STOPPING CALLOUTS > +.Ft void > +.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" > +This function is deprecated and cancels the timeout associated with the > +.Fa handle > +argument using the function pointed to by the > .Fa func > -and > +argument and having the > .Fa arg > -arguments from the previous callout. > -Note that one of the > -.Fn callout_reset > -functions must always be called to initialize > +arguments to validate the handle. > +If the handle does not correspond to a timeout with > +the function > .Fa func > -and > +taking the argument > .Fa arg > -before one of the > -.Fn callout_schedule > -functions can be used. > +no action is taken. The > +.Fa handle > +must be initialised by a previous call to > +.Fn timeout , > +.Fn callout_handle_init > +or assigned the value of > +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > +before being passed to > +.Fn untimeout . > +The behavior of calling > +.Fn untimeout > +with an uninitialised handle > +is undefined. > .Pp > -The callout subsystem provides a softclock thread for each CPU in the system. > -Callouts are assigned to a single CPU and are executed by the softclock thread > -for that CPU. > -Initially, > -callouts are assigned to CPU 0. > -The > -.Fn callout_reset_on , > -.Fn callout_reset_sbt_on , > -.Fn callout_schedule_on > -and > -.Fn callout_schedule_sbt_on > -functions assign the callout to CPU > -.Fa cpu . > -The > -.Fn callout_reset_curcpu , > -.Fn callout_reset_sbt_curpu , > -.Fn callout_schedule_curcpu > -and > -.Fn callout_schedule_sbt_curcpu > -functions assign the callout to the current CPU. > -The > -.Fn callout_reset , > -.Fn callout_reset_sbt , > -.Fn callout_schedule > -and > -.Fn callout_schedule_sbt > -functions schedule the callout to execute in the softclock thread of the CPU > -to which it is currently assigned. > +.Ft int > +.Fn callout_stop "struct callout *c" > +This function is used to stop a timeout function invocation associated with the callout pointed to by the > +.Fa c > +argument, in a non-blocking fashion. > +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialised. > +This function returns a non-zero value if the given callout was pending and > +the callback function was prevented from being called. > +Else a value of zero is returned. > +If a lock is associated with the callout given by the > +.Fa c > +argument and it is exclusivly locked when this function is called, the > +.Fn callout_stop > +function will always ensure that the callback function is never reached. > +In other words the callout will be atomically stopped. > +Else there is no such guarantee. > +.Sh DRAINING CALLOUTS > +.Ft int > +.Fn callout_drain "struct callout *c" > +This function works the same like the > +.Fn callout_stop > +function except it ensures that all callback functions have returned and there are no more references to the callout pointed to by the > +.Fa c > +argument inside the callout subsystem before it returns. > +Also this function ensures that the lock, if any, associated with the > +callout is no longer being used. > +When this function returns, it is safe to free the callout structure pointed to by the > +.Fa c > +argument. > .Pp > +.Ft int > +.Fn callout_drain_async "struct callout *c" "callout_func_t *fn" "void *arg" > +This function is non-blocking and works the same like the > +.Fn callout_stop > +function except if it returns non-zero it means the callback function pointed to by the > +.Fa fn > +argument will be called back with the > +.Fa arg > +argument when all references to the callout pointed to by the > +.Fa c > +argument are gone. > +If this function returns zero, it is safe to free the callout structure pointed to by the > +.Fa c > +argument right away. > +.Sh CALLOUT FUNCTION RESTRICTIONS > +Callout functions must not sleep. > +They may not acquire sleepable locks, wait on condition variables, > +perform blocking allocation requests, or invoke any other action that > +might sleep. > +.Sh CALLOUT SUBSYSTEM INTERNALS > +The callout subsystem has its own set of spinlocks to protect its internal state. > +The callout subsystem provides a softclock thread for each CPU in the > +system. > +Callouts are assigned to a single CPU and are executed by the > +softclock thread for that CPU. > +Initially, callouts are assigned to CPU 0. > Softclock threads are not pinned to their respective CPUs by default. > The softclock thread for CPU 0 can be pinned to CPU 0 by setting the > .Va kern.pin_default_swi > @@ -427,50 +531,7 @@ Softclock threads for CPUs other than ze > respective CPUs by setting the > .Va kern.pin_pcpu_swi > loader tunable to a non-zero value. > -.Pp > -The macros > -.Fn callout_pending , > -.Fn callout_active > -and > -.Fn callout_deactivate > -provide access to the current state of the callout. > -The > -.Fn callout_pending > -macro checks whether a callout is > -.Em pending ; > -a callout is considered > -.Em pending > -when a timeout has been set but the time has not yet arrived. > -Note that once the timeout time arrives and the callout subsystem > -starts to process this callout, > -.Fn callout_pending > -will return > -.Dv FALSE > -even though the callout function may not have finished > -.Pq or even begun > -executing. > -The > -.Fn callout_active > -macro checks whether a callout is marked as > -.Em active , > -and the > -.Fn callout_deactivate > -macro clears the callout's > -.Em active > -flag. > -The callout subsystem marks a callout as > -.Em active > -when a timeout is set and it clears the > -.Em active > -flag in > -.Fn callout_stop > -and > -.Fn callout_drain , > -but it > -.Em does not > -clear it when a callout expires normally via the execution of the > -callout function. > -.Ss "Avoiding Race Conditions" > +.Sh "AVOIDING RACE CONDITIONS" > The callout subsystem invokes callout functions from its own thread > context. > Without some kind of synchronization, > @@ -487,7 +548,7 @@ synchronization concerns. > The first approach is preferred as it is the simplest: > .Bl -enum -offset indent > .It > -Callouts can be associated with a specific lock when they are initialized > +Callouts can be associated with a specific lock when they are initialised > by > .Fn callout_init_mtx , > .Fn callout_init_rm , > @@ -508,7 +569,7 @@ or > .Fn callout_schedule > functions to provide this safety. > .Pp > -A callout initialized via > +A callout initialised via > .Fn callout_init > with > .Fa mpsafe > @@ -531,9 +592,8 @@ function families > .Pc > indicates whether or not the callout was removed. > If it is known that the callout was set and the callout function has > -not yet executed, then a return value of > -.Dv FALSE > -indicates that the callout function is about to be called. > +not yet executed, then a return value of zero indicates that the > +callout function is about to be called. > For example: > .Bd -literal -offset indent > if (sc->sc_flags & SCFLG_CALLOUT_RUNNING) { > @@ -589,16 +649,14 @@ The callout function should first check > .Em pending > flag and return without action if > .Fn callout_pending > -returns > -.Dv TRUE . > +returns non-zero. > This indicates that the callout was rescheduled using > .Fn callout_reset > just before the callout function was invoked. > If > .Fn callout_active > -returns > -.Dv FALSE > -then the callout function should also return without action. > +returns zero then the callout function should also return without > +action. > This indicates that the callout has been stopped. > Finally, the callout function should call > .Fn callout_deactivate > @@ -668,129 +726,13 @@ a callout should always be drained prior > or releasing the storage for the callout structure. > .Sh LEGACY API > .Bf Sy > -The functions below are a legacy API that will be removed in a future release. > -New code should not use these routines. > -.Ef > -.Pp > -The function > -.Fn timeout > -schedules a call to the function given by the argument > -.Fa func > -to take place after > -.Fa ticks Ns No /hz > -seconds. > -Non-positive values of > -.Fa ticks > -are silently converted to the value > -.Sq 1 . > -.Fa func > -should be a pointer to a function that takes a > -.Fa void * > -argument. > -Upon invocation, > -.Fa func > -will receive > -.Fa arg > -as its only argument. > -The return value from > +The > .Fn timeout > -is a > -.Ft struct callout_handle > -which can be used in conjunction with the > -.Fn untimeout > -function to request that a scheduled timeout be canceled. > -.Pp > -The function > -.Fn callout_handle_init > -can be used to initialize a handle to a state which will cause > -any calls to > -.Fn untimeout > -with that handle to return with no side > -effects. > -.Pp > -Assigning a callout handle the value of > -.Fn CALLOUT_HANDLE_INITIALIZER > -performs the same function as > -.Fn callout_handle_init > -and is provided for use on statically declared or global callout handles. > -.Pp > -The function > -.Fn untimeout > -cancels the timeout associated with > -.Fa handle > -using the > -.Fa func > and > -.Fa arg > -arguments to validate the handle. > -If the handle does not correspond to a timeout with > -the function > -.Fa func > -taking the argument > -.Fa arg > -no action is taken. > -.Fa handle > -must be initialized by a previous call to > -.Fn timeout , > -.Fn callout_handle_init , > -or assigned the value of > -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" > -before being passed to > -.Fn untimeout . > -The behavior of calling > .Fn untimeout > -with an uninitialized handle > -is undefined. > -.Pp > -As handles are recycled by the system, it is possible (although unlikely) > -that a handle from one invocation of > -.Fn timeout > -may match the handle of another invocation of > -.Fn timeout > -if both calls used the same function pointer and argument, and the first > -timeout is expired or canceled before the second call. > -The timeout facility offers O(1) running time for > -.Fn timeout > -and > -.Fn untimeout . > -Timeouts are executed from > -.Fn softclock > -with the > -.Va Giant > -lock held. > -Thus they are protected from re-entrancy. > -.Sh RETURN VALUES > -The > -.Fn callout_active > -macro returns the state of a callout's > -.Em active > -flag. > -.Pp > -The > -.Fn callout_pending > -macro returns the state of a callout's > -.Em pending > -flag. > -.Pp > -The > -.Fn callout_reset > -and > -.Fn callout_schedule > -function families return non-zero if the callout was pending before the new > -function invocation was scheduled. > -.Pp > -The > -.Fn callout_stop > -and > -.Fn callout_drain > -functions return non-zero if the callout was still pending when it was > -called or zero otherwise. > -The > -.Fn timeout > -function returns a > -.Ft struct callout_handle > -that can be passed to > -.Fn untimeout . > +functions are a legacy API that will be removed in a future release. > +New code should not use these routines. > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:51:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7483226; Tue, 20 Jan 2015 22:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99557A15; Tue, 20 Jan 2015 22:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMpUcU083559; Tue, 20 Jan 2015 22:51:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMpU6T083558; Tue, 20 Jan 2015 22:51:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501202251.t0KMpU6T083558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 20 Jan 2015 22:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277453 - head/tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:51:30 -0000 Author: ngie Date: Tue Jan 20 22:51:29 2015 New Revision: 277453 URL: https://svnweb.freebsd.org/changeset/base/277453 Log: Garbage collect a prove test wrapper MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Deleted: head/tools/regression/lib/libc/stdio/test-fmemopen.t Modified: Directory Properties: head/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:57:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D14A261B; Tue, 20 Jan 2015 22:57:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B122DA61; Tue, 20 Jan 2015 22:57:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KMv0RS086897; Tue, 20 Jan 2015 22:57:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KMv0Bi086894; Tue, 20 Jan 2015 22:57:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501202257.t0KMv0Bi086894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 20 Jan 2015 22:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277454 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 22:57:00 -0000 Author: ian Date: Tue Jan 20 22:56:59 2015 New Revision: 277454 URL: https://svnweb.freebsd.org/changeset/base/277454 Log: Add inline implementations of arm bus_space_read/write_N(). Reviewed by: cognet Modified: head/sys/arm/arm/bus_space-v6.c head/sys/arm/include/bus.h Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Tue Jan 20 22:51:29 2015 (r277453) +++ head/sys/arm/arm/bus_space-v6.c Tue Jan 20 22:56:59 2015 (r277454) @@ -65,10 +65,10 @@ static struct bus_space _base_tag = { generic_bs_barrier, /* read (single) */ - generic_bs_r_1, - generic_armv4_bs_r_2, - generic_bs_r_4, - NULL, + NULL, /* bs_r_1, Use inline code in bus.h */ + NULL, /* bs_r_2, Use inline code in bus.h */ + NULL, /* bs_r_4, Use inline code in bus.h */ + NULL, /* bs_r_8, Use inline code in bus.h */ /* read multiple */ generic_bs_rm_1, @@ -83,10 +83,10 @@ static struct bus_space _base_tag = { NULL, /* write (single) */ - generic_bs_w_1, - generic_armv4_bs_w_2, - generic_bs_w_4, - NULL, + NULL, /* bs_w_1, Use inline code in bus.h */ + NULL, /* bs_w_2, Use inline code in bus.h */ + NULL, /* bs_w_4, Use inline code in bus.h */ + NULL, /* bs_w_8, Use inline code in bus.h */ /* write multiple */ generic_bs_wm_1, @@ -119,10 +119,10 @@ static struct bus_space _base_tag = { NULL, /* read stream (single) */ - NULL, - NULL, - NULL, - NULL, + NULL, /* bs_r_1_s, Use inline code in bus.h */ + NULL, /* bs_r_2_s, Use inline code in bus.h */ + NULL, /* bs_r_4_s, Use inline code in bus.h */ + NULL, /* bs_r_8_s, Use inline code in bus.h */ /* read multiple stream */ NULL, @@ -137,10 +137,10 @@ static struct bus_space _base_tag = { NULL, /* write stream (single) */ - NULL, - NULL, - NULL, - NULL, + NULL, /* bs_w_1_s, Use inline code in bus.h */ + NULL, /* bs_w_2_s, Use inline code in bus.h */ + NULL, /* bs_w_4_s, Use inline code in bus.h */ + NULL, /* bs_w_8_s, Use inline code in bus.h */ /* write multiple stream */ NULL, Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Tue Jan 20 22:51:29 2015 (r277453) +++ head/sys/arm/include/bus.h Tue Jan 20 22:56:59 2015 (r277454) @@ -252,10 +252,6 @@ struct bus_space { #define __bs_c(a,b) __CONCAT(a,b) #define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) -#define __bs_rs(sz, t, h, o) \ - (*(t)->__bs_opname(r,sz))((t)->bs_cookie, h, o) -#define __bs_ws(sz, t, h, o, v) \ - (*(t)->__bs_opname(w,sz))((t)->bs_cookie, h, o, v) #define __bs_nonsingle(type, sz, t, h, o, a, c) \ (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, a, c) #define __bs_set(type, sz, t, h, o, v, c) \ @@ -272,6 +268,28 @@ struct bus_space { (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c) +#define __generate_inline_bs_rs(IFN, MBR, TYP) \ + static inline TYP \ + IFN(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) \ + { \ + \ + if (__predict_true(t->MBR == NULL)) \ + return (*(volatile TYP *)(h + o)); \ + else \ + return (t->MBR(t->bs_cookie, h, o)); \ + } + +#define __generate_inline_bs_ws(IFN, MBR, TYP) \ + static inline void \ + IFN(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, TYP v)\ + { \ + \ + if (__predict_true(t->MBR == NULL)) \ + *(volatile TYP *)(h + o) = v; \ + else \ + t->MBR(t->bs_cookie, h, o, v); \ + } + /* * Mapping and unmapping operations. */ @@ -304,15 +322,15 @@ struct bus_space { /* * Bus read (single) operations. */ -#define bus_space_read_1(t, h, o) __bs_rs(1,(t),(h),(o)) -#define bus_space_read_2(t, h, o) __bs_rs(2,(t),(h),(o)) -#define bus_space_read_4(t, h, o) __bs_rs(4,(t),(h),(o)) -#define bus_space_read_8(t, h, o) __bs_rs(8,(t),(h),(o)) - -#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) -#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) -#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) -#define bus_space_read_stream_8(t, h, o) __bs_rs_s(8,8,(t),(h),(o)) +__generate_inline_bs_rs(bus_space_read_1, bs_r_1, uint8_t); +__generate_inline_bs_rs(bus_space_read_2, bs_r_2, uint16_t); +__generate_inline_bs_rs(bus_space_read_4, bs_r_4, uint32_t); +__generate_inline_bs_rs(bus_space_read_8, bs_r_8, uint64_t); + +__generate_inline_bs_rs(bus_space_read_stream_1, bs_r_1_s, uint8_t); +__generate_inline_bs_rs(bus_space_read_stream_2, bs_r_2_s, uint16_t); +__generate_inline_bs_rs(bus_space_read_stream_4, bs_r_4_s, uint32_t); +__generate_inline_bs_rs(bus_space_read_stream_8, bs_r_8_s, uint64_t); /* * Bus read multiple operations. @@ -361,15 +379,15 @@ struct bus_space { /* * Bus write (single) operations. */ -#define bus_space_write_1(t, h, o, v) __bs_ws(1,(t),(h),(o),(v)) -#define bus_space_write_2(t, h, o, v) __bs_ws(2,(t),(h),(o),(v)) -#define bus_space_write_4(t, h, o, v) __bs_ws(4,(t),(h),(o),(v)) -#define bus_space_write_8(t, h, o, v) __bs_ws(8,(t),(h),(o),(v)) - -#define bus_space_write_stream_1(t, h, o, v) __bs_ws_s(1,(t),(h),(o),(v)) -#define bus_space_write_stream_2(t, h, o, v) __bs_ws_s(2,(t),(h),(o),(v)) -#define bus_space_write_stream_4(t, h, o, v) __bs_ws_s(4,(t),(h),(o),(v)) -#define bus_space_write_stream_8(t, h, o, v) __bs_ws_s(8,(t),(h),(o),(v)) +__generate_inline_bs_ws(bus_space_write_1, bs_w_1, uint8_t); +__generate_inline_bs_ws(bus_space_write_2, bs_w_2, uint16_t); +__generate_inline_bs_ws(bus_space_write_4, bs_w_4, uint32_t); +__generate_inline_bs_ws(bus_space_write_8, bs_w_8, uint64_t); + +__generate_inline_bs_ws(bus_space_write_stream_1, bs_w_1_s, uint8_t); +__generate_inline_bs_ws(bus_space_write_stream_2, bs_w_2_s, uint16_t); +__generate_inline_bs_ws(bus_space_write_stream_4, bs_w_4_s, uint32_t); +__generate_inline_bs_ws(bus_space_write_stream_8, bs_w_8_s, uint64_t); /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:17:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFBE432A for ; Tue, 20 Jan 2015 23:17:31 +0000 (UTC) Received: from nm37-vm6.bullet.mail.bf1.yahoo.com (nm37-vm6.bullet.mail.bf1.yahoo.com [72.30.238.206]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7653AC76 for ; Tue, 20 Jan 2015 23:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421795448; bh=mU5lQbB3mOBJastnhmWRgVchHJ3+P1uqHUvz12jFf6s=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=rAyUyr2gfSz6cbHBgjRbrErXz3KF7Caj7RqIdpuxJoSgOmaZqHyrTn7Jf0ndSygXpJSEc+0m3KvaSfYcDoy/v3ICk8sn9rLkt/EkEAyx957uAAtLSSjte3CKoe8UG1ymApCVtrxQ1/tKpPkK9E0vyMahdflDzu7rdtLj2z6IpRL4NBXvEHOaOo+NihY5zfjlLFKmd+Aejw0m1WzD+q2TdXdmg5k7s7FgwB6lVYkyy2oBjD2rqd8wHTAvnJDaSmuVMw0KDlJYQdvjskT7ML70DnbnHz6Ur1fRlOBIGtzAt13xH3Ktlu0fYax97vaJen0gHpVxvPFMrSpA35KPaSDm7Q== Received: from [98.139.215.142] by nm37.bullet.mail.bf1.yahoo.com with NNFMP; 20 Jan 2015 23:10:48 -0000 Received: from [98.139.211.206] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 20 Jan 2015 23:10:48 -0000 Received: from [127.0.0.1] by smtp215.mail.bf1.yahoo.com with NNFMP; 20 Jan 2015 23:10:48 -0000 X-Yahoo-Newman-Id: 568883.3178.bm@smtp215.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: H8MP0D4VM1mqJSyFt3xNmTh2whd.nn1BM6W_4Gq8ZQ0CysM yA.gbdmxv3ZuZ7sFiYz.8cFsQ.tBCLAv1g6gAVx4vyzF1TmpLCxTejtcISNi Jh7Yi7f87vypaNWwIuY.FNDMoCxM2Bx0HrRxbISXWQKStOShoulQij.DbN5L L_6.OKn2O1o5p9fT5MvA9mxzWJNouvoDJ0IoD.LOEg9_ec6.okVNFZKtL728 zHNacJ4FvjHokbzX.0nNi5ooynVYZMxxQ5YMh9nxuxsU7HSCeHpTPSnmUA0x JZbskxlpgovrYCLK_R43EkLhdidU71xpKRQvJNi7R1v6OX7SB.8s7cpu5Z.1 TGZhacsEvfmPGlB.DusCtEiTVVAWcRvpkTbPQZQqV9wt4zlBcr1yQB6CXElQ 6IIaZyy2VJf8QS3W_VgWIlEddDzdZnDw_A3ijgtoHuTEBXtSpd5wHbr23_zk 1Upw13j3G64ijhIkewbMWtvpywBKCwaiO369GJkx5p_nk3CU5jnSAZGLIuiz k3N_hoFhvphS9ec01O_6s8IHb.3ic4EoTuBPBxRf_FF4p9GC3yVibmS12yc4 s7Lo_pp4SidgQ3pt.8liJ3Prczn4s3EJHbYF3oQQSIHcZgisJEQDs76Bk.Wl gS_zk499WJQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BEE07A.3070207@FreeBSD.org> Date: Tue, 20 Jan 2015 18:10:50 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> In-Reply-To: <20150106203344.GB26068@ox> Content-Type: multipart/mixed; boundary="------------050000020104050008050000" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:17:31 -0000 This is a multi-part message in MIME format. --------------050000020104050008050000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi; I got this patch from the OpenBSD-tech list[1]. Perhaps this fixes the gcc issue? Apparently it's required for mesa too. Pedro. [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 On 01/06/15 15:33, Navdeep Parhar wrote: > On Tue, Jan 06, 2015 at 07:58:34PM +0100, Luigi Rizzo wrote: >> >> On Thu, Jan 1, 2015 at 12:19 AM, Navdeep Parhar wrote: >> >> Author: np >> Date: Wed Dec 31 23:19:16 2014 >> New Revision: 276485 >> URL: https://svnweb.freebsd.org/changeset/base/276485 >> >> Log: >> cxgbe(4): major tx rework. >> >> >> FYI, this commit has some unnamed unions (eg. in t4_mp_ring.c) >> which prevent the kernel from compiling with our stock gcc >> and its standard kernel build flags (specifically -std=...). >> >> Adding the following in the kernel config >> >> makeoptions COPTFLAGS="-fms-extensions" >> >> seems to do the job >> >> I know it is unavoidable that we'll end up with gcc not working, >> but maybe we can still avoid unnamed unions. > There are two unresolved issues with mp_ring and I had to make the > driver amd64-only while I consider my options. > > - platforms where gcc is the default (and our version has problems with > unnamed unions). This is simple to fix but reduces the readability of > the code. But sure, if building head with gcc is popular then that > trumps readability. I wonder if adding -fms-extensions just to the > driver's build flags would be an acceptable compromise. > - platforms without the acq/rel versions of 64b cmpset. I think it > would be simple to add acq/rel variants to i386/pc98 and others that > already have 64b cmpset. The driver will be permanently unplugged from > whatever remains (only 32 bit powerpc I think). > > I'll try to sort all this out within the next couple of weeks. > > Regards, > Navdeep > >> cheers >> luigi >> >> >> >> a) Front load as much work as possible in if_transmit, before any driver >> lock or software queue has to get involved. >> >> b) Replace buf_ring with a brand new mp_ring (multiproducer ring). This >> is specifically for the tx multiqueue model where one of the if_transmit >> producer threads becomes the consumer and other producers carry on as >> usual. mp_ring is implemented as standalone code and it should be >> possible to use it in any driver with tx multiqueue. It also has: >> - the ability to enqueue/dequeue multiple items. This might become >> significant if packet batching is ever implemented. >> - an abdication mechanism to allow a thread to give up writing tx >> descriptors and have another if_transmit thread take over. A thread >> that's writing tx descriptors can end up doing so for an unbounded >> time period if a) there are other if_transmit threads continuously >> feeding the sofware queue, and b) the chip keeps up with whatever the >> thread is throwing at it. >> - accurate statistics about interesting events even when the stats come >> at the expense of additional branches/conditional code. >> >> The NIC txq lock is uncontested on the fast path at this point. I've >> left it there for synchronization with the control events (interface >> up/down, modload/unload). >> >> c) Add support for "type 1" coalescing work request in the normal NIC tx >> path. This work request is optimized for frames with a single item in >> the DMA gather list. These are very common when forwarding packets. >> Note that netmap tx in cxgbe already uses these "type 1" work requests. >> >> d) Do not request automatic cidx updates every 32 descriptors. Instead, >> request updates via bits in individual work requests (still every 32 >> descriptors approximately). Also, request an automatic final update >> when the queue idles after activity. This means NIC tx reclaim is still >> performed lazily but it will catch up quickly as soon as the queue >> idles. This seems to be the best middle ground and I'll probably do >> something similar for netmap tx as well. >> >> e) Implement a faster tx path for WRQs (used by TOE tx and control >> queues, _not_ by the normal NIC tx). Allow work requests to be written >> directly to the hardware descriptor ring if room is available. I will >> convert t4_tom and iw_cxgbe modules to this faster style gradually. >> >> MFC after: 2 months >> >> Added: >> head/sys/dev/cxgbe/t4_mp_ring.c (contents, props changed) >> head/sys/dev/cxgbe/t4_mp_ring.h (contents, props changed) >> Modified: >> head/sys/conf/files >> head/sys/dev/cxgbe/adapter.h >> head/sys/dev/cxgbe/t4_l2t.c >> head/sys/dev/cxgbe/t4_main.c >> head/sys/dev/cxgbe/t4_sge.c >> head/sys/modules/cxgbe/if_cxgbe/Makefile >> >> Modified: head/sys/conf/files >> =========================================================================== >> === >> --- head/sys/conf/files Wed Dec 31 22:52:43 2014 (r276484) >> +++ head/sys/conf/files Wed Dec 31 23:19:16 2014 (r276485) >> @@ -1142,6 +1142,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p >> compile-with "${NORMAL_C} -I$S/dev/cxgb" >> dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ >> compile-with "${NORMAL_C} -I$S/dev/cxgb" >> +dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ >> + compile-with "${NORMAL_C} -I$S/dev/cxgbe" >> dev/cxgbe/t4_main.c optional cxgbe pci \ >> compile-with "${NORMAL_C} -I$S/dev/cxgbe" >> dev/cxgbe/t4_netmap.c optional cxgbe pci \ >> >> Modified: head/sys/dev/cxgbe/adapter.h >> =========================================================================== >> === >> --- head/sys/dev/cxgbe/adapter.h Wed Dec 31 22:52:43 2014 >> (r276484) >> +++ head/sys/dev/cxgbe/adapter.h Wed Dec 31 23:19:16 2014 >> (r276485) >> @@ -152,7 +152,8 @@ enum { >> CL_METADATA_SIZE = CACHE_LINE_SIZE, >> >> SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in >> desc */ >> - TX_SGL_SEGS = 36, >> + TX_SGL_SEGS = 39, >> + TX_SGL_SEGS_TSO = 38, >> TX_WR_FLITS = SGE_MAX_WR_LEN / 8 >> }; >> >> @@ -273,6 +274,7 @@ struct port_info { >> struct timeval last_refreshed; >> struct port_stats stats; >> u_int tnl_cong_drops; >> + u_int tx_parse_error; >> >> eventhandler_tag vlan_c; >> >> @@ -308,23 +310,9 @@ struct tx_desc { >> __be64 flit[8]; >> }; >> >> -struct tx_map { >> - struct mbuf *m; >> - bus_dmamap_t map; >> -}; >> - >> -/* DMA maps used for tx */ >> -struct tx_maps { >> - struct tx_map *maps; >> - uint32_t map_total; /* # of DMA maps */ >> - uint32_t map_pidx; /* next map to be used */ >> - uint32_t map_cidx; /* reclaimed up to this index */ >> - uint32_t map_avail; /* # of available maps */ >> -}; >> - >> struct tx_sdesc { >> + struct mbuf *m; /* m_nextpkt linked chain of frames */ >> uint8_t desc_used; /* # of hardware descriptors used by the WR >> */ >> - uint8_t credits; /* NIC txq: # of frames sent out in the WR >> */ >> }; >> >> >> @@ -378,16 +366,12 @@ struct sge_iq { >> enum { >> EQ_CTRL = 1, >> EQ_ETH = 2, >> -#ifdef TCP_OFFLOAD >> EQ_OFLD = 3, >> -#endif >> >> /* eq flags */ >> - EQ_TYPEMASK = 7, /* 3 lsbits hold the type */ >> - EQ_ALLOCATED = (1 << 3), /* firmware resources allocated */ >> - EQ_DOOMED = (1 << 4), /* about to be destroyed */ >> - EQ_CRFLUSHED = (1 << 5), /* expecting an update from SGE */ >> - EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps >> */ >> + EQ_TYPEMASK = 0x3, /* 2 lsbits hold the type (see >> above) */ >> + EQ_ALLOCATED = (1 << 2), /* firmware resources allocated */ >> + EQ_ENABLED = (1 << 3), /* open for business */ >> }; >> >> /* Listed in order of preference. Update t4_sysctls too if you change >> these */ >> @@ -402,32 +386,25 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB >> struct sge_eq { >> unsigned int flags; /* MUST be first */ >> unsigned int cntxt_id; /* SGE context id for the eq */ >> - bus_dma_tag_t desc_tag; >> - bus_dmamap_t desc_map; >> - char lockname[16]; >> struct mtx eq_lock; >> >> struct tx_desc *desc; /* KVA of descriptor ring */ >> - bus_addr_t ba; /* bus address of descriptor ring */ >> - struct sge_qstat *spg; /* status page, for convenience */ >> uint16_t doorbells; >> volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ >> u_int udb_qid; /* relative qid within the doorbell page */ >> - uint16_t cap; /* max # of desc, for convenience */ >> - uint16_t avail; /* available descriptors, for convenience * >> / >> - uint16_t qsize; /* size (# of entries) of the queue */ >> + uint16_t sidx; /* index of the entry with the status page >> */ >> uint16_t cidx; /* consumer idx (desc idx) */ >> uint16_t pidx; /* producer idx (desc idx) */ >> - uint16_t pending; /* # of descriptors used since last >> doorbell */ >> + uint16_t equeqidx; /* EQUEQ last requested at this pidx */ >> + uint16_t dbidx; /* pidx of the most recent doorbell */ >> uint16_t iqid; /* iq that gets egr_update for the eq */ >> uint8_t tx_chan; /* tx channel used by the eq */ >> - struct task tx_task; >> - struct callout tx_callout; >> + volatile u_int equiq; /* EQUIQ outstanding */ >> >> - /* stats */ >> - >> - uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for eq >> */ >> - uint32_t unstalled; /* recovered from stall */ >> + bus_dma_tag_t desc_tag; >> + bus_dmamap_t desc_map; >> + bus_addr_t ba; /* bus address of descriptor ring */ >> + char lockname[16]; >> }; >> >> struct sw_zone_info { >> @@ -499,18 +476,19 @@ struct sge_fl { >> struct cluster_layout cll_alt; /* alternate refill zone, layout */ >> }; >> >> +struct mp_ring; >> + >> /* txq: SGE egress queue + what's needed for Ethernet NIC */ >> struct sge_txq { >> struct sge_eq eq; /* MUST be first */ >> >> struct ifnet *ifp; /* the interface this txq belongs to */ >> - bus_dma_tag_t tx_tag; /* tag for transmit buffers */ >> - struct buf_ring *br; /* tx buffer ring */ >> + struct mp_ring *r; /* tx software ring */ >> struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ >> - struct mbuf *m; /* held up due to temporary resource >> shortage */ >> - >> - struct tx_maps txmaps; >> + struct sglist *gl; >> + __be32 cpl_ctrl0; /* for convenience */ >> >> + struct task tx_reclaim_task; >> /* stats for common events first */ >> >> uint64_t txcsum; /* # of times hardware assisted with >> checksum */ >> @@ -519,13 +497,12 @@ struct sge_txq { >> uint64_t imm_wrs; /* # of work requests with immediate data * >> / >> uint64_t sgl_wrs; /* # of work requests with direct SGL */ >> uint64_t txpkt_wrs; /* # of txpkt work requests (not coalesced) >> */ >> - uint64_t txpkts_wrs; /* # of coalesced tx work requests */ >> - uint64_t txpkts_pkts; /* # of frames in coalesced tx work >> requests */ >> + uint64_t txpkts0_wrs; /* # of type0 coalesced tx work requests */ >> + uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ >> + uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ >> + uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ >> >> /* stats for not-that-common events */ >> - >> - uint32_t no_dmamap; /* no DMA map to load the mbuf */ >> - uint32_t no_desc; /* out of hardware descriptors */ >> } __aligned(CACHE_LINE_SIZE); >> >> /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ >> @@ -574,7 +551,13 @@ struct wrqe { >> STAILQ_ENTRY(wrqe) link; >> struct sge_wrq *wrq; >> int wr_len; >> - uint64_t wr[] __aligned(16); >> + char wr[] __aligned(16); >> +}; >> + >> +struct wrq_cookie { >> + TAILQ_ENTRY(wrq_cookie) link; >> + int ndesc; >> + int pidx; >> }; >> >> /* >> @@ -585,17 +568,32 @@ struct sge_wrq { >> struct sge_eq eq; /* MUST be first */ >> >> struct adapter *adapter; >> + struct task wrq_tx_task; >> + >> + /* Tx desc reserved but WR not "committed" yet. */ >> + TAILQ_HEAD(wrq_incomplete_wrs , wrq_cookie) incomplete_wrs; >> >> - /* List of WRs held up due to lack of tx descriptors */ >> + /* List of WRs ready to go out as soon as descriptors are >> available. */ >> STAILQ_HEAD(, wrqe) wr_list; >> + u_int nwr_pending; >> + u_int ndesc_needed; >> >> /* stats for common events first */ >> >> - uint64_t tx_wrs; /* # of tx work requests */ >> + uint64_t tx_wrs_direct; /* # of WRs written directly to desc ring. >> */ >> + uint64_t tx_wrs_ss; /* # of WRs copied from scratch space. */ >> + uint64_t tx_wrs_copied; /* # of WRs queued and copied to desc ring. >> */ >> >> /* stats for not-that-common events */ >> >> - uint32_t no_desc; /* out of hardware descriptors */ >> + /* >> + * Scratch space for work requests that wrap around after reaching >> the >> + * status page, and some infomation about the last WR that used it. >> + */ >> + uint16_t ss_pidx; >> + uint16_t ss_len; >> + uint8_t ss[SGE_MAX_WR_LEN]; >> + >> } __aligned(CACHE_LINE_SIZE); >> >> >> @@ -744,7 +742,7 @@ struct adapter { >> struct sge sge; >> int lro_timeout; >> >> - struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out * >> / >> + struct taskqueue *tq[NCHAN]; /* General purpose taskqueues */ >> struct port_info *port[MAX_NPORTS]; >> uint8_t chan_map[NCHAN]; >> >> @@ -978,12 +976,11 @@ static inline int >> tx_resume_threshold(struct sge_eq *eq) >> { >> >> - return (eq->qsize / 4); >> + /* not quite the same as qsize / 4, but this will do. */ >> + return (eq->sidx / 4); >> } >> >> /* t4_main.c */ >> -void t4_tx_task(void *, int); >> -void t4_tx_callout(void *); >> int t4_os_find_pci_capability(struct adapter *, int); >> int t4_os_pci_save_state(struct adapter *); >> int t4_os_pci_restore_state(struct adapter *); >> @@ -1024,16 +1021,15 @@ int t4_setup_adapter_queues(struct adapt >> int t4_teardown_adapter_queues(struct adapter *); >> int t4_setup_port_queues(struct port_info *); >> int t4_teardown_port_queues(struct port_info *); >> -int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); >> -void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); >> void t4_intr_all(void *); >> void t4_intr(void *); >> void t4_intr_err(void *); >> void t4_intr_evt(void *); >> void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); >> -int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); >> void t4_update_fl_bufsize(struct ifnet *); >> -int can_resume_tx(struct sge_eq *); >> +int parse_pkt(struct mbuf **); >> +void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); >> +void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); >> >> /* t4_tracer.c */ >> struct t4_tracer; >> >> Modified: head/sys/dev/cxgbe/t4_l2t.c >> =========================================================================== >> === >> --- head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 22:52:43 2014 (r276484) >> +++ head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 23:19:16 2014 (r276485) >> @@ -113,16 +113,15 @@ found: >> int >> t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync) >> { >> - struct wrqe *wr; >> + struct wrq_cookie cookie; >> struct cpl_l2t_write_req *req; >> int idx = e->idx + sc->vres.l2t.start; >> >> mtx_assert(&e->lock, MA_OWNED); >> >> - wr = alloc_wrqe(sizeof(*req), &sc->sge.mgmtq); >> - if (wr == NULL) >> + req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), 16), & >> cookie); >> + if (req == NULL) >> return (ENOMEM); >> - req = wrtod(wr); >> >> INIT_TP_WR(req, 0); >> OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, idx | >> @@ -132,7 +131,7 @@ t4_write_l2e(struct adapter *sc, struct >> req->vlan = htons(e->vlan); >> memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); >> >> - t4_wrq_tx(sc, wr); >> + commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); >> >> if (sync && e->state != L2T_STATE_SWITCHING) >> e->state = L2T_STATE_SYNC_WRITE; >> >> Modified: head/sys/dev/cxgbe/t4_main.c >> =========================================================================== >> === >> --- head/sys/dev/cxgbe/t4_main.c Wed Dec 31 22:52:43 2014 >> (r276484) >> +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 31 23:19:16 2014 >> (r276485) >> @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); >> #include "common/t4_regs_values.h" >> #include "t4_ioctl.h" >> #include "t4_l2t.h" >> +#include "t4_mp_ring.h" >> >> /* T4 bus driver interface */ >> static int t4_probe(device_t); >> @@ -378,7 +379,8 @@ static void build_medialist(struct port_ >> static int cxgbe_init_synchronized(struct port_info *); >> static int cxgbe_uninit_synchronized(struct port_info *); >> static int setup_intr_handlers(struct adapter *); >> -static void quiesce_eq(struct adapter *, struct sge_eq *); >> +static void quiesce_txq(struct adapter *, struct sge_txq *); >> +static void quiesce_wrq(struct adapter *, struct sge_wrq *); >> static void quiesce_iq(struct adapter *, struct sge_iq *); >> static void quiesce_fl(struct adapter *, struct sge_fl *); >> static int t4_alloc_irq(struct adapter *, struct irq *, int rid, >> @@ -434,7 +436,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER >> static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); >> static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); >> #endif >> -static inline void txq_start(struct ifnet *, struct sge_txq *); >> static uint32_t fconf_to_mode(uint32_t); >> static uint32_t mode_to_fconf(uint32_t); >> static uint32_t fspec_to_fconf(struct t4_filter_specification *); >> @@ -1429,67 +1430,36 @@ cxgbe_transmit(struct ifnet *ifp, struct >> { >> struct port_info *pi = ifp->if_softc; >> struct adapter *sc = pi->adapter; >> - struct sge_txq *txq = &sc->sge.txq[pi->first_txq]; >> - struct buf_ring *br; >> + struct sge_txq *txq; >> + void *items[1]; >> int rc; >> >> M_ASSERTPKTHDR(m); >> + MPASS(m->m_nextpkt == NULL); /* not quite ready for this yet */ >> >> if (__predict_false(pi->link_cfg.link_ok == 0)) { >> m_freem(m); >> return (ENETDOWN); >> } >> >> - /* check if flowid is set */ >> - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >> - txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >> rsrv_noflowq)) >> - + pi->rsrv_noflowq); >> - br = txq->br; >> - >> - if (TXQ_TRYLOCK(txq) == 0) { >> - struct sge_eq *eq = &txq->eq; >> - >> - /* >> - * It is possible that t4_eth_tx finishes up and releases >> the >> - * lock between the TRYLOCK above and the drbr_enqueue >> here. We >> - * need to make sure that this mbuf doesn't just sit there >> in >> - * the drbr. >> - */ >> - >> - rc = drbr_enqueue(ifp, br, m); >> - if (rc == 0 && callout_pending(&eq->tx_callout) == 0 && >> - !(eq->flags & EQ_DOOMED)) >> - callout_reset(&eq->tx_callout, 1, t4_tx_callout, >> eq); >> + rc = parse_pkt(&m); >> + if (__predict_false(rc != 0)) { >> + MPASS(m == NULL); /* was freed >> already */ >> + atomic_add_int(&pi->tx_parse_error, 1); /* rare, atomic is >> ok */ >> return (rc); >> } >> >> - /* >> - * txq->m is the mbuf that is held up due to a temporary shortage >> of >> - * resources and it should be put on the wire first. Then what's >> in >> - * drbr and finally the mbuf that was just passed in to us. >> - * >> - * Return code should indicate the fate of the mbuf that was passed >> in >> - * this time. >> - */ >> - >> - TXQ_LOCK_ASSERT_OWNED(txq); >> - if (drbr_needs_enqueue(ifp, br) || txq->m) { >> - >> - /* Queued for transmission. */ >> - >> - rc = drbr_enqueue(ifp, br, m); >> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >> - (void) t4_eth_tx(ifp, txq, m); >> - TXQ_UNLOCK(txq); >> - return (rc); >> - } >> + /* Select a txq. */ >> + txq = &sc->sge.txq[pi->first_txq]; >> + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >> + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >> rsrv_noflowq)) + >> + pi->rsrv_noflowq); >> >> - /* Direct transmission. */ >> - rc = t4_eth_tx(ifp, txq, m); >> - if (rc != 0 && txq->m) >> - rc = 0; /* held, will be transmitted soon (hopefully) */ >> + items[0] = m; >> + rc = mp_ring_enqueue(txq->r, items, 1, 4096); >> + if (__predict_false(rc != 0)) >> + m_freem(m); >> >> - TXQ_UNLOCK(txq); >> return (rc); >> } >> >> @@ -1499,17 +1469,17 @@ cxgbe_qflush(struct ifnet *ifp) >> struct port_info *pi = ifp->if_softc; >> struct sge_txq *txq; >> int i; >> - struct mbuf *m; >> >> /* queues do not exist if !PORT_INIT_DONE. */ >> if (pi->flags & PORT_INIT_DONE) { >> for_each_txq(pi, i, txq) { >> TXQ_LOCK(txq); >> - m_freem(txq->m); >> - txq->m = NULL; >> - while ((m = buf_ring_dequeue_sc(txq->br)) != NULL) >> - m_freem(m); >> + txq->eq.flags &= ~EQ_ENABLED; >> TXQ_UNLOCK(txq); >> + while (!mp_ring_is_idle(txq->r)) { >> + mp_ring_check_drainage(txq->r, 0); >> + pause("qflush", 1); >> + } >> } >> } >> if_qflush(ifp); >> @@ -1564,7 +1534,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift >> struct sge_txq *txq; >> >> for_each_txq(pi, i, txq) >> - drops += txq->br->br_drops; >> + drops += counter_u64_fetch(txq->r->drops); >> } >> >> return (drops); >> @@ -3236,7 +3206,8 @@ cxgbe_init_synchronized(struct port_info >> { >> struct adapter *sc = pi->adapter; >> struct ifnet *ifp = pi->ifp; >> - int rc = 0; >> + int rc = 0, i; >> + struct sge_txq *txq; >> >> ASSERT_SYNCHRONIZED_OP(sc); >> >> @@ -3265,6 +3236,17 @@ cxgbe_init_synchronized(struct port_info >> } >> >> /* >> + * Can't fail from this point onwards. Review >> cxgbe_uninit_synchronized >> + * if this changes. >> + */ >> + >> + for_each_txq(pi, i, txq) { >> + TXQ_LOCK(txq); >> + txq->eq.flags |= EQ_ENABLED; >> + TXQ_UNLOCK(txq); >> + } >> + >> + /* >> * The first iq of the first port to come up is used for tracing. >> */ >> if (sc->traceq < 0) { >> @@ -3297,7 +3279,8 @@ cxgbe_uninit_synchronized(struct port_in >> { >> struct adapter *sc = pi->adapter; >> struct ifnet *ifp = pi->ifp; >> - int rc; >> + int rc, i; >> + struct sge_txq *txq; >> >> ASSERT_SYNCHRONIZED_OP(sc); >> >> @@ -3314,6 +3297,12 @@ cxgbe_uninit_synchronized(struct port_in >> return (rc); >> } >> >> + for_each_txq(pi, i, txq) { >> + TXQ_LOCK(txq); >> + txq->eq.flags &= ~EQ_ENABLED; >> + TXQ_UNLOCK(txq); >> + } >> + >> clrbit(&sc->open_device_map, pi->port_id); >> PORT_LOCK(pi); >> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >> @@ -3543,15 +3532,17 @@ port_full_uninit(struct port_info *pi) >> >> if (pi->flags & PORT_INIT_DONE) { >> >> - /* Need to quiesce queues. XXX: ctrl queues? */ >> + /* Need to quiesce queues. */ >> + >> + quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); >> >> for_each_txq(pi, i, txq) { >> - quiesce_eq(sc, &txq->eq); >> + quiesce_txq(sc, txq); >> } >> >> #ifdef TCP_OFFLOAD >> for_each_ofld_txq(pi, i, ofld_txq) { >> - quiesce_eq(sc, &ofld_txq->eq); >> + quiesce_wrq(sc, ofld_txq); >> } >> #endif >> >> @@ -3576,23 +3567,39 @@ port_full_uninit(struct port_info *pi) >> } >> >> static void >> -quiesce_eq(struct adapter *sc, struct sge_eq *eq) >> +quiesce_txq(struct adapter *sc, struct sge_txq *txq) >> { >> - EQ_LOCK(eq); >> - eq->flags |= EQ_DOOMED; >> + struct sge_eq *eq = &txq->eq; >> + struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; >> >> - /* >> - * Wait for the response to a credit flush if one's >> - * pending. >> - */ >> - while (eq->flags & EQ_CRFLUSHED) >> - mtx_sleep(eq, &eq->eq_lock, 0, "crflush", 0); >> - EQ_UNLOCK(eq); >> + (void) sc; /* unused */ >> >> - callout_drain(&eq->tx_callout); /* XXX: iffy */ >> - pause("callout", 10); /* Still iffy */ >> +#ifdef INVARIANTS >> + TXQ_LOCK(txq); >> + MPASS((eq->flags & EQ_ENABLED) == 0); >> + TXQ_UNLOCK(txq); >> +#endif >> >> - taskqueue_drain(sc->tq[eq->tx_chan], &eq->tx_task); >> + /* Wait for the mp_ring to empty. */ >> + while (!mp_ring_is_idle(txq->r)) { >> + mp_ring_check_drainage(txq->r, 0); >> + pause("rquiesce", 1); >> + } >> + >> + /* Then wait for the hardware to finish. */ >> + while (spg->cidx != htobe16(eq->pidx)) >> + pause("equiesce", 1); >> + >> + /* Finally, wait for the driver to reclaim all descriptors. */ >> + while (eq->cidx != eq->pidx) >> + pause("dquiesce", 1); >> +} >> + >> +static void >> +quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) >> +{ >> + >> + /* XXXTX */ >> } >> >> static void >> @@ -4892,6 +4899,9 @@ cxgbe_sysctls(struct port_info *pi) >> oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, >> NULL, "port statistics"); >> children = SYSCTL_CHILDREN(oid); >> + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "tx_parse_error", >> CTLFLAG_RD, >> + &pi->tx_parse_error, 0, >> + "# of tx packets with invalid length or # of segments"); >> >> #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ >> SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ >> @@ -6947,74 +6957,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) >> } >> #endif >> >> -static inline void >> -txq_start(struct ifnet *ifp, struct sge_txq *txq) >> -{ >> - struct buf_ring *br; >> - struct mbuf *m; >> - >> - TXQ_LOCK_ASSERT_OWNED(txq); >> - >> - br = txq->br; >> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >> - if (m) >> - t4_eth_tx(ifp, txq, m); >> -} >> - >> -void >> -t4_tx_callout(void *arg) >> -{ >> - struct sge_eq *eq = arg; >> - struct adapter *sc; >> - >> - if (EQ_TRYLOCK(eq) == 0) >> - goto reschedule; >> - >> - if (eq->flags & EQ_STALLED && !can_resume_tx(eq)) { >> - EQ_UNLOCK(eq); >> -reschedule: >> - if (__predict_true(!(eq->flags && EQ_DOOMED))) >> - callout_schedule(&eq->tx_callout, 1); >> - return; >> - } >> - >> - EQ_LOCK_ASSERT_OWNED(eq); >> - >> - if (__predict_true((eq->flags & EQ_DOOMED) == 0)) { >> - >> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >> - struct sge_txq *txq = arg; >> - struct port_info *pi = txq->ifp->if_softc; >> - >> - sc = pi->adapter; >> - } else { >> - struct sge_wrq *wrq = arg; >> - >> - sc = wrq->adapter; >> - } >> - >> - taskqueue_enqueue(sc->tq[eq->tx_chan], &eq->tx_task); >> - } >> - >> - EQ_UNLOCK(eq); >> -} >> - >> -void >> -t4_tx_task(void *arg, int count) >> -{ >> - struct sge_eq *eq = arg; >> - >> - EQ_LOCK(eq); >> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >> - struct sge_txq *txq = arg; >> - txq_start(txq->ifp, txq); >> - } else { >> - struct sge_wrq *wrq = arg; >> - t4_wrq_tx_locked(wrq->adapter, wrq, NULL); >> - } >> - EQ_UNLOCK(eq); >> -} >> - >> static uint32_t >> fconf_to_mode(uint32_t fconf) >> { >> @@ -7452,9 +7394,9 @@ static int >> set_filter_wr(struct adapter *sc, int fidx) >> { >> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >> - struct wrqe *wr; >> struct fw_filter_wr *fwr; >> unsigned int ftid; >> + struct wrq_cookie cookie; >> >> ASSERT_SYNCHRONIZED_OP(sc); >> >> @@ -7473,12 +7415,10 @@ set_filter_wr(struct adapter *sc, int fi >> >> ftid = sc->tids.ftid_base + fidx; >> >> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >> - if (wr == NULL) >> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), & >> cookie); >> + if (fwr == NULL) >> return (ENOMEM); >> - >> - fwr = wrtod(wr); >> - bzero(fwr, sizeof (*fwr)); >> + bzero(fwr, sizeof(*fwr)); >> >> fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); >> fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); >> @@ -7547,7 +7487,7 @@ set_filter_wr(struct adapter *sc, int fi >> f->pending = 1; >> sc->tids.ftids_in_use++; >> >> - t4_wrq_tx(sc, wr); >> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >> return (0); >> } >> >> @@ -7555,22 +7495,21 @@ static int >> del_filter_wr(struct adapter *sc, int fidx) >> { >> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >> - struct wrqe *wr; >> struct fw_filter_wr *fwr; >> unsigned int ftid; >> + struct wrq_cookie cookie; >> >> ftid = sc->tids.ftid_base + fidx; >> >> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >> - if (wr == NULL) >> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), & >> cookie); >> + if (fwr == NULL) >> return (ENOMEM); >> - fwr = wrtod(wr); >> bzero(fwr, sizeof (*fwr)); >> >> t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id); >> >> f->pending = 1; >> - t4_wrq_tx(sc, wr); >> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >> return (0); >> } >> >> @@ -8170,6 +8109,7 @@ t4_ioctl(struct cdev *dev, unsigned long >> >> /* MAC stats */ >> t4_clr_port_stats(sc, pi->tx_chan); >> + pi->tx_parse_error = 0; >> >> if (pi->flags & PORT_INIT_DONE) { >> struct sge_rxq *rxq; >> @@ -8192,24 +8132,24 @@ t4_ioctl(struct cdev *dev, unsigned long >> txq->imm_wrs = 0; >> txq->sgl_wrs = 0; >> txq->txpkt_wrs = 0; >> - txq->txpkts_wrs = 0; >> - txq->txpkts_pkts = 0; >> - txq->br->br_drops = 0; >> - txq->no_dmamap = 0; >> - txq->no_desc = 0; >> + txq->txpkts0_wrs = 0; >> + txq->txpkts1_wrs = 0; >> + txq->txpkts0_pkts = 0; >> + txq->txpkts1_pkts = 0; >> + mp_ring_reset_stats(txq->r); >> } >> >> #ifdef TCP_OFFLOAD >> /* nothing to clear for each ofld_rxq */ >> >> for_each_ofld_txq(pi, i, wrq) { >> - wrq->tx_wrs = 0; >> - wrq->no_desc = 0; >> + wrq->tx_wrs_direct = 0; >> + wrq->tx_wrs_copied = 0; >> } >> #endif >> wrq = &sc->sge.ctrlq[pi->port_id]; >> - wrq->tx_wrs = 0; >> - wrq->no_desc = 0; >> + wrq->tx_wrs_direct = 0; >> + wrq->tx_wrs_copied = 0; >> } >> break; >> } >> >> Added: head/sys/dev/cxgbe/t4_mp_ring.c >> =========================================================================== >> === >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/cxgbe/t4_mp_ring.c Wed Dec 31 23:19:16 2014 >> (r276485) >> @@ -0,0 +1,364 @@ >> +/*- >> + * Copyright (c) 2014 Chelsio Communications, Inc. >> + * All rights reserved. >> + * Written by: Navdeep Parhar >> + * >> + * 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 "t4_mp_ring.h" >> + >> +union ring_state { >> + struct { >> + uint16_t pidx_head; >> + uint16_t pidx_tail; >> + uint16_t cidx; >> + uint16_t flags; >> + }; >> + uint64_t state; >> +}; >> + >> +enum { >> + IDLE = 0, /* consumer ran to completion, nothing more to do. >> */ >> + BUSY, /* consumer is running already, or will be shortly. >> */ >> + STALLED, /* consumer stopped due to lack of resources. */ >> + ABDICATED, /* consumer stopped even though there was work to >> be >> + done because it wants another thread to take >> over. */ >> +}; >> + >> +static inline uint16_t >> +space_available(struct mp_ring *r, union ring_state s) >> +{ >> + uint16_t x = r->size - 1; >> + >> + if (s.cidx == s.pidx_head) >> + return (x); >> + else if (s.cidx > s.pidx_head) >> + return (s.cidx - s.pidx_head - 1); >> + else >> + return (x - s.pidx_head + s.cidx); >> +} >> + >> +static inline uint16_t >> +increment_idx(struct mp_ring *r, uint16_t idx, uint16_t n) >> +{ >> + int x = r->size - idx; >> + >> + MPASS(x > 0); >> + return (x > n ? idx + n : n - x); >> +} >> + >> +/* Consumer is about to update the ring's state to s */ >> +static inline uint16_t >> +state_to_flags(union ring_state s, int abdicate) >> +{ >> + >> + if (s.cidx == s.pidx_tail) >> + return (IDLE); >> + else if (abdicate && s.pidx_tail != s.pidx_head) >> + return (ABDICATED); >> + >> + return (BUSY); >> +} >> + >> +/* >> + * Caller passes in a state, with a guarantee that there is work to do and >> that >> + * all items up to the pidx_tail in the state are visible. >> + */ >> +static void >> +drain_ring(struct mp_ring *r, union ring_state os, uint16_t prev, int >> budget) >> +{ >> + union ring_state ns; >> + int n, pending, total; >> + uint16_t cidx = os.cidx; >> + uint16_t pidx = os.pidx_tail; >> + >> + MPASS(os.flags == BUSY); >> + MPASS(cidx != pidx); >> + >> + if (prev == IDLE) >> + counter_u64_add(r->starts, 1); >> + pending = 0; >> + total = 0; >> + >> + while (cidx != pidx) { >> + >> + /* Items from cidx to pidx are available for consumption. * >> / >> + n = r->drain(r, cidx, pidx); >> + if (n == 0) { >> + critical_enter(); >> + do { >> + os.state = ns.state = r->state; >> + ns.cidx = cidx; >> + ns.flags = STALLED; >> + } while (atomic_cmpset_64(&r->state, os.state, >> + ns.state) == 0); >> + critical_exit(); >> + if (prev != STALLED) >> + counter_u64_add(r->stalls, 1); >> + else if (total > 0) { >> + counter_u64_add(r->restarts, 1); >> + counter_u64_add(r->stalls, 1); >> + } >> + break; >> + } >> + cidx = increment_idx(r, cidx, n); >> + pending += n; >> + total += n; >> + >> + /* >> + * We update the cidx only if we've caught up with the >> pidx, the >> + * real cidx is getting too far ahead of the one visible to >> + * everyone else, or we have exceeded our budget. >> + */ >> + if (cidx != pidx && pending < 64 && total < budget) >> + continue; >> + critical_enter(); >> + do { >> + os.state = ns.state = r->state; >> + ns.cidx = cidx; >> + ns.flags = state_to_flags(ns, total >= budget); >> + } while (atomic_cmpset_acq_64(&r->state, os.state, >> ns.state) == 0); >> + critical_exit(); >> + >> + if (ns.flags == ABDICATED) >> + counter_u64_add(r->abdications, 1); >> + if (ns.flags != BUSY) { >> + /* Wrong loop exit if we're going to stall. */ >> + MPASS(ns.flags != STALLED); >> + if (prev == STALLED) { >> + MPASS(total > 0); >> + counter_u64_add(r->restarts, 1); >> + } >> + break; >> + } >> + >> + /* >> + * The acquire style atomic above guarantees visibility of >> items >> + * associated with any pidx change that we notice here. >> + */ >> + pidx = ns.pidx_tail; >> + pending = 0; >> + } >> +} >> + >> +int >> +mp_ring_alloc(struct mp_ring **pr, int size, void *cookie, ring_drain_t >> drain, >> + ring_can_drain_t can_drain, struct malloc_type *mt, int flags) >> +{ >> + struct mp_ring *r; >> + >> + /* All idx are 16b so size can be 65536 at most */ >> + if (pr == NULL || size < 2 || size > 65536 || drain == NULL || >> + can_drain == NULL) >> + return (EINVAL); >> + *pr = NULL; >> + flags &= M_NOWAIT | M_WAITOK; >> + MPASS(flags != 0); >> + >> + r = malloc(__offsetof(struct mp_ring, items[size]), mt, flags | >> M_ZERO); >> + if (r == NULL) >> + return (ENOMEM); >> + r->size = size; >> + r->cookie = cookie; >> + r->mt = mt; >> + r->drain = drain; >> + r->can_drain = can_drain; >> + r->enqueues = counter_u64_alloc(flags); >> + r->drops = counter_u64_alloc(flags); >> + r->starts = counter_u64_alloc(flags); >> + r->stalls = counter_u64_alloc(flags); >> + r->restarts = counter_u64_alloc(flags); >> + r->abdications = counter_u64_alloc(flags); >> + if (r->enqueues == NULL || r->drops == NULL || r->starts == NULL || >> + r->stalls == NULL || r->restarts == NULL || >> + r->abdications == NULL) { >> + mp_ring_free(r); >> + return (ENOMEM); >> + } >> + >> + *pr = r; >> + return (0); >> +} >> + >> +void >> + >> +mp_ring_free(struct mp_ring *r) >> +{ >> + >> + if (r == NULL) >> + return; >> + >> + if (r->enqueues != NULL) >> + counter_u64_free(r->enqueues); >> + if (r->drops != NULL) >> + counter_u64_free(r->drops); >> + if (r->starts != NULL) >> + counter_u64_free(r->starts); >> + if (r->stalls != NULL) >> + counter_u64_free(r->stalls); >> + if (r->restarts != NULL) >> + counter_u64_free(r->restarts); >> + if (r->abdications != NULL) >> + counter_u64_free(r->abdications); >> + >> + free(r, r->mt); >> +} >> + >> +/* >> + * Enqueue n items and maybe drain the ring for some time. >> + * >> + * Returns an errno. >> + */ >> +int >> +mp_ring_enqueue(struct mp_ring *r, void **items, int n, int budget) >> +{ >> + union ring_state os, ns; >> + uint16_t pidx_start, pidx_stop; >> + int i; >> + >> + MPASS(items != NULL); >> + MPASS(n > 0); >> + >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> >> >> >> >> >> -- >> -----------------------------------------+------------------------------- >> Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione >> http://www.iet.unipi.it/~luigi/ . Universita` di Pisa >> TEL +39-050-2211611 . via Diotisalvi 2 >> Mobile +39-338-6809875 . 56122 PISA (Italy) >> -----------------------------------------+------------------------------- --------------050000020104050008050000 Content-Type: text/x-patch; name="gcc-anonstructunions.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc-anonstructunions.diff" Index: contrib/gcc/c-decl.c =================================================================== --- contrib/gcc/c-decl.c (revision 277326) +++ contrib/gcc/c-decl.c (working copy) @@ -5970,7 +5970,7 @@ if (flag_ms_extensions) ok = true; else if (flag_iso) - ok = false; + ok = true; else if (TYPE_NAME (type) == NULL) ok = true; else --------------050000020104050008050000-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:21:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07806562; Tue, 20 Jan 2015 23:21:46 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2305D44; Tue, 20 Jan 2015 23:21:45 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y13so21001838pdi.8; Tue, 20 Jan 2015 15:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=s8M+h50cIBm56henotXYYLjyFKn9b0nfmS/mYvFR7Ak=; b=B9g1o2Og/1elue0AZUDS/rClJaBru+Pbd9gdN/GyKZ+fpHhPC056F9IpCWTIndA1W/ JPSgYMw6oTiCtS+BKc3qQPWPaBDvxGH6wMFPpn9eeSIeRlTLW44QGKc16g3Sy6trYZJA hkpUruQ6qKdHsqS6z+78Yh3iQlDQ2mqOCAuOq6X3+IGG4UNyLSWXekuJnhKQoaQB2h6m JkR68hzUsSSaU7Fnt8mwx+/J6s3MZtyzbx+e4hkZYluiovSzTR9KF6CmMh5K8jObfCg/ rbGDGnEXpEuZh4M7q31bp8YgCB7cNlvwtskuZBOx4VFaAVjY2EHr3s7jjZd6vOxaXf/m C2uw== X-Received: by 10.66.163.228 with SMTP id yl4mr31560751pab.51.1421796105245; Tue, 20 Jan 2015 15:21:45 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id cm10sm4249106pad.46.2015.01.20.15.21.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 15:21:43 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54BEE305.6020905@FreeBSD.org> Date: Tue, 20 Jan 2015 15:21:41 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pedro Giffuni , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> In-Reply-To: <54BEE07A.3070207@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:21:46 -0000 The problem reported by Luigi has been fixed in r277225 already. Regards, Navdeep On 01/20/15 15:10, Pedro Giffuni wrote: > Hi; > > I got this patch from the OpenBSD-tech list[1]. > Perhaps this fixes the gcc issue? > > Apparently it's required for mesa too. > > Pedro. > > [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 > > On 01/06/15 15:33, Navdeep Parhar wrote: >> On Tue, Jan 06, 2015 at 07:58:34PM +0100, Luigi Rizzo wrote: >>> >>> On Thu, Jan 1, 2015 at 12:19 AM, Navdeep Parhar wrote: >>> >>> Author: np >>> Date: Wed Dec 31 23:19:16 2014 >>> New Revision: 276485 >>> URL: https://svnweb.freebsd.org/changeset/base/276485 >>> >>> Log: >>> cxgbe(4): major tx rework. >>> >>> >>> FYI, this commit has some unnamed unions (eg. in t4_mp_ring.c) >>> which prevent the kernel from compiling with our stock gcc >>> and its standard kernel build flags (specifically -std=...). >>> >>> Adding the following in the kernel config >>> >>> makeoptions COPTFLAGS="-fms-extensions" >>> >>> seems to do the job >>> >>> I know it is unavoidable that we'll end up with gcc not working, >>> but maybe we can still avoid unnamed unions. >> There are two unresolved issues with mp_ring and I had to make the >> driver amd64-only while I consider my options. >> >> - platforms where gcc is the default (and our version has problems with >> unnamed unions). This is simple to fix but reduces the readability of >> the code. But sure, if building head with gcc is popular then that >> trumps readability. I wonder if adding -fms-extensions just to the >> driver's build flags would be an acceptable compromise. >> - platforms without the acq/rel versions of 64b cmpset. I think it >> would be simple to add acq/rel variants to i386/pc98 and others that >> already have 64b cmpset. The driver will be permanently unplugged >> from >> whatever remains (only 32 bit powerpc I think). >> >> I'll try to sort all this out within the next couple of weeks. >> >> Regards, >> Navdeep >> >>> cheers >>> luigi >>> >>> >>> a) Front load as much work as possible in if_transmit, before >>> any driver >>> lock or software queue has to get involved. >>> >>> b) Replace buf_ring with a brand new mp_ring (multiproducer >>> ring). This >>> is specifically for the tx multiqueue model where one of the >>> if_transmit >>> producer threads becomes the consumer and other producers >>> carry on as >>> usual. mp_ring is implemented as standalone code and it >>> should be >>> possible to use it in any driver with tx multiqueue. It also >>> has: >>> - the ability to enqueue/dequeue multiple items. This might >>> become >>> significant if packet batching is ever implemented. >>> - an abdication mechanism to allow a thread to give up writing tx >>> descriptors and have another if_transmit thread take over. >>> A thread >>> that's writing tx descriptors can end up doing so for an >>> unbounded >>> time period if a) there are other if_transmit threads >>> continuously >>> feeding the sofware queue, and b) the chip keeps up with >>> whatever the >>> thread is throwing at it. >>> - accurate statistics about interesting events even when the >>> stats come >>> at the expense of additional branches/conditional code. >>> >>> The NIC txq lock is uncontested on the fast path at this >>> point. I've >>> left it there for synchronization with the control events >>> (interface >>> up/down, modload/unload). >>> >>> c) Add support for "type 1" coalescing work request in the >>> normal NIC tx >>> path. This work request is optimized for frames with a single >>> item in >>> the DMA gather list. These are very common when forwarding >>> packets. >>> Note that netmap tx in cxgbe already uses these "type 1" work >>> requests. >>> >>> d) Do not request automatic cidx updates every 32 >>> descriptors. Instead, >>> request updates via bits in individual work requests (still >>> every 32 >>> descriptors approximately). Also, request an automatic final >>> update >>> when the queue idles after activity. This means NIC tx >>> reclaim is still >>> performed lazily but it will catch up quickly as soon as the >>> queue >>> idles. This seems to be the best middle ground and I'll >>> probably do >>> something similar for netmap tx as well. >>> >>> e) Implement a faster tx path for WRQs (used by TOE tx and >>> control >>> queues, _not_ by the normal NIC tx). Allow work requests to >>> be written >>> directly to the hardware descriptor ring if room is >>> available. I will >>> convert t4_tom and iw_cxgbe modules to this faster style >>> gradually. >>> >>> MFC after: 2 months >>> >>> Added: >>> head/sys/dev/cxgbe/t4_mp_ring.c (contents, props changed) >>> head/sys/dev/cxgbe/t4_mp_ring.h (contents, props changed) >>> Modified: >>> head/sys/conf/files >>> head/sys/dev/cxgbe/adapter.h >>> head/sys/dev/cxgbe/t4_l2t.c >>> head/sys/dev/cxgbe/t4_main.c >>> head/sys/dev/cxgbe/t4_sge.c >>> head/sys/modules/cxgbe/if_cxgbe/Makefile >>> >>> Modified: head/sys/conf/files >>> >>> =========================================================================== >>> >>> === >>> --- head/sys/conf/files Wed Dec 31 22:52:43 2014 (r276484) >>> +++ head/sys/conf/files Wed Dec 31 23:19:16 2014 (r276485) >>> @@ -1142,6 +1142,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p >>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>> dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ >>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>> +dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ >>> + compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>> dev/cxgbe/t4_main.c optional cxgbe pci \ >>> compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>> dev/cxgbe/t4_netmap.c optional cxgbe pci \ >>> >>> Modified: head/sys/dev/cxgbe/adapter.h >>> >>> =========================================================================== >>> >>> === >>> --- head/sys/dev/cxgbe/adapter.h Wed Dec 31 22:52:43 2014 >>> (r276484) >>> +++ head/sys/dev/cxgbe/adapter.h Wed Dec 31 23:19:16 2014 >>> (r276485) >>> @@ -152,7 +152,8 @@ enum { >>> CL_METADATA_SIZE = CACHE_LINE_SIZE, >>> >>> SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR >>> size in >>> desc */ >>> - TX_SGL_SEGS = 36, >>> + TX_SGL_SEGS = 39, >>> + TX_SGL_SEGS_TSO = 38, >>> TX_WR_FLITS = SGE_MAX_WR_LEN / 8 >>> }; >>> >>> @@ -273,6 +274,7 @@ struct port_info { >>> struct timeval last_refreshed; >>> struct port_stats stats; >>> u_int tnl_cong_drops; >>> + u_int tx_parse_error; >>> >>> eventhandler_tag vlan_c; >>> >>> @@ -308,23 +310,9 @@ struct tx_desc { >>> __be64 flit[8]; >>> }; >>> >>> -struct tx_map { >>> - struct mbuf *m; >>> - bus_dmamap_t map; >>> -}; >>> - >>> -/* DMA maps used for tx */ >>> -struct tx_maps { >>> - struct tx_map *maps; >>> - uint32_t map_total; /* # of DMA maps */ >>> - uint32_t map_pidx; /* next map to be used */ >>> - uint32_t map_cidx; /* reclaimed up to this index */ >>> - uint32_t map_avail; /* # of available maps */ >>> -}; >>> - >>> struct tx_sdesc { >>> + struct mbuf *m; /* m_nextpkt linked chain of >>> frames */ >>> uint8_t desc_used; /* # of hardware descriptors >>> used by the WR >>> */ >>> - uint8_t credits; /* NIC txq: # of frames sent out >>> in the WR >>> */ >>> }; >>> >>> >>> @@ -378,16 +366,12 @@ struct sge_iq { >>> enum { >>> EQ_CTRL = 1, >>> EQ_ETH = 2, >>> -#ifdef TCP_OFFLOAD >>> EQ_OFLD = 3, >>> -#endif >>> >>> /* eq flags */ >>> - EQ_TYPEMASK = 7, /* 3 lsbits hold the >>> type */ >>> - EQ_ALLOCATED = (1 << 3), /* firmware resources >>> allocated */ >>> - EQ_DOOMED = (1 << 4), /* about to be destroyed */ >>> - EQ_CRFLUSHED = (1 << 5), /* expecting an update >>> from SGE */ >>> - EQ_STALLED = (1 << 6), /* out of hw descriptors >>> or dmamaps >>> */ >>> + EQ_TYPEMASK = 0x3, /* 2 lsbits hold the >>> type (see >>> above) */ >>> + EQ_ALLOCATED = (1 << 2), /* firmware resources >>> allocated */ >>> + EQ_ENABLED = (1 << 3), /* open for business */ >>> }; >>> >>> /* Listed in order of preference. Update t4_sysctls too if you >>> change >>> these */ >>> @@ -402,32 +386,25 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB >>> struct sge_eq { >>> unsigned int flags; /* MUST be first */ >>> unsigned int cntxt_id; /* SGE context id for the eq */ >>> - bus_dma_tag_t desc_tag; >>> - bus_dmamap_t desc_map; >>> - char lockname[16]; >>> struct mtx eq_lock; >>> >>> struct tx_desc *desc; /* KVA of descriptor ring */ >>> - bus_addr_t ba; /* bus address of descriptor >>> ring */ >>> - struct sge_qstat *spg; /* status page, for convenience */ >>> uint16_t doorbells; >>> volatile uint32_t *udb; /* KVA of doorbell (lies within >>> BAR2) */ >>> u_int udb_qid; /* relative qid within the >>> doorbell page */ >>> - uint16_t cap; /* max # of desc, for >>> convenience */ >>> - uint16_t avail; /* available descriptors, for >>> convenience * >>> / >>> - uint16_t qsize; /* size (# of entries) of the >>> queue */ >>> + uint16_t sidx; /* index of the entry with the >>> status page >>> */ >>> uint16_t cidx; /* consumer idx (desc idx) */ >>> uint16_t pidx; /* producer idx (desc idx) */ >>> - uint16_t pending; /* # of descriptors used since last >>> doorbell */ >>> + uint16_t equeqidx; /* EQUEQ last requested at this >>> pidx */ >>> + uint16_t dbidx; /* pidx of the most recent >>> doorbell */ >>> uint16_t iqid; /* iq that gets egr_update for >>> the eq */ >>> uint8_t tx_chan; /* tx channel used by the eq */ >>> - struct task tx_task; >>> - struct callout tx_callout; >>> + volatile u_int equiq; /* EQUIQ outstanding */ >>> >>> - /* stats */ >>> - >>> - uint32_t egr_update; /* # of SGE_EGR_UPDATE >>> notifications for eq >>> */ >>> - uint32_t unstalled; /* recovered from stall */ >>> + bus_dma_tag_t desc_tag; >>> + bus_dmamap_t desc_map; >>> + bus_addr_t ba; /* bus address of descriptor >>> ring */ >>> + char lockname[16]; >>> }; >>> >>> struct sw_zone_info { >>> @@ -499,18 +476,19 @@ struct sge_fl { >>> struct cluster_layout cll_alt; /* alternate refill >>> zone, layout */ >>> }; >>> >>> +struct mp_ring; >>> + >>> /* txq: SGE egress queue + what's needed for Ethernet NIC */ >>> struct sge_txq { >>> struct sge_eq eq; /* MUST be first */ >>> >>> struct ifnet *ifp; /* the interface this txq >>> belongs to */ >>> - bus_dma_tag_t tx_tag; /* tag for transmit buffers */ >>> - struct buf_ring *br; /* tx buffer ring */ >>> + struct mp_ring *r; /* tx software ring */ >>> struct tx_sdesc *sdesc; /* KVA of software descriptor >>> ring */ >>> - struct mbuf *m; /* held up due to temporary >>> resource >>> shortage */ >>> - >>> - struct tx_maps txmaps; >>> + struct sglist *gl; >>> + __be32 cpl_ctrl0; /* for convenience */ >>> >>> + struct task tx_reclaim_task; >>> /* stats for common events first */ >>> >>> uint64_t txcsum; /* # of times hardware assisted >>> with >>> checksum */ >>> @@ -519,13 +497,12 @@ struct sge_txq { >>> uint64_t imm_wrs; /* # of work requests with >>> immediate data * >>> / >>> uint64_t sgl_wrs; /* # of work requests with >>> direct SGL */ >>> uint64_t txpkt_wrs; /* # of txpkt work requests (not >>> coalesced) >>> */ >>> - uint64_t txpkts_wrs; /* # of coalesced tx work >>> requests */ >>> - uint64_t txpkts_pkts; /* # of frames in coalesced tx work >>> requests */ >>> + uint64_t txpkts0_wrs; /* # of type0 coalesced tx work >>> requests */ >>> + uint64_t txpkts1_wrs; /* # of type1 coalesced tx work >>> requests */ >>> + uint64_t txpkts0_pkts; /* # of frames in type0 >>> coalesced tx WRs */ >>> + uint64_t txpkts1_pkts; /* # of frames in type1 >>> coalesced tx WRs */ >>> >>> /* stats for not-that-common events */ >>> - >>> - uint32_t no_dmamap; /* no DMA map to load the mbuf */ >>> - uint32_t no_desc; /* out of hardware descriptors */ >>> } __aligned(CACHE_LINE_SIZE); >>> >>> /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ >>> @@ -574,7 +551,13 @@ struct wrqe { >>> STAILQ_ENTRY(wrqe) link; >>> struct sge_wrq *wrq; >>> int wr_len; >>> - uint64_t wr[] __aligned(16); >>> + char wr[] __aligned(16); >>> +}; >>> + >>> +struct wrq_cookie { >>> + TAILQ_ENTRY(wrq_cookie) link; >>> + int ndesc; >>> + int pidx; >>> }; >>> >>> /* >>> @@ -585,17 +568,32 @@ struct sge_wrq { >>> struct sge_eq eq; /* MUST be first */ >>> >>> struct adapter *adapter; >>> + struct task wrq_tx_task; >>> + >>> + /* Tx desc reserved but WR not "committed" yet. */ >>> + TAILQ_HEAD(wrq_incomplete_wrs , wrq_cookie) incomplete_wrs; >>> >>> - /* List of WRs held up due to lack of tx descriptors */ >>> + /* List of WRs ready to go out as soon as descriptors are >>> available. */ >>> STAILQ_HEAD(, wrqe) wr_list; >>> + u_int nwr_pending; >>> + u_int ndesc_needed; >>> >>> /* stats for common events first */ >>> >>> - uint64_t tx_wrs; /* # of tx work requests */ >>> + uint64_t tx_wrs_direct; /* # of WRs written directly to >>> desc ring. >>> */ >>> + uint64_t tx_wrs_ss; /* # of WRs copied from scratch >>> space. */ >>> + uint64_t tx_wrs_copied; /* # of WRs queued and copied to >>> desc ring. >>> */ >>> >>> /* stats for not-that-common events */ >>> >>> - uint32_t no_desc; /* out of hardware descriptors */ >>> + /* >>> + * Scratch space for work requests that wrap around >>> after reaching >>> the >>> + * status page, and some infomation about the last WR >>> that used it. >>> + */ >>> + uint16_t ss_pidx; >>> + uint16_t ss_len; >>> + uint8_t ss[SGE_MAX_WR_LEN]; >>> + >>> } __aligned(CACHE_LINE_SIZE); >>> >>> >>> @@ -744,7 +742,7 @@ struct adapter { >>> struct sge sge; >>> int lro_timeout; >>> >>> - struct taskqueue *tq[NCHAN]; /* taskqueues that flush >>> data out * >>> / >>> + struct taskqueue *tq[NCHAN]; /* General purpose >>> taskqueues */ >>> struct port_info *port[MAX_NPORTS]; >>> uint8_t chan_map[NCHAN]; >>> >>> @@ -978,12 +976,11 @@ static inline int >>> tx_resume_threshold(struct sge_eq *eq) >>> { >>> >>> - return (eq->qsize / 4); >>> + /* not quite the same as qsize / 4, but this will do. */ >>> + return (eq->sidx / 4); >>> } >>> >>> /* t4_main.c */ >>> -void t4_tx_task(void *, int); >>> -void t4_tx_callout(void *); >>> int t4_os_find_pci_capability(struct adapter *, int); >>> int t4_os_pci_save_state(struct adapter *); >>> int t4_os_pci_restore_state(struct adapter *); >>> @@ -1024,16 +1021,15 @@ int t4_setup_adapter_queues(struct adapt >>> int t4_teardown_adapter_queues(struct adapter *); >>> int t4_setup_port_queues(struct port_info *); >>> int t4_teardown_port_queues(struct port_info *); >>> -int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); >>> -void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); >>> void t4_intr_all(void *); >>> void t4_intr(void *); >>> void t4_intr_err(void *); >>> void t4_intr_evt(void *); >>> void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, >>> struct wrqe *); >>> -int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); >>> void t4_update_fl_bufsize(struct ifnet *); >>> -int can_resume_tx(struct sge_eq *); >>> +int parse_pkt(struct mbuf **); >>> +void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); >>> +void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); >>> >>> /* t4_tracer.c */ >>> struct t4_tracer; >>> >>> Modified: head/sys/dev/cxgbe/t4_l2t.c >>> >>> =========================================================================== >>> >>> === >>> --- head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 22:52:43 2014 >>> (r276484) >>> +++ head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 23:19:16 2014 >>> (r276485) >>> @@ -113,16 +113,15 @@ found: >>> int >>> t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync) >>> { >>> - struct wrqe *wr; >>> + struct wrq_cookie cookie; >>> struct cpl_l2t_write_req *req; >>> int idx = e->idx + sc->vres.l2t.start; >>> >>> mtx_assert(&e->lock, MA_OWNED); >>> >>> - wr = alloc_wrqe(sizeof(*req), &sc->sge.mgmtq); >>> - if (wr == NULL) >>> + req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), >>> 16), & >>> cookie); >>> + if (req == NULL) >>> return (ENOMEM); >>> - req = wrtod(wr); >>> >>> INIT_TP_WR(req, 0); >>> OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, >>> idx | >>> @@ -132,7 +131,7 @@ t4_write_l2e(struct adapter *sc, struct >>> req->vlan = htons(e->vlan); >>> memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); >>> >>> - t4_wrq_tx(sc, wr); >>> + commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); >>> >>> if (sync && e->state != L2T_STATE_SWITCHING) >>> e->state = L2T_STATE_SYNC_WRITE; >>> >>> Modified: head/sys/dev/cxgbe/t4_main.c >>> >>> =========================================================================== >>> >>> === >>> --- head/sys/dev/cxgbe/t4_main.c Wed Dec 31 22:52:43 2014 >>> (r276484) >>> +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 31 23:19:16 2014 >>> (r276485) >>> @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); >>> #include "common/t4_regs_values.h" >>> #include "t4_ioctl.h" >>> #include "t4_l2t.h" >>> +#include "t4_mp_ring.h" >>> >>> /* T4 bus driver interface */ >>> static int t4_probe(device_t); >>> @@ -378,7 +379,8 @@ static void build_medialist(struct port_ >>> static int cxgbe_init_synchronized(struct port_info *); >>> static int cxgbe_uninit_synchronized(struct port_info *); >>> static int setup_intr_handlers(struct adapter *); >>> -static void quiesce_eq(struct adapter *, struct sge_eq *); >>> +static void quiesce_txq(struct adapter *, struct sge_txq *); >>> +static void quiesce_wrq(struct adapter *, struct sge_wrq *); >>> static void quiesce_iq(struct adapter *, struct sge_iq *); >>> static void quiesce_fl(struct adapter *, struct sge_fl *); >>> static int t4_alloc_irq(struct adapter *, struct irq *, int rid, >>> @@ -434,7 +436,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER >>> static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); >>> static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); >>> #endif >>> -static inline void txq_start(struct ifnet *, struct sge_txq *); >>> static uint32_t fconf_to_mode(uint32_t); >>> static uint32_t mode_to_fconf(uint32_t); >>> static uint32_t fspec_to_fconf(struct t4_filter_specification *); >>> @@ -1429,67 +1430,36 @@ cxgbe_transmit(struct ifnet *ifp, struct >>> { >>> struct port_info *pi = ifp->if_softc; >>> struct adapter *sc = pi->adapter; >>> - struct sge_txq *txq = &sc->sge.txq[pi->first_txq]; >>> - struct buf_ring *br; >>> + struct sge_txq *txq; >>> + void *items[1]; >>> int rc; >>> >>> M_ASSERTPKTHDR(m); >>> + MPASS(m->m_nextpkt == NULL); /* not quite ready for >>> this yet */ >>> >>> if (__predict_false(pi->link_cfg.link_ok == 0)) { >>> m_freem(m); >>> return (ENETDOWN); >>> } >>> >>> - /* check if flowid is set */ >>> - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>> - txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>> rsrv_noflowq)) >>> - + pi->rsrv_noflowq); >>> - br = txq->br; >>> - >>> - if (TXQ_TRYLOCK(txq) == 0) { >>> - struct sge_eq *eq = &txq->eq; >>> - >>> - /* >>> - * It is possible that t4_eth_tx finishes up and >>> releases >>> the >>> - * lock between the TRYLOCK above and the >>> drbr_enqueue >>> here. We >>> - * need to make sure that this mbuf doesn't just >>> sit there >>> in >>> - * the drbr. >>> - */ >>> - >>> - rc = drbr_enqueue(ifp, br, m); >>> - if (rc == 0 && callout_pending(&eq->tx_callout) >>> == 0 && >>> - !(eq->flags & EQ_DOOMED)) >>> - callout_reset(&eq->tx_callout, 1, >>> t4_tx_callout, >>> eq); >>> + rc = parse_pkt(&m); >>> + if (__predict_false(rc != 0)) { >>> + MPASS(m == NULL); /* was >>> freed >>> already */ >>> + atomic_add_int(&pi->tx_parse_error, 1); /* rare, >>> atomic is >>> ok */ >>> return (rc); >>> } >>> >>> - /* >>> - * txq->m is the mbuf that is held up due to a temporary >>> shortage >>> of >>> - * resources and it should be put on the wire first. >>> Then what's >>> in >>> - * drbr and finally the mbuf that was just passed in to us. >>> - * >>> - * Return code should indicate the fate of the mbuf that >>> was passed >>> in >>> - * this time. >>> - */ >>> - >>> - TXQ_LOCK_ASSERT_OWNED(txq); >>> - if (drbr_needs_enqueue(ifp, br) || txq->m) { >>> - >>> - /* Queued for transmission. */ >>> - >>> - rc = drbr_enqueue(ifp, br, m); >>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>> - (void) t4_eth_tx(ifp, txq, m); >>> - TXQ_UNLOCK(txq); >>> - return (rc); >>> - } >>> + /* Select a txq. */ >>> + txq = &sc->sge.txq[pi->first_txq]; >>> + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>> + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>> rsrv_noflowq)) + >>> + pi->rsrv_noflowq); >>> >>> - /* Direct transmission. */ >>> - rc = t4_eth_tx(ifp, txq, m); >>> - if (rc != 0 && txq->m) >>> - rc = 0; /* held, will be transmitted soon >>> (hopefully) */ >>> + items[0] = m; >>> + rc = mp_ring_enqueue(txq->r, items, 1, 4096); >>> + if (__predict_false(rc != 0)) >>> + m_freem(m); >>> >>> - TXQ_UNLOCK(txq); >>> return (rc); >>> } >>> >>> @@ -1499,17 +1469,17 @@ cxgbe_qflush(struct ifnet *ifp) >>> struct port_info *pi = ifp->if_softc; >>> struct sge_txq *txq; >>> int i; >>> - struct mbuf *m; >>> >>> /* queues do not exist if !PORT_INIT_DONE. */ >>> if (pi->flags & PORT_INIT_DONE) { >>> for_each_txq(pi, i, txq) { >>> TXQ_LOCK(txq); >>> - m_freem(txq->m); >>> - txq->m = NULL; >>> - while ((m = >>> buf_ring_dequeue_sc(txq->br)) != NULL) >>> - m_freem(m); >>> + txq->eq.flags &= ~EQ_ENABLED; >>> TXQ_UNLOCK(txq); >>> + while (!mp_ring_is_idle(txq->r)) { >>> + mp_ring_check_drainage(txq->r, 0); >>> + pause("qflush", 1); >>> + } >>> } >>> } >>> if_qflush(ifp); >>> @@ -1564,7 +1534,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift >>> struct sge_txq *txq; >>> >>> for_each_txq(pi, i, txq) >>> - drops += txq->br->br_drops; >>> + drops += >>> counter_u64_fetch(txq->r->drops); >>> } >>> >>> return (drops); >>> @@ -3236,7 +3206,8 @@ cxgbe_init_synchronized(struct port_info >>> { >>> struct adapter *sc = pi->adapter; >>> struct ifnet *ifp = pi->ifp; >>> - int rc = 0; >>> + int rc = 0, i; >>> + struct sge_txq *txq; >>> >>> ASSERT_SYNCHRONIZED_OP(sc); >>> >>> @@ -3265,6 +3236,17 @@ cxgbe_init_synchronized(struct port_info >>> } >>> >>> /* >>> + * Can't fail from this point onwards. Review >>> cxgbe_uninit_synchronized >>> + * if this changes. >>> + */ >>> + >>> + for_each_txq(pi, i, txq) { >>> + TXQ_LOCK(txq); >>> + txq->eq.flags |= EQ_ENABLED; >>> + TXQ_UNLOCK(txq); >>> + } >>> + >>> + /* >>> * The first iq of the first port to come up is used for >>> tracing. >>> */ >>> if (sc->traceq < 0) { >>> @@ -3297,7 +3279,8 @@ cxgbe_uninit_synchronized(struct port_in >>> { >>> struct adapter *sc = pi->adapter; >>> struct ifnet *ifp = pi->ifp; >>> - int rc; >>> + int rc, i; >>> + struct sge_txq *txq; >>> >>> ASSERT_SYNCHRONIZED_OP(sc); >>> >>> @@ -3314,6 +3297,12 @@ cxgbe_uninit_synchronized(struct port_in >>> return (rc); >>> } >>> >>> + for_each_txq(pi, i, txq) { >>> + TXQ_LOCK(txq); >>> + txq->eq.flags &= ~EQ_ENABLED; >>> + TXQ_UNLOCK(txq); >>> + } >>> + >>> clrbit(&sc->open_device_map, pi->port_id); >>> PORT_LOCK(pi); >>> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >>> @@ -3543,15 +3532,17 @@ port_full_uninit(struct port_info *pi) >>> >>> if (pi->flags & PORT_INIT_DONE) { >>> >>> - /* Need to quiesce queues. XXX: ctrl queues? */ >>> + /* Need to quiesce queues. */ >>> + >>> + quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); >>> >>> for_each_txq(pi, i, txq) { >>> - quiesce_eq(sc, &txq->eq); >>> + quiesce_txq(sc, txq); >>> } >>> >>> #ifdef TCP_OFFLOAD >>> for_each_ofld_txq(pi, i, ofld_txq) { >>> - quiesce_eq(sc, &ofld_txq->eq); >>> + quiesce_wrq(sc, ofld_txq); >>> } >>> #endif >>> >>> @@ -3576,23 +3567,39 @@ port_full_uninit(struct port_info *pi) >>> } >>> >>> static void >>> -quiesce_eq(struct adapter *sc, struct sge_eq *eq) >>> +quiesce_txq(struct adapter *sc, struct sge_txq *txq) >>> { >>> - EQ_LOCK(eq); >>> - eq->flags |= EQ_DOOMED; >>> + struct sge_eq *eq = &txq->eq; >>> + struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; >>> >>> - /* >>> - * Wait for the response to a credit flush if one's >>> - * pending. >>> - */ >>> - while (eq->flags & EQ_CRFLUSHED) >>> - mtx_sleep(eq, &eq->eq_lock, 0, "crflush", 0); >>> - EQ_UNLOCK(eq); >>> + (void) sc; /* unused */ >>> >>> - callout_drain(&eq->tx_callout); /* XXX: iffy */ >>> - pause("callout", 10); /* Still iffy */ >>> +#ifdef INVARIANTS >>> + TXQ_LOCK(txq); >>> + MPASS((eq->flags & EQ_ENABLED) == 0); >>> + TXQ_UNLOCK(txq); >>> +#endif >>> >>> - taskqueue_drain(sc->tq[eq->tx_chan], &eq->tx_task); >>> + /* Wait for the mp_ring to empty. */ >>> + while (!mp_ring_is_idle(txq->r)) { >>> + mp_ring_check_drainage(txq->r, 0); >>> + pause("rquiesce", 1); >>> + } >>> + >>> + /* Then wait for the hardware to finish. */ >>> + while (spg->cidx != htobe16(eq->pidx)) >>> + pause("equiesce", 1); >>> + >>> + /* Finally, wait for the driver to reclaim all >>> descriptors. */ >>> + while (eq->cidx != eq->pidx) >>> + pause("dquiesce", 1); >>> +} >>> + >>> +static void >>> +quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) >>> +{ >>> + >>> + /* XXXTX */ >>> } >>> >>> static void >>> @@ -4892,6 +4899,9 @@ cxgbe_sysctls(struct port_info *pi) >>> oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", >>> CTLFLAG_RD, >>> NULL, "port statistics"); >>> children = SYSCTL_CHILDREN(oid); >>> + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "tx_parse_error", >>> CTLFLAG_RD, >>> + &pi->tx_parse_error, 0, >>> + "# of tx packets with invalid length or # of >>> segments"); >>> >>> #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ >>> SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ >>> @@ -6947,74 +6957,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) >>> } >>> #endif >>> >>> -static inline void >>> -txq_start(struct ifnet *ifp, struct sge_txq *txq) >>> -{ >>> - struct buf_ring *br; >>> - struct mbuf *m; >>> - >>> - TXQ_LOCK_ASSERT_OWNED(txq); >>> - >>> - br = txq->br; >>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>> - if (m) >>> - t4_eth_tx(ifp, txq, m); >>> -} >>> - >>> -void >>> -t4_tx_callout(void *arg) >>> -{ >>> - struct sge_eq *eq = arg; >>> - struct adapter *sc; >>> - >>> - if (EQ_TRYLOCK(eq) == 0) >>> - goto reschedule; >>> - >>> - if (eq->flags & EQ_STALLED && !can_resume_tx(eq)) { >>> - EQ_UNLOCK(eq); >>> -reschedule: >>> - if (__predict_true(!(eq->flags && EQ_DOOMED))) >>> - callout_schedule(&eq->tx_callout, 1); >>> - return; >>> - } >>> - >>> - EQ_LOCK_ASSERT_OWNED(eq); >>> - >>> - if (__predict_true((eq->flags & EQ_DOOMED) == 0)) { >>> - >>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>> - struct sge_txq *txq = arg; >>> - struct port_info *pi = txq->ifp->if_softc; >>> - >>> - sc = pi->adapter; >>> - } else { >>> - struct sge_wrq *wrq = arg; >>> - >>> - sc = wrq->adapter; >>> - } >>> - >>> - taskqueue_enqueue(sc->tq[eq->tx_chan], >>> &eq->tx_task); >>> - } >>> - >>> - EQ_UNLOCK(eq); >>> -} >>> - >>> -void >>> -t4_tx_task(void *arg, int count) >>> -{ >>> - struct sge_eq *eq = arg; >>> - >>> - EQ_LOCK(eq); >>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>> - struct sge_txq *txq = arg; >>> - txq_start(txq->ifp, txq); >>> - } else { >>> - struct sge_wrq *wrq = arg; >>> - t4_wrq_tx_locked(wrq->adapter, wrq, NULL); >>> - } >>> - EQ_UNLOCK(eq); >>> -} >>> - >>> static uint32_t >>> fconf_to_mode(uint32_t fconf) >>> { >>> @@ -7452,9 +7394,9 @@ static int >>> set_filter_wr(struct adapter *sc, int fidx) >>> { >>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>> - struct wrqe *wr; >>> struct fw_filter_wr *fwr; >>> unsigned int ftid; >>> + struct wrq_cookie cookie; >>> >>> ASSERT_SYNCHRONIZED_OP(sc); >>> >>> @@ -7473,12 +7415,10 @@ set_filter_wr(struct adapter *sc, int fi >>> >>> ftid = sc->tids.ftid_base + fidx; >>> >>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>> - if (wr == NULL) >>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>> 16), & >>> cookie); >>> + if (fwr == NULL) >>> return (ENOMEM); >>> - >>> - fwr = wrtod(wr); >>> - bzero(fwr, sizeof (*fwr)); >>> + bzero(fwr, sizeof(*fwr)); >>> >>> fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); >>> fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); >>> @@ -7547,7 +7487,7 @@ set_filter_wr(struct adapter *sc, int fi >>> f->pending = 1; >>> sc->tids.ftids_in_use++; >>> >>> - t4_wrq_tx(sc, wr); >>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>> return (0); >>> } >>> >>> @@ -7555,22 +7495,21 @@ static int >>> del_filter_wr(struct adapter *sc, int fidx) >>> { >>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>> - struct wrqe *wr; >>> struct fw_filter_wr *fwr; >>> unsigned int ftid; >>> + struct wrq_cookie cookie; >>> >>> ftid = sc->tids.ftid_base + fidx; >>> >>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>> - if (wr == NULL) >>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>> 16), & >>> cookie); >>> + if (fwr == NULL) >>> return (ENOMEM); >>> - fwr = wrtod(wr); >>> bzero(fwr, sizeof (*fwr)); >>> >>> t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id); >>> >>> f->pending = 1; >>> - t4_wrq_tx(sc, wr); >>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>> return (0); >>> } >>> >>> @@ -8170,6 +8109,7 @@ t4_ioctl(struct cdev *dev, unsigned long >>> >>> /* MAC stats */ >>> t4_clr_port_stats(sc, pi->tx_chan); >>> + pi->tx_parse_error = 0; >>> >>> if (pi->flags & PORT_INIT_DONE) { >>> struct sge_rxq *rxq; >>> @@ -8192,24 +8132,24 @@ t4_ioctl(struct cdev *dev, unsigned long >>> txq->imm_wrs = 0; >>> txq->sgl_wrs = 0; >>> txq->txpkt_wrs = 0; >>> - txq->txpkts_wrs = 0; >>> - txq->txpkts_pkts = 0; >>> - txq->br->br_drops = 0; >>> - txq->no_dmamap = 0; >>> - txq->no_desc = 0; >>> + txq->txpkts0_wrs = 0; >>> + txq->txpkts1_wrs = 0; >>> + txq->txpkts0_pkts = 0; >>> + txq->txpkts1_pkts = 0; >>> + mp_ring_reset_stats(txq->r); >>> } >>> >>> #ifdef TCP_OFFLOAD >>> /* nothing to clear for each ofld_rxq */ >>> >>> for_each_ofld_txq(pi, i, wrq) { >>> - wrq->tx_wrs = 0; >>> - wrq->no_desc = 0; >>> + wrq->tx_wrs_direct = 0; >>> + wrq->tx_wrs_copied = 0; >>> } >>> #endif >>> wrq = &sc->sge.ctrlq[pi->port_id]; >>> - wrq->tx_wrs = 0; >>> - wrq->no_desc = 0; >>> + wrq->tx_wrs_direct = 0; >>> + wrq->tx_wrs_copied = 0; >>> } >>> break; >>> } >>> >>> Added: head/sys/dev/cxgbe/t4_mp_ring.c >>> >>> =========================================================================== >>> >>> === >>> --- /dev/null 00:00:00 1970 (empty, because file is newly >>> added) >>> +++ head/sys/dev/cxgbe/t4_mp_ring.c Wed Dec 31 23:19:16 2014 >>> (r276485) >>> @@ -0,0 +1,364 @@ >>> +/*- >>> + * Copyright (c) 2014 Chelsio Communications, Inc. >>> + * All rights reserved. >>> + * Written by: Navdeep Parhar >>> + * >>> + * 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 "t4_mp_ring.h" >>> + >>> +union ring_state { >>> + struct { >>> + uint16_t pidx_head; >>> + uint16_t pidx_tail; >>> + uint16_t cidx; >>> + uint16_t flags; >>> + }; >>> + uint64_t state; >>> +}; >>> + >>> +enum { >>> + IDLE = 0, /* consumer ran to completion, nothing >>> more to do. >>> */ >>> + BUSY, /* consumer is running already, or will >>> be shortly. >>> */ >>> + STALLED, /* consumer stopped due to lack of >>> resources. */ >>> + ABDICATED, /* consumer stopped even though there >>> was work to >>> be >>> + done because it wants another thread >>> to take >>> over. */ >>> +}; >>> + >>> +static inline uint16_t >>> +space_available(struct mp_ring *r, union ring_state s) >>> +{ >>> + uint16_t x = r->size - 1; >>> + >>> + if (s.cidx == s.pidx_head) >>> + return (x); >>> + else if (s.cidx > s.pidx_head) >>> + return (s.cidx - s.pidx_head - 1); >>> + else >>> + return (x - s.pidx_head + s.cidx); >>> +} >>> + >>> +static inline uint16_t >>> +increment_idx(struct mp_ring *r, uint16_t idx, uint16_t n) >>> +{ >>> + int x = r->size - idx; >>> + >>> + MPASS(x > 0); >>> + return (x > n ? idx + n : n - x); >>> +} >>> + >>> +/* Consumer is about to update the ring's state to s */ >>> +static inline uint16_t >>> +state_to_flags(union ring_state s, int abdicate) >>> +{ >>> + >>> + if (s.cidx == s.pidx_tail) >>> + return (IDLE); >>> + else if (abdicate && s.pidx_tail != s.pidx_head) >>> + return (ABDICATED); >>> + >>> + return (BUSY); >>> +} >>> + >>> +/* >>> + * Caller passes in a state, with a guarantee that there is >>> work to do and >>> that >>> + * all items up to the pidx_tail in the state are visible. >>> + */ >>> +static void >>> +drain_ring(struct mp_ring *r, union ring_state os, uint16_t >>> prev, int >>> budget) >>> +{ >>> + union ring_state ns; >>> + int n, pending, total; >>> + uint16_t cidx = os.cidx; >>> + uint16_t pidx = os.pidx_tail; >>> + >>> + MPASS(os.flags == BUSY); >>> + MPASS(cidx != pidx); >>> + >>> + if (prev == IDLE) >>> + counter_u64_add(r->starts, 1); >>> + pending = 0; >>> + total = 0; >>> + >>> + while (cidx != pidx) { >>> + >>> + /* Items from cidx to pidx are available for >>> consumption. * >>> / >>> + n = r->drain(r, cidx, pidx); >>> + if (n == 0) { >>> + critical_enter(); >>> + do { >>> + os.state = ns.state = r->state; >>> + ns.cidx = cidx; >>> + ns.flags = STALLED; >>> + } while (atomic_cmpset_64(&r->state, >>> os.state, >>> + ns.state) == 0); >>> + critical_exit(); >>> + if (prev != STALLED) >>> + counter_u64_add(r->stalls, 1); >>> + else if (total > 0) { >>> + counter_u64_add(r->restarts, 1); >>> + counter_u64_add(r->stalls, 1); >>> + } >>> + break; >>> + } >>> + cidx = increment_idx(r, cidx, n); >>> + pending += n; >>> + total += n; >>> + >>> + /* >>> + * We update the cidx only if we've caught up >>> with the >>> pidx, the >>> + * real cidx is getting too far ahead of the one >>> visible to >>> + * everyone else, or we have exceeded our budget. >>> + */ >>> + if (cidx != pidx && pending < 64 && total < budget) >>> + continue; >>> + critical_enter(); >>> + do { >>> + os.state = ns.state = r->state; >>> + ns.cidx = cidx; >>> + ns.flags = state_to_flags(ns, total >= >>> budget); >>> + } while (atomic_cmpset_acq_64(&r->state, os.state, >>> ns.state) == 0); >>> + critical_exit(); >>> + >>> + if (ns.flags == ABDICATED) >>> + counter_u64_add(r->abdications, 1); >>> + if (ns.flags != BUSY) { >>> + /* Wrong loop exit if we're going to >>> stall. */ >>> + MPASS(ns.flags != STALLED); >>> + if (prev == STALLED) { >>> + MPASS(total > 0); >>> + counter_u64_add(r->restarts, 1); >>> + } >>> + break; >>> + } >>> + >>> + /* >>> + * The acquire style atomic above guarantees >>> visibility of >>> items >>> + * associated with any pidx change that we >>> notice here. >>> + */ >>> + pidx = ns.pidx_tail; >>> + pending = 0; >>> + } >>> +} >>> + >>> +int >>> +mp_ring_alloc(struct mp_ring **pr, int size, void *cookie, >>> ring_drain_t >>> drain, >>> + ring_can_drain_t can_drain, struct malloc_type *mt, int flags) >>> +{ >>> + struct mp_ring *r; >>> + >>> + /* All idx are 16b so size can be 65536 at most */ >>> + if (pr == NULL || size < 2 || size > 65536 || drain == >>> NULL || >>> + can_drain == NULL) >>> + return (EINVAL); >>> + *pr = NULL; >>> + flags &= M_NOWAIT | M_WAITOK; >>> + MPASS(flags != 0); >>> + >>> + r = malloc(__offsetof(struct mp_ring, items[size]), mt, >>> flags | >>> M_ZERO); >>> + if (r == NULL) >>> + return (ENOMEM); >>> + r->size = size; >>> + r->cookie = cookie; >>> + r->mt = mt; >>> + r->drain = drain; >>> + r->can_drain = can_drain; >>> + r->enqueues = counter_u64_alloc(flags); >>> + r->drops = counter_u64_alloc(flags); >>> + r->starts = counter_u64_alloc(flags); >>> + r->stalls = counter_u64_alloc(flags); >>> + r->restarts = counter_u64_alloc(flags); >>> + r->abdications = counter_u64_alloc(flags); >>> + if (r->enqueues == NULL || r->drops == NULL || r->starts >>> == NULL || >>> + r->stalls == NULL || r->restarts == NULL || >>> + r->abdications == NULL) { >>> + mp_ring_free(r); >>> + return (ENOMEM); >>> + } >>> + >>> + *pr = r; >>> + return (0); >>> +} >>> + >>> +void >>> + >>> +mp_ring_free(struct mp_ring *r) >>> +{ >>> + >>> + if (r == NULL) >>> + return; >>> + >>> + if (r->enqueues != NULL) >>> + counter_u64_free(r->enqueues); >>> + if (r->drops != NULL) >>> + counter_u64_free(r->drops); >>> + if (r->starts != NULL) >>> + counter_u64_free(r->starts); >>> + if (r->stalls != NULL) >>> + counter_u64_free(r->stalls); >>> + if (r->restarts != NULL) >>> + counter_u64_free(r->restarts); >>> + if (r->abdications != NULL) >>> + counter_u64_free(r->abdications); >>> + >>> + free(r, r->mt); >>> +} >>> + >>> +/* >>> + * Enqueue n items and maybe drain the ring for some time. >>> + * >>> + * Returns an errno. >>> + */ >>> +int >>> +mp_ring_enqueue(struct mp_ring *r, void **items, int n, int >>> budget) >>> +{ >>> + union ring_state os, ns; >>> + uint16_t pidx_start, pidx_stop; >>> + int i; >>> + >>> + MPASS(items != NULL); >>> + MPASS(n > 0); >>> + >>> >>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>> >>> >>> >>> >>> >>> -- >>> -----------------------------------------+------------------------------- >>> >>> Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. >>> dell'Informazione >>> http://www.iet.unipi.it/~luigi/ . Universita` di Pisa >>> TEL +39-050-2211611 . via Diotisalvi 2 >>> Mobile +39-338-6809875 . 56122 PISA (Italy) >>> -----------------------------------------+------------------------------- >>> > From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:35:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBE14991; Tue, 20 Jan 2015 23:35:28 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92332E51; Tue, 20 Jan 2015 23:35:28 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id E899C192A3B; Tue, 20 Jan 2015 23:35:25 +0000 (UTC) Message-ID: <54BEE62D.2060703@ignoranthack.me> Date: Tue, 20 Jan 2015 15:35:09 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Hans Petter Selasky , Gleb Smirnoff , Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> In-Reply-To: <54BED6FB.8060401@selasky.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Jason Wolfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:35:28 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/20/15 14:30, Hans Petter Selasky wrote: > On 01/20/15 22:11, Gleb Smirnoff wrote: >> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin Belousov >> wrote: K> > Like stated in the manual page, >> callout_reset_curcpu/on() does not work K> > with MPSAFE callouts >> any more! K> I.e. you 'fixed' some undeterminate bugs in callout >> migration by not K> doing migration at all anymore. K> K> > K> > >> You need to use callout_init_{mtx,rm,rw} and remove the custom >> locking K> > inside the callback in the TCP stack to get it >> working like before! K> K> No, you need to do this, if you think >> that whole callout KPI must be K> rototiled. It is up to the >> person who modifies the KPI, to ensure that K> existing code is >> not broken. K> K> As I understand, currently we are back to the >> one-cpu callouts. K> Do other people consider this situation >> acceptable ? >> >> I think this isn't acceptable. The commit to a complex subsystem >> lacked a review from persons involved in the system before. The >> commit to subsystem broke consumers of the subsystem and this was >> even done not accidentially, but due to Hans not caring about >> it. >> >> As for me this is enough to request a backout, and let the >> change back in only after proper review. >> > > Hi Gleb, > > Backing out my callout API patch means we will for sure > re-introduce an unknown callout spinlock hang, as noted to me by > several people. What do you think about that? dram Maybe "Jason > Wolfe" CC'ed can add to 10-stable w/o my patches: > Jason picked up this patch for work and it resolved our instability issues that had remained unsolved for quite some time as reported to freebsd-net: https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html This had gone undiagnosed for some time (even with the gracious help of jhb in offline emails, thanks btw!). There's some diagnostics in that email thread that may be of value to you folks for determination of the validity of changing the callout API or at least understanding why we were involved in diagnostics. While I'd sure love to tune performance, the fact that our machines were basically going out to lunch without these changes, probably means that others were seeing it and didn't know what else to do. As much as I enjoy a good "break out the pitch forks and torches" email thread, this increased stability for us and is allowing us to upgrade from freebsd8 to freebsd10. Bear this in mind when you throw your voice in favor of reverting. > int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, > sbintime_t precision, void (*ftn)(void *), void *arg, int cpu, int > flags) { sbintime_t to_sbt, pr; struct callout_cpu *cc; int > cancelled, direct; > > + cpu = timeout_cpu; /* XXX test code XXX */ > > cancelled = 0; > Jason or I would have to run this in production, which would be problematic I fear. We never had a deterministic test case that would exhibit the reported failure. We merely "tested in production" and saw that panics ceased. We didn't note a dropoff in our traffic either, perhaps we are not as efficient as others in this corner case, but we were consistently seeing the spinlock hangs after a day or so of traffic. > And see if he observes a callout spinlock hang or not on his test > setup. The patch above should force all callouts to the same thread > basically. Then we could maybe see if single threading the callouts > has anything to do with solving the spinlock hang. > > The "rewritten" callout API still has all the features and > capabilities the old one had, when used as described in "man 9 > callout". > > At the present moment I'm not technically convinced a backout is > correct. Neither am I, to be honest. Just based on *results*. > > Gleb: I think we would see far better results with high speed > internet links using TCP if we could extend the LRO (large receive > offload) code to accumulate more than 64KBytes worth of data per > call to the TCP stack instead of complaining about some callouts > ending up on the same thread! Actually I have a patch for that. > > --HPS > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUvuYrXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kJTMIAMfh6ghV/AwQauY+a44q1hjJ WC7E3u69FK0opgSYg71kk6HckbyB+sTWND6HdXnpyrcMLXUt74zlB8c48wbUUV5+ EwKNYzGNNnDNhoc0WtPMect8e9Y1kBRvSGfHBdVrqATXfPOyZEa+i4lQAXpiFKIt nndqVrAH7bJM6143YDpnIg7vaR+8IQnC2ztSP4ogJzh03DZ7zVsg4BsoCPg50eVZ kr46cXcE+SP/TsQBsVNVwRJD5NFie6QJdLoTnwkd0XfQGJMIWivNgUcE4tIxqPIf nGQ0xMJCotpNLuPtzYzCIurSaDHdHmL6bjkhjTtBmWsMNfdGH8TKoih79GDxkTg= =Y3rd -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:39:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2593DC40; Tue, 20 Jan 2015 23:39:51 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCFC5E7C; Tue, 20 Jan 2015 23:39:50 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id kx10so18202426pab.11; Tue, 20 Jan 2015 15:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=OO0IsrzIa+yF+Y9dTe7RSTvOrSDGBszNetsP2KYVkAk=; b=c6DMyysZAhhbReyvaxCPp7O+h+e7sLoVq0FJL+h5jJOcyvTho74p1hHbszCpGrSqum tlw0L2Y9bKMtL+8l67VyNuKzpen3GiRG8Y+GYJnzRRsvkLnXsbzTA8BZMg5p/gp8ohLN 5Q0AQbkLEDyxW8uR+8lIHSZBMTu9ir3yhR3MBKAl/vaVxtuHfvtWAwZHVl1YHt5y8g13 NzPkf/wKo89VU6OkAE1qtFQUaDFd5vHZk7PcJu9dLTr/JE0KW9UC04YZNXx38N7v9oQD jXRwLRK01C47Ck3piBSLFB5xYC4lq7JS2mc/ODkj4m+Guaq5XD+kYEFFltnP7WCgqfr1 d3RQ== X-Received: by 10.66.250.166 with SMTP id zd6mr56042719pac.41.1421797190419; Tue, 20 Jan 2015 15:39:50 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id yq5sm4312910pac.15.2015.01.20.15.39.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 15:39:49 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54BEE743.7030601@FreeBSD.org> Date: Tue, 20 Jan 2015 15:39:47 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: sbruno@freebsd.org, Hans Petter Selasky , Gleb Smirnoff , Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> In-Reply-To: <54BEE62D.2060703@ignoranthack.me> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Jason Wolfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:39:51 -0000 Sean, Was this really "Reviewed by: sbruno@" or just "Tested by: sbruno@"? I was very happy to see so many reviewers on the original commit but you seem to be the only one still left on the list. Regards, Navdeep On 01/20/15 15:35, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/20/15 14:30, Hans Petter Selasky wrote: >> On 01/20/15 22:11, Gleb Smirnoff wrote: >>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin Belousov >>> wrote: K> > Like stated in the manual page, >>> callout_reset_curcpu/on() does not work K> > with MPSAFE callouts >>> any more! K> I.e. you 'fixed' some undeterminate bugs in callout >>> migration by not K> doing migration at all anymore. K> K> > K> > >>> You need to use callout_init_{mtx,rm,rw} and remove the custom >>> locking K> > inside the callback in the TCP stack to get it >>> working like before! K> K> No, you need to do this, if you think >>> that whole callout KPI must be K> rototiled. It is up to the >>> person who modifies the KPI, to ensure that K> existing code is >>> not broken. K> K> As I understand, currently we are back to the >>> one-cpu callouts. K> Do other people consider this situation >>> acceptable ? >>> >>> I think this isn't acceptable. The commit to a complex subsystem >>> lacked a review from persons involved in the system before. The >>> commit to subsystem broke consumers of the subsystem and this was >>> even done not accidentially, but due to Hans not caring about >>> it. >>> >>> As for me this is enough to request a backout, and let the >>> change back in only after proper review. >>> >> >> Hi Gleb, >> >> Backing out my callout API patch means we will for sure >> re-introduce an unknown callout spinlock hang, as noted to me by >> several people. What do you think about that? dram Maybe "Jason >> Wolfe" CC'ed can add to 10-stable w/o my patches: >> > > Jason picked up this patch for work and it resolved our instability > issues that had remained unsolved for quite some time as reported to > freebsd-net: > > https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html > > This had gone undiagnosed for some time (even with the gracious help > of jhb in offline emails, thanks btw!). > > There's some diagnostics in that email thread that may be of value to > you folks for determination of the validity of changing the callout > API or at least understanding why we were involved in diagnostics. > > While I'd sure love to tune performance, the fact that our machines > were basically going out to lunch without these changes, probably > means that others were seeing it and didn't know what else to do. As > much as I enjoy a good "break out the pitch forks and torches" email > thread, this increased stability for us and is allowing us to upgrade > from freebsd8 to freebsd10. Bear this in mind when you throw your > voice in favor of reverting. > >> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >> sbintime_t precision, void (*ftn)(void *), void *arg, int cpu, int >> flags) { sbintime_t to_sbt, pr; struct callout_cpu *cc; int >> cancelled, direct; >> >> + cpu = timeout_cpu; /* XXX test code XXX */ >> >> cancelled = 0; >> > > Jason or I would have to run this in production, which would be > problematic I fear. We never had a deterministic test case that would > exhibit the reported failure. We merely "tested in production" and > saw that panics ceased. We didn't note a dropoff in our traffic > either, perhaps we are not as efficient as others in this corner case, > but we were consistently seeing the spinlock hangs after a day or so > of traffic. > >> And see if he observes a callout spinlock hang or not on his test >> setup. The patch above should force all callouts to the same thread >> basically. Then we could maybe see if single threading the callouts >> has anything to do with solving the spinlock hang. >> >> The "rewritten" callout API still has all the features and >> capabilities the old one had, when used as described in "man 9 >> callout". >> >> At the present moment I'm not technically convinced a backout is >> correct. > > Neither am I, to be honest. Just based on *results*. > >> >> Gleb: I think we would see far better results with high speed >> internet links using TCP if we could extend the LRO (large receive >> offload) code to accumulate more than 64KBytes worth of data per >> call to the TCP stack instead of complaining about some callouts >> ending up on the same thread! Actually I have a patch for that. >> >> --HPS >> >> >> > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUvuYrXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kJTMIAMfh6ghV/AwQauY+a44q1hjJ > WC7E3u69FK0opgSYg71kk6HckbyB+sTWND6HdXnpyrcMLXUt74zlB8c48wbUUV5+ > EwKNYzGNNnDNhoc0WtPMect8e9Y1kBRvSGfHBdVrqATXfPOyZEa+i4lQAXpiFKIt > nndqVrAH7bJM6143YDpnIg7vaR+8IQnC2ztSP4ogJzh03DZ7zVsg4BsoCPg50eVZ > kr46cXcE+SP/TsQBsVNVwRJD5NFie6QJdLoTnwkd0XfQGJMIWivNgUcE4tIxqPIf > nGQ0xMJCotpNLuPtzYzCIurSaDHdHmL6bjkhjTtBmWsMNfdGH8TKoih79GDxkTg= > =Y3rd > -----END PGP SIGNATURE----- > From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:40:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B130AD84; Tue, 20 Jan 2015 23:40:16 +0000 (UTC) Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 646ABE86; Tue, 20 Jan 2015 23:40:16 +0000 (UTC) Received: by mail-yk0-f171.google.com with SMTP id 10so5243861ykt.2; Tue, 20 Jan 2015 15:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9bFAJdLE5sFn/ThVb+TOCqf1rdErdUTB70w1x4Hb+5k=; b=KMiIi1NBsXq/GhqiyUb+NOP6oztJE6fkuJcIHStzEe5aKSznP72DSm9srnuKHe17ZY fSAeQaHySrs2/jRMzNpC+e/HWtccwLH2mTmcascaasAuFERB7eB/GxzRL1qAu9714kOE Ujj/D0uyVDM/TW6g4G5gJckg+DWJUNerLdkCjPQVq3M+fLQjMCN2uk77tjG6Y274wAe4 aoMUpBBDxKqgVRqRYutr7OB/9BYQcVfVg6YH6rj22/qRRlSl2fwu13sU1KD6GfHCy15l dxHs5jRUSf+Vrbcg/BIUfgU1ivRfeCaDGz6NjPjUbNeMPl6n38Shud+pymCIfwNRY4ii 6QJw== MIME-Version: 1.0 X-Received: by 10.170.57.143 with SMTP id 137mr8189323ykz.10.1421797215562; Tue, 20 Jan 2015 15:40:15 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 15:40:15 -0800 (PST) In-Reply-To: <54BEE62D.2060703@ignoranthack.me> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> Date: Tue, 20 Jan 2015 15:40:15 -0800 X-Google-Sender-Auth: TCMvssV_b-y4xnPC2DU8I4XNojY Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:40:16 -0000 I think you're working around driver locking bugs by crippling the callout code. -K On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/20/15 14:30, Hans Petter Selasky wrote: >> On 01/20/15 22:11, Gleb Smirnoff wrote: >>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin Belousov >>> wrote: K> > Like stated in the manual page, >>> callout_reset_curcpu/on() does not work K> > with MPSAFE callouts >>> any more! K> I.e. you 'fixed' some undeterminate bugs in callout >>> migration by not K> doing migration at all anymore. K> K> > K> > >>> You need to use callout_init_{mtx,rm,rw} and remove the custom >>> locking K> > inside the callback in the TCP stack to get it >>> working like before! K> K> No, you need to do this, if you think >>> that whole callout KPI must be K> rototiled. It is up to the >>> person who modifies the KPI, to ensure that K> existing code is >>> not broken. K> K> As I understand, currently we are back to the >>> one-cpu callouts. K> Do other people consider this situation >>> acceptable ? >>> >>> I think this isn't acceptable. The commit to a complex subsystem >>> lacked a review from persons involved in the system before. The >>> commit to subsystem broke consumers of the subsystem and this was >>> even done not accidentially, but due to Hans not caring about >>> it. >>> >>> As for me this is enough to request a backout, and let the >>> change back in only after proper review. >>> >> >> Hi Gleb, >> >> Backing out my callout API patch means we will for sure >> re-introduce an unknown callout spinlock hang, as noted to me by >> several people. What do you think about that? dram Maybe "Jason >> Wolfe" CC'ed can add to 10-stable w/o my patches: >> > > Jason picked up this patch for work and it resolved our instability > issues that had remained unsolved for quite some time as reported to > freebsd-net: > > https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html > > This had gone undiagnosed for some time (even with the gracious help > of jhb in offline emails, thanks btw!). > > There's some diagnostics in that email thread that may be of value to > you folks for determination of the validity of changing the callout > API or at least understanding why we were involved in diagnostics. > > While I'd sure love to tune performance, the fact that our machines > were basically going out to lunch without these changes, probably > means that others were seeing it and didn't know what else to do. As > much as I enjoy a good "break out the pitch forks and torches" email > thread, this increased stability for us and is allowing us to upgrade > from freebsd8 to freebsd10. Bear this in mind when you throw your > voice in favor of reverting. > >> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >> sbintime_t precision, void (*ftn)(void *), void *arg, int cpu, int >> flags) { sbintime_t to_sbt, pr; struct callout_cpu *cc; int >> cancelled, direct; >> >> + cpu = timeout_cpu; /* XXX test code XXX */ >> >> cancelled = 0; >> > > Jason or I would have to run this in production, which would be > problematic I fear. We never had a deterministic test case that would > exhibit the reported failure. We merely "tested in production" and > saw that panics ceased. We didn't note a dropoff in our traffic > either, perhaps we are not as efficient as others in this corner case, > but we were consistently seeing the spinlock hangs after a day or so > of traffic. > >> And see if he observes a callout spinlock hang or not on his test >> setup. The patch above should force all callouts to the same thread >> basically. Then we could maybe see if single threading the callouts >> has anything to do with solving the spinlock hang. >> >> The "rewritten" callout API still has all the features and >> capabilities the old one had, when used as described in "man 9 >> callout". >> >> At the present moment I'm not technically convinced a backout is >> correct. > > Neither am I, to be honest. Just based on *results*. > >> >> Gleb: I think we would see far better results with high speed >> internet links using TCP if we could extend the LRO (large receive >> offload) code to accumulate more than 64KBytes worth of data per >> call to the TCP stack instead of complaining about some callouts >> ending up on the same thread! Actually I have a patch for that. >> >> --HPS >> >> >> > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUvuYrXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kJTMIAMfh6ghV/AwQauY+a44q1hjJ > WC7E3u69FK0opgSYg71kk6HckbyB+sTWND6HdXnpyrcMLXUt74zlB8c48wbUUV5+ > EwKNYzGNNnDNhoc0WtPMect8e9Y1kBRvSGfHBdVrqATXfPOyZEa+i4lQAXpiFKIt > nndqVrAH7bJM6143YDpnIg7vaR+8IQnC2ztSP4ogJzh03DZ7zVsg4BsoCPg50eVZ > kr46cXcE+SP/TsQBsVNVwRJD5NFie6QJdLoTnwkd0XfQGJMIWivNgUcE4tIxqPIf > nGQ0xMJCotpNLuPtzYzCIurSaDHdHmL6bjkhjTtBmWsMNfdGH8TKoih79GDxkTg= > =Y3rd > -----END PGP SIGNATURE----- > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:44:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FC2DF1B; Tue, 20 Jan 2015 23:44:40 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74C81F31; Tue, 20 Jan 2015 23:44:40 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 20310192A3B; Tue, 20 Jan 2015 23:44:39 +0000 (UTC) Message-ID: <54BEE866.6090106@ignoranthack.me> Date: Tue, 20 Jan 2015 15:44:38 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Navdeep Parhar , Hans Petter Selasky , Gleb Smirnoff , Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE743.7030601@FreeBSD.org> In-Reply-To: <54BEE743.7030601@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Jason Wolfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:44:40 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/20/15 15:39, Navdeep Parhar wrote: > Sean, > > Was this really "Reviewed by: sbruno@" or just "Tested by: > sbruno@"? I was very happy to see so many reviewers on the > original commit but you seem to be the only one still left on the > list. > > Regards, Navdeep I doubt that I would qualify as a "Reviewer" in this code by any stretch of the imagination. My contribution to the testing was in house and general review of code flow in out freebsd10 environment. sean > > On 01/20/15 15:35, Sean Bruno wrote: On 01/20/15 14:30, Hans Petter > Selasky wrote: >>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>> Belousov wrote: K> > Like stated in the manual page, >>>>> callout_reset_curcpu/on() does not work K> > with MPSAFE >>>>> callouts any more! K> I.e. you 'fixed' some undeterminate >>>>> bugs in callout migration by not K> doing migration at all >>>>> anymore. K> K> > K> > You need to use >>>>> callout_init_{mtx,rm,rw} and remove the custom locking K> > >>>>> inside the callback in the TCP stack to get it working like >>>>> before! K> K> No, you need to do this, if you think that >>>>> whole callout KPI must be K> rototiled. It is up to the >>>>> person who modifies the KPI, to ensure that K> existing >>>>> code is not broken. K> K> As I understand, currently we are >>>>> back to the one-cpu callouts. K> Do other people consider >>>>> this situation acceptable ? >>>>> >>>>> I think this isn't acceptable. The commit to a complex >>>>> subsystem lacked a review from persons involved in the >>>>> system before. The commit to subsystem broke consumers of >>>>> the subsystem and this was even done not accidentially, but >>>>> due to Hans not caring about it. >>>>> >>>>> As for me this is enough to request a backout, and let the >>>>> change back in only after proper review. >>>>> >>>> >>>> Hi Gleb, >>>> >>>> Backing out my callout API patch means we will for sure >>>> re-introduce an unknown callout spinlock hang, as noted to me >>>> by several people. What do you think about that? dram Maybe >>>> "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: >>>> > > Jason picked up this patch for work and it resolved our > instability issues that had remained unsolved for quite some time > as reported to freebsd-net: > > https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html > > This had gone undiagnosed for some time (even with the gracious > help of jhb in offline emails, thanks btw!). > > There's some diagnostics in that email thread that may be of value > to you folks for determination of the validity of changing the > callout API or at least understanding why we were involved in > diagnostics. > > While I'd sure love to tune performance, the fact that our > machines were basically going out to lunch without these changes, > probably means that others were seeing it and didn't know what else > to do. As much as I enjoy a good "break out the pitch forks and > torches" email thread, this increased stability for us and is > allowing us to upgrade from freebsd8 to freebsd10. Bear this in > mind when you throw your voice in favor of reverting. > >>>> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >>>> sbintime_t precision, void (*ftn)(void *), void *arg, int >>>> cpu, int flags) { sbintime_t to_sbt, pr; struct callout_cpu >>>> *cc; int cancelled, direct; >>>> >>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>> >>>> cancelled = 0; >>>> > > Jason or I would have to run this in production, which would be > problematic I fear. We never had a deterministic test case that > would exhibit the reported failure. We merely "tested in > production" and saw that panics ceased. We didn't note a dropoff > in our traffic either, perhaps we are not as efficient as others in > this corner case, but we were consistently seeing the spinlock > hangs after a day or so of traffic. > >>>> And see if he observes a callout spinlock hang or not on his >>>> test setup. The patch above should force all callouts to the >>>> same thread basically. Then we could maybe see if single >>>> threading the callouts has anything to do with solving the >>>> spinlock hang. >>>> >>>> The "rewritten" callout API still has all the features and >>>> capabilities the old one had, when used as described in "man >>>> 9 callout". >>>> >>>> At the present moment I'm not technically convinced a backout >>>> is correct. > > Neither am I, to be honest. Just based on *results*. > >>>> >>>> Gleb: I think we would see far better results with high >>>> speed internet links using TCP if we could extend the LRO >>>> (large receive offload) code to accumulate more than 64KBytes >>>> worth of data per call to the TCP stack instead of >>>> complaining about some callouts ending up on the same thread! >>>> Actually I have a patch for that. >>>> >>>> --HPS >>>> >>>> >>>> > >> > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUvuhjXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kz74H/RVMvCmstmep+rXvwYNXwQvQ M45uwBUYe27qL1Z11qbMwghV0tkLWPkko7Nwgb+BwDhNcqsgxvGxH/8i8ohElHs2 8Pbec9ajuZtDuhPL8ldibntT7OZJYUUkTbvC7sxlT0MCHyuu+Dn8wKR5BtgcmhCW rCEkanrXtGHZdP+JnN9zvo4jcxC2pDNxd/7poo3dDLf75z76k+gGborubGoYP36C 6356JneibgbybjhjK0qWW15b5sZyCgtbS1TQq2avmRdSDtyv6umPVCsS1p2JTKnS o6LChkGvtUb+HDLkQMHYoNF6KMNRefIiYqvXtnzvxCv1yjoDz9zEv5vRm/Y21Xc= =luC8 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:46:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D33B4E0; Tue, 20 Jan 2015 23:46:48 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 980D4F44; Tue, 20 Jan 2015 23:46:48 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 54547192A3B; Tue, 20 Jan 2015 23:46:47 +0000 (UTC) Message-ID: <54BEE8E6.3080009@ignoranthack.me> Date: Tue, 20 Jan 2015 15:46:46 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:46:49 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/20/15 15:40, K. Macy wrote: > I think you're working around driver locking bugs by crippling the > callout code. > > -K > We had zero evidence of this. What leads you down that path? I'm totally open to being wrong, e.g. "yeah, you slowed down things so that you don't hit a race condition" sean > On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno > wrote: On 01/20/15 14:30, Hans Petter > Selasky wrote: >>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>> Belousov wrote: K> > Like stated in the manual page, >>>>> callout_reset_curcpu/on() does not work K> > with MPSAFE >>>>> callouts any more! K> I.e. you 'fixed' some undeterminate >>>>> bugs in callout migration by not K> doing migration at all >>>>> anymore. K> K> > K> > You need to use >>>>> callout_init_{mtx,rm,rw} and remove the custom locking K> > >>>>> inside the callback in the TCP stack to get it working like >>>>> before! K> K> No, you need to do this, if you think that >>>>> whole callout KPI must be K> rototiled. It is up to the >>>>> person who modifies the KPI, to ensure that K> existing >>>>> code is not broken. K> K> As I understand, currently we are >>>>> back to the one-cpu callouts. K> Do other people consider >>>>> this situation acceptable ? >>>>> >>>>> I think this isn't acceptable. The commit to a complex >>>>> subsystem lacked a review from persons involved in the >>>>> system before. The commit to subsystem broke consumers of >>>>> the subsystem and this was even done not accidentially, but >>>>> due to Hans not caring about it. >>>>> >>>>> As for me this is enough to request a backout, and let the >>>>> change back in only after proper review. >>>>> >>>> >>>> Hi Gleb, >>>> >>>> Backing out my callout API patch means we will for sure >>>> re-introduce an unknown callout spinlock hang, as noted to me >>>> by several people. What do you think about that? dram Maybe >>>> "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: >>>> > > Jason picked up this patch for work and it resolved our > instability issues that had remained unsolved for quite some time > as reported to freebsd-net: > > https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html > > This had gone undiagnosed for some time (even with the gracious > help of jhb in offline emails, thanks btw!). > > There's some diagnostics in that email thread that may be of value > to you folks for determination of the validity of changing the > callout API or at least understanding why we were involved in > diagnostics. > > While I'd sure love to tune performance, the fact that our > machines were basically going out to lunch without these changes, > probably means that others were seeing it and didn't know what else > to do. As much as I enjoy a good "break out the pitch forks and > torches" email thread, this increased stability for us and is > allowing us to upgrade from freebsd8 to freebsd10. Bear this in > mind when you throw your voice in favor of reverting. > >>>> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >>>> sbintime_t precision, void (*ftn)(void *), void *arg, int >>>> cpu, int flags) { sbintime_t to_sbt, pr; struct callout_cpu >>>> *cc; int cancelled, direct; >>>> >>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>> >>>> cancelled = 0; >>>> > > Jason or I would have to run this in production, which would be > problematic I fear. We never had a deterministic test case that > would exhibit the reported failure. We merely "tested in > production" and saw that panics ceased. We didn't note a dropoff > in our traffic either, perhaps we are not as efficient as others in > this corner case, but we were consistently seeing the spinlock > hangs after a day or so of traffic. > >>>> And see if he observes a callout spinlock hang or not on his >>>> test setup. The patch above should force all callouts to the >>>> same thread basically. Then we could maybe see if single >>>> threading the callouts has anything to do with solving the >>>> spinlock hang. >>>> >>>> The "rewritten" callout API still has all the features and >>>> capabilities the old one had, when used as described in "man >>>> 9 callout". >>>> >>>> At the present moment I'm not technically convinced a backout >>>> is correct. > > Neither am I, to be honest. Just based on *results*. > >>>> >>>> Gleb: I think we would see far better results with high >>>> speed internet links using TCP if we could extend the LRO >>>> (large receive offload) code to accumulate more than 64KBytes >>>> worth of data per call to the TCP stack instead of >>>> complaining about some callouts ending up on the same thread! >>>> Actually I have a patch for that. >>>> >>>> --HPS >>>> >>>> >>>> > >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-head To >> unsubscribe, send any mail to >> "svn-src-head-unsubscribe@freebsd.org" > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUvujmXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kv2MH/1F15x/lgwWq5fE/cZ3n9HlV 9Nd7DU03coj9qUU6LH1eLPPuUn7yelCw8xxtb0qOTIDyrzNYe+HIaJi1GMHkV8Ve iKFuB1G9gcN/nQ5BdaAezOazEUcRY2msigMh5n/2X/UDRzLAGfhbDFbogpRy1TyI fqKzYDM8Mx9yZfCuc4/yBUVmxDcVn6NsuQ7CW745qXQcrELdJ8fjKfaYWbprCR7u xA3Iwiio9Bv0/8MvR9n3PZ8z3NjAKD1XxV5iAPI+ANc/5Rc60cSmtP0mQakqOoz6 8uucaus79KdykdNovh31ka0dp0JBCghZOsfNXP69TFfvSXyngMZqwZgqVLVcX3M= =0AV4 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:48:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EABC9222; Tue, 20 Jan 2015 23:48:06 +0000 (UTC) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB1EFF4B; Tue, 20 Jan 2015 23:48:06 +0000 (UTC) Received: by mail-yh0-f48.google.com with SMTP id a41so5473131yho.7; Tue, 20 Jan 2015 15:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ys/gb57OI3eZ7XOY7tNt1O7PLAwVgHYynV1B53vbTug=; b=xt2tt23lG0vsoVcCm230nShvB3lIG8X3sMUimbjmaiteDdMlCBBYcE4XcK/V9t3KEH nnsTGYrdSAUt3zNXCIqxKFMhxHmaNUuHBkY+a2wdR8bjvOArxoIP2M6ehN7penEe3Q4A HXcGpVL0nDQOV/RK9jL9g00LElFQE6XEUGF6ht6ddZ+F+4jKQ0X9ov1zmL1wj98cnEXT SldoSC9pyETVN6sjzsiQvG6cmMW5lKciUuhLwcAVbE/tAEO9seL3E875pWy7XJFHIlNL glMy5POfVgaE7yifoSorNZtcvOAxfM4sprLi2rh9P9b4g1HulzKyNEvbldFAl1dvA0Jc MI9Q== MIME-Version: 1.0 X-Received: by 10.236.89.172 with SMTP id c32mr22709191yhf.180.1421797685822; Tue, 20 Jan 2015 15:48:05 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 15:48:05 -0800 (PST) In-Reply-To: <54BEE8E6.3080009@ignoranthack.me> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> Date: Tue, 20 Jan 2015 15:48:05 -0800 X-Google-Sender-Auth: l7UP_U1iq2RWv4WgNDglT54hWB4 Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:48:07 -0000 Are any other drivers hitting this? e.g. cxgb/cxgbe? -K On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/20/15 15:40, K. Macy wrote: >> I think you're working around driver locking bugs by crippling the >> callout code. >> >> -K >> > > We had zero evidence of this. What leads you down that path? I'm > totally open to being wrong, e.g. "yeah, you slowed down things so > that you don't hit a race condition" > > sean > >> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >> wrote: On 01/20/15 14:30, Hans Petter >> Selasky wrote: >>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>>> Belousov wrote: K> > Like stated in the manual page, >>>>>> callout_reset_curcpu/on() does not work K> > with MPSAFE >>>>>> callouts any more! K> I.e. you 'fixed' some undeterminate >>>>>> bugs in callout migration by not K> doing migration at all >>>>>> anymore. K> K> > K> > You need to use >>>>>> callout_init_{mtx,rm,rw} and remove the custom locking K> > >>>>>> inside the callback in the TCP stack to get it working like >>>>>> before! K> K> No, you need to do this, if you think that >>>>>> whole callout KPI must be K> rototiled. It is up to the >>>>>> person who modifies the KPI, to ensure that K> existing >>>>>> code is not broken. K> K> As I understand, currently we are >>>>>> back to the one-cpu callouts. K> Do other people consider >>>>>> this situation acceptable ? >>>>>> >>>>>> I think this isn't acceptable. The commit to a complex >>>>>> subsystem lacked a review from persons involved in the >>>>>> system before. The commit to subsystem broke consumers of >>>>>> the subsystem and this was even done not accidentially, but >>>>>> due to Hans not caring about it. >>>>>> >>>>>> As for me this is enough to request a backout, and let the >>>>>> change back in only after proper review. >>>>>> >>>>> >>>>> Hi Gleb, >>>>> >>>>> Backing out my callout API patch means we will for sure >>>>> re-introduce an unknown callout spinlock hang, as noted to me >>>>> by several people. What do you think about that? dram Maybe >>>>> "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: >>>>> >> >> Jason picked up this patch for work and it resolved our >> instability issues that had remained unsolved for quite some time >> as reported to freebsd-net: >> >> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >> >> This had gone undiagnosed for some time (even with the gracious >> help of jhb in offline emails, thanks btw!). >> >> There's some diagnostics in that email thread that may be of value >> to you folks for determination of the validity of changing the >> callout API or at least understanding why we were involved in >> diagnostics. >> >> While I'd sure love to tune performance, the fact that our >> machines were basically going out to lunch without these changes, >> probably means that others were seeing it and didn't know what else >> to do. As much as I enjoy a good "break out the pitch forks and >> torches" email thread, this increased stability for us and is >> allowing us to upgrade from freebsd8 to freebsd10. Bear this in >> mind when you throw your voice in favor of reverting. >> >>>>> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >>>>> sbintime_t precision, void (*ftn)(void *), void *arg, int >>>>> cpu, int flags) { sbintime_t to_sbt, pr; struct callout_cpu >>>>> *cc; int cancelled, direct; >>>>> >>>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>>> >>>>> cancelled = 0; >>>>> >> >> Jason or I would have to run this in production, which would be >> problematic I fear. We never had a deterministic test case that >> would exhibit the reported failure. We merely "tested in >> production" and saw that panics ceased. We didn't note a dropoff >> in our traffic either, perhaps we are not as efficient as others in >> this corner case, but we were consistently seeing the spinlock >> hangs after a day or so of traffic. >> >>>>> And see if he observes a callout spinlock hang or not on his >>>>> test setup. The patch above should force all callouts to the >>>>> same thread basically. Then we could maybe see if single >>>>> threading the callouts has anything to do with solving the >>>>> spinlock hang. >>>>> >>>>> The "rewritten" callout API still has all the features and >>>>> capabilities the old one had, when used as described in "man >>>>> 9 callout". >>>>> >>>>> At the present moment I'm not technically convinced a backout >>>>> is correct. >> >> Neither am I, to be honest. Just based on *results*. >> >>>>> >>>>> Gleb: I think we would see far better results with high >>>>> speed internet links using TCP if we could extend the LRO >>>>> (large receive offload) code to accumulate more than 64KBytes >>>>> worth of data per call to the TCP stack instead of >>>>> complaining about some callouts ending up on the same thread! >>>>> Actually I have a patch for that. >>>>> >>>>> --HPS >>>>> >>>>> >>>>> >> >>> _______________________________________________ >>> svn-src-head@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/svn-src-head To >>> unsubscribe, send any mail to >>> "svn-src-head-unsubscribe@freebsd.org" >> >> > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUvujmXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kv2MH/1F15x/lgwWq5fE/cZ3n9HlV > 9Nd7DU03coj9qUU6LH1eLPPuUn7yelCw8xxtb0qOTIDyrzNYe+HIaJi1GMHkV8Ve > iKFuB1G9gcN/nQ5BdaAezOazEUcRY2msigMh5n/2X/UDRzLAGfhbDFbogpRy1TyI > fqKzYDM8Mx9yZfCuc4/yBUVmxDcVn6NsuQ7CW745qXQcrELdJ8fjKfaYWbprCR7u > xA3Iwiio9Bv0/8MvR9n3PZ8z3NjAKD1XxV5iAPI+ANc/5Rc60cSmtP0mQakqOoz6 > 8uucaus79KdykdNovh31ka0dp0JBCghZOsfNXP69TFfvSXyngMZqwZgqVLVcX3M= > =0AV4 > -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:51:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 430AF471; Tue, 20 Jan 2015 23:51:56 +0000 (UTC) Received: from mail-yk0-x231.google.com (mail-yk0-x231.google.com [IPv6:2607:f8b0:4002:c07::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8BD4FF8; Tue, 20 Jan 2015 23:51:55 +0000 (UTC) Received: by mail-yk0-f177.google.com with SMTP id 19so1971769ykq.8; Tue, 20 Jan 2015 15:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Q/X1v9EUfs/EnEiltc7u0207HQ0LvnhTZsJ67s8QOsU=; b=KG3bwO7O/M7gwdnsSXrKcjGmq1g/J+wjm4pHNo7XQIvijafEAanWHj7ZZ/mgnpSc/O COlNA4rOVPePanIAr1XZ84WOIN2qea2kLddBo2LhFvIK7UPUozFF3ruoBLdvoiyRlbv2 Y3QzbwF76brUQopZjGLtqD02APhCA/sd4aRZKe2uWb62P1rBOdDunR34kzVLlBWTmw36 AhGUGOI0v2XE9auWcJOT31lLkrNabe3jPZZJp3rGRPS9SHgVKwr+oS2KUUxCpJ2X5vso Tn2QTbFUq9l59bjFgpjylAxR42e73YS8y1FW7mrcp+KZm6FYx6I+eDTYpig/FdZsbjjY kx8w== MIME-Version: 1.0 X-Received: by 10.170.44.4 with SMTP id 4mr2900501ykm.101.1421797915016; Tue, 20 Jan 2015 15:51:55 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 15:51:54 -0800 (PST) In-Reply-To: References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> Date: Tue, 20 Jan 2015 15:51:54 -0800 X-Google-Sender-Auth: 9hW-saO6bX0FxhRQu7tmoJssbOw Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:51:56 -0000 On Tue, Jan 20, 2015 at 3:48 PM, K. Macy wrote: > Are any other drivers hitting this? e.g. cxgb/cxgbe? The evidence is simply past experience of recurring locking and control flow bugs in the intel drivers. -K > > -K > > On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA512 >> >> On 01/20/15 15:40, K. Macy wrote: >>> I think you're working around driver locking bugs by crippling the >>> callout code. >>> >>> -K >>> >> >> We had zero evidence of this. What leads you down that path? I'm >> totally open to being wrong, e.g. "yeah, you slowed down things so >> that you don't hit a race condition" >> >> sean >> >>> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >>> wrote: On 01/20/15 14:30, Hans Petter >>> Selasky wrote: >>>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>>>> Belousov wrote: K> > Like stated in the manual page, >>>>>>> callout_reset_curcpu/on() does not work K> > with MPSAFE >>>>>>> callouts any more! K> I.e. you 'fixed' some undeterminate >>>>>>> bugs in callout migration by not K> doing migration at all >>>>>>> anymore. K> K> > K> > You need to use >>>>>>> callout_init_{mtx,rm,rw} and remove the custom locking K> > >>>>>>> inside the callback in the TCP stack to get it working like >>>>>>> before! K> K> No, you need to do this, if you think that >>>>>>> whole callout KPI must be K> rototiled. It is up to the >>>>>>> person who modifies the KPI, to ensure that K> existing >>>>>>> code is not broken. K> K> As I understand, currently we are >>>>>>> back to the one-cpu callouts. K> Do other people consider >>>>>>> this situation acceptable ? >>>>>>> >>>>>>> I think this isn't acceptable. The commit to a complex >>>>>>> subsystem lacked a review from persons involved in the >>>>>>> system before. The commit to subsystem broke consumers of >>>>>>> the subsystem and this was even done not accidentially, but >>>>>>> due to Hans not caring about it. >>>>>>> >>>>>>> As for me this is enough to request a backout, and let the >>>>>>> change back in only after proper review. >>>>>>> >>>>>> >>>>>> Hi Gleb, >>>>>> >>>>>> Backing out my callout API patch means we will for sure >>>>>> re-introduce an unknown callout spinlock hang, as noted to me >>>>>> by several people. What do you think about that? dram Maybe >>>>>> "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: >>>>>> >>> >>> Jason picked up this patch for work and it resolved our >>> instability issues that had remained unsolved for quite some time >>> as reported to freebsd-net: >>> >>> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >>> >>> This had gone undiagnosed for some time (even with the gracious >>> help of jhb in offline emails, thanks btw!). >>> >>> There's some diagnostics in that email thread that may be of value >>> to you folks for determination of the validity of changing the >>> callout API or at least understanding why we were involved in >>> diagnostics. >>> >>> While I'd sure love to tune performance, the fact that our >>> machines were basically going out to lunch without these changes, >>> probably means that others were seeing it and didn't know what else >>> to do. As much as I enjoy a good "break out the pitch forks and >>> torches" email thread, this increased stability for us and is >>> allowing us to upgrade from freebsd8 to freebsd10. Bear this in >>> mind when you throw your voice in favor of reverting. >>> >>>>>> int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, >>>>>> sbintime_t precision, void (*ftn)(void *), void *arg, int >>>>>> cpu, int flags) { sbintime_t to_sbt, pr; struct callout_cpu >>>>>> *cc; int cancelled, direct; >>>>>> >>>>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>>>> >>>>>> cancelled = 0; >>>>>> >>> >>> Jason or I would have to run this in production, which would be >>> problematic I fear. We never had a deterministic test case that >>> would exhibit the reported failure. We merely "tested in >>> production" and saw that panics ceased. We didn't note a dropoff >>> in our traffic either, perhaps we are not as efficient as others in >>> this corner case, but we were consistently seeing the spinlock >>> hangs after a day or so of traffic. >>> >>>>>> And see if he observes a callout spinlock hang or not on his >>>>>> test setup. The patch above should force all callouts to the >>>>>> same thread basically. Then we could maybe see if single >>>>>> threading the callouts has anything to do with solving the >>>>>> spinlock hang. >>>>>> >>>>>> The "rewritten" callout API still has all the features and >>>>>> capabilities the old one had, when used as described in "man >>>>>> 9 callout". >>>>>> >>>>>> At the present moment I'm not technically convinced a backout >>>>>> is correct. >>> >>> Neither am I, to be honest. Just based on *results*. >>> >>>>>> >>>>>> Gleb: I think we would see far better results with high >>>>>> speed internet links using TCP if we could extend the LRO >>>>>> (large receive offload) code to accumulate more than 64KBytes >>>>>> worth of data per call to the TCP stack instead of >>>>>> complaining about some callouts ending up on the same thread! >>>>>> Actually I have a patch for that. >>>>>> >>>>>> --HPS >>>>>> >>>>>> >>>>>> >>> >>>> _______________________________________________ >>>> svn-src-head@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head To >>>> unsubscribe, send any mail to >>>> "svn-src-head-unsubscribe@freebsd.org" >>> >>> >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v2 >> >> iQF8BAEBCgBmBQJUvujmXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w >> ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx >> MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kv2MH/1F15x/lgwWq5fE/cZ3n9HlV >> 9Nd7DU03coj9qUU6LH1eLPPuUn7yelCw8xxtb0qOTIDyrzNYe+HIaJi1GMHkV8Ve >> iKFuB1G9gcN/nQ5BdaAezOazEUcRY2msigMh5n/2X/UDRzLAGfhbDFbogpRy1TyI >> fqKzYDM8Mx9yZfCuc4/yBUVmxDcVn6NsuQ7CW745qXQcrELdJ8fjKfaYWbprCR7u >> xA3Iwiio9Bv0/8MvR9n3PZ8z3NjAKD1XxV5iAPI+ANc/5Rc60cSmtP0mQakqOoz6 >> 8uucaus79KdykdNovh31ka0dp0JBCghZOsfNXP69TFfvSXyngMZqwZgqVLVcX3M= >> =0AV4 >> -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:53:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A295C0; Tue, 20 Jan 2015 23:53:37 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C47771; Tue, 20 Jan 2015 23:53:36 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id A175F192A3B; Tue, 20 Jan 2015 23:53:35 +0000 (UTC) Message-ID: <54BEEA7F.1070301@ignoranthack.me> Date: Tue, 20 Jan 2015 15:53:35 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:53:37 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/20/15 15:48, K. Macy wrote: > Are any other drivers hitting this? e.g. cxgb/cxgbe? > > -K > Unkown to me. Nor am I aware of anyone else who ever hit our panics either. Our environment, and the failure, was only seen in the Intel 10GE space (ixgbe). This is an artifact of our use cases, and hasn't been expanded nor tested in our environment with other vendor interfaces. sean > On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno > wrote: On 01/20/15 15:40, K. Macy wrote: >>>> I think you're working around driver locking bugs by >>>> crippling the callout code. >>>> >>>> -K >>>> > > We had zero evidence of this. What leads you down that path? I'm > totally open to being wrong, e.g. "yeah, you slowed down things so > that you don't hit a race condition" > > sean > >>>> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >>>> wrote: On 01/20/15 14:30, Hans >>>> Petter Selasky wrote: >>>>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>>>>> Belousov wrote: K> > Like stated in the manual page, >>>>>>>> callout_reset_curcpu/on() does not work K> > with >>>>>>>> MPSAFE callouts any more! K> I.e. you 'fixed' some >>>>>>>> undeterminate bugs in callout migration by not K> >>>>>>>> doing migration at all anymore. K> K> > K> > You need >>>>>>>> to use callout_init_{mtx,rm,rw} and remove the custom >>>>>>>> locking K> > inside the callback in the TCP stack to >>>>>>>> get it working like before! K> K> No, you need to do >>>>>>>> this, if you think that whole callout KPI must be K> >>>>>>>> rototiled. It is up to the person who modifies the >>>>>>>> KPI, to ensure that K> existing code is not broken. >>>>>>>> K> K> As I understand, currently we are back to the >>>>>>>> one-cpu callouts. K> Do other people consider this >>>>>>>> situation acceptable ? >>>>>>>> >>>>>>>> I think this isn't acceptable. The commit to a >>>>>>>> complex subsystem lacked a review from persons >>>>>>>> involved in the system before. The commit to >>>>>>>> subsystem broke consumers of the subsystem and this >>>>>>>> was even done not accidentially, but due to Hans not >>>>>>>> caring about it. >>>>>>>> >>>>>>>> As for me this is enough to request a backout, and >>>>>>>> let the change back in only after proper review. >>>>>>>> >>>>>>> >>>>>>> Hi Gleb, >>>>>>> >>>>>>> Backing out my callout API patch means we will for >>>>>>> sure re-introduce an unknown callout spinlock hang, as >>>>>>> noted to me by several people. What do you think about >>>>>>> that? dram Maybe "Jason Wolfe" CC'ed can add to >>>>>>> 10-stable w/o my patches: >>>>>>> >>>> >>>> Jason picked up this patch for work and it resolved our >>>> instability issues that had remained unsolved for quite some >>>> time as reported to freebsd-net: >>>> >>>> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >>>> >>>> >>>> This had gone undiagnosed for some time (even with the gracious >>>> help of jhb in offline emails, thanks btw!). >>>> >>>> There's some diagnostics in that email thread that may be of >>>> value to you folks for determination of the validity of >>>> changing the callout API or at least understanding why we >>>> were involved in diagnostics. >>>> >>>> While I'd sure love to tune performance, the fact that our >>>> machines were basically going out to lunch without these >>>> changes, probably means that others were seeing it and didn't >>>> know what else to do. As much as I enjoy a good "break out >>>> the pitch forks and torches" email thread, this increased >>>> stability for us and is allowing us to upgrade from freebsd8 >>>> to freebsd10. Bear this in mind when you throw your voice in >>>> favor of reverting. >>>> >>>>>>> int callout_reset_sbt_on(struct callout *c, sbintime_t >>>>>>> sbt, sbintime_t precision, void (*ftn)(void *), void >>>>>>> *arg, int cpu, int flags) { sbintime_t to_sbt, pr; >>>>>>> struct callout_cpu *cc; int cancelled, direct; >>>>>>> >>>>>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>>>>> >>>>>>> cancelled = 0; >>>>>>> >>>> >>>> Jason or I would have to run this in production, which would >>>> be problematic I fear. We never had a deterministic test >>>> case that would exhibit the reported failure. We merely >>>> "tested in production" and saw that panics ceased. We didn't >>>> note a dropoff in our traffic either, perhaps we are not as >>>> efficient as others in this corner case, but we were >>>> consistently seeing the spinlock hangs after a day or so of >>>> traffic. >>>> >>>>>>> And see if he observes a callout spinlock hang or not >>>>>>> on his test setup. The patch above should force all >>>>>>> callouts to the same thread basically. Then we could >>>>>>> maybe see if single threading the callouts has anything >>>>>>> to do with solving the spinlock hang. >>>>>>> >>>>>>> The "rewritten" callout API still has all the features >>>>>>> and capabilities the old one had, when used as >>>>>>> described in "man 9 callout". >>>>>>> >>>>>>> At the present moment I'm not technically convinced a >>>>>>> backout is correct. >>>> >>>> Neither am I, to be honest. Just based on *results*. >>>> >>>>>>> >>>>>>> Gleb: I think we would see far better results with >>>>>>> high speed internet links using TCP if we could extend >>>>>>> the LRO (large receive offload) code to accumulate more >>>>>>> than 64KBytes worth of data per call to the TCP stack >>>>>>> instead of complaining about some callouts ending up on >>>>>>> the same thread! Actually I have a patch for that. >>>>>>> >>>>>>> --HPS >>>>>>> >>>>>>> >>>>>>> >>>> >>>>> _______________________________________________ >>>>> svn-src-head@freebsd.org mailing list >>>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head To >>>>> unsubscribe, send any mail to >>>>> "svn-src-head-unsubscribe@freebsd.org" >>>> >>>> > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUvup4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kNdgH/iFU6kSAcuPJDwiNONLULu9c Nu9kJzQUgCpROor2CnrsjN0WILWTAfmWaQK1b7ClUIwKPmgzvX09DZdsdfQnIMFR aimC3uKW0rJeMDlQNbN/J2mI5+QOyREUozxb53jetDj9t+OmC08idne0AuYuMgwY NZoKt2llhJScjjEu2EJV9W3FoDCmg/ITA83IbzmmoZHHtXACdDVh0vwmNb1UPluA 0hcJv4rQrY5Khq08a4tonQxTB96Sgk/c+0zPpvqSctKEEmf6TiREbwr68SOM4dkY zLxpD/9IeExFTShJSGW+slKAuzCobr+iG8a9tDLV+STtoAX9i5jyLQLnwDcX7AY= =F1sR -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:56:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD3A9717; Tue, 20 Jan 2015 23:56:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5FF88C; Tue, 20 Jan 2015 23:56:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0KNu8Aj016565; Tue, 20 Jan 2015 23:56:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0KNu5ts016548; Tue, 20 Jan 2015 23:56:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501202356.t0KNu5ts016548@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 20 Jan 2015 23:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277458 - in head: release release/amd64 release/i386 release/scripts release/tools share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:56:09 -0000 Author: gjb Date: Tue Jan 20 23:56:04 2015 New Revision: 277458 URL: https://svnweb.freebsd.org/changeset/base/277458 Log: Merge the following revisions from ^/projects/release-vmimage: r273823-r273826, r273833, r273836, r273944, r274069-r274071, r274134, r274211, r274280-r274285, r274287-r274288, r274292, r274296-r274297, r274356, r274533, r274725, r274726, r274729, r274734, r274771, r274945-r274946, r277180, r277183-r277184, r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384, r277393-r277395, r277438-r277439, r277447, r277455: r273823: Move virtual machine / cloud provider targets and options from release/Makefile to their own Makefile. r273824: Add glue to allow enabling building cloud provider VM images by default. When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the release/Makefile 'release' target. r273825: Avoid hard-coding the Azure image file format. While here, avoid using OSRELEASE for the output file name. r273826: Remove a few vestiges of passing an exit code to panic(). r273833: Initial commit providing a mechanism to create openstack images as part of the release build. r273836: Fix output file name for openstack images. No further conversion is necessary for this VM file target, so there is no need to append the '.raw' suffix here. r273944: Uncomment the cloudinit rc.conf(5) line. r274069: Add line continuation so OPENSTACKCONF is actually included in the env(1). r274070: Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS. r274071: Add examples for WITH_CLOUDWARE to release.conf.sample. Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS. r274134: Initial rewrite to consolidate VM image build scripts into one. r274211: Add write_partition_layout() used to populate the final image. Fix duplicated mkimg(1) call in vm_create_disk(). Add primitive (untested) PowerPC/PowerPC64 VM image support. Note: As it is currently written, the /boot/pmbr and /boot/{gptboot,boot1.hfs} use the build host and not the target build. Fixing this is likely going to be a hack in itself. r274280: Return if vm_create_disk() is unsuccessful. r274281: Add CLEANFILES entry for VM targets r274282: Add vm_extra_pre_umount() prototype to vmimage.subr. r274283: Fix DESTDIR for installworld, and make sure it is created before use. r274284: Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr has not been sourced. r274285: Spell 'OPTARG' correctly. Actually call vm_create_base(). r274287: Fix line continuation in write_partition_layout(). Remove variable test that is no longer needed. r274288: Fix scheme flag to mkimg(1). r274292: mount(8) and umount(8) devfs(5) as needed. r274296: Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that it is consolidated into one file. Fix paths for the base image and output disk image files. r274297: Call cleanup() after everything is done. r274356: Remove a stray directory from CLEANFILES. r274533: Set the boot partition type to 'apple-boot' for powerpc. r274725: In vm_install_base(), copy the host resolv.conf into the build chroot before attempting to do anything that requires working DNS (i.e., pkg bootstrap). In vm_extra_pre_umount(), remove the resolv.conf before the disk image is unmounted from the backing md(4). r274726 (cperciva): Silence errors when umounting the chroot's /dev, since it probably doesn't exist when we're running this. Unmount filesystems before attempting to destroy the md which holds them. r274729 (cperciva): Unmount filesystem and destroy md before we read the vnode from disk and package it into a disk image. Otherwise we end up packaging an unclean filesystem. r274734 (cperciva): Merge duplicative vm-CLOUDTYPE targets before additional duplication gets added by the impending arrival of ec2 and gcloud. r274771 (cperciva): Add NOSWAP option which can be set by a vmimage.conf file to specify that no swap space should be created in the image. This will be used by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral" disks which are physically attached to the Xen host node. r274945: In vm_extra_install_packages(), only bootstrap pkg(8) if VM_EXTRA_PACKAGES is empty. In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was bootstrapped earlier. r274946: Fix indentation nit. r277180: In vm_extra_install_base(), do not install waagent in the openstack image, because it is not used. This appears to be a copy mistake. Remove vm_extra_install_base() from the openstack.conf entirely, since it does not need to be overridden. r277183: Enable the textmode console by default for VM images, since there is no way to tell if the environment will be able to use the graphics-mode console. r277184: Enable password-less sudo for openstack images. r277186: Update the VM_EXTRA_PACKAGES list for the openstack images. The documentation suggests doing a "just fetch this and run it"-style bootstrap, from which the list of dependencies was obtained (in github, at: pellaeon/bsd-cloudinit-installer) There is one Python dependency unmet, oslo.config, which is not in the Ports Collection. r277187: Add a comment to note that setting hw.vga.textmode=1 is temporary. r277250: Remove vm_extra_install_base() for the Azure image, now that the waagent exists in the ports tree. Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list. In vm_extra_pre_umount(), remove the explicit pkg(8) install list, as dependencies are resolved by sysutils/azure-agent. r277251: Add a 'list-cloudware' target to print the list of supported CLOUDWARE values and a description. Add the AZURE_DESC and OPENSTACK_DESC descriptions. r277252: Update release(7) r277253: Add 'list-vmtargets' target, which produces a list of all supported VM and cloud provider images. Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions. Format the output to make a bit more readable. Update release(7) to document the list-vmtargets target. r277263: Add initial support for the GCE (Google Compute Engine) cloud hosting provider image. r277264: Style and line length cleanup. r277383: Remove the console setting from rc.conf(5), which is not used there. While here, set console to include vidconsole in the loader.conf(5). r277384: Fix an indentation nit. No functional changes. r277393: Remove the pkg-clean(8) call from vm_extra_pre_umount() since the function is often overridden. Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated code. r277394: Move resolv.conf(5) removal back to vm_extra_pre_umount() where it belongs. The GCE image needs resolv.conf(5) to exist (created as part of the image setup), so it cannot be removed. r277395: Comment the line that configures ttys(5) to 'off', which makes it impossible to test that the image boots. Add a note explaining why the line is commented, and not (yet) removed entirely. r277438: Move the 'install' bits that are specific to virtual machine images from the Makefile to Makefile.vm. Rename the 'install' target to 'release-install', and add a new 'vm-install' target. Add a new 'install' target that invokes the new targets. r277439: Add WITH_CLOUDWARE to the list of make(1) variables for the release build. r277447: Remove hw.vga.textmode=1 from the VM image loader.conf, which was included during test builds and not intended to be included when merging this project branch back to head. r277455: Remove mk-azure.sh, which is no longer needed. MFC after: 1 month X-MFC-To: stable/10 (requires mkimg(1)) Help from: cperciva, swills Relnotes: yes Sponsored by: The FreeBSD Foundation Added: head/release/Makefile.vm - copied, changed from r273823, projects/release-vmimage/release/Makefile.vm head/release/scripts/mk-vmimage.sh - copied, changed from r274134, projects/release-vmimage/release/scripts/mk-vmimage.sh head/release/tools/gce.conf - copied, changed from r277263, projects/release-vmimage/release/tools/gce.conf head/release/tools/openstack.conf - copied, changed from r273833, projects/release-vmimage/release/tools/openstack.conf head/release/tools/vmimage.subr (contents, props changed) - copied, changed from r274134, projects/release-vmimage/release/tools/vmimage.subr Deleted: head/release/amd64/mk-azure.sh head/release/amd64/mk-vmimage.sh head/release/i386/mk-azure.sh head/release/i386/mk-vmimage.sh Modified: head/release/Makefile head/release/release.conf.sample head/release/release.sh head/release/tools/azure.conf head/share/man/man7/release.7 Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jan 20 23:39:08 2015 (r277457) +++ head/release/Makefile Tue Jan 20 23:56:04 2015 (r277458) @@ -9,7 +9,9 @@ # mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area -# install: Copies all release media into ${DESTDIR} +# install: Invokes the release-install and vm-install targets +# release-install: Copies all release installation media into ${DESTDIR} +# vm-install: Copies all virtual machine images into ${DESTDIR} # # Variables affecting the build process: # WORLDDIR: location of src tree -- must have built world and default kernel @@ -26,6 +28,7 @@ # WITH_VMIMAGES: if set, build virtual machine images with the release # WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images # with xz(1) (extremely time consuming) +# WITH_CLOUDWARE: if set, build cloud hosting disk images with the release # TARGET/TARGET_ARCH: architecture of built release # @@ -103,12 +106,6 @@ IMAGES+= memstick.img IMAGES+= mini-memstick.img .endif -VMTARGETS= vm-base vm-image -VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 20G -VMBASE?= vm -AZURECONF?= ${.CURDIR}/tools/azure.conf - CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} @@ -118,22 +115,7 @@ CLEANFILES+= ${I}.xz .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -CLEANFILES+= ${VMBASE}.img -. for FORMAT in ${VMFORMATS} -CLEANFILES+= ${VMBASE}.${FORMAT} -. endfor -.endif CLEANDIRS= dist ftp release bootonly dvd -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -CLEANDIRS+= ${VMTARGETS} -.endif -.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) -CLEANFILES+= ${OSRELEASE}.vhd \ - ${OSRELEASE}.vhd.raw \ - azure.img -CLEANDIRS+= vm-azure -.endif beforeclean: chflags -R noschg . .include @@ -299,8 +281,13 @@ release: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} .endif +.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} +.endif + +install: release-install vm-install -install: +release-install: .if defined(DESTDIR) && !empty(DESTDIR) mkdir -p ${DESTDIR} .endif @@ -313,52 +300,5 @@ install: .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) - mkdir -p ${DESTDIR}/vmimages -. for FORMAT in ${VMFORMATS} - cp -p ${VMBASE}.${FORMAT} \ - ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} -. endfor -. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) -# This is very time consuming, so defer it after the images are moved to -# the DESTDIR. -. for FORMAT in ${VMFORMATS} - # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. - ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} -. endfor -. endif - cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ - ${DESTDIR}/vmimages/CHECKSUM.SHA256 - cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ - ${DESTDIR}/vmimages/CHECKSUM.MD5 -.endif -vm-base: -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) - env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ - ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE} -. endif -.endif - touch ${.TARGET} - -vm-image: vm-base -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) -. for FORMAT in ${VMFORMATS} - env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ - ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT} -. endfor -. endif -.endif - touch ${.TARGET} - -vm-azure: -.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) - env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \ - ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \ - ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd -.endif - touch ${.TARGET} +.include "${.CURDIR}/Makefile.vm" Copied and modified: head/release/Makefile.vm (from r273823, projects/release-vmimage/release/Makefile.vm) ============================================================================== --- projects/release-vmimage/release/Makefile.vm Wed Oct 29 14:57:30 2014 (r273823, copy source) +++ head/release/Makefile.vm Tue Jan 20 23:56:04 2015 (r277458) @@ -5,11 +5,48 @@ # Makefile for building virtual machine and cloud provider disk images. # -VMTARGETS= vm-base vm-image +VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw VMSIZE?= 20G VMBASE?= vm -AZURECONF?= ${.CURDIR}/tools/azure.conf + +VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image +VMDK_DESC= VMWare, VirtualBox disk image +QCOW2_DESC= Qemu, KVM disk image +RAW_DESC= Unformatted raw disk image + +CLOUDWARE?= AZURE \ + GCE \ + OPENSTACK +AZURE_FORMAT= vhdf +AZURE_DESC= Microsoft Azure platform image +GCE_FORMAT= raw +GCE_DESC= Google Compute Engine image +OPENSTACK_FORMAT=qcow2 +OPENSTACK_DESC= OpenStack platform image + +.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) +. for _CW in ${CLOUDWARE} +CLOUDTARGETS+= vm-${_CW:tl} +CLEANDIRS+= vm-${_CW:tl} +CLEANFILES+= ${_CW:tl}.img \ + ${_CW:tl}.${${_CW:tu}_FORMAT} \ + ${_CW:tl}.${${_CW:tu}_FORMAT}.raw +${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT} +. if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF) +${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf +. endif + +vm-${_CW:tl}: + mkdir -p ${.OBJDIR}/${.TARGET} + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/scripts/mk-vmimage.sh \ + -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ + -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \ + -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF} + touch ${.TARGET} +. endfor +.endif .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) CLEANDIRS+= ${VMTARGETS} @@ -19,39 +56,56 @@ CLEANFILES+= ${VMBASE}.${FORMAT} . endfor .endif -.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) -CLEANFILES+= ${OSRELEASE}.vhd \ - ${OSRELEASE}.vhd.raw \ - azure.img -CLEANDIRS+= vm-azure -.endif +vm-base: vm-image -vm-base: +vm-image: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) +. for FORMAT in ${VMFORMATS} + mkdir -p ${.OBJDIR}/${.TARGET} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ - ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE} -. endif + ${.CURDIR}/scripts/mk-vmimage.sh \ + -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ + -i ${.OBJDIR}/${VMBASE}.img -s ${VMSIZE} -f ${FORMAT} \ + -S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FORMAT} +. endfor .endif touch ${.TARGET} -vm-image: vm-base +vm-cloudware: ${CLOUDTARGETS} + +list-vmtargets: list-cloudware + @${ECHO} + @${ECHO} "Supported virtual machine disk image formats:" +.for FORMAT in ${VMFORMATS:tu} + @${ECHO} " ${FORMAT:tl}: ${${FORMAT}_DESC}" +.endfor + +list-cloudware: +.if !empty(CLOUDWARE) + @${ECHO} + @${ECHO} "Supported cloud hosting provider images:" +. for _CW in ${CLOUDWARE} + @${ECHO} " ${_CW:tu}: ${${_CW:tu}_DESC}" +. endfor +.endif + +vm-install: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) -. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) + mkdir -p ${DESTDIR}/vmimages +. for FORMAT in ${VMFORMATS} + cp -p ${VMBASE}.${FORMAT} \ + ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} +. endfor +. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) +# This is very time consuming, so defer it after the images are moved to +# the DESTDIR. . for FORMAT in ${VMFORMATS} - env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ - ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT} + # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. + ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} . endfor . endif + cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.SHA256 + cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.MD5 .endif - touch ${.TARGET} - -vm-azure: -.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) - env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \ - ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \ - ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd -.endif - touch ${.TARGET} Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Tue Jan 20 23:39:08 2015 (r277457) +++ head/release/release.conf.sample Tue Jan 20 23:56:04 2015 (r277458) @@ -98,3 +98,11 @@ PORTBRANCH="ports/head@rHEAD" ## image formats to create. Valid values are listed in the mkimg(1) ## manual page, as well as 'mkimg --formats' output. #VMFORMATS="vhdf vmdk qcow2 raw" + +## Set to a non-empty value to build virtual machine images for various +## cloud providers as part of the release build. +#WITH_CLOUDWARE= + +## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers +## to create disk images. +#CLOUDWARE="AZURE OPENSTACK" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue Jan 20 23:39:08 2015 (r277457) +++ head/release/release.sh Tue Jan 20 23:56:04 2015 (r277458) @@ -94,6 +94,10 @@ WITH_COMPRESSED_IMAGES= WITH_VMIMAGES= WITH_COMPRESSED_VMIMAGES= +# Set to non-empty value to build virtual machine images for various +# cloud providers as part of the release. +WITH_CLOUDWARE= + usage() { echo "Usage: $0 [-c release.conf]" exit 1 @@ -174,7 +178,8 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES}" + ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ + WITH_CLOUDWARE=${WITH_CLOUDWARE}" # Force src checkout if configured FORCE_SRC_KEY= Copied and modified: head/release/scripts/mk-vmimage.sh (from r274134, projects/release-vmimage/release/scripts/mk-vmimage.sh) ============================================================================== --- projects/release-vmimage/release/scripts/mk-vmimage.sh Wed Nov 5 13:22:19 2014 (r274134, copy source) +++ head/release/scripts/mk-vmimage.sh Tue Jan 20 23:56:04 2015 (r277458) @@ -32,6 +32,12 @@ # $FreeBSD$ # +usage() { + echo "${0} usage:" + echo "${@}" + return 1 +} + main() { local arg while getopts "C:c:d:f:i:o:s:S:" arg; do @@ -49,7 +55,7 @@ main() { VMFORMAT="${OPTARG}" ;; i) - VMBASE="${VMBASE}" + VMBASE="${OPTARG}" ;; o) VMIMAGE="${OPTARG}" @@ -87,13 +93,16 @@ main() { . "${VMCONFIG}" fi + vm_create_base vm_install_base vm_extra_install_base vm_extra_install_packages vm_extra_install_ports vm_extra_enable_services vm_extra_pre_umount - vm_create_disk + vm_extra_pkg_rmcache + cleanup + vm_create_disk || return 0 vm_extra_create_disk return 0 Modified: head/release/tools/azure.conf ============================================================================== --- head/release/tools/azure.conf Tue Jan 20 23:39:08 2015 (r277457) +++ head/release/tools/azure.conf Tue Jan 20 23:56:04 2015 (r277458) @@ -6,9 +6,37 @@ # Set to a list of packages to install. # Example: #export VM_EXTRA_PACKAGES="www/apache24" -export VM_EXTRA_PACKAGES= +export VM_EXTRA_PACKAGES="sysutils/azure-agent" # Set to a list of third-party software to enable in rc.conf(5). # Example: #export VM_RC_LIST="apache24" export VM_RC_LIST= + +vm_extra_pre_umount() { + chroot ${DESTDIR} /usr/sbin/waagent -verbose -install + yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision + echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf + echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf + echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf + + rm -f ${DESTDIR}/etc/resolv.conf + + return 0 +} + +vm_extra_create_disk() { + if [ ! -x "/usr/local/bin/qemu-img" ]; then + env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-devel + fi + + mv ${VMIMAGE} ${VMIMAGE}.raw + size=$(qemu-img info -f raw --output json ${VMIMAGE}.raw | awk '/virtual-size/ {print $2}' | tr -d ',') + size=$(( ( ${size} / ( 1024 * 1024 ) + 1 ) * ( 1024 * 1024 ) )) + qemu-img resize ${VMIMAGE}.raw ${size} + qemu-img convert -f raw -o subformat=fixed -O vpc ${VMIMAGE}.raw ${VMIMAGE} + + return 0 +} Copied and modified: head/release/tools/gce.conf (from r277263, projects/release-vmimage/release/tools/gce.conf) ============================================================================== --- projects/release-vmimage/release/tools/gce.conf Fri Jan 16 19:27:19 2015 (r277263, copy source) +++ head/release/tools/gce.conf Tue Jan 20 23:56:04 2015 (r277458) @@ -4,7 +4,9 @@ # # Set to a list of packages to install. -export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs google-cloud-sdk google-daemon panicmail sudo firstboot-growfs google-startup-scripts" +export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ + google-cloud-sdk google-daemon panicmail sudo firstboot-growfs \ + google-startup-scripts" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="google_accounts_manager ntpd" @@ -16,8 +18,7 @@ vm_extra_install_base() { } vm_extra_pre_umount() { - cat << EOF >> ${DESTDIR}/etc/rc.conf -console="comconsole" + cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" ifconfig_vtnet0="SYNCDHCP mtu 1460" ntpd_sync_on_start="YES" @@ -34,12 +35,12 @@ firstboot_growfs_enable="YES" google_startup_enable="YES" EOF - cat << EOF >> ${DESTDIR}/boot/loader.conf + cat << EOF >> ${DESTDIR}/boot/loader.conf autoboot_delay="-1" beastie_disable="YES" loader_logo="none" hw.memtest.tests="0" -console="comconsole" +console="comconsole,vidconsole" hw.vtnet.mq_disable=1 kern.timecounter.hardware=ACPI-safe aesni_load="YES" @@ -50,7 +51,7 @@ EOF ${DESTDIR}/etc/hosts # overwrite ntp.conf - cat << EOF > ${DESTDIR}/etc/ntp.conf + cat << EOF > ${DESTDIR}/etc/ntp.conf server metadata.google.internal iburst restrict default kod nomodify notrap nopeer noquery @@ -61,11 +62,11 @@ restrict -6 ::1 restrict 127.127.1.0 EOF - cat << EOF >> ${DESTDIR}/etc/syslog.conf + cat << EOF >> ${DESTDIR}/etc/syslog.conf *.err;kern.warning;auth.notice;mail.crit /dev/console EOF - cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config + cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config ChallengeResponseAuthentication no X11Forwarding no AcceptEnv LANG @@ -74,11 +75,11 @@ AllowAgentForwarding no ClientAliveInterval 420 EOF - cat << EOF >> ${DESTDIR}/etc/crontab + cat << EOF >> ${DESTDIR}/etc/crontab 0 3 * * * root /usr/sbin/freebsd-update cron EOF - cat << EOF >> ${DESTDIR}/etc/sysctl.conf + cat << EOF >> ${DESTDIR}/etc/sysctl.conf net.inet.icmp.drop_redirect=1 net.inet.ip.redirect=0 net.inet.tcp.blackhole=2 @@ -88,9 +89,12 @@ debug.trace_on_panic=1 debug.debugger_on_panic=0 EOF - sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys + ## XXX: Verify this is needed. I do not see this requirement + ## in the docs, and it impairs the ability to boot-test a copy + ## of the image prior to packaging for upload to GCE. + #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys - touch ${DESTDIR}/firstboot + touch ${DESTDIR}/firstboot return 0 } Copied and modified: head/release/tools/openstack.conf (from r273833, projects/release-vmimage/release/tools/openstack.conf) ============================================================================== --- projects/release-vmimage/release/tools/openstack.conf Wed Oct 29 17:04:09 2014 (r273833, copy source) +++ head/release/tools/openstack.conf Tue Jan 20 23:56:04 2015 (r277458) @@ -4,7 +4,22 @@ # # Set to a list of packages to install. -export VM_EXTRA_PACKAGES="net/cloud-init" +export VM_EXTRA_PACKAGES="net/cloud-init devel/py-pbr devel/py-iso8601 \ + net/py-eventlet net/py-netaddr comms/py-serial devel/py-six \ + devel/py-babel net/py-oauth net/py-netifaces" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="#cloudinit" +export VM_RC_LIST="cloudinit" + +vm_extra_pre_umount() { + echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf + + # Openstack wants sudo(8) usable by default without a password. + echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> \ + ${DESTDIR}/usr/local/etc/sudoers.d/cloud-init + + rm -f ${DESTDIR}/etc/resolv.conf + + return 0 +} Copied and modified: head/release/tools/vmimage.subr (from r274134, projects/release-vmimage/release/tools/vmimage.subr) ============================================================================== --- projects/release-vmimage/release/tools/vmimage.subr Wed Nov 5 13:22:19 2014 (r274134, copy source) +++ head/release/tools/vmimage.subr Tue Jan 20 23:56:04 2015 (r277458) @@ -9,15 +9,33 @@ export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" trap "cleanup" INT QUIT TRAP ABRT TERM -mkimg_bootcode="/boot/pmbr" -mkimg_partitions="-p freebsd-boot/bootfs:=/boot/gptboot" -mkimg_partitions="${mkimg_partitions} -p freebsd-swap/swapfs::1G" -mkimg_partitions="${mkimg_partitions} freebsd-ufs/rootfs:=${VMBASE}" - -usage() { - echo "${0} usage:" - echo "${@}" - return 1 +write_partition_layout() { + if [ -z "${NOSWAP}" ]; then + SWAPOPT="-p freebsd-swap/swapfs::1G" + fi + + case "${TARGET}:${TARGET_ARCH}" in + amd64:amd64 | i386:i386) + mkimg -s gpt -b /boot/pmbr \ + -p freebsd-boot/bootfs:=/boot/gptboot \ + ${SWAPOPT} \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE} + ;; + powerpc:powerpc*) + mkimg -s apm \ + -p apple-boot/bootfs:=/boot/boot1.hfs \ + ${SWAPOPT} \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE} + ;; + *) + # ENOTSUPP + return 1 + ;; + esac + + return 0 } err() { @@ -27,11 +45,11 @@ err() { } cleanup() { + umount ${DESTDIR}/dev 2>/dev/null + umount ${DESTDIR} if [ ! -z "${mddev}" ]; then mdconfig -d -u ${mddev} fi - umount ${DESTDIR}/dev - umount ${DESTDIR} return 0 } @@ -61,11 +79,18 @@ vm_install_base() { > ${DESTDIR}/etc/fstab echo '/dev/gpt/rootfs / ufs rw 1 1' \ >> ${DESTDIR}/etc/fstab - echo '/dev/gpt/swapfs none swap sw 0 0' \ - >> ${DESTDIR}/etc/fstab + if [ -z "${NOSWAP}" ]; then + echo '/dev/gpt/swapfs none swap sw 0 0' \ + >> ${DESTDIR}/etc/fstab + fi + mkdir -p ${DESTDIR}/dev + mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} /usr/bin/newaliases chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart + umount ${DESTDIR}/dev + + cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf return 0 } @@ -89,12 +114,16 @@ vm_extra_enable_services() { } vm_extra_install_packages() { + if [ -z "${VM_EXTRA_PACKAGES}" ]; then + return 0 + fi + mkdir -p ${DESTDIR}/dev + mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg bootstrap -y - if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then - chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg install -y ${VM_EXTRA_PACKAGES} - fi + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg install -y ${VM_EXTRA_PACKAGES} + umount ${DESTDIR}/dev return 0 } @@ -106,6 +135,23 @@ vm_extra_install_ports() { return 0 } +vm_extra_pre_umount() { + # Prototype. When overridden, installs additional ports within the + # virtual machine environment. + + rm -f ${DESTDIR}/etc/resolv.conf + return 0 +} + +vm_extra_pkg_rmcache() { + if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/local/sbin/pkg clean -y -a + fi + + return 0 +} + vm_umount_base() { i=0 sync @@ -124,21 +170,10 @@ vm_umount_base() { } vm_create_disk() { - if [ -z "${mkimg_paritions}" ]; then - err "No partition types specified. Skipping." - return 1 - fi echo "Creating image... Please wait." echo - mkimg -f ${mkimg_format} -s ${mkimg_scheme} \ - ${mkimg_bootcode} \ - ${mkimg_partitions} \ - ${mkimg_outfile} - - mkimg -b /boot/pmbr -p freebsd-boot/bootfs:=/boot/gptboot \ - -p freebsd-swap/swapfs::1G \ - -p freebsd-ufs/rootfs:=${VMBASE} \ - -o ${VMIMAGE}.raw + + write_partition_layout || return 1 return 0 } Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Tue Jan 20 23:39:08 2015 (r277457) +++ head/share/man/man7/release.7 Tue Jan 20 23:56:04 2015 (r277458) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2014 +.Dd January 16, 2015 .Dt RELEASE 7 .Os .Sh NAME @@ -406,6 +406,57 @@ See for valid format values .Pq requires version 20140927 or later . .El +.Pp +For a list of supported +.Va VMFORMATS +values +.Pq including cloud hosting provider formats +along with a brief description, run: +.Bd -literal -offset indent +cd /usr/src +make -C release list-vmtargets +.Ed +.Sh CLOUD HOSTING MACHINE IMAGES +The +.Fx +release build tools support building virtual machine images for various +cloud hosting providers, each with their own specific configuration to +include support for each hosting provider by default. +.Pp +The following +.Xr make 1 +environment variables are supported: +.Pp +.Bl -tag -width Ev +.It Va CLOUDWARE +Set to a list of one or more cloud hosting providers, enclosed in quotes. +Requires +.Va WITH_CLOUDWARE +to also be set. +.It Va WITH_CLOUDWARE +Set to a non-empty value to enable building virtual machine images +for various cloud hosting providers. +Requires +.Va CLOUDWARE +to also be set. +.El +.Pp +Additionally, the +.Va CLOUDWARE +and +.Va WITH_CLOUDWARE +variables can be added to +.Pa release.conf , +and used in conjunction with +.Pa release.sh . +.Pp +For a list of supported +.Va CLOUDWARE +values, run: +.Bd -literal -offset indent +cd /usr/src +make -C release list-cloudware +.Ed .Sh MAKEFILE TARGETS The release makefile .Pq Pa src/release/Makefile @@ -470,6 +521,23 @@ target requires the .Va WITH_VMIMAGES .Xr make 1 envirionment variable to be set to a non-null value. +.It Cm vm-cloudware +Builds +.Fx +virtual machine images for various cloud hosting providers. +See +.Qq CLOUD HOSTING MACHINE IMAGES +for implementation details. +.It Cm list-cloudware +Displays the list of valid +.Va CLOUDWARE +values. +.It Cm list-vmtargets +Displays the list of valid +.Va VMFORMAT +and +.Va CLOUDWARE +values. .El .Pp Major subtargets called by targets above: @@ -576,8 +644,11 @@ Typically, one only needs to set .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .It Pa /usr/src/release/Makefile +.It Pa /usr/src/release/Makefile.vm .It Pa /usr/src/release/release.sh .It Pa /usr/src/release/release.conf.sample +.It Pa /usr/src/release/tools/*.conf +.It Pa /usr/src/release/tools/vmimage.subr .El .Sh EXAMPLES The following sequence of commands can be used to build a From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:59:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 149A69AE; Tue, 20 Jan 2015 23:59:50 +0000 (UTC) Received: from mail-yk0-x234.google.com (mail-yk0-x234.google.com [IPv6:2607:f8b0:4002:c07::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAD05B8; Tue, 20 Jan 2015 23:59:49 +0000 (UTC) Received: by mail-yk0-f180.google.com with SMTP id 131so1980839ykp.11; Tue, 20 Jan 2015 15:59:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=weq51djkEwlWd7n+TIZJDdxlBgrnzFnRG3IPWO+2l3w=; b=KgpjjxqDPlL2GtBFHZgGSKbxjE5W0MadW29ENCPUBgUM+YXukryoBUMQ+k6/xnzexu WFflS0uFwLFZzmi1llLOmR0NpJZjQGRwL+6TbGNrn923fLkeaI8CopOA/ECgAxtEeCo1 28M/8/YADZce3YD4qLAfkTpt+lPrfy0r3anqKDWCh6JlEtV3nh1ILelhSuQVsLHL1dgH eDB8PbiMNkLpJh7tnoxuPrRRLtfx91z1gMBbaElN37FSpFT4fqjSYnn5/lcpROXtaG6Y NnSQy5KT46DEqYwU5inZ7of940FnOwxLksvNm9ujvF7OyH9RGS+d2rMO6QtMM6383A16 PYTg== MIME-Version: 1.0 X-Received: by 10.170.121.76 with SMTP id n73mr13373585ykb.119.1421798389009; Tue, 20 Jan 2015 15:59:49 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 15:59:48 -0800 (PST) In-Reply-To: <54BEEA7F.1070301@ignoranthack.me> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> Date: Tue, 20 Jan 2015 15:59:48 -0800 X-Google-Sender-Auth: xxeBevLHZGEMac3qZR7zl_1ypbI Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 23:59:50 -0000 On Tue, Jan 20, 2015 at 3:53 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/20/15 15:48, K. Macy wrote: >> Are any other drivers hitting this? e.g. cxgb/cxgbe? >> >> -K >> > > Unkown to me. Nor am I aware of anyone else who ever hit our panics > either. Our environment, and the failure, was only seen in the Intel > 10GE space (ixgbe). This is an artifact of our use cases, and hasn't > been expanded nor tested in our environment with other vendor interfaces. For an ill characterized problem isolated to one environment this seems like a workaround that should not be part of the general code base. -K > sean > >> On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno >> wrote: On 01/20/15 15:40, K. Macy wrote: >>>>> I think you're working around driver locking bugs by >>>>> crippling the callout code. >>>>> >>>>> -K >>>>> >> >> We had zero evidence of this. What leads you down that path? I'm >> totally open to being wrong, e.g. "yeah, you slowed down things so >> that you don't hit a race condition" >> >> sean >> >>>>> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >>>>> wrote: On 01/20/15 14:30, Hans >>>>> Petter Selasky wrote: >>>>>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, Konstantin >>>>>>>>> Belousov wrote: K> > Like stated in the manual page, >>>>>>>>> callout_reset_curcpu/on() does not work K> > with >>>>>>>>> MPSAFE callouts any more! K> I.e. you 'fixed' some >>>>>>>>> undeterminate bugs in callout migration by not K> >>>>>>>>> doing migration at all anymore. K> K> > K> > You need >>>>>>>>> to use callout_init_{mtx,rm,rw} and remove the custom >>>>>>>>> locking K> > inside the callback in the TCP stack to >>>>>>>>> get it working like before! K> K> No, you need to do >>>>>>>>> this, if you think that whole callout KPI must be K> >>>>>>>>> rototiled. It is up to the person who modifies the >>>>>>>>> KPI, to ensure that K> existing code is not broken. >>>>>>>>> K> K> As I understand, currently we are back to the >>>>>>>>> one-cpu callouts. K> Do other people consider this >>>>>>>>> situation acceptable ? >>>>>>>>> >>>>>>>>> I think this isn't acceptable. The commit to a >>>>>>>>> complex subsystem lacked a review from persons >>>>>>>>> involved in the system before. The commit to >>>>>>>>> subsystem broke consumers of the subsystem and this >>>>>>>>> was even done not accidentially, but due to Hans not >>>>>>>>> caring about it. >>>>>>>>> >>>>>>>>> As for me this is enough to request a backout, and >>>>>>>>> let the change back in only after proper review. >>>>>>>>> >>>>>>>> >>>>>>>> Hi Gleb, >>>>>>>> >>>>>>>> Backing out my callout API patch means we will for >>>>>>>> sure re-introduce an unknown callout spinlock hang, as >>>>>>>> noted to me by several people. What do you think about >>>>>>>> that? dram Maybe "Jason Wolfe" CC'ed can add to >>>>>>>> 10-stable w/o my patches: >>>>>>>> >>>>> >>>>> Jason picked up this patch for work and it resolved our >>>>> instability issues that had remained unsolved for quite some >>>>> time as reported to freebsd-net: >>>>> >>>>> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >>>>> >>>>> >>>>> > This had gone undiagnosed for some time (even with the gracious >>>>> help of jhb in offline emails, thanks btw!). >>>>> >>>>> There's some diagnostics in that email thread that may be of >>>>> value to you folks for determination of the validity of >>>>> changing the callout API or at least understanding why we >>>>> were involved in diagnostics. >>>>> >>>>> While I'd sure love to tune performance, the fact that our >>>>> machines were basically going out to lunch without these >>>>> changes, probably means that others were seeing it and didn't >>>>> know what else to do. As much as I enjoy a good "break out >>>>> the pitch forks and torches" email thread, this increased >>>>> stability for us and is allowing us to upgrade from freebsd8 >>>>> to freebsd10. Bear this in mind when you throw your voice in >>>>> favor of reverting. >>>>> >>>>>>>> int callout_reset_sbt_on(struct callout *c, sbintime_t >>>>>>>> sbt, sbintime_t precision, void (*ftn)(void *), void >>>>>>>> *arg, int cpu, int flags) { sbintime_t to_sbt, pr; >>>>>>>> struct callout_cpu *cc; int cancelled, direct; >>>>>>>> >>>>>>>> + cpu = timeout_cpu; /* XXX test code XXX */ >>>>>>>> >>>>>>>> cancelled = 0; >>>>>>>> >>>>> >>>>> Jason or I would have to run this in production, which would >>>>> be problematic I fear. We never had a deterministic test >>>>> case that would exhibit the reported failure. We merely >>>>> "tested in production" and saw that panics ceased. We didn't >>>>> note a dropoff in our traffic either, perhaps we are not as >>>>> efficient as others in this corner case, but we were >>>>> consistently seeing the spinlock hangs after a day or so of >>>>> traffic. >>>>> >>>>>>>> And see if he observes a callout spinlock hang or not >>>>>>>> on his test setup. The patch above should force all >>>>>>>> callouts to the same thread basically. Then we could >>>>>>>> maybe see if single threading the callouts has anything >>>>>>>> to do with solving the spinlock hang. >>>>>>>> >>>>>>>> The "rewritten" callout API still has all the features >>>>>>>> and capabilities the old one had, when used as >>>>>>>> described in "man 9 callout". >>>>>>>> >>>>>>>> At the present moment I'm not technically convinced a >>>>>>>> backout is correct. >>>>> >>>>> Neither am I, to be honest. Just based on *results*. >>>>> >>>>>>>> >>>>>>>> Gleb: I think we would see far better results with >>>>>>>> high speed internet links using TCP if we could extend >>>>>>>> the LRO (large receive offload) code to accumulate more >>>>>>>> than 64KBytes worth of data per call to the TCP stack >>>>>>>> instead of complaining about some callouts ending up on >>>>>>>> the same thread! Actually I have a patch for that. >>>>>>>> >>>>>>>> --HPS >>>>>>>> >>>>>>>> >>>>>>>> >>>>> >>>>>> _______________________________________________ >>>>>> svn-src-head@freebsd.org mailing list >>>>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head To >>>>>> unsubscribe, send any mail to >>>>>> "svn-src-head-unsubscribe@freebsd.org" >>>>> >>>>> >> >> >> > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUvup4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kNdgH/iFU6kSAcuPJDwiNONLULu9c > Nu9kJzQUgCpROor2CnrsjN0WILWTAfmWaQK1b7ClUIwKPmgzvX09DZdsdfQnIMFR > aimC3uKW0rJeMDlQNbN/J2mI5+QOyREUozxb53jetDj9t+OmC08idne0AuYuMgwY > NZoKt2llhJScjjEu2EJV9W3FoDCmg/ITA83IbzmmoZHHtXACdDVh0vwmNb1UPluA > 0hcJv4rQrY5Khq08a4tonQxTB96Sgk/c+0zPpvqSctKEEmf6TiREbwr68SOM4dkY > zLxpD/9IeExFTShJSGW+slKAuzCobr+iG8a9tDLV+STtoAX9i5jyLQLnwDcX7AY= > =F1sR > -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 00:22:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D455E5A; Wed, 21 Jan 2015 00:22:48 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E308038E; Wed, 21 Jan 2015 00:22:47 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 0A779192A3B; Wed, 21 Jan 2015 00:22:45 +0000 (UTC) Message-ID: <54BEF154.3030606@ignoranthack.me> Date: Tue, 20 Jan 2015 16:22:44 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 00:22:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/20/15 15:59, K. Macy wrote: > On Tue, Jan 20, 2015 at 3:53 PM, Sean Bruno > wrote: On 01/20/15 15:48, K. Macy wrote: >>>> Are any other drivers hitting this? e.g. cxgb/cxgbe? >>>> >>>> -K >>>> > > Unkown to me. Nor am I aware of anyone else who ever hit our > panics either. Our environment, and the failure, was only seen in > the Intel 10GE space (ixgbe). This is an artifact of our use > cases, and hasn't been expanded nor tested in our environment with > other vendor interfaces. > >> For an ill characterized problem isolated to one environment >> this seems like a workaround that should not be part of the >> general code base. > >> -K > There was never any indication in our testing that the driver was involved in any way. In our universe, this commit (right or wrong) resolved our panics. I think that there is some room for improvement based on the commentary in this thread, but some people do indeed prefer stability over performance. I hope we can come to a middle ground somewhere here. sean > > sean > >>>> On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno >>>> wrote: On 01/20/15 15:40, K. Macy >>>> wrote: >>>>>>> I think you're working around driver locking bugs by >>>>>>> crippling the callout code. >>>>>>> >>>>>>> -K >>>>>>> >>>> >>>> We had zero evidence of this. What leads you down that path? >>>> I'm totally open to being wrong, e.g. "yeah, you slowed down >>>> things so that you don't hit a race condition" >>>> >>>> sean >>>> >>>>>>> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >>>>>>> wrote: On 01/20/15 14:30, >>>>>>> Hans Petter Selasky wrote: >>>>>>>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>>>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, >>>>>>>>>>> Konstantin Belousov wrote: K> > Like stated in >>>>>>>>>>> the manual page, callout_reset_curcpu/on() does >>>>>>>>>>> not work K> > with MPSAFE callouts any more! K> >>>>>>>>>>> I.e. you 'fixed' some undeterminate bugs in >>>>>>>>>>> callout migration by not K> doing migration at >>>>>>>>>>> all anymore. K> K> > K> > You need to use >>>>>>>>>>> callout_init_{mtx,rm,rw} and remove the custom >>>>>>>>>>> locking K> > inside the callback in the TCP >>>>>>>>>>> stack to get it working like before! K> K> No, >>>>>>>>>>> you need to do this, if you think that whole >>>>>>>>>>> callout KPI must be K> rototiled. It is up to >>>>>>>>>>> the person who modifies the KPI, to ensure that >>>>>>>>>>> K> existing code is not broken. K> K> As I >>>>>>>>>>> understand, currently we are back to the >>>>>>>>>>> one-cpu callouts. K> Do other people consider >>>>>>>>>>> this situation acceptable ? >>>>>>>>>>> >>>>>>>>>>> I think this isn't acceptable. The commit to a >>>>>>>>>>> complex subsystem lacked a review from persons >>>>>>>>>>> involved in the system before. The commit to >>>>>>>>>>> subsystem broke consumers of the subsystem and >>>>>>>>>>> this was even done not accidentially, but due >>>>>>>>>>> to Hans not caring about it. >>>>>>>>>>> >>>>>>>>>>> As for me this is enough to request a backout, >>>>>>>>>>> and let the change back in only after proper >>>>>>>>>>> review. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Hi Gleb, >>>>>>>>>> >>>>>>>>>> Backing out my callout API patch means we will >>>>>>>>>> for sure re-introduce an unknown callout spinlock >>>>>>>>>> hang, as noted to me by several people. What do >>>>>>>>>> you think about that? dram Maybe "Jason Wolfe" >>>>>>>>>> CC'ed can add to 10-stable w/o my patches: >>>>>>>>>> >>>>>>> >>>>>>> Jason picked up this patch for work and it resolved >>>>>>> our instability issues that had remained unsolved for >>>>>>> quite some time as reported to freebsd-net: >>>>>>> >>>>>>> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >>>>>>> >>>>>>> >>>>>>> > >>>>>>> This had gone undiagnosed for some time (even with the gracious >>>>>>> help of jhb in offline emails, thanks btw!). >>>>>>> >>>>>>> There's some diagnostics in that email thread that may >>>>>>> be of value to you folks for determination of the >>>>>>> validity of changing the callout API or at least >>>>>>> understanding why we were involved in diagnostics. >>>>>>> >>>>>>> While I'd sure love to tune performance, the fact that >>>>>>> our machines were basically going out to lunch without >>>>>>> these changes, probably means that others were seeing >>>>>>> it and didn't know what else to do. As much as I enjoy >>>>>>> a good "break out the pitch forks and torches" email >>>>>>> thread, this increased stability for us and is allowing >>>>>>> us to upgrade from freebsd8 to freebsd10. Bear this in >>>>>>> mind when you throw your voice in favor of reverting. >>>>>>> >>>>>>>>>> int callout_reset_sbt_on(struct callout *c, >>>>>>>>>> sbintime_t sbt, sbintime_t precision, void >>>>>>>>>> (*ftn)(void *), void *arg, int cpu, int flags) { >>>>>>>>>> sbintime_t to_sbt, pr; struct callout_cpu *cc; >>>>>>>>>> int cancelled, direct; >>>>>>>>>> >>>>>>>>>> + cpu = timeout_cpu; /* XXX test code XXX >>>>>>>>>> */ >>>>>>>>>> >>>>>>>>>> cancelled = 0; >>>>>>>>>> >>>>>>> >>>>>>> Jason or I would have to run this in production, which >>>>>>> would be problematic I fear. We never had a >>>>>>> deterministic test case that would exhibit the reported >>>>>>> failure. We merely "tested in production" and saw that >>>>>>> panics ceased. We didn't note a dropoff in our traffic >>>>>>> either, perhaps we are not as efficient as others in >>>>>>> this corner case, but we were consistently seeing the >>>>>>> spinlock hangs after a day or so of traffic. >>>>>>> >>>>>>>>>> And see if he observes a callout spinlock hang or >>>>>>>>>> not on his test setup. The patch above should >>>>>>>>>> force all callouts to the same thread basically. >>>>>>>>>> Then we could maybe see if single threading the >>>>>>>>>> callouts has anything to do with solving the >>>>>>>>>> spinlock hang. >>>>>>>>>> >>>>>>>>>> The "rewritten" callout API still has all the >>>>>>>>>> features and capabilities the old one had, when >>>>>>>>>> used as described in "man 9 callout". >>>>>>>>>> >>>>>>>>>> At the present moment I'm not technically >>>>>>>>>> convinced a backout is correct. >>>>>>> >>>>>>> Neither am I, to be honest. Just based on *results*. >>>>>>> >>>>>>>>>> >>>>>>>>>> Gleb: I think we would see far better results >>>>>>>>>> with high speed internet links using TCP if we >>>>>>>>>> could extend the LRO (large receive offload) code >>>>>>>>>> to accumulate more than 64KBytes worth of data >>>>>>>>>> per call to the TCP stack instead of complaining >>>>>>>>>> about some callouts ending up on the same thread! >>>>>>>>>> Actually I have a patch for that. >>>>>>>>>> >>>>>>>>>> --HPS >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> svn-src-head@freebsd.org mailing list >>>>>>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>>>>> To unsubscribe, send any mail to >>>>>>>> "svn-src-head-unsubscribe@freebsd.org" >>>>>>> >>>>>>> >>>> >>>> >>>> > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJUvvFSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5k1AcIAJvIeDso4/a4YqEyXxGj4CAb QLfESoILRDF3LpczRpIFGnUPRs9pWUTm6DIUut0ZjgLChq1kHzdi2uIFe9QB3ehX zzw4MEtxDEqXv5zOAmP1gvcx1a2rKZJnTlfW2CHa2QAYTR06BFARu8u3NyC3tZiq o/NGpidv+nrkcrDSHmzpVgIrlZzyB+YsGyNcvRUkewxMpos9syB2sKiXm9u/MQYQ nHyjFw9IOjDFAiZgww0y/8QYB9efr639Hgt1BYn86t4iZzwDOajH+jeb9VXMT5s9 liauQ4NiiMBe6F/mldoJ+XrtlPZ9rdx5jbgz8zBQcB7LzoWv91q0GOVpk/Am8FQ= =E1eL -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 00:37:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96A2623C; Wed, 21 Jan 2015 00:37:45 +0000 (UTC) Received: from mail-yh0-x22a.google.com (mail-yh0-x22a.google.com [IPv6:2607:f8b0:4002:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DAA6A2; Wed, 21 Jan 2015 00:37:45 +0000 (UTC) Received: by mail-yh0-f42.google.com with SMTP id a41so5580612yho.1; Tue, 20 Jan 2015 16:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mYFdu5RixQPZoBkoG9X98f+ZVaEV5J8dEGOdcWow9g8=; b=J0aXZQhmV6zwvXzfmlN660l9sLKqDoEbADtAW6k2uS/kSYTcC7eePDPnBH5i+c7NXv dGcOxiLdScgOelRjGCx74syJNSIgy8c1HsTdecHg3mynNM4BAZLCjNp9VtpINgdkve7w Z0zBXePZ9VOt2v7LzV8PnSfBXs4HrtrPkMCkBpS15nT3pgrLOUboPAFx03tuumHD8qYg ncsqaYnQQG/wmyM1nCnKWmUd2/Czh4B2FS3quE1kdWEXiK23iVWV2w9xeaApihe7HYzz f4FY0EWtpaY8QvD3/gIRaXXr3aty4N9z6auLUJDNwv2RZGfxLEcECXl6Du9aXpfI+FL5 4LCg== MIME-Version: 1.0 X-Received: by 10.170.44.4 with SMTP id 4mr2949166ykm.101.1421800664480; Tue, 20 Jan 2015 16:37:44 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Tue, 20 Jan 2015 16:37:44 -0800 (PST) In-Reply-To: <54BEF154.3030606@ignoranthack.me> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> Date: Tue, 20 Jan 2015 16:37:44 -0800 X-Google-Sender-Auth: -L9LfQBSVVnEHcsvC2pM95gqdno Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 00:37:45 -0000 On Tue, Jan 20, 2015 at 4:22 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 01/20/15 15:59, K. Macy wrote: >> On Tue, Jan 20, 2015 at 3:53 PM, Sean Bruno >> wrote: On 01/20/15 15:48, K. Macy wrote: >>>>> Are any other drivers hitting this? e.g. cxgb/cxgbe? >>>>> >>>>> -K >>>>> >> >> Unkown to me. Nor am I aware of anyone else who ever hit our >> panics either. Our environment, and the failure, was only seen in >> the Intel 10GE space (ixgbe). This is an artifact of our use >> cases, and hasn't been expanded nor tested in our environment with >> other vendor interfaces. >> >>> For an ill characterized problem isolated to one environment >>> this seems like a workaround that should not be part of the >>> general code base. >> >>> -K >> > > There was never any indication in our testing that the driver was > involved in any way. > > In our universe, this commit (right or wrong) resolved our panics. I > think that there is some room for improvement based on the commentary > in this thread, but some people do indeed prefer stability over > performance. I hope we can come to a middle ground somewhere here. I would pick stability over performance any day. However, it _seems_ to me, and maybe I simply don't understand some key details, that the fix consisted of largely single-threading the callout system. And as I say I may simply not understand the specifics, but this sort of large scale disabling does not constitute a fix but is a workaround. It's more like disabling preemption because it fixes a panic. Yes, it might "fix" a whole array of bugs that crop up but it could not be seen as a fix to an otherwise working system. -K > > sean > >> >> sean >> >>>>> On Tue, Jan 20, 2015 at 3:46 PM, Sean Bruno >>>>> wrote: On 01/20/15 15:40, K. Macy >>>>> wrote: >>>>>>>> I think you're working around driver locking bugs by >>>>>>>> crippling the callout code. >>>>>>>> >>>>>>>> -K >>>>>>>> >>>>> >>>>> We had zero evidence of this. What leads you down that path? >>>>> I'm totally open to being wrong, e.g. "yeah, you slowed down >>>>> things so that you don't hit a race condition" >>>>> >>>>> sean >>>>> >>>>>>>> On Tue, Jan 20, 2015 at 3:35 PM, Sean Bruno >>>>>>>> wrote: On 01/20/15 14:30, >>>>>>>> Hans Petter Selasky wrote: >>>>>>>>>>> On 01/20/15 22:11, Gleb Smirnoff wrote: >>>>>>>>>>>> On Tue, Jan 20, 2015 at 09:51:26AM +0200, >>>>>>>>>>>> Konstantin Belousov wrote: K> > Like stated in >>>>>>>>>>>> the manual page, callout_reset_curcpu/on() does >>>>>>>>>>>> not work K> > with MPSAFE callouts any more! K> >>>>>>>>>>>> I.e. you 'fixed' some undeterminate bugs in >>>>>>>>>>>> callout migration by not K> doing migration at >>>>>>>>>>>> all anymore. K> K> > K> > You need to use >>>>>>>>>>>> callout_init_{mtx,rm,rw} and remove the custom >>>>>>>>>>>> locking K> > inside the callback in the TCP >>>>>>>>>>>> stack to get it working like before! K> K> No, >>>>>>>>>>>> you need to do this, if you think that whole >>>>>>>>>>>> callout KPI must be K> rototiled. It is up to >>>>>>>>>>>> the person who modifies the KPI, to ensure that >>>>>>>>>>>> K> existing code is not broken. K> K> As I >>>>>>>>>>>> understand, currently we are back to the >>>>>>>>>>>> one-cpu callouts. K> Do other people consider >>>>>>>>>>>> this situation acceptable ? >>>>>>>>>>>> >>>>>>>>>>>> I think this isn't acceptable. The commit to a >>>>>>>>>>>> complex subsystem lacked a review from persons >>>>>>>>>>>> involved in the system before. The commit to >>>>>>>>>>>> subsystem broke consumers of the subsystem and >>>>>>>>>>>> this was even done not accidentially, but due >>>>>>>>>>>> to Hans not caring about it. >>>>>>>>>>>> >>>>>>>>>>>> As for me this is enough to request a backout, >>>>>>>>>>>> and let the change back in only after proper >>>>>>>>>>>> review. >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Hi Gleb, >>>>>>>>>>> >>>>>>>>>>> Backing out my callout API patch means we will >>>>>>>>>>> for sure re-introduce an unknown callout spinlock >>>>>>>>>>> hang, as noted to me by several people. What do >>>>>>>>>>> you think about that? dram Maybe "Jason Wolfe" >>>>>>>>>>> CC'ed can add to 10-stable w/o my patches: >>>>>>>>>>> >>>>>>>> >>>>>>>> Jason picked up this patch for work and it resolved >>>>>>>> our instability issues that had remained unsolved for >>>>>>>> quite some time as reported to freebsd-net: >>>>>>>> >>>>>>>> https://lists.freebsd.org/pipermail/freebsd-net/2015-January/040895.html >>>>>>>> >>>>>>>> >>>>>>>> >> >>>>>>>> > This had gone undiagnosed for some time (even with the gracious >>>>>>>> help of jhb in offline emails, thanks btw!). >>>>>>>> >>>>>>>> There's some diagnostics in that email thread that may >>>>>>>> be of value to you folks for determination of the >>>>>>>> validity of changing the callout API or at least >>>>>>>> understanding why we were involved in diagnostics. >>>>>>>> >>>>>>>> While I'd sure love to tune performance, the fact that >>>>>>>> our machines were basically going out to lunch without >>>>>>>> these changes, probably means that others were seeing >>>>>>>> it and didn't know what else to do. As much as I enjoy >>>>>>>> a good "break out the pitch forks and torches" email >>>>>>>> thread, this increased stability for us and is allowing >>>>>>>> us to upgrade from freebsd8 to freebsd10. Bear this in >>>>>>>> mind when you throw your voice in favor of reverting. >>>>>>>> >>>>>>>>>>> int callout_reset_sbt_on(struct callout *c, >>>>>>>>>>> sbintime_t sbt, sbintime_t precision, void >>>>>>>>>>> (*ftn)(void *), void *arg, int cpu, int flags) { >>>>>>>>>>> sbintime_t to_sbt, pr; struct callout_cpu *cc; >>>>>>>>>>> int cancelled, direct; >>>>>>>>>>> >>>>>>>>>>> + cpu = timeout_cpu; /* XXX test code XXX >>>>>>>>>>> */ >>>>>>>>>>> >>>>>>>>>>> cancelled = 0; >>>>>>>>>>> >>>>>>>> >>>>>>>> Jason or I would have to run this in production, which >>>>>>>> would be problematic I fear. We never had a >>>>>>>> deterministic test case that would exhibit the reported >>>>>>>> failure. We merely "tested in production" and saw that >>>>>>>> panics ceased. We didn't note a dropoff in our traffic >>>>>>>> either, perhaps we are not as efficient as others in >>>>>>>> this corner case, but we were consistently seeing the >>>>>>>> spinlock hangs after a day or so of traffic. >>>>>>>> >>>>>>>>>>> And see if he observes a callout spinlock hang or >>>>>>>>>>> not on his test setup. The patch above should >>>>>>>>>>> force all callouts to the same thread basically. >>>>>>>>>>> Then we could maybe see if single threading the >>>>>>>>>>> callouts has anything to do with solving the >>>>>>>>>>> spinlock hang. >>>>>>>>>>> >>>>>>>>>>> The "rewritten" callout API still has all the >>>>>>>>>>> features and capabilities the old one had, when >>>>>>>>>>> used as described in "man 9 callout". >>>>>>>>>>> >>>>>>>>>>> At the present moment I'm not technically >>>>>>>>>>> convinced a backout is correct. >>>>>>>> >>>>>>>> Neither am I, to be honest. Just based on *results*. >>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Gleb: I think we would see far better results >>>>>>>>>>> with high speed internet links using TCP if we >>>>>>>>>>> could extend the LRO (large receive offload) code >>>>>>>>>>> to accumulate more than 64KBytes worth of data >>>>>>>>>>> per call to the TCP stack instead of complaining >>>>>>>>>>> about some callouts ending up on the same thread! >>>>>>>>>>> Actually I have a patch for that. >>>>>>>>>>> >>>>>>>>>>> --HPS >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> svn-src-head@freebsd.org mailing list >>>>>>>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>>>>>> To unsubscribe, send any mail to >>>>>>>>> "svn-src-head-unsubscribe@freebsd.org" >>>>>>>> >>>>>>>> >>>>> >>>>> >>>>> >> >> >> >> > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUvvFSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx > MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5k1AcIAJvIeDso4/a4YqEyXxGj4CAb > QLfESoILRDF3LpczRpIFGnUPRs9pWUTm6DIUut0ZjgLChq1kHzdi2uIFe9QB3ehX > zzw4MEtxDEqXv5zOAmP1gvcx1a2rKZJnTlfW2CHa2QAYTR06BFARu8u3NyC3tZiq > o/NGpidv+nrkcrDSHmzpVgIrlZzyB+YsGyNcvRUkewxMpos9syB2sKiXm9u/MQYQ > nHyjFw9IOjDFAiZgww0y/8QYB9efr639Hgt1BYn86t4iZzwDOajH+jeb9VXMT5s9 > liauQ4NiiMBe6F/mldoJ+XrtlPZ9rdx5jbgz8zBQcB7LzoWv91q0GOVpk/Am8FQ= > =E1eL > -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 00:50:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C49C4BE; Wed, 21 Jan 2015 00:50:00 +0000 (UTC) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1AF07E6; Wed, 21 Jan 2015 00:49:59 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id hn18so6095450igb.2; Tue, 20 Jan 2015 16:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=quqiDEo6lbjiQU3p59cMdu3xkbwGtlVCKg33kJKiBXI=; b=XIVsc0kP68F80uzjgKxKv8yLvvgoR/So3T3KsGauRqWWdEP39yy1wA/LCGZtCmT4i2 5vg0xwjyelVCeFIN5vOY3U5Ok/1WrmN/3i9xFN3EXoHClvGDljB1zLwVu8C5AZ60EflQ NYNLXgQxiqbsmYbP+s+MDZpSGP1IA71l52fNGzWm9UG6D8WyFzhlBOUGCneM9R8Va1E0 08w2DCdsr6JzD7kriQcaQ/vcqYFC2/AAgqD9MgWv647pN2phuMBC6uUqp2xSIt7U1Gyq BqECdn/Gkaidffvr5bMoZLvyEGUZDlUDuaq1MGYvjX+P6LuVApMJUpACuazAdDP0HdzJ CutQ== MIME-Version: 1.0 X-Received: by 10.50.66.171 with SMTP id g11mr517250igt.49.1421801399255; Tue, 20 Jan 2015 16:49:59 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Tue, 20 Jan 2015 16:49:59 -0800 (PST) In-Reply-To: <54BED6FB.8060401@selasky.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> Date: Tue, 20 Jan 2015 16:49:59 -0800 X-Google-Sender-Auth: NXKq1hKRrZ9-zvF905vKlDFggLY Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 00:50:00 -0000 On 20 January 2015 at 14:30, Hans Petter Selasky wrote: > Backing out my callout API patch means we will for sure re-introduce an > unknown callout spinlock hang, as noted to me by several people. What do you > think about that? > > Maybe "Jason Wolfe" CC'ed can add to 10-stable w/o my patches: > > int > callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t > precision, > void (*ftn)(void *), void *arg, int cpu, int flags) > { > sbintime_t to_sbt, pr; > struct callout_cpu *cc; > int cancelled, direct; > > + cpu = timeout_cpu; /* XXX test code XXX */ > > cancelled = 0; > > And see if he observes a callout spinlock hang or not on his test setup. The > patch above should force all callouts to the same thread basically. Then we > could maybe see if single threading the callouts has anything to do with > solving the spinlock hang. > > The "rewritten" callout API still has all the features and capabilities the > old one had, when used as described in "man 9 callout". > > At the present moment I'm not technically convinced a backout is correct. > > Gleb: I think we would see far better results with high speed internet links > using TCP if we could extend the LRO (large receive offload) code to > accumulate more than 64KBytes worth of data per call to the TCP stack > instead of complaining about some callouts ending up on the same thread! > Actually I have a patch for that. You should totally try say, 100,000 active TCP connections on a box. See what happens to swi0 (clock). TL;DR - the lock contention sucks and it takes a chunk of the core up. The lock contention is highly not good. That's why I'd like to see both the callout stuff in its slightly-better-defined-and-sane state from you /and/ make it so TCP can use it. I'll have to double-check to see if the RSS stuff is all lined up correctly so we can use it when we create the callouts (well, at inpcb creation time, right), rather than when we first schedule them. Then we can experiment with having the initial CPU be specified at callout create time rather than expecting to be able to move it when we first schedule it. Or, hm, maybe have it so we don't have a CPU chosen until the first time we schedule the timeout, and if it hasn't been scheduled before, allow the CPU to be set? Because at that point we aren't migrating it off f timeout_cpu - it's never been added to it in the first place. -a From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 00:50:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78B765FD for ; Wed, 21 Jan 2015 00:50:41 +0000 (UTC) Received: from nm32-vm4.bullet.mail.bf1.yahoo.com (nm32-vm4.bullet.mail.bf1.yahoo.com [72.30.239.140]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 126D27F0 for ; Wed, 21 Jan 2015 00:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421801433; bh=MHbTwGeIoqlEwpe67rWMRNPHZq1BICYRwxiZrc2nNj4=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=lahE/Oj5ylz/KCv5YvCnD6qwLKECDnBujr0zA/H1QHpcRuaImpbm/uMKTsIPIn2W7nLc+NMuE3+npOzHiRlxvEiRtgJ5j+DkeUTXULjnMotdlEwhmg0v/9Ky7ZoHFYQAiNCj7yxzcPQDKbYk7TM+e4tBcS7RcW4UViz9R3Oe4ugwO20q59mEKRgoXn2qg751eCzsVxv0jsOzElkguKMRMykZp0fEPZDBYTPyoCrU2QmTiZHlW2Ukt7F37lt8vgGf+dSIvXfSXtrLukFXymZSZwgU40Oq7I6PwtyOtzD66d5ZDIy9Gflt0SD0h6pmCunA8F8BPoKZXZL7HfB/SMo/1A== Received: from [66.196.81.174] by nm32.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 00:50:33 -0000 Received: from [68.142.230.64] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 00:50:33 -0000 Received: from [127.0.0.1] by smtp221.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 00:50:33 -0000 X-Yahoo-Newman-Id: 89947.54961.bm@smtp221.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: w71VM0QVM1kfbA8rOKidKHokW0xPRTTw2.E2v9M52zspZKc OCSux4YCLc3D57scymTz3jKKZLftxZgacMMbucxzZstVCjkT2X6qPrrAvaU7 KC3YGGz.756qKxrMBhjeiFKfhg4qyJCRsS8fyKYton8iccA5.QvXleF2VHxh EJTas7XHHhTGrCUOg.ZITMM.DnVZkBP3XrPGG3HZV6jby5G0daF2ZjYXURw6 lGlU8Id_sM7rFeF3H4mhEzYN5HJqWfAmpRQCUe3nHQkMg0QCKFIYXGnzg24l 3aTDYbudcGRssxJx21.njkUsj4xcCc1ozqN1ig2aKBRyngl5LWq4PVkUKuRC .dIj7vIocWkyrzwmSnytLoD7B8PHS6CusCujol82.wIgzlEmUzmBKfANIY3T 38fWAA.nlYnoifFURooyYqWzzX9FJ.2b.E4dNZeHjnsAJ7RM8uyW38htP1yp G8144hQgZREo820SJXE4DrS6UTUsqjwXTUVj.TrGFe8cTRLLf5bg9lY8qCoX 9hv886jNi4lTjd47PMMZnLX0lXnTNiKL1XpVvZQ6goLKoqRFDMqv1R6fEhOH dXuDPk0lqxDCwvKrBaraJW0X4ioZFpSW_QRqQE.j_38FOx92OOFv4FpYy8YW yu1G9yWVYoQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BEF7CF.9030505@FreeBSD.org> Date: Tue, 20 Jan 2015 19:50:23 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Navdeep Parhar , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> In-Reply-To: <54BEE305.6020905@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 00:50:41 -0000 On 01/20/15 18:21, Navdeep Parhar wrote: > The problem reported by Luigi has been fixed in r277225 already. > > Regards, > Navdeep > But the fix is rather ugly, isn't it? I would personally prefer to just kill the older gcc but in the meantime updating it so that it behaves like the updated gcc/clang would be better. IMHO. Pedro. > On 01/20/15 15:10, Pedro Giffuni wrote: >> Hi; >> >> I got this patch from the OpenBSD-tech list[1]. >> Perhaps this fixes the gcc issue? >> >> Apparently it's required for mesa too. >> >> Pedro. >> >> [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 >> >> On 01/06/15 15:33, Navdeep Parhar wrote: >>> On Tue, Jan 06, 2015 at 07:58:34PM +0100, Luigi Rizzo wrote: >>>> >>>> On Thu, Jan 1, 2015 at 12:19 AM, Navdeep Parhar >>>> wrote: >>>> >>>> Author: np >>>> Date: Wed Dec 31 23:19:16 2014 >>>> New Revision: 276485 >>>> URL: https://svnweb.freebsd.org/changeset/base/276485 >>>> >>>> Log: >>>> cxgbe(4): major tx rework. >>>> >>>> >>>> FYI, this commit has some unnamed unions (eg. in t4_mp_ring.c) >>>> which prevent the kernel from compiling with our stock gcc >>>> and its standard kernel build flags (specifically -std=...). >>>> >>>> Adding the following in the kernel config >>>> >>>> makeoptions COPTFLAGS="-fms-extensions" >>>> >>>> seems to do the job >>>> >>>> I know it is unavoidable that we'll end up with gcc not working, >>>> but maybe we can still avoid unnamed unions. >>> There are two unresolved issues with mp_ring and I had to make the >>> driver amd64-only while I consider my options. >>> >>> - platforms where gcc is the default (and our version has problems with >>> unnamed unions). This is simple to fix but reduces the >>> readability of >>> the code. But sure, if building head with gcc is popular then that >>> trumps readability. I wonder if adding -fms-extensions just to the >>> driver's build flags would be an acceptable compromise. >>> - platforms without the acq/rel versions of 64b cmpset. I think it >>> would be simple to add acq/rel variants to i386/pc98 and others that >>> already have 64b cmpset. The driver will be permanently unplugged >>> from >>> whatever remains (only 32 bit powerpc I think). >>> >>> I'll try to sort all this out within the next couple of weeks. >>> >>> Regards, >>> Navdeep >>> >>>> cheers >>>> luigi >>>> >>>> >>>> a) Front load as much work as possible in if_transmit, before >>>> any driver >>>> lock or software queue has to get involved. >>>> >>>> b) Replace buf_ring with a brand new mp_ring (multiproducer >>>> ring). This >>>> is specifically for the tx multiqueue model where one of the >>>> if_transmit >>>> producer threads becomes the consumer and other producers >>>> carry on as >>>> usual. mp_ring is implemented as standalone code and it >>>> should be >>>> possible to use it in any driver with tx multiqueue. It also >>>> has: >>>> - the ability to enqueue/dequeue multiple items. This might >>>> become >>>> significant if packet batching is ever implemented. >>>> - an abdication mechanism to allow a thread to give up >>>> writing tx >>>> descriptors and have another if_transmit thread take over. >>>> A thread >>>> that's writing tx descriptors can end up doing so for an >>>> unbounded >>>> time period if a) there are other if_transmit threads >>>> continuously >>>> feeding the sofware queue, and b) the chip keeps up with >>>> whatever the >>>> thread is throwing at it. >>>> - accurate statistics about interesting events even when the >>>> stats come >>>> at the expense of additional branches/conditional code. >>>> >>>> The NIC txq lock is uncontested on the fast path at this >>>> point. I've >>>> left it there for synchronization with the control events >>>> (interface >>>> up/down, modload/unload). >>>> >>>> c) Add support for "type 1" coalescing work request in the >>>> normal NIC tx >>>> path. This work request is optimized for frames with a single >>>> item in >>>> the DMA gather list. These are very common when forwarding >>>> packets. >>>> Note that netmap tx in cxgbe already uses these "type 1" work >>>> requests. >>>> >>>> d) Do not request automatic cidx updates every 32 >>>> descriptors. Instead, >>>> request updates via bits in individual work requests (still >>>> every 32 >>>> descriptors approximately). Also, request an automatic final >>>> update >>>> when the queue idles after activity. This means NIC tx >>>> reclaim is still >>>> performed lazily but it will catch up quickly as soon as the >>>> queue >>>> idles. This seems to be the best middle ground and I'll >>>> probably do >>>> something similar for netmap tx as well. >>>> >>>> e) Implement a faster tx path for WRQs (used by TOE tx and >>>> control >>>> queues, _not_ by the normal NIC tx). Allow work requests to >>>> be written >>>> directly to the hardware descriptor ring if room is >>>> available. I will >>>> convert t4_tom and iw_cxgbe modules to this faster style >>>> gradually. >>>> >>>> MFC after: 2 months >>>> >>>> Added: >>>> head/sys/dev/cxgbe/t4_mp_ring.c (contents, props changed) >>>> head/sys/dev/cxgbe/t4_mp_ring.h (contents, props changed) >>>> Modified: >>>> head/sys/conf/files >>>> head/sys/dev/cxgbe/adapter.h >>>> head/sys/dev/cxgbe/t4_l2t.c >>>> head/sys/dev/cxgbe/t4_main.c >>>> head/sys/dev/cxgbe/t4_sge.c >>>> head/sys/modules/cxgbe/if_cxgbe/Makefile >>>> >>>> Modified: head/sys/conf/files >>>> >>>> =========================================================================== >>>> >>>> >>>> === >>>> --- head/sys/conf/files Wed Dec 31 22:52:43 2014 (r276484) >>>> +++ head/sys/conf/files Wed Dec 31 23:19:16 2014 (r276485) >>>> @@ -1142,6 +1142,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p >>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>> dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ >>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>> +dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ >>>> + compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>> dev/cxgbe/t4_main.c optional cxgbe pci \ >>>> compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>> dev/cxgbe/t4_netmap.c optional cxgbe pci \ >>>> >>>> Modified: head/sys/dev/cxgbe/adapter.h >>>> >>>> =========================================================================== >>>> >>>> >>>> === >>>> --- head/sys/dev/cxgbe/adapter.h Wed Dec 31 22:52:43 2014 >>>> (r276484) >>>> +++ head/sys/dev/cxgbe/adapter.h Wed Dec 31 23:19:16 2014 >>>> (r276485) >>>> @@ -152,7 +152,8 @@ enum { >>>> CL_METADATA_SIZE = CACHE_LINE_SIZE, >>>> >>>> SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR >>>> size in >>>> desc */ >>>> - TX_SGL_SEGS = 36, >>>> + TX_SGL_SEGS = 39, >>>> + TX_SGL_SEGS_TSO = 38, >>>> TX_WR_FLITS = SGE_MAX_WR_LEN / 8 >>>> }; >>>> >>>> @@ -273,6 +274,7 @@ struct port_info { >>>> struct timeval last_refreshed; >>>> struct port_stats stats; >>>> u_int tnl_cong_drops; >>>> + u_int tx_parse_error; >>>> >>>> eventhandler_tag vlan_c; >>>> >>>> @@ -308,23 +310,9 @@ struct tx_desc { >>>> __be64 flit[8]; >>>> }; >>>> >>>> -struct tx_map { >>>> - struct mbuf *m; >>>> - bus_dmamap_t map; >>>> -}; >>>> - >>>> -/* DMA maps used for tx */ >>>> -struct tx_maps { >>>> - struct tx_map *maps; >>>> - uint32_t map_total; /* # of DMA maps */ >>>> - uint32_t map_pidx; /* next map to be used */ >>>> - uint32_t map_cidx; /* reclaimed up to this index */ >>>> - uint32_t map_avail; /* # of available maps */ >>>> -}; >>>> - >>>> struct tx_sdesc { >>>> + struct mbuf *m; /* m_nextpkt linked chain of >>>> frames */ >>>> uint8_t desc_used; /* # of hardware descriptors >>>> used by the WR >>>> */ >>>> - uint8_t credits; /* NIC txq: # of frames sent out >>>> in the WR >>>> */ >>>> }; >>>> >>>> >>>> @@ -378,16 +366,12 @@ struct sge_iq { >>>> enum { >>>> EQ_CTRL = 1, >>>> EQ_ETH = 2, >>>> -#ifdef TCP_OFFLOAD >>>> EQ_OFLD = 3, >>>> -#endif >>>> >>>> /* eq flags */ >>>> - EQ_TYPEMASK = 7, /* 3 lsbits hold the >>>> type */ >>>> - EQ_ALLOCATED = (1 << 3), /* firmware resources >>>> allocated */ >>>> - EQ_DOOMED = (1 << 4), /* about to be >>>> destroyed */ >>>> - EQ_CRFLUSHED = (1 << 5), /* expecting an update >>>> from SGE */ >>>> - EQ_STALLED = (1 << 6), /* out of hw descriptors >>>> or dmamaps >>>> */ >>>> + EQ_TYPEMASK = 0x3, /* 2 lsbits hold the >>>> type (see >>>> above) */ >>>> + EQ_ALLOCATED = (1 << 2), /* firmware resources >>>> allocated */ >>>> + EQ_ENABLED = (1 << 3), /* open for business */ >>>> }; >>>> >>>> /* Listed in order of preference. Update t4_sysctls too if you >>>> change >>>> these */ >>>> @@ -402,32 +386,25 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB >>>> struct sge_eq { >>>> unsigned int flags; /* MUST be first */ >>>> unsigned int cntxt_id; /* SGE context id for the eq */ >>>> - bus_dma_tag_t desc_tag; >>>> - bus_dmamap_t desc_map; >>>> - char lockname[16]; >>>> struct mtx eq_lock; >>>> >>>> struct tx_desc *desc; /* KVA of descriptor ring */ >>>> - bus_addr_t ba; /* bus address of descriptor >>>> ring */ >>>> - struct sge_qstat *spg; /* status page, for >>>> convenience */ >>>> uint16_t doorbells; >>>> volatile uint32_t *udb; /* KVA of doorbell (lies within >>>> BAR2) */ >>>> u_int udb_qid; /* relative qid within the >>>> doorbell page */ >>>> - uint16_t cap; /* max # of desc, for >>>> convenience */ >>>> - uint16_t avail; /* available descriptors, for >>>> convenience * >>>> / >>>> - uint16_t qsize; /* size (# of entries) of the >>>> queue */ >>>> + uint16_t sidx; /* index of the entry with the >>>> status page >>>> */ >>>> uint16_t cidx; /* consumer idx (desc idx) */ >>>> uint16_t pidx; /* producer idx (desc idx) */ >>>> - uint16_t pending; /* # of descriptors used since >>>> last >>>> doorbell */ >>>> + uint16_t equeqidx; /* EQUEQ last requested at this >>>> pidx */ >>>> + uint16_t dbidx; /* pidx of the most recent >>>> doorbell */ >>>> uint16_t iqid; /* iq that gets egr_update for >>>> the eq */ >>>> uint8_t tx_chan; /* tx channel used by the eq */ >>>> - struct task tx_task; >>>> - struct callout tx_callout; >>>> + volatile u_int equiq; /* EQUIQ outstanding */ >>>> >>>> - /* stats */ >>>> - >>>> - uint32_t egr_update; /* # of SGE_EGR_UPDATE >>>> notifications for eq >>>> */ >>>> - uint32_t unstalled; /* recovered from stall */ >>>> + bus_dma_tag_t desc_tag; >>>> + bus_dmamap_t desc_map; >>>> + bus_addr_t ba; /* bus address of descriptor >>>> ring */ >>>> + char lockname[16]; >>>> }; >>>> >>>> struct sw_zone_info { >>>> @@ -499,18 +476,19 @@ struct sge_fl { >>>> struct cluster_layout cll_alt; /* alternate refill >>>> zone, layout */ >>>> }; >>>> >>>> +struct mp_ring; >>>> + >>>> /* txq: SGE egress queue + what's needed for Ethernet NIC */ >>>> struct sge_txq { >>>> struct sge_eq eq; /* MUST be first */ >>>> >>>> struct ifnet *ifp; /* the interface this txq >>>> belongs to */ >>>> - bus_dma_tag_t tx_tag; /* tag for transmit buffers */ >>>> - struct buf_ring *br; /* tx buffer ring */ >>>> + struct mp_ring *r; /* tx software ring */ >>>> struct tx_sdesc *sdesc; /* KVA of software descriptor >>>> ring */ >>>> - struct mbuf *m; /* held up due to temporary >>>> resource >>>> shortage */ >>>> - >>>> - struct tx_maps txmaps; >>>> + struct sglist *gl; >>>> + __be32 cpl_ctrl0; /* for convenience */ >>>> >>>> + struct task tx_reclaim_task; >>>> /* stats for common events first */ >>>> >>>> uint64_t txcsum; /* # of times hardware assisted >>>> with >>>> checksum */ >>>> @@ -519,13 +497,12 @@ struct sge_txq { >>>> uint64_t imm_wrs; /* # of work requests with >>>> immediate data * >>>> / >>>> uint64_t sgl_wrs; /* # of work requests with >>>> direct SGL */ >>>> uint64_t txpkt_wrs; /* # of txpkt work requests (not >>>> coalesced) >>>> */ >>>> - uint64_t txpkts_wrs; /* # of coalesced tx work >>>> requests */ >>>> - uint64_t txpkts_pkts; /* # of frames in coalesced tx >>>> work >>>> requests */ >>>> + uint64_t txpkts0_wrs; /* # of type0 coalesced tx work >>>> requests */ >>>> + uint64_t txpkts1_wrs; /* # of type1 coalesced tx work >>>> requests */ >>>> + uint64_t txpkts0_pkts; /* # of frames in type0 >>>> coalesced tx WRs */ >>>> + uint64_t txpkts1_pkts; /* # of frames in type1 >>>> coalesced tx WRs */ >>>> >>>> /* stats for not-that-common events */ >>>> - >>>> - uint32_t no_dmamap; /* no DMA map to load the mbuf */ >>>> - uint32_t no_desc; /* out of hardware descriptors */ >>>> } __aligned(CACHE_LINE_SIZE); >>>> >>>> /* rxq: SGE ingress queue + SGE free list + miscellaneous >>>> items */ >>>> @@ -574,7 +551,13 @@ struct wrqe { >>>> STAILQ_ENTRY(wrqe) link; >>>> struct sge_wrq *wrq; >>>> int wr_len; >>>> - uint64_t wr[] __aligned(16); >>>> + char wr[] __aligned(16); >>>> +}; >>>> + >>>> +struct wrq_cookie { >>>> + TAILQ_ENTRY(wrq_cookie) link; >>>> + int ndesc; >>>> + int pidx; >>>> }; >>>> >>>> /* >>>> @@ -585,17 +568,32 @@ struct sge_wrq { >>>> struct sge_eq eq; /* MUST be first */ >>>> >>>> struct adapter *adapter; >>>> + struct task wrq_tx_task; >>>> + >>>> + /* Tx desc reserved but WR not "committed" yet. */ >>>> + TAILQ_HEAD(wrq_incomplete_wrs , wrq_cookie) >>>> incomplete_wrs; >>>> >>>> - /* List of WRs held up due to lack of tx descriptors */ >>>> + /* List of WRs ready to go out as soon as descriptors are >>>> available. */ >>>> STAILQ_HEAD(, wrqe) wr_list; >>>> + u_int nwr_pending; >>>> + u_int ndesc_needed; >>>> >>>> /* stats for common events first */ >>>> >>>> - uint64_t tx_wrs; /* # of tx work requests */ >>>> + uint64_t tx_wrs_direct; /* # of WRs written directly to >>>> desc ring. >>>> */ >>>> + uint64_t tx_wrs_ss; /* # of WRs copied from scratch >>>> space. */ >>>> + uint64_t tx_wrs_copied; /* # of WRs queued and copied to >>>> desc ring. >>>> */ >>>> >>>> /* stats for not-that-common events */ >>>> >>>> - uint32_t no_desc; /* out of hardware descriptors */ >>>> + /* >>>> + * Scratch space for work requests that wrap around >>>> after reaching >>>> the >>>> + * status page, and some infomation about the last WR >>>> that used it. >>>> + */ >>>> + uint16_t ss_pidx; >>>> + uint16_t ss_len; >>>> + uint8_t ss[SGE_MAX_WR_LEN]; >>>> + >>>> } __aligned(CACHE_LINE_SIZE); >>>> >>>> >>>> @@ -744,7 +742,7 @@ struct adapter { >>>> struct sge sge; >>>> int lro_timeout; >>>> >>>> - struct taskqueue *tq[NCHAN]; /* taskqueues that flush >>>> data out * >>>> / >>>> + struct taskqueue *tq[NCHAN]; /* General purpose >>>> taskqueues */ >>>> struct port_info *port[MAX_NPORTS]; >>>> uint8_t chan_map[NCHAN]; >>>> >>>> @@ -978,12 +976,11 @@ static inline int >>>> tx_resume_threshold(struct sge_eq *eq) >>>> { >>>> >>>> - return (eq->qsize / 4); >>>> + /* not quite the same as qsize / 4, but this will do. */ >>>> + return (eq->sidx / 4); >>>> } >>>> >>>> /* t4_main.c */ >>>> -void t4_tx_task(void *, int); >>>> -void t4_tx_callout(void *); >>>> int t4_os_find_pci_capability(struct adapter *, int); >>>> int t4_os_pci_save_state(struct adapter *); >>>> int t4_os_pci_restore_state(struct adapter *); >>>> @@ -1024,16 +1021,15 @@ int t4_setup_adapter_queues(struct adapt >>>> int t4_teardown_adapter_queues(struct adapter *); >>>> int t4_setup_port_queues(struct port_info *); >>>> int t4_teardown_port_queues(struct port_info *); >>>> -int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); >>>> -void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); >>>> void t4_intr_all(void *); >>>> void t4_intr(void *); >>>> void t4_intr_err(void *); >>>> void t4_intr_evt(void *); >>>> void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, >>>> struct wrqe *); >>>> -int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); >>>> void t4_update_fl_bufsize(struct ifnet *); >>>> -int can_resume_tx(struct sge_eq *); >>>> +int parse_pkt(struct mbuf **); >>>> +void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); >>>> +void commit_wrq_wr(struct sge_wrq *, void *, struct >>>> wrq_cookie *); >>>> >>>> /* t4_tracer.c */ >>>> struct t4_tracer; >>>> >>>> Modified: head/sys/dev/cxgbe/t4_l2t.c >>>> >>>> =========================================================================== >>>> >>>> >>>> === >>>> --- head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 22:52:43 2014 >>>> (r276484) >>>> +++ head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 23:19:16 2014 >>>> (r276485) >>>> @@ -113,16 +113,15 @@ found: >>>> int >>>> t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync) >>>> { >>>> - struct wrqe *wr; >>>> + struct wrq_cookie cookie; >>>> struct cpl_l2t_write_req *req; >>>> int idx = e->idx + sc->vres.l2t.start; >>>> >>>> mtx_assert(&e->lock, MA_OWNED); >>>> >>>> - wr = alloc_wrqe(sizeof(*req), &sc->sge.mgmtq); >>>> - if (wr == NULL) >>>> + req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), >>>> 16), & >>>> cookie); >>>> + if (req == NULL) >>>> return (ENOMEM); >>>> - req = wrtod(wr); >>>> >>>> INIT_TP_WR(req, 0); >>>> OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, >>>> idx | >>>> @@ -132,7 +131,7 @@ t4_write_l2e(struct adapter *sc, struct >>>> req->vlan = htons(e->vlan); >>>> memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); >>>> >>>> - t4_wrq_tx(sc, wr); >>>> + commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); >>>> >>>> if (sync && e->state != L2T_STATE_SWITCHING) >>>> e->state = L2T_STATE_SYNC_WRITE; >>>> >>>> Modified: head/sys/dev/cxgbe/t4_main.c >>>> >>>> =========================================================================== >>>> >>>> >>>> === >>>> --- head/sys/dev/cxgbe/t4_main.c Wed Dec 31 22:52:43 2014 >>>> (r276484) >>>> +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 31 23:19:16 2014 >>>> (r276485) >>>> @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); >>>> #include "common/t4_regs_values.h" >>>> #include "t4_ioctl.h" >>>> #include "t4_l2t.h" >>>> +#include "t4_mp_ring.h" >>>> >>>> /* T4 bus driver interface */ >>>> static int t4_probe(device_t); >>>> @@ -378,7 +379,8 @@ static void build_medialist(struct port_ >>>> static int cxgbe_init_synchronized(struct port_info *); >>>> static int cxgbe_uninit_synchronized(struct port_info *); >>>> static int setup_intr_handlers(struct adapter *); >>>> -static void quiesce_eq(struct adapter *, struct sge_eq *); >>>> +static void quiesce_txq(struct adapter *, struct sge_txq *); >>>> +static void quiesce_wrq(struct adapter *, struct sge_wrq *); >>>> static void quiesce_iq(struct adapter *, struct sge_iq *); >>>> static void quiesce_fl(struct adapter *, struct sge_fl *); >>>> static int t4_alloc_irq(struct adapter *, struct irq *, int rid, >>>> @@ -434,7 +436,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER >>>> static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); >>>> static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); >>>> #endif >>>> -static inline void txq_start(struct ifnet *, struct sge_txq *); >>>> static uint32_t fconf_to_mode(uint32_t); >>>> static uint32_t mode_to_fconf(uint32_t); >>>> static uint32_t fspec_to_fconf(struct t4_filter_specification >>>> *); >>>> @@ -1429,67 +1430,36 @@ cxgbe_transmit(struct ifnet *ifp, struct >>>> { >>>> struct port_info *pi = ifp->if_softc; >>>> struct adapter *sc = pi->adapter; >>>> - struct sge_txq *txq = &sc->sge.txq[pi->first_txq]; >>>> - struct buf_ring *br; >>>> + struct sge_txq *txq; >>>> + void *items[1]; >>>> int rc; >>>> >>>> M_ASSERTPKTHDR(m); >>>> + MPASS(m->m_nextpkt == NULL); /* not quite ready for >>>> this yet */ >>>> >>>> if (__predict_false(pi->link_cfg.link_ok == 0)) { >>>> m_freem(m); >>>> return (ENETDOWN); >>>> } >>>> >>>> - /* check if flowid is set */ >>>> - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>> - txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>> rsrv_noflowq)) >>>> - + pi->rsrv_noflowq); >>>> - br = txq->br; >>>> - >>>> - if (TXQ_TRYLOCK(txq) == 0) { >>>> - struct sge_eq *eq = &txq->eq; >>>> - >>>> - /* >>>> - * It is possible that t4_eth_tx finishes up and >>>> releases >>>> the >>>> - * lock between the TRYLOCK above and the >>>> drbr_enqueue >>>> here. We >>>> - * need to make sure that this mbuf doesn't just >>>> sit there >>>> in >>>> - * the drbr. >>>> - */ >>>> - >>>> - rc = drbr_enqueue(ifp, br, m); >>>> - if (rc == 0 && callout_pending(&eq->tx_callout) >>>> == 0 && >>>> - !(eq->flags & EQ_DOOMED)) >>>> - callout_reset(&eq->tx_callout, 1, >>>> t4_tx_callout, >>>> eq); >>>> + rc = parse_pkt(&m); >>>> + if (__predict_false(rc != 0)) { >>>> + MPASS(m == NULL); /* was >>>> freed >>>> already */ >>>> + atomic_add_int(&pi->tx_parse_error, 1); /* rare, >>>> atomic is >>>> ok */ >>>> return (rc); >>>> } >>>> >>>> - /* >>>> - * txq->m is the mbuf that is held up due to a temporary >>>> shortage >>>> of >>>> - * resources and it should be put on the wire first. >>>> Then what's >>>> in >>>> - * drbr and finally the mbuf that was just passed in >>>> to us. >>>> - * >>>> - * Return code should indicate the fate of the mbuf that >>>> was passed >>>> in >>>> - * this time. >>>> - */ >>>> - >>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>> - if (drbr_needs_enqueue(ifp, br) || txq->m) { >>>> - >>>> - /* Queued for transmission. */ >>>> - >>>> - rc = drbr_enqueue(ifp, br, m); >>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>> - (void) t4_eth_tx(ifp, txq, m); >>>> - TXQ_UNLOCK(txq); >>>> - return (rc); >>>> - } >>>> + /* Select a txq. */ >>>> + txq = &sc->sge.txq[pi->first_txq]; >>>> + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>> + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>> rsrv_noflowq)) + >>>> + pi->rsrv_noflowq); >>>> >>>> - /* Direct transmission. */ >>>> - rc = t4_eth_tx(ifp, txq, m); >>>> - if (rc != 0 && txq->m) >>>> - rc = 0; /* held, will be transmitted soon >>>> (hopefully) */ >>>> + items[0] = m; >>>> + rc = mp_ring_enqueue(txq->r, items, 1, 4096); >>>> + if (__predict_false(rc != 0)) >>>> + m_freem(m); >>>> >>>> - TXQ_UNLOCK(txq); >>>> return (rc); >>>> } >>>> >>>> @@ -1499,17 +1469,17 @@ cxgbe_qflush(struct ifnet *ifp) >>>> struct port_info *pi = ifp->if_softc; >>>> struct sge_txq *txq; >>>> int i; >>>> - struct mbuf *m; >>>> >>>> /* queues do not exist if !PORT_INIT_DONE. */ >>>> if (pi->flags & PORT_INIT_DONE) { >>>> for_each_txq(pi, i, txq) { >>>> TXQ_LOCK(txq); >>>> - m_freem(txq->m); >>>> - txq->m = NULL; >>>> - while ((m = >>>> buf_ring_dequeue_sc(txq->br)) != NULL) >>>> - m_freem(m); >>>> + txq->eq.flags &= ~EQ_ENABLED; >>>> TXQ_UNLOCK(txq); >>>> + while (!mp_ring_is_idle(txq->r)) { >>>> + mp_ring_check_drainage(txq->r, 0); >>>> + pause("qflush", 1); >>>> + } >>>> } >>>> } >>>> if_qflush(ifp); >>>> @@ -1564,7 +1534,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift >>>> struct sge_txq *txq; >>>> >>>> for_each_txq(pi, i, txq) >>>> - drops += txq->br->br_drops; >>>> + drops += >>>> counter_u64_fetch(txq->r->drops); >>>> } >>>> >>>> return (drops); >>>> @@ -3236,7 +3206,8 @@ cxgbe_init_synchronized(struct port_info >>>> { >>>> struct adapter *sc = pi->adapter; >>>> struct ifnet *ifp = pi->ifp; >>>> - int rc = 0; >>>> + int rc = 0, i; >>>> + struct sge_txq *txq; >>>> >>>> ASSERT_SYNCHRONIZED_OP(sc); >>>> >>>> @@ -3265,6 +3236,17 @@ cxgbe_init_synchronized(struct port_info >>>> } >>>> >>>> /* >>>> + * Can't fail from this point onwards. Review >>>> cxgbe_uninit_synchronized >>>> + * if this changes. >>>> + */ >>>> + >>>> + for_each_txq(pi, i, txq) { >>>> + TXQ_LOCK(txq); >>>> + txq->eq.flags |= EQ_ENABLED; >>>> + TXQ_UNLOCK(txq); >>>> + } >>>> + >>>> + /* >>>> * The first iq of the first port to come up is used for >>>> tracing. >>>> */ >>>> if (sc->traceq < 0) { >>>> @@ -3297,7 +3279,8 @@ cxgbe_uninit_synchronized(struct port_in >>>> { >>>> struct adapter *sc = pi->adapter; >>>> struct ifnet *ifp = pi->ifp; >>>> - int rc; >>>> + int rc, i; >>>> + struct sge_txq *txq; >>>> >>>> ASSERT_SYNCHRONIZED_OP(sc); >>>> >>>> @@ -3314,6 +3297,12 @@ cxgbe_uninit_synchronized(struct port_in >>>> return (rc); >>>> } >>>> >>>> + for_each_txq(pi, i, txq) { >>>> + TXQ_LOCK(txq); >>>> + txq->eq.flags &= ~EQ_ENABLED; >>>> + TXQ_UNLOCK(txq); >>>> + } >>>> + >>>> clrbit(&sc->open_device_map, pi->port_id); >>>> PORT_LOCK(pi); >>>> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >>>> @@ -3543,15 +3532,17 @@ port_full_uninit(struct port_info *pi) >>>> >>>> if (pi->flags & PORT_INIT_DONE) { >>>> >>>> - /* Need to quiesce queues. XXX: ctrl queues? */ >>>> + /* Need to quiesce queues. */ >>>> + >>>> + quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); >>>> >>>> for_each_txq(pi, i, txq) { >>>> - quiesce_eq(sc, &txq->eq); >>>> + quiesce_txq(sc, txq); >>>> } >>>> >>>> #ifdef TCP_OFFLOAD >>>> for_each_ofld_txq(pi, i, ofld_txq) { >>>> - quiesce_eq(sc, &ofld_txq->eq); >>>> + quiesce_wrq(sc, ofld_txq); >>>> } >>>> #endif >>>> >>>> @@ -3576,23 +3567,39 @@ port_full_uninit(struct port_info *pi) >>>> } >>>> >>>> static void >>>> -quiesce_eq(struct adapter *sc, struct sge_eq *eq) >>>> +quiesce_txq(struct adapter *sc, struct sge_txq *txq) >>>> { >>>> - EQ_LOCK(eq); >>>> - eq->flags |= EQ_DOOMED; >>>> + struct sge_eq *eq = &txq->eq; >>>> + struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; >>>> >>>> - /* >>>> - * Wait for the response to a credit flush if one's >>>> - * pending. >>>> - */ >>>> - while (eq->flags & EQ_CRFLUSHED) >>>> - mtx_sleep(eq, &eq->eq_lock, 0, "crflush", 0); >>>> - EQ_UNLOCK(eq); >>>> + (void) sc; /* unused */ >>>> >>>> - callout_drain(&eq->tx_callout); /* XXX: iffy */ >>>> - pause("callout", 10); /* Still iffy */ >>>> +#ifdef INVARIANTS >>>> + TXQ_LOCK(txq); >>>> + MPASS((eq->flags & EQ_ENABLED) == 0); >>>> + TXQ_UNLOCK(txq); >>>> +#endif >>>> >>>> - taskqueue_drain(sc->tq[eq->tx_chan], &eq->tx_task); >>>> + /* Wait for the mp_ring to empty. */ >>>> + while (!mp_ring_is_idle(txq->r)) { >>>> + mp_ring_check_drainage(txq->r, 0); >>>> + pause("rquiesce", 1); >>>> + } >>>> + >>>> + /* Then wait for the hardware to finish. */ >>>> + while (spg->cidx != htobe16(eq->pidx)) >>>> + pause("equiesce", 1); >>>> + >>>> + /* Finally, wait for the driver to reclaim all >>>> descriptors. */ >>>> + while (eq->cidx != eq->pidx) >>>> + pause("dquiesce", 1); >>>> +} >>>> + >>>> +static void >>>> +quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) >>>> +{ >>>> + >>>> + /* XXXTX */ >>>> } >>>> >>>> static void >>>> @@ -4892,6 +4899,9 @@ cxgbe_sysctls(struct port_info *pi) >>>> oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", >>>> CTLFLAG_RD, >>>> NULL, "port statistics"); >>>> children = SYSCTL_CHILDREN(oid); >>>> + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, >>>> "tx_parse_error", >>>> CTLFLAG_RD, >>>> + &pi->tx_parse_error, 0, >>>> + "# of tx packets with invalid length or # of >>>> segments"); >>>> >>>> #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ >>>> SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ >>>> @@ -6947,74 +6957,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) >>>> } >>>> #endif >>>> >>>> -static inline void >>>> -txq_start(struct ifnet *ifp, struct sge_txq *txq) >>>> -{ >>>> - struct buf_ring *br; >>>> - struct mbuf *m; >>>> - >>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>> - >>>> - br = txq->br; >>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>> - if (m) >>>> - t4_eth_tx(ifp, txq, m); >>>> -} >>>> - >>>> -void >>>> -t4_tx_callout(void *arg) >>>> -{ >>>> - struct sge_eq *eq = arg; >>>> - struct adapter *sc; >>>> - >>>> - if (EQ_TRYLOCK(eq) == 0) >>>> - goto reschedule; >>>> - >>>> - if (eq->flags & EQ_STALLED && !can_resume_tx(eq)) { >>>> - EQ_UNLOCK(eq); >>>> -reschedule: >>>> - if (__predict_true(!(eq->flags && EQ_DOOMED))) >>>> - callout_schedule(&eq->tx_callout, 1); >>>> - return; >>>> - } >>>> - >>>> - EQ_LOCK_ASSERT_OWNED(eq); >>>> - >>>> - if (__predict_true((eq->flags & EQ_DOOMED) == 0)) { >>>> - >>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>> - struct sge_txq *txq = arg; >>>> - struct port_info *pi = >>>> txq->ifp->if_softc; >>>> - >>>> - sc = pi->adapter; >>>> - } else { >>>> - struct sge_wrq *wrq = arg; >>>> - >>>> - sc = wrq->adapter; >>>> - } >>>> - >>>> - taskqueue_enqueue(sc->tq[eq->tx_chan], >>>> &eq->tx_task); >>>> - } >>>> - >>>> - EQ_UNLOCK(eq); >>>> -} >>>> - >>>> -void >>>> -t4_tx_task(void *arg, int count) >>>> -{ >>>> - struct sge_eq *eq = arg; >>>> - >>>> - EQ_LOCK(eq); >>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>> - struct sge_txq *txq = arg; >>>> - txq_start(txq->ifp, txq); >>>> - } else { >>>> - struct sge_wrq *wrq = arg; >>>> - t4_wrq_tx_locked(wrq->adapter, wrq, NULL); >>>> - } >>>> - EQ_UNLOCK(eq); >>>> -} >>>> - >>>> static uint32_t >>>> fconf_to_mode(uint32_t fconf) >>>> { >>>> @@ -7452,9 +7394,9 @@ static int >>>> set_filter_wr(struct adapter *sc, int fidx) >>>> { >>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>> - struct wrqe *wr; >>>> struct fw_filter_wr *fwr; >>>> unsigned int ftid; >>>> + struct wrq_cookie cookie; >>>> >>>> ASSERT_SYNCHRONIZED_OP(sc); >>>> >>>> @@ -7473,12 +7415,10 @@ set_filter_wr(struct adapter *sc, int fi >>>> >>>> ftid = sc->tids.ftid_base + fidx; >>>> >>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>> - if (wr == NULL) >>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>>> 16), & >>>> cookie); >>>> + if (fwr == NULL) >>>> return (ENOMEM); >>>> - >>>> - fwr = wrtod(wr); >>>> - bzero(fwr, sizeof (*fwr)); >>>> + bzero(fwr, sizeof(*fwr)); >>>> >>>> fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); >>>> fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); >>>> @@ -7547,7 +7487,7 @@ set_filter_wr(struct adapter *sc, int fi >>>> f->pending = 1; >>>> sc->tids.ftids_in_use++; >>>> >>>> - t4_wrq_tx(sc, wr); >>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>> return (0); >>>> } >>>> >>>> @@ -7555,22 +7495,21 @@ static int >>>> del_filter_wr(struct adapter *sc, int fidx) >>>> { >>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>> - struct wrqe *wr; >>>> struct fw_filter_wr *fwr; >>>> unsigned int ftid; >>>> + struct wrq_cookie cookie; >>>> >>>> ftid = sc->tids.ftid_base + fidx; >>>> >>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>> - if (wr == NULL) >>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>>> 16), & >>>> cookie); >>>> + if (fwr == NULL) >>>> return (ENOMEM); >>>> - fwr = wrtod(wr); >>>> bzero(fwr, sizeof (*fwr)); >>>> >>>> t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id); >>>> >>>> f->pending = 1; >>>> - t4_wrq_tx(sc, wr); >>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>> return (0); >>>> } >>>> >>>> @@ -8170,6 +8109,7 @@ t4_ioctl(struct cdev *dev, unsigned long >>>> >>>> /* MAC stats */ >>>> t4_clr_port_stats(sc, pi->tx_chan); >>>> + pi->tx_parse_error = 0; >>>> >>>> if (pi->flags & PORT_INIT_DONE) { >>>> struct sge_rxq *rxq; >>>> @@ -8192,24 +8132,24 @@ t4_ioctl(struct cdev *dev, unsigned long >>>> txq->imm_wrs = 0; >>>> txq->sgl_wrs = 0; >>>> txq->txpkt_wrs = 0; >>>> - txq->txpkts_wrs = 0; >>>> - txq->txpkts_pkts = 0; >>>> - txq->br->br_drops = 0; >>>> - txq->no_dmamap = 0; >>>> - txq->no_desc = 0; >>>> + txq->txpkts0_wrs = 0; >>>> + txq->txpkts1_wrs = 0; >>>> + txq->txpkts0_pkts = 0; >>>> + txq->txpkts1_pkts = 0; >>>> + mp_ring_reset_stats(txq->r); >>>> } >>>> >>>> #ifdef TCP_OFFLOAD >>>> /* nothing to clear for each ofld_rxq */ >>>> >>>> for_each_ofld_txq(pi, i, wrq) { >>>> - wrq->tx_wrs = 0; >>>> - wrq->no_desc = 0; >>>> + wrq->tx_wrs_direct = 0; >>>> + wrq->tx_wrs_copied = 0; >>>> } >>>> #endif >>>> wrq = &sc->sge.ctrlq[pi->port_id]; >>>> - wrq->tx_wrs = 0; >>>> - wrq->no_desc = 0; >>>> + wrq->tx_wrs_direct = 0; >>>> + wrq->tx_wrs_copied = 0; >>>> } >>>> break; >>>> } >>>> >>>> Added: head/sys/dev/cxgbe/t4_mp_ring.c >>>> >>>> =========================================================================== >>>> >>>> >>>> === >>>> --- /dev/null 00:00:00 1970 (empty, because file is newly >>>> added) >>>> +++ head/sys/dev/cxgbe/t4_mp_ring.c Wed Dec 31 23:19:16 2014 >>>> (r276485) >>>> @@ -0,0 +1,364 @@ >>>> +/*- >>>> + * Copyright (c) 2014 Chelsio Communications, Inc. >>>> + * All rights reserved. >>>> + * Written by: Navdeep Parhar >>>> + * >>>> + * 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 "t4_mp_ring.h" >>>> + >>>> +union ring_state { >>>> + struct { >>>> + uint16_t pidx_head; >>>> + uint16_t pidx_tail; >>>> + uint16_t cidx; >>>> + uint16_t flags; >>>> + }; >>>> + uint64_t state; >>>> +}; >>>> + >>>> +enum { >>>> + IDLE = 0, /* consumer ran to completion, nothing >>>> more to do. >>>> */ >>>> + BUSY, /* consumer is running already, or will >>>> be shortly. >>>> */ >>>> + STALLED, /* consumer stopped due to lack of >>>> resources. */ >>>> + ABDICATED, /* consumer stopped even though there >>>> was work to >>>> be >>>> + done because it wants another thread >>>> to take >>>> over. */ >>>> +}; >>>> + >>>> +static inline uint16_t >>>> +space_available(struct mp_ring *r, union ring_state s) >>>> +{ >>>> + uint16_t x = r->size - 1; >>>> + >>>> + if (s.cidx == s.pidx_head) >>>> + return (x); >>>> + else if (s.cidx > s.pidx_head) >>>> + return (s.cidx - s.pidx_head - 1); >>>> + else >>>> + return (x - s.pidx_head + s.cidx); >>>> +} >>>> + >>>> +static inline uint16_t >>>> +increment_idx(struct mp_ring *r, uint16_t idx, uint16_t n) >>>> +{ >>>> + int x = r->size - idx; >>>> + >>>> + MPASS(x > 0); >>>> + return (x > n ? idx + n : n - x); >>>> +} >>>> + >>>> +/* Consumer is about to update the ring's state to s */ >>>> +static inline uint16_t >>>> +state_to_flags(union ring_state s, int abdicate) >>>> +{ >>>> + >>>> + if (s.cidx == s.pidx_tail) >>>> + return (IDLE); >>>> + else if (abdicate && s.pidx_tail != s.pidx_head) >>>> + return (ABDICATED); >>>> + >>>> + return (BUSY); >>>> +} >>>> + >>>> +/* >>>> + * Caller passes in a state, with a guarantee that there is >>>> work to do and >>>> that >>>> + * all items up to the pidx_tail in the state are visible. >>>> + */ >>>> +static void >>>> +drain_ring(struct mp_ring *r, union ring_state os, uint16_t >>>> prev, int >>>> budget) >>>> +{ >>>> + union ring_state ns; >>>> + int n, pending, total; >>>> + uint16_t cidx = os.cidx; >>>> + uint16_t pidx = os.pidx_tail; >>>> + >>>> + MPASS(os.flags == BUSY); >>>> + MPASS(cidx != pidx); >>>> + >>>> + if (prev == IDLE) >>>> + counter_u64_add(r->starts, 1); >>>> + pending = 0; >>>> + total = 0; >>>> + >>>> + while (cidx != pidx) { >>>> + >>>> + /* Items from cidx to pidx are available for >>>> consumption. * >>>> / >>>> + n = r->drain(r, cidx, pidx); >>>> + if (n == 0) { >>>> + critical_enter(); >>>> + do { >>>> + os.state = ns.state = r->state; >>>> + ns.cidx = cidx; >>>> + ns.flags = STALLED; >>>> + } while (atomic_cmpset_64(&r->state, >>>> os.state, >>>> + ns.state) == 0); >>>> + critical_exit(); >>>> + if (prev != STALLED) >>>> + counter_u64_add(r->stalls, 1); >>>> + else if (total > 0) { >>>> + counter_u64_add(r->restarts, 1); >>>> + counter_u64_add(r->stalls, 1); >>>> + } >>>> + break; >>>> + } >>>> + cidx = increment_idx(r, cidx, n); >>>> + pending += n; >>>> + total += n; >>>> + >>>> + /* >>>> + * We update the cidx only if we've caught up >>>> with the >>>> pidx, the >>>> + * real cidx is getting too far ahead of the one >>>> visible to >>>> + * everyone else, or we have exceeded our budget. >>>> + */ >>>> + if (cidx != pidx && pending < 64 && total < >>>> budget) >>>> + continue; >>>> + critical_enter(); >>>> + do { >>>> + os.state = ns.state = r->state; >>>> + ns.cidx = cidx; >>>> + ns.flags = state_to_flags(ns, total >= >>>> budget); >>>> + } while (atomic_cmpset_acq_64(&r->state, >>>> os.state, >>>> ns.state) == 0); >>>> + critical_exit(); >>>> + >>>> + if (ns.flags == ABDICATED) >>>> + counter_u64_add(r->abdications, 1); >>>> + if (ns.flags != BUSY) { >>>> + /* Wrong loop exit if we're going to >>>> stall. */ >>>> + MPASS(ns.flags != STALLED); >>>> + if (prev == STALLED) { >>>> + MPASS(total > 0); >>>> + counter_u64_add(r->restarts, 1); >>>> + } >>>> + break; >>>> + } >>>> + >>>> + /* >>>> + * The acquire style atomic above guarantees >>>> visibility of >>>> items >>>> + * associated with any pidx change that we >>>> notice here. >>>> + */ >>>> + pidx = ns.pidx_tail; >>>> + pending = 0; >>>> + } >>>> +} >>>> + >>>> +int >>>> +mp_ring_alloc(struct mp_ring **pr, int size, void *cookie, >>>> ring_drain_t >>>> drain, >>>> + ring_can_drain_t can_drain, struct malloc_type *mt, int >>>> flags) >>>> +{ >>>> + struct mp_ring *r; >>>> + >>>> + /* All idx are 16b so size can be 65536 at most */ >>>> + if (pr == NULL || size < 2 || size > 65536 || drain == >>>> NULL || >>>> + can_drain == NULL) >>>> + return (EINVAL); >>>> + *pr = NULL; >>>> + flags &= M_NOWAIT | M_WAITOK; >>>> + MPASS(flags != 0); >>>> + >>>> + r = malloc(__offsetof(struct mp_ring, items[size]), mt, >>>> flags | >>>> M_ZERO); >>>> + if (r == NULL) >>>> + return (ENOMEM); >>>> + r->size = size; >>>> + r->cookie = cookie; >>>> + r->mt = mt; >>>> + r->drain = drain; >>>> + r->can_drain = can_drain; >>>> + r->enqueues = counter_u64_alloc(flags); >>>> + r->drops = counter_u64_alloc(flags); >>>> + r->starts = counter_u64_alloc(flags); >>>> + r->stalls = counter_u64_alloc(flags); >>>> + r->restarts = counter_u64_alloc(flags); >>>> + r->abdications = counter_u64_alloc(flags); >>>> + if (r->enqueues == NULL || r->drops == NULL || r->starts >>>> == NULL || >>>> + r->stalls == NULL || r->restarts == NULL || >>>> + r->abdications == NULL) { >>>> + mp_ring_free(r); >>>> + return (ENOMEM); >>>> + } >>>> + >>>> + *pr = r; >>>> + return (0); >>>> +} >>>> + >>>> +void >>>> + >>>> +mp_ring_free(struct mp_ring *r) >>>> +{ >>>> + >>>> + if (r == NULL) >>>> + return; >>>> + >>>> + if (r->enqueues != NULL) >>>> + counter_u64_free(r->enqueues); >>>> + if (r->drops != NULL) >>>> + counter_u64_free(r->drops); >>>> + if (r->starts != NULL) >>>> + counter_u64_free(r->starts); >>>> + if (r->stalls != NULL) >>>> + counter_u64_free(r->stalls); >>>> + if (r->restarts != NULL) >>>> + counter_u64_free(r->restarts); >>>> + if (r->abdications != NULL) >>>> + counter_u64_free(r->abdications); >>>> + >>>> + free(r, r->mt); >>>> +} >>>> + >>>> +/* >>>> + * Enqueue n items and maybe drain the ring for some time. >>>> + * >>>> + * Returns an errno. >>>> + */ >>>> +int >>>> +mp_ring_enqueue(struct mp_ring *r, void **items, int n, int >>>> budget) >>>> +{ >>>> + union ring_state os, ns; >>>> + uint16_t pidx_start, pidx_stop; >>>> + int i; >>>> + >>>> + MPASS(items != NULL); >>>> + MPASS(n > 0); >>>> + >>>> >>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> -----------------------------------------+------------------------------- >>>> >>>> >>>> Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. >>>> dell'Informazione >>>> http://www.iet.unipi.it/~luigi/ . Universita` di Pisa >>>> TEL +39-050-2211611 . via Diotisalvi 2 >>>> Mobile +39-338-6809875 . 56122 PISA (Italy) >>>> -----------------------------------------+------------------------------- >>>> >>>> >> > > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:06:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 997E9871; Wed, 21 Jan 2015 01:06:05 +0000 (UTC) Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com [IPv6:2607:f8b0:400e:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1C9976; Wed, 21 Jan 2015 01:06:05 +0000 (UTC) Received: by mail-pd0-f175.google.com with SMTP id fl12so13419584pdb.6; Tue, 20 Jan 2015 17:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=E1vUNFCsp0k7+y5juK4Pa4/MdXQIrzdiGaFADLGv8YQ=; b=N09TYSbJI7P1WB+NpnHDJD9SUJfuxz8DV9Pm0LLwcJuGQgjpXWjPkWUTk2Sm7qjib9 jbUBMRud3r4HScLwiw2wkJ+UpoVDiACpN6jMSNNHVw2ko1RtNmdz1P2+zOWqQ9kISDUO Zl8yhGNkWmlarZIAf9b/uD7qkdq7UVD5LTGQJnHdwivbjLAmn7UkWZhQSrPQET/5MGI7 YH9Dqjf2OxdW6xDJNJoH5fNU/PQN5KQFpYMoVFKl3kwgITNwb/PK8k281yXQO1Ier7/g gQw/cdHcUKjWp7Lz6AYXtQp+XKpMu4D9qY6JYKdOVCYt8cCGJ8z/oykeJfDX2h3ElDZc AQzQ== X-Received: by 10.69.26.130 with SMTP id iy2mr58462302pbd.93.1421802364906; Tue, 20 Jan 2015 17:06:04 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id gk2sm4130386pbc.14.2015.01.20.17.06.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 17:06:03 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54BEFB79.6090806@FreeBSD.org> Date: Tue, 20 Jan 2015 17:06:01 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pedro Giffuni , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> In-Reply-To: <54BEF7CF.9030505@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:06:05 -0000 On 01/20/15 16:50, Pedro Giffuni wrote: > > On 01/20/15 18:21, Navdeep Parhar wrote: >> The problem reported by Luigi has been fixed in r277225 already. >> >> Regards, >> Navdeep >> > > But the fix is rather ugly, isn't it? I would personally prefer to just > kill the older > gcc but in the meantime updating it so that it behaves like the updated > gcc/clang would be better. IMHO. I'm not sure why you think the fix is ugly. Modifying the base compiler to deal with minor stuff like this seems excessive and I never even considered that. Regards, Navdeep > > Pedro. > >> On 01/20/15 15:10, Pedro Giffuni wrote: >>> Hi; >>> >>> I got this patch from the OpenBSD-tech list[1]. >>> Perhaps this fixes the gcc issue? >>> >>> Apparently it's required for mesa too. >>> >>> Pedro. >>> >>> [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 >>> >>> On 01/06/15 15:33, Navdeep Parhar wrote: >>>> On Tue, Jan 06, 2015 at 07:58:34PM +0100, Luigi Rizzo wrote: >>>>> >>>>> On Thu, Jan 1, 2015 at 12:19 AM, Navdeep Parhar >>>>> wrote: >>>>> >>>>> Author: np >>>>> Date: Wed Dec 31 23:19:16 2014 >>>>> New Revision: 276485 >>>>> URL: https://svnweb.freebsd.org/changeset/base/276485 >>>>> >>>>> Log: >>>>> cxgbe(4): major tx rework. >>>>> >>>>> >>>>> FYI, this commit has some unnamed unions (eg. in t4_mp_ring.c) >>>>> which prevent the kernel from compiling with our stock gcc >>>>> and its standard kernel build flags (specifically -std=...). >>>>> >>>>> Adding the following in the kernel config >>>>> >>>>> makeoptions COPTFLAGS="-fms-extensions" >>>>> >>>>> seems to do the job >>>>> >>>>> I know it is unavoidable that we'll end up with gcc not working, >>>>> but maybe we can still avoid unnamed unions. >>>> There are two unresolved issues with mp_ring and I had to make the >>>> driver amd64-only while I consider my options. >>>> >>>> - platforms where gcc is the default (and our version has problems with >>>> unnamed unions). This is simple to fix but reduces the >>>> readability of >>>> the code. But sure, if building head with gcc is popular then that >>>> trumps readability. I wonder if adding -fms-extensions just to the >>>> driver's build flags would be an acceptable compromise. >>>> - platforms without the acq/rel versions of 64b cmpset. I think it >>>> would be simple to add acq/rel variants to i386/pc98 and others that >>>> already have 64b cmpset. The driver will be permanently unplugged >>>> from >>>> whatever remains (only 32 bit powerpc I think). >>>> >>>> I'll try to sort all this out within the next couple of weeks. >>>> >>>> Regards, >>>> Navdeep >>>> >>>>> cheers >>>>> luigi >>>>> >>>>> >>>>> a) Front load as much work as possible in if_transmit, before >>>>> any driver >>>>> lock or software queue has to get involved. >>>>> >>>>> b) Replace buf_ring with a brand new mp_ring (multiproducer >>>>> ring). This >>>>> is specifically for the tx multiqueue model where one of the >>>>> if_transmit >>>>> producer threads becomes the consumer and other producers >>>>> carry on as >>>>> usual. mp_ring is implemented as standalone code and it >>>>> should be >>>>> possible to use it in any driver with tx multiqueue. It also >>>>> has: >>>>> - the ability to enqueue/dequeue multiple items. This might >>>>> become >>>>> significant if packet batching is ever implemented. >>>>> - an abdication mechanism to allow a thread to give up >>>>> writing tx >>>>> descriptors and have another if_transmit thread take over. >>>>> A thread >>>>> that's writing tx descriptors can end up doing so for an >>>>> unbounded >>>>> time period if a) there are other if_transmit threads >>>>> continuously >>>>> feeding the sofware queue, and b) the chip keeps up with >>>>> whatever the >>>>> thread is throwing at it. >>>>> - accurate statistics about interesting events even when the >>>>> stats come >>>>> at the expense of additional branches/conditional code. >>>>> >>>>> The NIC txq lock is uncontested on the fast path at this >>>>> point. I've >>>>> left it there for synchronization with the control events >>>>> (interface >>>>> up/down, modload/unload). >>>>> >>>>> c) Add support for "type 1" coalescing work request in the >>>>> normal NIC tx >>>>> path. This work request is optimized for frames with a single >>>>> item in >>>>> the DMA gather list. These are very common when forwarding >>>>> packets. >>>>> Note that netmap tx in cxgbe already uses these "type 1" work >>>>> requests. >>>>> >>>>> d) Do not request automatic cidx updates every 32 >>>>> descriptors. Instead, >>>>> request updates via bits in individual work requests (still >>>>> every 32 >>>>> descriptors approximately). Also, request an automatic final >>>>> update >>>>> when the queue idles after activity. This means NIC tx >>>>> reclaim is still >>>>> performed lazily but it will catch up quickly as soon as the >>>>> queue >>>>> idles. This seems to be the best middle ground and I'll >>>>> probably do >>>>> something similar for netmap tx as well. >>>>> >>>>> e) Implement a faster tx path for WRQs (used by TOE tx and >>>>> control >>>>> queues, _not_ by the normal NIC tx). Allow work requests to >>>>> be written >>>>> directly to the hardware descriptor ring if room is >>>>> available. I will >>>>> convert t4_tom and iw_cxgbe modules to this faster style >>>>> gradually. >>>>> >>>>> MFC after: 2 months >>>>> >>>>> Added: >>>>> head/sys/dev/cxgbe/t4_mp_ring.c (contents, props changed) >>>>> head/sys/dev/cxgbe/t4_mp_ring.h (contents, props changed) >>>>> Modified: >>>>> head/sys/conf/files >>>>> head/sys/dev/cxgbe/adapter.h >>>>> head/sys/dev/cxgbe/t4_l2t.c >>>>> head/sys/dev/cxgbe/t4_main.c >>>>> head/sys/dev/cxgbe/t4_sge.c >>>>> head/sys/modules/cxgbe/if_cxgbe/Makefile >>>>> >>>>> Modified: head/sys/conf/files >>>>> >>>>> =========================================================================== >>>>> >>>>> >>>>> === >>>>> --- head/sys/conf/files Wed Dec 31 22:52:43 2014 (r276484) >>>>> +++ head/sys/conf/files Wed Dec 31 23:19:16 2014 (r276485) >>>>> @@ -1142,6 +1142,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p >>>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>>> dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ >>>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>>> +dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ >>>>> + compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>>> dev/cxgbe/t4_main.c optional cxgbe pci \ >>>>> compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>>> dev/cxgbe/t4_netmap.c optional cxgbe pci \ >>>>> >>>>> Modified: head/sys/dev/cxgbe/adapter.h >>>>> >>>>> =========================================================================== >>>>> >>>>> >>>>> === >>>>> --- head/sys/dev/cxgbe/adapter.h Wed Dec 31 22:52:43 2014 >>>>> (r276484) >>>>> +++ head/sys/dev/cxgbe/adapter.h Wed Dec 31 23:19:16 2014 >>>>> (r276485) >>>>> @@ -152,7 +152,8 @@ enum { >>>>> CL_METADATA_SIZE = CACHE_LINE_SIZE, >>>>> >>>>> SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR >>>>> size in >>>>> desc */ >>>>> - TX_SGL_SEGS = 36, >>>>> + TX_SGL_SEGS = 39, >>>>> + TX_SGL_SEGS_TSO = 38, >>>>> TX_WR_FLITS = SGE_MAX_WR_LEN / 8 >>>>> }; >>>>> >>>>> @@ -273,6 +274,7 @@ struct port_info { >>>>> struct timeval last_refreshed; >>>>> struct port_stats stats; >>>>> u_int tnl_cong_drops; >>>>> + u_int tx_parse_error; >>>>> >>>>> eventhandler_tag vlan_c; >>>>> >>>>> @@ -308,23 +310,9 @@ struct tx_desc { >>>>> __be64 flit[8]; >>>>> }; >>>>> >>>>> -struct tx_map { >>>>> - struct mbuf *m; >>>>> - bus_dmamap_t map; >>>>> -}; >>>>> - >>>>> -/* DMA maps used for tx */ >>>>> -struct tx_maps { >>>>> - struct tx_map *maps; >>>>> - uint32_t map_total; /* # of DMA maps */ >>>>> - uint32_t map_pidx; /* next map to be used */ >>>>> - uint32_t map_cidx; /* reclaimed up to this index */ >>>>> - uint32_t map_avail; /* # of available maps */ >>>>> -}; >>>>> - >>>>> struct tx_sdesc { >>>>> + struct mbuf *m; /* m_nextpkt linked chain of >>>>> frames */ >>>>> uint8_t desc_used; /* # of hardware descriptors >>>>> used by the WR >>>>> */ >>>>> - uint8_t credits; /* NIC txq: # of frames sent out >>>>> in the WR >>>>> */ >>>>> }; >>>>> >>>>> >>>>> @@ -378,16 +366,12 @@ struct sge_iq { >>>>> enum { >>>>> EQ_CTRL = 1, >>>>> EQ_ETH = 2, >>>>> -#ifdef TCP_OFFLOAD >>>>> EQ_OFLD = 3, >>>>> -#endif >>>>> >>>>> /* eq flags */ >>>>> - EQ_TYPEMASK = 7, /* 3 lsbits hold the >>>>> type */ >>>>> - EQ_ALLOCATED = (1 << 3), /* firmware resources >>>>> allocated */ >>>>> - EQ_DOOMED = (1 << 4), /* about to be >>>>> destroyed */ >>>>> - EQ_CRFLUSHED = (1 << 5), /* expecting an update >>>>> from SGE */ >>>>> - EQ_STALLED = (1 << 6), /* out of hw descriptors >>>>> or dmamaps >>>>> */ >>>>> + EQ_TYPEMASK = 0x3, /* 2 lsbits hold the >>>>> type (see >>>>> above) */ >>>>> + EQ_ALLOCATED = (1 << 2), /* firmware resources >>>>> allocated */ >>>>> + EQ_ENABLED = (1 << 3), /* open for business */ >>>>> }; >>>>> >>>>> /* Listed in order of preference. Update t4_sysctls too if you >>>>> change >>>>> these */ >>>>> @@ -402,32 +386,25 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB >>>>> struct sge_eq { >>>>> unsigned int flags; /* MUST be first */ >>>>> unsigned int cntxt_id; /* SGE context id for the eq */ >>>>> - bus_dma_tag_t desc_tag; >>>>> - bus_dmamap_t desc_map; >>>>> - char lockname[16]; >>>>> struct mtx eq_lock; >>>>> >>>>> struct tx_desc *desc; /* KVA of descriptor ring */ >>>>> - bus_addr_t ba; /* bus address of descriptor >>>>> ring */ >>>>> - struct sge_qstat *spg; /* status page, for >>>>> convenience */ >>>>> uint16_t doorbells; >>>>> volatile uint32_t *udb; /* KVA of doorbell (lies within >>>>> BAR2) */ >>>>> u_int udb_qid; /* relative qid within the >>>>> doorbell page */ >>>>> - uint16_t cap; /* max # of desc, for >>>>> convenience */ >>>>> - uint16_t avail; /* available descriptors, for >>>>> convenience * >>>>> / >>>>> - uint16_t qsize; /* size (# of entries) of the >>>>> queue */ >>>>> + uint16_t sidx; /* index of the entry with the >>>>> status page >>>>> */ >>>>> uint16_t cidx; /* consumer idx (desc idx) */ >>>>> uint16_t pidx; /* producer idx (desc idx) */ >>>>> - uint16_t pending; /* # of descriptors used since >>>>> last >>>>> doorbell */ >>>>> + uint16_t equeqidx; /* EQUEQ last requested at this >>>>> pidx */ >>>>> + uint16_t dbidx; /* pidx of the most recent >>>>> doorbell */ >>>>> uint16_t iqid; /* iq that gets egr_update for >>>>> the eq */ >>>>> uint8_t tx_chan; /* tx channel used by the eq */ >>>>> - struct task tx_task; >>>>> - struct callout tx_callout; >>>>> + volatile u_int equiq; /* EQUIQ outstanding */ >>>>> >>>>> - /* stats */ >>>>> - >>>>> - uint32_t egr_update; /* # of SGE_EGR_UPDATE >>>>> notifications for eq >>>>> */ >>>>> - uint32_t unstalled; /* recovered from stall */ >>>>> + bus_dma_tag_t desc_tag; >>>>> + bus_dmamap_t desc_map; >>>>> + bus_addr_t ba; /* bus address of descriptor >>>>> ring */ >>>>> + char lockname[16]; >>>>> }; >>>>> >>>>> struct sw_zone_info { >>>>> @@ -499,18 +476,19 @@ struct sge_fl { >>>>> struct cluster_layout cll_alt; /* alternate refill >>>>> zone, layout */ >>>>> }; >>>>> >>>>> +struct mp_ring; >>>>> + >>>>> /* txq: SGE egress queue + what's needed for Ethernet NIC */ >>>>> struct sge_txq { >>>>> struct sge_eq eq; /* MUST be first */ >>>>> >>>>> struct ifnet *ifp; /* the interface this txq >>>>> belongs to */ >>>>> - bus_dma_tag_t tx_tag; /* tag for transmit buffers */ >>>>> - struct buf_ring *br; /* tx buffer ring */ >>>>> + struct mp_ring *r; /* tx software ring */ >>>>> struct tx_sdesc *sdesc; /* KVA of software descriptor >>>>> ring */ >>>>> - struct mbuf *m; /* held up due to temporary >>>>> resource >>>>> shortage */ >>>>> - >>>>> - struct tx_maps txmaps; >>>>> + struct sglist *gl; >>>>> + __be32 cpl_ctrl0; /* for convenience */ >>>>> >>>>> + struct task tx_reclaim_task; >>>>> /* stats for common events first */ >>>>> >>>>> uint64_t txcsum; /* # of times hardware assisted >>>>> with >>>>> checksum */ >>>>> @@ -519,13 +497,12 @@ struct sge_txq { >>>>> uint64_t imm_wrs; /* # of work requests with >>>>> immediate data * >>>>> / >>>>> uint64_t sgl_wrs; /* # of work requests with >>>>> direct SGL */ >>>>> uint64_t txpkt_wrs; /* # of txpkt work requests (not >>>>> coalesced) >>>>> */ >>>>> - uint64_t txpkts_wrs; /* # of coalesced tx work >>>>> requests */ >>>>> - uint64_t txpkts_pkts; /* # of frames in coalesced tx >>>>> work >>>>> requests */ >>>>> + uint64_t txpkts0_wrs; /* # of type0 coalesced tx work >>>>> requests */ >>>>> + uint64_t txpkts1_wrs; /* # of type1 coalesced tx work >>>>> requests */ >>>>> + uint64_t txpkts0_pkts; /* # of frames in type0 >>>>> coalesced tx WRs */ >>>>> + uint64_t txpkts1_pkts; /* # of frames in type1 >>>>> coalesced tx WRs */ >>>>> >>>>> /* stats for not-that-common events */ >>>>> - >>>>> - uint32_t no_dmamap; /* no DMA map to load the mbuf */ >>>>> - uint32_t no_desc; /* out of hardware descriptors */ >>>>> } __aligned(CACHE_LINE_SIZE); >>>>> >>>>> /* rxq: SGE ingress queue + SGE free list + miscellaneous >>>>> items */ >>>>> @@ -574,7 +551,13 @@ struct wrqe { >>>>> STAILQ_ENTRY(wrqe) link; >>>>> struct sge_wrq *wrq; >>>>> int wr_len; >>>>> - uint64_t wr[] __aligned(16); >>>>> + char wr[] __aligned(16); >>>>> +}; >>>>> + >>>>> +struct wrq_cookie { >>>>> + TAILQ_ENTRY(wrq_cookie) link; >>>>> + int ndesc; >>>>> + int pidx; >>>>> }; >>>>> >>>>> /* >>>>> @@ -585,17 +568,32 @@ struct sge_wrq { >>>>> struct sge_eq eq; /* MUST be first */ >>>>> >>>>> struct adapter *adapter; >>>>> + struct task wrq_tx_task; >>>>> + >>>>> + /* Tx desc reserved but WR not "committed" yet. */ >>>>> + TAILQ_HEAD(wrq_incomplete_wrs , wrq_cookie) >>>>> incomplete_wrs; >>>>> >>>>> - /* List of WRs held up due to lack of tx descriptors */ >>>>> + /* List of WRs ready to go out as soon as descriptors are >>>>> available. */ >>>>> STAILQ_HEAD(, wrqe) wr_list; >>>>> + u_int nwr_pending; >>>>> + u_int ndesc_needed; >>>>> >>>>> /* stats for common events first */ >>>>> >>>>> - uint64_t tx_wrs; /* # of tx work requests */ >>>>> + uint64_t tx_wrs_direct; /* # of WRs written directly to >>>>> desc ring. >>>>> */ >>>>> + uint64_t tx_wrs_ss; /* # of WRs copied from scratch >>>>> space. */ >>>>> + uint64_t tx_wrs_copied; /* # of WRs queued and copied to >>>>> desc ring. >>>>> */ >>>>> >>>>> /* stats for not-that-common events */ >>>>> >>>>> - uint32_t no_desc; /* out of hardware descriptors */ >>>>> + /* >>>>> + * Scratch space for work requests that wrap around >>>>> after reaching >>>>> the >>>>> + * status page, and some infomation about the last WR >>>>> that used it. >>>>> + */ >>>>> + uint16_t ss_pidx; >>>>> + uint16_t ss_len; >>>>> + uint8_t ss[SGE_MAX_WR_LEN]; >>>>> + >>>>> } __aligned(CACHE_LINE_SIZE); >>>>> >>>>> >>>>> @@ -744,7 +742,7 @@ struct adapter { >>>>> struct sge sge; >>>>> int lro_timeout; >>>>> >>>>> - struct taskqueue *tq[NCHAN]; /* taskqueues that flush >>>>> data out * >>>>> / >>>>> + struct taskqueue *tq[NCHAN]; /* General purpose >>>>> taskqueues */ >>>>> struct port_info *port[MAX_NPORTS]; >>>>> uint8_t chan_map[NCHAN]; >>>>> >>>>> @@ -978,12 +976,11 @@ static inline int >>>>> tx_resume_threshold(struct sge_eq *eq) >>>>> { >>>>> >>>>> - return (eq->qsize / 4); >>>>> + /* not quite the same as qsize / 4, but this will do. */ >>>>> + return (eq->sidx / 4); >>>>> } >>>>> >>>>> /* t4_main.c */ >>>>> -void t4_tx_task(void *, int); >>>>> -void t4_tx_callout(void *); >>>>> int t4_os_find_pci_capability(struct adapter *, int); >>>>> int t4_os_pci_save_state(struct adapter *); >>>>> int t4_os_pci_restore_state(struct adapter *); >>>>> @@ -1024,16 +1021,15 @@ int t4_setup_adapter_queues(struct adapt >>>>> int t4_teardown_adapter_queues(struct adapter *); >>>>> int t4_setup_port_queues(struct port_info *); >>>>> int t4_teardown_port_queues(struct port_info *); >>>>> -int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); >>>>> -void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); >>>>> void t4_intr_all(void *); >>>>> void t4_intr(void *); >>>>> void t4_intr_err(void *); >>>>> void t4_intr_evt(void *); >>>>> void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, >>>>> struct wrqe *); >>>>> -int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); >>>>> void t4_update_fl_bufsize(struct ifnet *); >>>>> -int can_resume_tx(struct sge_eq *); >>>>> +int parse_pkt(struct mbuf **); >>>>> +void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); >>>>> +void commit_wrq_wr(struct sge_wrq *, void *, struct >>>>> wrq_cookie *); >>>>> >>>>> /* t4_tracer.c */ >>>>> struct t4_tracer; >>>>> >>>>> Modified: head/sys/dev/cxgbe/t4_l2t.c >>>>> >>>>> =========================================================================== >>>>> >>>>> >>>>> === >>>>> --- head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 22:52:43 2014 >>>>> (r276484) >>>>> +++ head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 23:19:16 2014 >>>>> (r276485) >>>>> @@ -113,16 +113,15 @@ found: >>>>> int >>>>> t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync) >>>>> { >>>>> - struct wrqe *wr; >>>>> + struct wrq_cookie cookie; >>>>> struct cpl_l2t_write_req *req; >>>>> int idx = e->idx + sc->vres.l2t.start; >>>>> >>>>> mtx_assert(&e->lock, MA_OWNED); >>>>> >>>>> - wr = alloc_wrqe(sizeof(*req), &sc->sge.mgmtq); >>>>> - if (wr == NULL) >>>>> + req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), >>>>> 16), & >>>>> cookie); >>>>> + if (req == NULL) >>>>> return (ENOMEM); >>>>> - req = wrtod(wr); >>>>> >>>>> INIT_TP_WR(req, 0); >>>>> OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, >>>>> idx | >>>>> @@ -132,7 +131,7 @@ t4_write_l2e(struct adapter *sc, struct >>>>> req->vlan = htons(e->vlan); >>>>> memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); >>>>> >>>>> - t4_wrq_tx(sc, wr); >>>>> + commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); >>>>> >>>>> if (sync && e->state != L2T_STATE_SWITCHING) >>>>> e->state = L2T_STATE_SYNC_WRITE; >>>>> >>>>> Modified: head/sys/dev/cxgbe/t4_main.c >>>>> >>>>> =========================================================================== >>>>> >>>>> >>>>> === >>>>> --- head/sys/dev/cxgbe/t4_main.c Wed Dec 31 22:52:43 2014 >>>>> (r276484) >>>>> +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 31 23:19:16 2014 >>>>> (r276485) >>>>> @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); >>>>> #include "common/t4_regs_values.h" >>>>> #include "t4_ioctl.h" >>>>> #include "t4_l2t.h" >>>>> +#include "t4_mp_ring.h" >>>>> >>>>> /* T4 bus driver interface */ >>>>> static int t4_probe(device_t); >>>>> @@ -378,7 +379,8 @@ static void build_medialist(struct port_ >>>>> static int cxgbe_init_synchronized(struct port_info *); >>>>> static int cxgbe_uninit_synchronized(struct port_info *); >>>>> static int setup_intr_handlers(struct adapter *); >>>>> -static void quiesce_eq(struct adapter *, struct sge_eq *); >>>>> +static void quiesce_txq(struct adapter *, struct sge_txq *); >>>>> +static void quiesce_wrq(struct adapter *, struct sge_wrq *); >>>>> static void quiesce_iq(struct adapter *, struct sge_iq *); >>>>> static void quiesce_fl(struct adapter *, struct sge_fl *); >>>>> static int t4_alloc_irq(struct adapter *, struct irq *, int rid, >>>>> @@ -434,7 +436,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER >>>>> static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); >>>>> static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); >>>>> #endif >>>>> -static inline void txq_start(struct ifnet *, struct sge_txq *); >>>>> static uint32_t fconf_to_mode(uint32_t); >>>>> static uint32_t mode_to_fconf(uint32_t); >>>>> static uint32_t fspec_to_fconf(struct t4_filter_specification >>>>> *); >>>>> @@ -1429,67 +1430,36 @@ cxgbe_transmit(struct ifnet *ifp, struct >>>>> { >>>>> struct port_info *pi = ifp->if_softc; >>>>> struct adapter *sc = pi->adapter; >>>>> - struct sge_txq *txq = &sc->sge.txq[pi->first_txq]; >>>>> - struct buf_ring *br; >>>>> + struct sge_txq *txq; >>>>> + void *items[1]; >>>>> int rc; >>>>> >>>>> M_ASSERTPKTHDR(m); >>>>> + MPASS(m->m_nextpkt == NULL); /* not quite ready for >>>>> this yet */ >>>>> >>>>> if (__predict_false(pi->link_cfg.link_ok == 0)) { >>>>> m_freem(m); >>>>> return (ENETDOWN); >>>>> } >>>>> >>>>> - /* check if flowid is set */ >>>>> - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>>> - txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>>> rsrv_noflowq)) >>>>> - + pi->rsrv_noflowq); >>>>> - br = txq->br; >>>>> - >>>>> - if (TXQ_TRYLOCK(txq) == 0) { >>>>> - struct sge_eq *eq = &txq->eq; >>>>> - >>>>> - /* >>>>> - * It is possible that t4_eth_tx finishes up and >>>>> releases >>>>> the >>>>> - * lock between the TRYLOCK above and the >>>>> drbr_enqueue >>>>> here. We >>>>> - * need to make sure that this mbuf doesn't just >>>>> sit there >>>>> in >>>>> - * the drbr. >>>>> - */ >>>>> - >>>>> - rc = drbr_enqueue(ifp, br, m); >>>>> - if (rc == 0 && callout_pending(&eq->tx_callout) >>>>> == 0 && >>>>> - !(eq->flags & EQ_DOOMED)) >>>>> - callout_reset(&eq->tx_callout, 1, >>>>> t4_tx_callout, >>>>> eq); >>>>> + rc = parse_pkt(&m); >>>>> + if (__predict_false(rc != 0)) { >>>>> + MPASS(m == NULL); /* was >>>>> freed >>>>> already */ >>>>> + atomic_add_int(&pi->tx_parse_error, 1); /* rare, >>>>> atomic is >>>>> ok */ >>>>> return (rc); >>>>> } >>>>> >>>>> - /* >>>>> - * txq->m is the mbuf that is held up due to a temporary >>>>> shortage >>>>> of >>>>> - * resources and it should be put on the wire first. >>>>> Then what's >>>>> in >>>>> - * drbr and finally the mbuf that was just passed in >>>>> to us. >>>>> - * >>>>> - * Return code should indicate the fate of the mbuf that >>>>> was passed >>>>> in >>>>> - * this time. >>>>> - */ >>>>> - >>>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>>> - if (drbr_needs_enqueue(ifp, br) || txq->m) { >>>>> - >>>>> - /* Queued for transmission. */ >>>>> - >>>>> - rc = drbr_enqueue(ifp, br, m); >>>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>>> - (void) t4_eth_tx(ifp, txq, m); >>>>> - TXQ_UNLOCK(txq); >>>>> - return (rc); >>>>> - } >>>>> + /* Select a txq. */ >>>>> + txq = &sc->sge.txq[pi->first_txq]; >>>>> + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>>> + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>>> rsrv_noflowq)) + >>>>> + pi->rsrv_noflowq); >>>>> >>>>> - /* Direct transmission. */ >>>>> - rc = t4_eth_tx(ifp, txq, m); >>>>> - if (rc != 0 && txq->m) >>>>> - rc = 0; /* held, will be transmitted soon >>>>> (hopefully) */ >>>>> + items[0] = m; >>>>> + rc = mp_ring_enqueue(txq->r, items, 1, 4096); >>>>> + if (__predict_false(rc != 0)) >>>>> + m_freem(m); >>>>> >>>>> - TXQ_UNLOCK(txq); >>>>> return (rc); >>>>> } >>>>> >>>>> @@ -1499,17 +1469,17 @@ cxgbe_qflush(struct ifnet *ifp) >>>>> struct port_info *pi = ifp->if_softc; >>>>> struct sge_txq *txq; >>>>> int i; >>>>> - struct mbuf *m; >>>>> >>>>> /* queues do not exist if !PORT_INIT_DONE. */ >>>>> if (pi->flags & PORT_INIT_DONE) { >>>>> for_each_txq(pi, i, txq) { >>>>> TXQ_LOCK(txq); >>>>> - m_freem(txq->m); >>>>> - txq->m = NULL; >>>>> - while ((m = >>>>> buf_ring_dequeue_sc(txq->br)) != NULL) >>>>> - m_freem(m); >>>>> + txq->eq.flags &= ~EQ_ENABLED; >>>>> TXQ_UNLOCK(txq); >>>>> + while (!mp_ring_is_idle(txq->r)) { >>>>> + mp_ring_check_drainage(txq->r, 0); >>>>> + pause("qflush", 1); >>>>> + } >>>>> } >>>>> } >>>>> if_qflush(ifp); >>>>> @@ -1564,7 +1534,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift >>>>> struct sge_txq *txq; >>>>> >>>>> for_each_txq(pi, i, txq) >>>>> - drops += txq->br->br_drops; >>>>> + drops += >>>>> counter_u64_fetch(txq->r->drops); >>>>> } >>>>> >>>>> return (drops); >>>>> @@ -3236,7 +3206,8 @@ cxgbe_init_synchronized(struct port_info >>>>> { >>>>> struct adapter *sc = pi->adapter; >>>>> struct ifnet *ifp = pi->ifp; >>>>> - int rc = 0; >>>>> + int rc = 0, i; >>>>> + struct sge_txq *txq; >>>>> >>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>> >>>>> @@ -3265,6 +3236,17 @@ cxgbe_init_synchronized(struct port_info >>>>> } >>>>> >>>>> /* >>>>> + * Can't fail from this point onwards. Review >>>>> cxgbe_uninit_synchronized >>>>> + * if this changes. >>>>> + */ >>>>> + >>>>> + for_each_txq(pi, i, txq) { >>>>> + TXQ_LOCK(txq); >>>>> + txq->eq.flags |= EQ_ENABLED; >>>>> + TXQ_UNLOCK(txq); >>>>> + } >>>>> + >>>>> + /* >>>>> * The first iq of the first port to come up is used for >>>>> tracing. >>>>> */ >>>>> if (sc->traceq < 0) { >>>>> @@ -3297,7 +3279,8 @@ cxgbe_uninit_synchronized(struct port_in >>>>> { >>>>> struct adapter *sc = pi->adapter; >>>>> struct ifnet *ifp = pi->ifp; >>>>> - int rc; >>>>> + int rc, i; >>>>> + struct sge_txq *txq; >>>>> >>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>> >>>>> @@ -3314,6 +3297,12 @@ cxgbe_uninit_synchronized(struct port_in >>>>> return (rc); >>>>> } >>>>> >>>>> + for_each_txq(pi, i, txq) { >>>>> + TXQ_LOCK(txq); >>>>> + txq->eq.flags &= ~EQ_ENABLED; >>>>> + TXQ_UNLOCK(txq); >>>>> + } >>>>> + >>>>> clrbit(&sc->open_device_map, pi->port_id); >>>>> PORT_LOCK(pi); >>>>> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >>>>> @@ -3543,15 +3532,17 @@ port_full_uninit(struct port_info *pi) >>>>> >>>>> if (pi->flags & PORT_INIT_DONE) { >>>>> >>>>> - /* Need to quiesce queues. XXX: ctrl queues? */ >>>>> + /* Need to quiesce queues. */ >>>>> + >>>>> + quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); >>>>> >>>>> for_each_txq(pi, i, txq) { >>>>> - quiesce_eq(sc, &txq->eq); >>>>> + quiesce_txq(sc, txq); >>>>> } >>>>> >>>>> #ifdef TCP_OFFLOAD >>>>> for_each_ofld_txq(pi, i, ofld_txq) { >>>>> - quiesce_eq(sc, &ofld_txq->eq); >>>>> + quiesce_wrq(sc, ofld_txq); >>>>> } >>>>> #endif >>>>> >>>>> @@ -3576,23 +3567,39 @@ port_full_uninit(struct port_info *pi) >>>>> } >>>>> >>>>> static void >>>>> -quiesce_eq(struct adapter *sc, struct sge_eq *eq) >>>>> +quiesce_txq(struct adapter *sc, struct sge_txq *txq) >>>>> { >>>>> - EQ_LOCK(eq); >>>>> - eq->flags |= EQ_DOOMED; >>>>> + struct sge_eq *eq = &txq->eq; >>>>> + struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; >>>>> >>>>> - /* >>>>> - * Wait for the response to a credit flush if one's >>>>> - * pending. >>>>> - */ >>>>> - while (eq->flags & EQ_CRFLUSHED) >>>>> - mtx_sleep(eq, &eq->eq_lock, 0, "crflush", 0); >>>>> - EQ_UNLOCK(eq); >>>>> + (void) sc; /* unused */ >>>>> >>>>> - callout_drain(&eq->tx_callout); /* XXX: iffy */ >>>>> - pause("callout", 10); /* Still iffy */ >>>>> +#ifdef INVARIANTS >>>>> + TXQ_LOCK(txq); >>>>> + MPASS((eq->flags & EQ_ENABLED) == 0); >>>>> + TXQ_UNLOCK(txq); >>>>> +#endif >>>>> >>>>> - taskqueue_drain(sc->tq[eq->tx_chan], &eq->tx_task); >>>>> + /* Wait for the mp_ring to empty. */ >>>>> + while (!mp_ring_is_idle(txq->r)) { >>>>> + mp_ring_check_drainage(txq->r, 0); >>>>> + pause("rquiesce", 1); >>>>> + } >>>>> + >>>>> + /* Then wait for the hardware to finish. */ >>>>> + while (spg->cidx != htobe16(eq->pidx)) >>>>> + pause("equiesce", 1); >>>>> + >>>>> + /* Finally, wait for the driver to reclaim all >>>>> descriptors. */ >>>>> + while (eq->cidx != eq->pidx) >>>>> + pause("dquiesce", 1); >>>>> +} >>>>> + >>>>> +static void >>>>> +quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) >>>>> +{ >>>>> + >>>>> + /* XXXTX */ >>>>> } >>>>> >>>>> static void >>>>> @@ -4892,6 +4899,9 @@ cxgbe_sysctls(struct port_info *pi) >>>>> oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", >>>>> CTLFLAG_RD, >>>>> NULL, "port statistics"); >>>>> children = SYSCTL_CHILDREN(oid); >>>>> + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, >>>>> "tx_parse_error", >>>>> CTLFLAG_RD, >>>>> + &pi->tx_parse_error, 0, >>>>> + "# of tx packets with invalid length or # of >>>>> segments"); >>>>> >>>>> #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ >>>>> SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ >>>>> @@ -6947,74 +6957,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) >>>>> } >>>>> #endif >>>>> >>>>> -static inline void >>>>> -txq_start(struct ifnet *ifp, struct sge_txq *txq) >>>>> -{ >>>>> - struct buf_ring *br; >>>>> - struct mbuf *m; >>>>> - >>>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>>> - >>>>> - br = txq->br; >>>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>>> - if (m) >>>>> - t4_eth_tx(ifp, txq, m); >>>>> -} >>>>> - >>>>> -void >>>>> -t4_tx_callout(void *arg) >>>>> -{ >>>>> - struct sge_eq *eq = arg; >>>>> - struct adapter *sc; >>>>> - >>>>> - if (EQ_TRYLOCK(eq) == 0) >>>>> - goto reschedule; >>>>> - >>>>> - if (eq->flags & EQ_STALLED && !can_resume_tx(eq)) { >>>>> - EQ_UNLOCK(eq); >>>>> -reschedule: >>>>> - if (__predict_true(!(eq->flags && EQ_DOOMED))) >>>>> - callout_schedule(&eq->tx_callout, 1); >>>>> - return; >>>>> - } >>>>> - >>>>> - EQ_LOCK_ASSERT_OWNED(eq); >>>>> - >>>>> - if (__predict_true((eq->flags & EQ_DOOMED) == 0)) { >>>>> - >>>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>>> - struct sge_txq *txq = arg; >>>>> - struct port_info *pi = >>>>> txq->ifp->if_softc; >>>>> - >>>>> - sc = pi->adapter; >>>>> - } else { >>>>> - struct sge_wrq *wrq = arg; >>>>> - >>>>> - sc = wrq->adapter; >>>>> - } >>>>> - >>>>> - taskqueue_enqueue(sc->tq[eq->tx_chan], >>>>> &eq->tx_task); >>>>> - } >>>>> - >>>>> - EQ_UNLOCK(eq); >>>>> -} >>>>> - >>>>> -void >>>>> -t4_tx_task(void *arg, int count) >>>>> -{ >>>>> - struct sge_eq *eq = arg; >>>>> - >>>>> - EQ_LOCK(eq); >>>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>>> - struct sge_txq *txq = arg; >>>>> - txq_start(txq->ifp, txq); >>>>> - } else { >>>>> - struct sge_wrq *wrq = arg; >>>>> - t4_wrq_tx_locked(wrq->adapter, wrq, NULL); >>>>> - } >>>>> - EQ_UNLOCK(eq); >>>>> -} >>>>> - >>>>> static uint32_t >>>>> fconf_to_mode(uint32_t fconf) >>>>> { >>>>> @@ -7452,9 +7394,9 @@ static int >>>>> set_filter_wr(struct adapter *sc, int fidx) >>>>> { >>>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>>> - struct wrqe *wr; >>>>> struct fw_filter_wr *fwr; >>>>> unsigned int ftid; >>>>> + struct wrq_cookie cookie; >>>>> >>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>> >>>>> @@ -7473,12 +7415,10 @@ set_filter_wr(struct adapter *sc, int fi >>>>> >>>>> ftid = sc->tids.ftid_base + fidx; >>>>> >>>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>>> - if (wr == NULL) >>>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>>>> 16), & >>>>> cookie); >>>>> + if (fwr == NULL) >>>>> return (ENOMEM); >>>>> - >>>>> - fwr = wrtod(wr); >>>>> - bzero(fwr, sizeof (*fwr)); >>>>> + bzero(fwr, sizeof(*fwr)); >>>>> >>>>> fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); >>>>> fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); >>>>> @@ -7547,7 +7487,7 @@ set_filter_wr(struct adapter *sc, int fi >>>>> f->pending = 1; >>>>> sc->tids.ftids_in_use++; >>>>> >>>>> - t4_wrq_tx(sc, wr); >>>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>>> return (0); >>>>> } >>>>> >>>>> @@ -7555,22 +7495,21 @@ static int >>>>> del_filter_wr(struct adapter *sc, int fidx) >>>>> { >>>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>>> - struct wrqe *wr; >>>>> struct fw_filter_wr *fwr; >>>>> unsigned int ftid; >>>>> + struct wrq_cookie cookie; >>>>> >>>>> ftid = sc->tids.ftid_base + fidx; >>>>> >>>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>>> - if (wr == NULL) >>>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), >>>>> 16), & >>>>> cookie); >>>>> + if (fwr == NULL) >>>>> return (ENOMEM); >>>>> - fwr = wrtod(wr); >>>>> bzero(fwr, sizeof (*fwr)); >>>>> >>>>> t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id); >>>>> >>>>> f->pending = 1; >>>>> - t4_wrq_tx(sc, wr); >>>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>>> return (0); >>>>> } >>>>> >>>>> @@ -8170,6 +8109,7 @@ t4_ioctl(struct cdev *dev, unsigned long >>>>> >>>>> /* MAC stats */ >>>>> t4_clr_port_stats(sc, pi->tx_chan); >>>>> + pi->tx_parse_error = 0; >>>>> >>>>> if (pi->flags & PORT_INIT_DONE) { >>>>> struct sge_rxq *rxq; >>>>> @@ -8192,24 +8132,24 @@ t4_ioctl(struct cdev *dev, unsigned long >>>>> txq->imm_wrs = 0; >>>>> txq->sgl_wrs = 0; >>>>> txq->txpkt_wrs = 0; >>>>> - txq->txpkts_wrs = 0; >>>>> - txq->txpkts_pkts = 0; >>>>> - txq->br->br_drops = 0; >>>>> - txq->no_dmamap = 0; >>>>> - txq->no_desc = 0; >>>>> + txq->txpkts0_wrs = 0; >>>>> + txq->txpkts1_wrs = 0; >>>>> + txq->txpkts0_pkts = 0; >>>>> + txq->txpkts1_pkts = 0; >>>>> + mp_ring_reset_stats(txq->r); >>>>> } >>>>> >>>>> #ifdef TCP_OFFLOAD >>>>> /* nothing to clear for each ofld_rxq */ >>>>> >>>>> for_each_ofld_txq(pi, i, wrq) { >>>>> - wrq->tx_wrs = 0; >>>>> - wrq->no_desc = 0; >>>>> + wrq->tx_wrs_direct = 0; >>>>> + wrq->tx_wrs_copied = 0; >>>>> } >>>>> #endif >>>>> wrq = &sc->sge.ctrlq[pi->port_id]; >>>>> - wrq->tx_wrs = 0; >>>>> - wrq->no_desc = 0; >>>>> + wrq->tx_wrs_direct = 0; >>>>> + wrq->tx_wrs_copied = 0; >>>>> } >>>>> break; >>>>> } >>>>> >>>>> Added: head/sys/dev/cxgbe/t4_mp_ring.c >>>>> >>>>> =========================================================================== >>>>> >>>>> >>>>> === >>>>> --- /dev/null 00:00:00 1970 (empty, because file is newly >>>>> added) >>>>> +++ head/sys/dev/cxgbe/t4_mp_ring.c Wed Dec 31 23:19:16 2014 >>>>> (r276485) >>>>> @@ -0,0 +1,364 @@ >>>>> +/*- >>>>> + * Copyright (c) 2014 Chelsio Communications, Inc. >>>>> + * All rights reserved. >>>>> + * Written by: Navdeep Parhar >>>>> + * >>>>> + * 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 "t4_mp_ring.h" >>>>> + >>>>> +union ring_state { >>>>> + struct { >>>>> + uint16_t pidx_head; >>>>> + uint16_t pidx_tail; >>>>> + uint16_t cidx; >>>>> + uint16_t flags; >>>>> + }; >>>>> + uint64_t state; >>>>> +}; >>>>> + >>>>> +enum { >>>>> + IDLE = 0, /* consumer ran to completion, nothing >>>>> more to do. >>>>> */ >>>>> + BUSY, /* consumer is running already, or will >>>>> be shortly. >>>>> */ >>>>> + STALLED, /* consumer stopped due to lack of >>>>> resources. */ >>>>> + ABDICATED, /* consumer stopped even though there >>>>> was work to >>>>> be >>>>> + done because it wants another thread >>>>> to take >>>>> over. */ >>>>> +}; >>>>> + >>>>> +static inline uint16_t >>>>> +space_available(struct mp_ring *r, union ring_state s) >>>>> +{ >>>>> + uint16_t x = r->size - 1; >>>>> + >>>>> + if (s.cidx == s.pidx_head) >>>>> + return (x); >>>>> + else if (s.cidx > s.pidx_head) >>>>> + return (s.cidx - s.pidx_head - 1); >>>>> + else >>>>> + return (x - s.pidx_head + s.cidx); >>>>> +} >>>>> + >>>>> +static inline uint16_t >>>>> +increment_idx(struct mp_ring *r, uint16_t idx, uint16_t n) >>>>> +{ >>>>> + int x = r->size - idx; >>>>> + >>>>> + MPASS(x > 0); >>>>> + return (x > n ? idx + n : n - x); >>>>> +} >>>>> + >>>>> +/* Consumer is about to update the ring's state to s */ >>>>> +static inline uint16_t >>>>> +state_to_flags(union ring_state s, int abdicate) >>>>> +{ >>>>> + >>>>> + if (s.cidx == s.pidx_tail) >>>>> + return (IDLE); >>>>> + else if (abdicate && s.pidx_tail != s.pidx_head) >>>>> + return (ABDICATED); >>>>> + >>>>> + return (BUSY); >>>>> +} >>>>> + >>>>> +/* >>>>> + * Caller passes in a state, with a guarantee that there is >>>>> work to do and >>>>> that >>>>> + * all items up to the pidx_tail in the state are visible. >>>>> + */ >>>>> +static void >>>>> +drain_ring(struct mp_ring *r, union ring_state os, uint16_t >>>>> prev, int >>>>> budget) >>>>> +{ >>>>> + union ring_state ns; >>>>> + int n, pending, total; >>>>> + uint16_t cidx = os.cidx; >>>>> + uint16_t pidx = os.pidx_tail; >>>>> + >>>>> + MPASS(os.flags == BUSY); >>>>> + MPASS(cidx != pidx); >>>>> + >>>>> + if (prev == IDLE) >>>>> + counter_u64_add(r->starts, 1); >>>>> + pending = 0; >>>>> + total = 0; >>>>> + >>>>> + while (cidx != pidx) { >>>>> + >>>>> + /* Items from cidx to pidx are available for >>>>> consumption. * >>>>> / >>>>> + n = r->drain(r, cidx, pidx); >>>>> + if (n == 0) { >>>>> + critical_enter(); >>>>> + do { >>>>> + os.state = ns.state = r->state; >>>>> + ns.cidx = cidx; >>>>> + ns.flags = STALLED; >>>>> + } while (atomic_cmpset_64(&r->state, >>>>> os.state, >>>>> + ns.state) == 0); >>>>> + critical_exit(); >>>>> + if (prev != STALLED) >>>>> + counter_u64_add(r->stalls, 1); >>>>> + else if (total > 0) { >>>>> + counter_u64_add(r->restarts, 1); >>>>> + counter_u64_add(r->stalls, 1); >>>>> + } >>>>> + break; >>>>> + } >>>>> + cidx = increment_idx(r, cidx, n); >>>>> + pending += n; >>>>> + total += n; >>>>> + >>>>> + /* >>>>> + * We update the cidx only if we've caught up >>>>> with the >>>>> pidx, the >>>>> + * real cidx is getting too far ahead of the one >>>>> visible to >>>>> + * everyone else, or we have exceeded our budget. >>>>> + */ >>>>> + if (cidx != pidx && pending < 64 && total < >>>>> budget) >>>>> + continue; >>>>> + critical_enter(); >>>>> + do { >>>>> + os.state = ns.state = r->state; >>>>> + ns.cidx = cidx; >>>>> + ns.flags = state_to_flags(ns, total >= >>>>> budget); >>>>> + } while (atomic_cmpset_acq_64(&r->state, >>>>> os.state, >>>>> ns.state) == 0); >>>>> + critical_exit(); >>>>> + >>>>> + if (ns.flags == ABDICATED) >>>>> + counter_u64_add(r->abdications, 1); >>>>> + if (ns.flags != BUSY) { >>>>> + /* Wrong loop exit if we're going to >>>>> stall. */ >>>>> + MPASS(ns.flags != STALLED); >>>>> + if (prev == STALLED) { >>>>> + MPASS(total > 0); >>>>> + counter_u64_add(r->restarts, 1); >>>>> + } >>>>> + break; >>>>> + } >>>>> + >>>>> + /* >>>>> + * The acquire style atomic above guarantees >>>>> visibility of >>>>> items >>>>> + * associated with any pidx change that we >>>>> notice here. >>>>> + */ >>>>> + pidx = ns.pidx_tail; >>>>> + pending = 0; >>>>> + } >>>>> +} >>>>> + >>>>> +int >>>>> +mp_ring_alloc(struct mp_ring **pr, int size, void *cookie, >>>>> ring_drain_t >>>>> drain, >>>>> + ring_can_drain_t can_drain, struct malloc_type *mt, int >>>>> flags) >>>>> +{ >>>>> + struct mp_ring *r; >>>>> + >>>>> + /* All idx are 16b so size can be 65536 at most */ >>>>> + if (pr == NULL || size < 2 || size > 65536 || drain == >>>>> NULL || >>>>> + can_drain == NULL) >>>>> + return (EINVAL); >>>>> + *pr = NULL; >>>>> + flags &= M_NOWAIT | M_WAITOK; >>>>> + MPASS(flags != 0); >>>>> + >>>>> + r = malloc(__offsetof(struct mp_ring, items[size]), mt, >>>>> flags | >>>>> M_ZERO); >>>>> + if (r == NULL) >>>>> + return (ENOMEM); >>>>> + r->size = size; >>>>> + r->cookie = cookie; >>>>> + r->mt = mt; >>>>> + r->drain = drain; >>>>> + r->can_drain = can_drain; >>>>> + r->enqueues = counter_u64_alloc(flags); >>>>> + r->drops = counter_u64_alloc(flags); >>>>> + r->starts = counter_u64_alloc(flags); >>>>> + r->stalls = counter_u64_alloc(flags); >>>>> + r->restarts = counter_u64_alloc(flags); >>>>> + r->abdications = counter_u64_alloc(flags); >>>>> + if (r->enqueues == NULL || r->drops == NULL || r->starts >>>>> == NULL || >>>>> + r->stalls == NULL || r->restarts == NULL || >>>>> + r->abdications == NULL) { >>>>> + mp_ring_free(r); >>>>> + return (ENOMEM); >>>>> + } >>>>> + >>>>> + *pr = r; >>>>> + return (0); >>>>> +} >>>>> + >>>>> +void >>>>> + >>>>> +mp_ring_free(struct mp_ring *r) >>>>> +{ >>>>> + >>>>> + if (r == NULL) >>>>> + return; >>>>> + >>>>> + if (r->enqueues != NULL) >>>>> + counter_u64_free(r->enqueues); >>>>> + if (r->drops != NULL) >>>>> + counter_u64_free(r->drops); >>>>> + if (r->starts != NULL) >>>>> + counter_u64_free(r->starts); >>>>> + if (r->stalls != NULL) >>>>> + counter_u64_free(r->stalls); >>>>> + if (r->restarts != NULL) >>>>> + counter_u64_free(r->restarts); >>>>> + if (r->abdications != NULL) >>>>> + counter_u64_free(r->abdications); >>>>> + >>>>> + free(r, r->mt); >>>>> +} >>>>> + >>>>> +/* >>>>> + * Enqueue n items and maybe drain the ring for some time. >>>>> + * >>>>> + * Returns an errno. >>>>> + */ >>>>> +int >>>>> +mp_ring_enqueue(struct mp_ring *r, void **items, int n, int >>>>> budget) >>>>> +{ >>>>> + union ring_state os, ns; >>>>> + uint16_t pidx_start, pidx_stop; >>>>> + int i; >>>>> + >>>>> + MPASS(items != NULL); >>>>> + MPASS(n > 0); >>>>> + >>>>> >>>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> -----------------------------------------+------------------------------- >>>>> >>>>> >>>>> Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. >>>>> dell'Informazione >>>>> http://www.iet.unipi.it/~luigi/ . Universita` di Pisa >>>>> TEL +39-050-2211611 . via Diotisalvi 2 >>>>> Mobile +39-338-6809875 . 56122 PISA (Italy) >>>>> -----------------------------------------+------------------------------- >>>>> >>>>> >>> >> >> > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:06:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F80929; Wed, 21 Jan 2015 01:06:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96FC4978; Wed, 21 Jan 2015 01:06:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L16AHX050649; Wed, 21 Jan 2015 01:06:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L168OS050631; Wed, 21 Jan 2015 01:06:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210106.t0L168OS050631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 01:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277460 - in head/sys: arm/arm arm/at91 arm/include arm/versatile arm/xilinx arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:06:11 -0000 Author: ian Date: Wed Jan 21 01:06:08 2015 New Revision: 277460 URL: https://svnweb.freebsd.org/changeset/base/277460 Log: Revise the arm bus_space implementation to avoid dereferencing the tag on every operation to retrieve the bs_cookie value almost nothing actually uses. The bus_space struct contains a private data pointer (poorly named bs_cookie, now renamed to bs_privdata) which is used only by a few old armv4 xscale implementations. The bus_space functions were all defined to take this value as the first parameter instead of the bus_space_tag_t, requiring all the inline macro and function expansions to dereference the tag to pass it to another function, which never uses it. Now all the functions take the tag as the first parameter and retrieve the privdata if they need it. Also fix a couple bus_space_unmap() implementations that were calling kva_free() instead of pmap_unmapdev(). Discussed with: cognet Modified: head/sys/arm/arm/bus_space_generic.c head/sys/arm/at91/at91.c head/sys/arm/include/bus.h head/sys/arm/versatile/bus_space.c head/sys/arm/xilinx/zy7_bus_space.c head/sys/arm/xscale/i80321/i80321_space.c head/sys/arm/xscale/i8134x/i81342_space.c head/sys/arm/xscale/ixp425/avila_ata.c head/sys/arm/xscale/ixp425/cambria_exp_space.c head/sys/arm/xscale/ixp425/ixp425_a4x_space.c head/sys/arm/xscale/ixp425/ixp425_pci_space.c head/sys/arm/xscale/ixp425/ixp425_space.c head/sys/arm/xscale/pxa/pxa_space.c head/sys/dev/usb/controller/ehci_ixp4xx.c Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/arm/bus_space_generic.c Wed Jan 21 01:06:08 2015 (r277460) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); bs_protos(generic); int -generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +generic_bs_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { void *va; @@ -74,7 +74,7 @@ generic_bs_map(void *t, bus_addr_t bpa, } int -generic_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, +generic_bs_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, bus_space_handle_t *bshp) { @@ -84,21 +84,21 @@ generic_bs_alloc(void *t, bus_addr_t rst void -generic_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) +generic_bs_unmap(bus_space_tag_t t, bus_space_handle_t h, bus_size_t size) { pmap_unmapdev((vm_offset_t)h, size); } void -generic_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +generic_bs_free(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) { panic("generic_bs_free(): not implemented"); } int -generic_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, +generic_bs_subregion(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp) { @@ -107,7 +107,7 @@ generic_bs_subregion(void *t, bus_space_ } void -generic_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, +generic_bs_barrier(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t offset, bus_size_t len, int flags) { Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/at91/at91.c Wed Jan 21 01:06:08 2015 (r277460) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); uint32_t at91_master_clock; static int -at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +at91_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { vm_paddr_t pa, endpa; @@ -77,23 +77,18 @@ at91_bs_map(void *t, bus_addr_t bpa, bus } static void -at91_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) +at91_bs_unmap(bus_space_tag_t tag, bus_space_handle_t h, bus_size_t size) { - vm_offset_t va, endva; + vm_offset_t va; - if (t == 0) - return; - va = trunc_page((vm_offset_t)t); + va = (vm_offset_t)h; if (va >= AT91_BASE && va <= AT91_BASE + 0xff00000) return; - endva = round_page((vm_offset_t)t + size); - - /* Free the kernel virtual mapping. */ - kva_free(va, endva - va); + pmap_unmapdev(va, size); } static int -at91_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, +at91_bs_subregion(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp) { @@ -102,7 +97,7 @@ at91_bs_subregion(void *t, bus_space_han } static void -at91_barrier(void *t, bus_space_handle_t bsh, bus_size_t size, bus_size_t b, +at91_barrier(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t size, bus_size_t b, int a) { } Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/include/bus.h Wed Jan 21 01:06:08 2015 (r277460) @@ -81,168 +81,168 @@ struct bus_space { /* cookie */ - void *bs_cookie; + void *bs_privdata; /* mapping/unmapping */ - int (*bs_map) (void *, bus_addr_t, bus_size_t, + int (*bs_map) (bus_space_tag_t, bus_addr_t, bus_size_t, int, bus_space_handle_t *); - void (*bs_unmap) (void *, bus_space_handle_t, bus_size_t); - int (*bs_subregion) (void *, bus_space_handle_t, + void (*bs_unmap) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + int (*bs_subregion) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); /* allocation/deallocation */ - int (*bs_alloc) (void *, bus_addr_t, bus_addr_t, + int (*bs_alloc) (bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); - void (*bs_free) (void *, bus_space_handle_t, + void (*bs_free) (bus_space_tag_t, bus_space_handle_t, bus_size_t); /* get kernel virtual address */ /* barrier */ - void (*bs_barrier) (void *, bus_space_handle_t, + void (*bs_barrier) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, int); /* read (single) */ - u_int8_t (*bs_r_1) (void *, bus_space_handle_t, bus_size_t); - u_int16_t (*bs_r_2) (void *, bus_space_handle_t, bus_size_t); - u_int32_t (*bs_r_4) (void *, bus_space_handle_t, bus_size_t); - u_int64_t (*bs_r_8) (void *, bus_space_handle_t, bus_size_t); + uint8_t (*bs_r_1) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint16_t (*bs_r_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint32_t (*bs_r_4) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint64_t (*bs_r_8) (bus_space_tag_t, bus_space_handle_t, bus_size_t); /* read multiple */ - void (*bs_rm_1) (void *, bus_space_handle_t, bus_size_t, - u_int8_t *, bus_size_t); - void (*bs_rm_2) (void *, bus_space_handle_t, bus_size_t, - u_int16_t *, bus_size_t); - void (*bs_rm_4) (void *, bus_space_handle_t, - bus_size_t, u_int32_t *, bus_size_t); - void (*bs_rm_8) (void *, bus_space_handle_t, - bus_size_t, u_int64_t *, bus_size_t); + void (*bs_rm_1) (bus_space_tag_t, bus_space_handle_t, bus_size_t, + uint8_t *, bus_size_t); + void (*bs_rm_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t, + uint16_t *, bus_size_t); + void (*bs_rm_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t *, bus_size_t); + void (*bs_rm_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t *, bus_size_t); /* read region */ - void (*bs_rr_1) (void *, bus_space_handle_t, - bus_size_t, u_int8_t *, bus_size_t); - void (*bs_rr_2) (void *, bus_space_handle_t, - bus_size_t, u_int16_t *, bus_size_t); - void (*bs_rr_4) (void *, bus_space_handle_t, - bus_size_t, u_int32_t *, bus_size_t); - void (*bs_rr_8) (void *, bus_space_handle_t, - bus_size_t, u_int64_t *, bus_size_t); + void (*bs_rr_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t *, bus_size_t); + void (*bs_rr_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t *, bus_size_t); + void (*bs_rr_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t *, bus_size_t); + void (*bs_rr_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t *, bus_size_t); /* write (single) */ - void (*bs_w_1) (void *, bus_space_handle_t, - bus_size_t, u_int8_t); - void (*bs_w_2) (void *, bus_space_handle_t, - bus_size_t, u_int16_t); - void (*bs_w_4) (void *, bus_space_handle_t, - bus_size_t, u_int32_t); - void (*bs_w_8) (void *, bus_space_handle_t, - bus_size_t, u_int64_t); + void (*bs_w_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t); + void (*bs_w_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t); + void (*bs_w_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t); + void (*bs_w_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t); /* write multiple */ - void (*bs_wm_1) (void *, bus_space_handle_t, - bus_size_t, const u_int8_t *, bus_size_t); - void (*bs_wm_2) (void *, bus_space_handle_t, - bus_size_t, const u_int16_t *, bus_size_t); - void (*bs_wm_4) (void *, bus_space_handle_t, - bus_size_t, const u_int32_t *, bus_size_t); - void (*bs_wm_8) (void *, bus_space_handle_t, - bus_size_t, const u_int64_t *, bus_size_t); + void (*bs_wm_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint8_t *, bus_size_t); + void (*bs_wm_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint16_t *, bus_size_t); + void (*bs_wm_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint32_t *, bus_size_t); + void (*bs_wm_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint64_t *, bus_size_t); /* write region */ - void (*bs_wr_1) (void *, bus_space_handle_t, - bus_size_t, const u_int8_t *, bus_size_t); - void (*bs_wr_2) (void *, bus_space_handle_t, - bus_size_t, const u_int16_t *, bus_size_t); - void (*bs_wr_4) (void *, bus_space_handle_t, - bus_size_t, const u_int32_t *, bus_size_t); - void (*bs_wr_8) (void *, bus_space_handle_t, - bus_size_t, const u_int64_t *, bus_size_t); + void (*bs_wr_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint8_t *, bus_size_t); + void (*bs_wr_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint16_t *, bus_size_t); + void (*bs_wr_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint32_t *, bus_size_t); + void (*bs_wr_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint64_t *, bus_size_t); /* set multiple */ - void (*bs_sm_1) (void *, bus_space_handle_t, - bus_size_t, u_int8_t, bus_size_t); - void (*bs_sm_2) (void *, bus_space_handle_t, - bus_size_t, u_int16_t, bus_size_t); - void (*bs_sm_4) (void *, bus_space_handle_t, - bus_size_t, u_int32_t, bus_size_t); - void (*bs_sm_8) (void *, bus_space_handle_t, - bus_size_t, u_int64_t, bus_size_t); + void (*bs_sm_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t, bus_size_t); + void (*bs_sm_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t, bus_size_t); + void (*bs_sm_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t, bus_size_t); + void (*bs_sm_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t, bus_size_t); /* set region */ - void (*bs_sr_1) (void *, bus_space_handle_t, - bus_size_t, u_int8_t, bus_size_t); - void (*bs_sr_2) (void *, bus_space_handle_t, - bus_size_t, u_int16_t, bus_size_t); - void (*bs_sr_4) (void *, bus_space_handle_t, - bus_size_t, u_int32_t, bus_size_t); - void (*bs_sr_8) (void *, bus_space_handle_t, - bus_size_t, u_int64_t, bus_size_t); + void (*bs_sr_1) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t, bus_size_t); + void (*bs_sr_2) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t, bus_size_t); + void (*bs_sr_4) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t, bus_size_t); + void (*bs_sr_8) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t, bus_size_t); /* copy */ - void (*bs_c_1) (void *, bus_space_handle_t, bus_size_t, + void (*bs_c_1) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); - void (*bs_c_2) (void *, bus_space_handle_t, bus_size_t, + void (*bs_c_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); - void (*bs_c_4) (void *, bus_space_handle_t, bus_size_t, + void (*bs_c_4) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); - void (*bs_c_8) (void *, bus_space_handle_t, bus_size_t, + void (*bs_c_8) (bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); /* read stream (single) */ - u_int8_t (*bs_r_1_s) (void *, bus_space_handle_t, bus_size_t); - u_int16_t (*bs_r_2_s) (void *, bus_space_handle_t, bus_size_t); - u_int32_t (*bs_r_4_s) (void *, bus_space_handle_t, bus_size_t); - u_int64_t (*bs_r_8_s) (void *, bus_space_handle_t, bus_size_t); + uint8_t (*bs_r_1_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint16_t (*bs_r_2_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint32_t (*bs_r_4_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint64_t (*bs_r_8_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t); /* read multiple stream */ - void (*bs_rm_1_s) (void *, bus_space_handle_t, bus_size_t, - u_int8_t *, bus_size_t); - void (*bs_rm_2_s) (void *, bus_space_handle_t, bus_size_t, - u_int16_t *, bus_size_t); - void (*bs_rm_4_s) (void *, bus_space_handle_t, - bus_size_t, u_int32_t *, bus_size_t); - void (*bs_rm_8_s) (void *, bus_space_handle_t, - bus_size_t, u_int64_t *, bus_size_t); + void (*bs_rm_1_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t, + uint8_t *, bus_size_t); + void (*bs_rm_2_s) (bus_space_tag_t, bus_space_handle_t, bus_size_t, + uint16_t *, bus_size_t); + void (*bs_rm_4_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t *, bus_size_t); + void (*bs_rm_8_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t *, bus_size_t); /* read region stream */ - void (*bs_rr_1_s) (void *, bus_space_handle_t, - bus_size_t, u_int8_t *, bus_size_t); - void (*bs_rr_2_s) (void *, bus_space_handle_t, - bus_size_t, u_int16_t *, bus_size_t); - void (*bs_rr_4_s) (void *, bus_space_handle_t, - bus_size_t, u_int32_t *, bus_size_t); - void (*bs_rr_8_s) (void *, bus_space_handle_t, - bus_size_t, u_int64_t *, bus_size_t); + void (*bs_rr_1_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t *, bus_size_t); + void (*bs_rr_2_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t *, bus_size_t); + void (*bs_rr_4_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t *, bus_size_t); + void (*bs_rr_8_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t *, bus_size_t); /* write stream (single) */ - void (*bs_w_1_s) (void *, bus_space_handle_t, - bus_size_t, u_int8_t); - void (*bs_w_2_s) (void *, bus_space_handle_t, - bus_size_t, u_int16_t); - void (*bs_w_4_s) (void *, bus_space_handle_t, - bus_size_t, u_int32_t); - void (*bs_w_8_s) (void *, bus_space_handle_t, - bus_size_t, u_int64_t); + void (*bs_w_1_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t); + void (*bs_w_2_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint16_t); + void (*bs_w_4_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t); + void (*bs_w_8_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint64_t); /* write multiple stream */ - void (*bs_wm_1_s) (void *, bus_space_handle_t, - bus_size_t, const u_int8_t *, bus_size_t); - void (*bs_wm_2_s) (void *, bus_space_handle_t, - bus_size_t, const u_int16_t *, bus_size_t); - void (*bs_wm_4_s) (void *, bus_space_handle_t, - bus_size_t, const u_int32_t *, bus_size_t); - void (*bs_wm_8_s) (void *, bus_space_handle_t, - bus_size_t, const u_int64_t *, bus_size_t); + void (*bs_wm_1_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint8_t *, bus_size_t); + void (*bs_wm_2_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint16_t *, bus_size_t); + void (*bs_wm_4_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint32_t *, bus_size_t); + void (*bs_wm_8_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint64_t *, bus_size_t); /* write region stream */ - void (*bs_wr_1_s) (void *, bus_space_handle_t, - bus_size_t, const u_int8_t *, bus_size_t); - void (*bs_wr_2_s) (void *, bus_space_handle_t, - bus_size_t, const u_int16_t *, bus_size_t); - void (*bs_wr_4_s) (void *, bus_space_handle_t, - bus_size_t, const u_int32_t *, bus_size_t); - void (*bs_wr_8_s) (void *, bus_space_handle_t, - bus_size_t, const u_int64_t *, bus_size_t); + void (*bs_wr_1_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint8_t *, bus_size_t); + void (*bs_wr_2_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint16_t *, bus_size_t); + void (*bs_wr_4_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint32_t *, bus_size_t); + void (*bs_wr_8_s) (bus_space_tag_t, bus_space_handle_t, + bus_size_t, const uint64_t *, bus_size_t); }; @@ -253,19 +253,19 @@ struct bus_space { #define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) #define __bs_nonsingle(type, sz, t, h, o, a, c) \ - (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, a, c) + (*(t)->__bs_opname(type,sz))((t), h, o, a, c) #define __bs_set(type, sz, t, h, o, v, c) \ - (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, v, c) + (*(t)->__bs_opname(type,sz))((t), h, o, v, c) #define __bs_copy(sz, t, h1, o1, h2, o2, cnt) \ - (*(t)->__bs_opname(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt) + (*(t)->__bs_opname(c,sz))((t), h1, o1, h2, o2, cnt) #define __bs_opname_s(op,size) __bs_c(__bs_c(__bs_c(__bs_c(bs_,op),_),size),_s) #define __bs_rs_s(sz, t, h, o) \ - (*(t)->__bs_opname_s(r,sz))((t)->bs_cookie, h, o) + (*(t)->__bs_opname_s(r,sz))((t), h, o) #define __bs_ws_s(sz, t, h, o, v) \ - (*(t)->__bs_opname_s(w,sz))((t)->bs_cookie, h, o, v) + (*(t)->__bs_opname_s(w,sz))((t), h, o, v) #define __bs_nonsingle_s(type, sz, t, h, o, a, c) \ - (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c) + (*(t)->__bs_opname_s(type,sz))((t), h, o, a, c) #define __generate_inline_bs_rs(IFN, MBR, TYP) \ @@ -276,7 +276,7 @@ struct bus_space { if (__predict_true(t->MBR == NULL)) \ return (*(volatile TYP *)(h + o)); \ else \ - return (t->MBR(t->bs_cookie, h, o)); \ + return (t->MBR(t, h, o)); \ } #define __generate_inline_bs_ws(IFN, MBR, TYP) \ @@ -287,34 +287,34 @@ struct bus_space { if (__predict_true(t->MBR == NULL)) \ *(volatile TYP *)(h + o) = v; \ else \ - t->MBR(t->bs_cookie, h, o, v); \ + t->MBR(t, h, o, v); \ } /* * Mapping and unmapping operations. */ #define bus_space_map(t, a, s, c, hp) \ - (*(t)->bs_map)((t)->bs_cookie, (a), (s), (c), (hp)) + (*(t)->bs_map)((t), (a), (s), (c), (hp)) #define bus_space_unmap(t, h, s) \ - (*(t)->bs_unmap)((t)->bs_cookie, (h), (s)) + (*(t)->bs_unmap)((t), (h), (s)) #define bus_space_subregion(t, h, o, s, hp) \ - (*(t)->bs_subregion)((t)->bs_cookie, (h), (o), (s), (hp)) + (*(t)->bs_subregion)((t), (h), (o), (s), (hp)) /* * Allocation and deallocation operations. */ #define bus_space_alloc(t, rs, re, s, a, b, c, ap, hp) \ - (*(t)->bs_alloc)((t)->bs_cookie, (rs), (re), (s), (a), (b), \ + (*(t)->bs_alloc)((t), (rs), (re), (s), (a), (b), \ (c), (ap), (hp)) #define bus_space_free(t, h, s) \ - (*(t)->bs_free)((t)->bs_cookie, (h), (s)) + (*(t)->bs_free)((t), (h), (s)) /* * Bus barrier operations. */ #define bus_space_barrier(t, h, o, l, f) \ - (*(t)->bs_barrier)((t)->bs_cookie, (h), (o), (l), (f)) + (*(t)->bs_barrier)((t), (h), (o), (l), (f)) #define BUS_SPACE_BARRIER_READ 0x01 #define BUS_SPACE_BARRIER_WRITE 0x02 @@ -478,204 +478,204 @@ __generate_inline_bs_ws(bus_space_write_ */ #define bs_map_proto(f) \ -int __bs_c(f,_bs_map) (void *t, bus_addr_t addr, \ +int __bs_c(f,_bs_map) (bus_space_tag_t t, bus_addr_t addr, \ bus_size_t size, int cacheable, bus_space_handle_t *bshp); #define bs_unmap_proto(f) \ -void __bs_c(f,_bs_unmap) (void *t, bus_space_handle_t bsh, \ +void __bs_c(f,_bs_unmap) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t size); #define bs_subregion_proto(f) \ -int __bs_c(f,_bs_subregion) (void *t, bus_space_handle_t bsh, \ +int __bs_c(f,_bs_subregion) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset, bus_size_t size, \ bus_space_handle_t *nbshp); #define bs_alloc_proto(f) \ -int __bs_c(f,_bs_alloc) (void *t, bus_addr_t rstart, \ +int __bs_c(f,_bs_alloc) (bus_space_tag_t t, bus_addr_t rstart, \ bus_addr_t rend, bus_size_t size, bus_size_t align, \ bus_size_t boundary, int cacheable, bus_addr_t *addrp, \ bus_space_handle_t *bshp); #define bs_free_proto(f) \ -void __bs_c(f,_bs_free) (void *t, bus_space_handle_t bsh, \ +void __bs_c(f,_bs_free) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t size); #define bs_mmap_proto(f) \ int __bs_c(f,_bs_mmap) (struct cdev *, vm_offset_t, vm_paddr_t *, int); #define bs_barrier_proto(f) \ -void __bs_c(f,_bs_barrier) (void *t, bus_space_handle_t bsh, \ +void __bs_c(f,_bs_barrier) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset, bus_size_t len, int flags); #define bs_r_1_proto(f) \ -u_int8_t __bs_c(f,_bs_r_1) (void *t, bus_space_handle_t bsh, \ +uint8_t __bs_c(f,_bs_r_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_2_proto(f) \ -u_int16_t __bs_c(f,_bs_r_2) (void *t, bus_space_handle_t bsh, \ +uint16_t __bs_c(f,_bs_r_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_4_proto(f) \ -u_int32_t __bs_c(f,_bs_r_4) (void *t, bus_space_handle_t bsh, \ +uint32_t __bs_c(f,_bs_r_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_8_proto(f) \ -u_int64_t __bs_c(f,_bs_r_8) (void *t, bus_space_handle_t bsh, \ +uint64_t __bs_c(f,_bs_r_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_1_s_proto(f) \ -u_int8_t __bs_c(f,_bs_r_1_s) (void *t, bus_space_handle_t bsh, \ +uint8_t __bs_c(f,_bs_r_1_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_2_s_proto(f) \ -u_int16_t __bs_c(f,_bs_r_2_s) (void *t, bus_space_handle_t bsh, \ +uint16_t __bs_c(f,_bs_r_2_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_r_4_s_proto(f) \ -u_int32_t __bs_c(f,_bs_r_4_s) (void *t, bus_space_handle_t bsh, \ +uint32_t __bs_c(f,_bs_r_4_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ bus_size_t offset); #define bs_w_1_proto(f) \ -void __bs_c(f,_bs_w_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t value); +void __bs_c(f,_bs_w_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t value); #define bs_w_2_proto(f) \ -void __bs_c(f,_bs_w_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t value); +void __bs_c(f,_bs_w_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t value); #define bs_w_4_proto(f) \ -void __bs_c(f,_bs_w_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t value); +void __bs_c(f,_bs_w_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t value); #define bs_w_8_proto(f) \ -void __bs_c(f,_bs_w_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int64_t value); +void __bs_c(f,_bs_w_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint64_t value); #define bs_w_1_s_proto(f) \ -void __bs_c(f,_bs_w_1_s) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t value); +void __bs_c(f,_bs_w_1_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t value); #define bs_w_2_s_proto(f) \ -void __bs_c(f,_bs_w_2_s) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t value); +void __bs_c(f,_bs_w_2_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t value); #define bs_w_4_s_proto(f) \ -void __bs_c(f,_bs_w_4_s) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t value); +void __bs_c(f,_bs_w_4_s) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t value); #define bs_rm_1_proto(f) \ -void __bs_c(f,_bs_rm_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t *addr, bus_size_t count); +void __bs_c(f,_bs_rm_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t *addr, bus_size_t count); #define bs_rm_2_proto(f) \ -void __bs_c(f,_bs_rm_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t *addr, bus_size_t count); +void __bs_c(f,_bs_rm_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t *addr, bus_size_t count); #define bs_rm_4_proto(f) \ -void __bs_c(f,_bs_rm_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t *addr, bus_size_t count); +void __bs_c(f,_bs_rm_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t *addr, bus_size_t count); #define bs_rm_8_proto(f) \ -void __bs_c(f,_bs_rm_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int64_t *addr, bus_size_t count); +void __bs_c(f,_bs_rm_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint64_t *addr, bus_size_t count); #define bs_wm_1_proto(f) \ -void __bs_c(f,_bs_wm_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int8_t *addr, bus_size_t count); +void __bs_c(f,_bs_wm_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint8_t *addr, bus_size_t count); #define bs_wm_2_proto(f) \ -void __bs_c(f,_bs_wm_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int16_t *addr, bus_size_t count); +void __bs_c(f,_bs_wm_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint16_t *addr, bus_size_t count); #define bs_wm_4_proto(f) \ -void __bs_c(f,_bs_wm_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int32_t *addr, bus_size_t count); +void __bs_c(f,_bs_wm_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint32_t *addr, bus_size_t count); #define bs_wm_8_proto(f) \ -void __bs_c(f,_bs_wm_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int64_t *addr, bus_size_t count); +void __bs_c(f,_bs_wm_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint64_t *addr, bus_size_t count); #define bs_rr_1_proto(f) \ -void __bs_c(f, _bs_rr_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t *addr, bus_size_t count); +void __bs_c(f, _bs_rr_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t *addr, bus_size_t count); #define bs_rr_2_proto(f) \ -void __bs_c(f, _bs_rr_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t *addr, bus_size_t count); +void __bs_c(f, _bs_rr_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t *addr, bus_size_t count); #define bs_rr_4_proto(f) \ -void __bs_c(f, _bs_rr_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t *addr, bus_size_t count); +void __bs_c(f, _bs_rr_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t *addr, bus_size_t count); #define bs_rr_8_proto(f) \ -void __bs_c(f, _bs_rr_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int64_t *addr, bus_size_t count); +void __bs_c(f, _bs_rr_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint64_t *addr, bus_size_t count); #define bs_wr_1_proto(f) \ -void __bs_c(f, _bs_wr_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int8_t *addr, bus_size_t count); +void __bs_c(f, _bs_wr_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint8_t *addr, bus_size_t count); #define bs_wr_2_proto(f) \ -void __bs_c(f, _bs_wr_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int16_t *addr, bus_size_t count); +void __bs_c(f, _bs_wr_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint16_t *addr, bus_size_t count); #define bs_wr_4_proto(f) \ -void __bs_c(f, _bs_wr_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int32_t *addr, bus_size_t count); +void __bs_c(f, _bs_wr_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint32_t *addr, bus_size_t count); #define bs_wr_8_proto(f) \ -void __bs_c(f, _bs_wr_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, const u_int64_t *addr, bus_size_t count); +void __bs_c(f, _bs_wr_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, const uint64_t *addr, bus_size_t count); #define bs_sm_1_proto(f) \ -void __bs_c(f,_bs_sm_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t value, bus_size_t count); +void __bs_c(f,_bs_sm_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t value, bus_size_t count); #define bs_sm_2_proto(f) \ -void __bs_c(f,_bs_sm_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t value, bus_size_t count); +void __bs_c(f,_bs_sm_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t value, bus_size_t count); #define bs_sm_4_proto(f) \ -void __bs_c(f,_bs_sm_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t value, bus_size_t count); +void __bs_c(f,_bs_sm_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t value, bus_size_t count); #define bs_sm_8_proto(f) \ -void __bs_c(f,_bs_sm_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int64_t value, bus_size_t count); +void __bs_c(f,_bs_sm_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint64_t value, bus_size_t count); #define bs_sr_1_proto(f) \ -void __bs_c(f,_bs_sr_1) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int8_t value, bus_size_t count); +void __bs_c(f,_bs_sr_1) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint8_t value, bus_size_t count); #define bs_sr_2_proto(f) \ -void __bs_c(f,_bs_sr_2) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int16_t value, bus_size_t count); +void __bs_c(f,_bs_sr_2) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint16_t value, bus_size_t count); #define bs_sr_4_proto(f) \ -void __bs_c(f,_bs_sr_4) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int32_t value, bus_size_t count); +void __bs_c(f,_bs_sr_4) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint32_t value, bus_size_t count); #define bs_sr_8_proto(f) \ -void __bs_c(f,_bs_sr_8) (void *t, bus_space_handle_t bsh, \ - bus_size_t offset, u_int64_t value, bus_size_t count); +void __bs_c(f,_bs_sr_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ + bus_size_t offset, uint64_t value, bus_size_t count); #define bs_c_1_proto(f) \ -void __bs_c(f,_bs_c_1) (void *t, bus_space_handle_t bsh1, \ +void __bs_c(f,_bs_c_1) (bus_space_tag_t t, bus_space_handle_t bsh1, \ bus_size_t offset1, bus_space_handle_t bsh2, \ bus_size_t offset2, bus_size_t count); #define bs_c_2_proto(f) \ -void __bs_c(f,_bs_c_2) (void *t, bus_space_handle_t bsh1, \ +void __bs_c(f,_bs_c_2) (bus_space_tag_t t, bus_space_handle_t bsh1, \ bus_size_t offset1, bus_space_handle_t bsh2, \ bus_size_t offset2, bus_size_t count); #define bs_c_4_proto(f) \ -void __bs_c(f,_bs_c_4) (void *t, bus_space_handle_t bsh1, \ +void __bs_c(f,_bs_c_4) (bus_space_tag_t t, bus_space_handle_t bsh1, \ bus_size_t offset1, bus_space_handle_t bsh2, \ bus_size_t offset2, bus_size_t count); #define bs_c_8_proto(f) \ -void __bs_c(f,_bs_c_8) (void *t, bus_space_handle_t bsh1, \ +void __bs_c(f,_bs_c_8) (bus_space_tag_t t, bus_space_handle_t bsh1, \ bus_size_t offset1, bus_space_handle_t bsh2, \ bus_size_t offset2, bus_size_t count); Modified: head/sys/arm/versatile/bus_space.c ============================================================================== --- head/sys/arm/versatile/bus_space.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/versatile/bus_space.c Wed Jan 21 01:06:08 2015 (r277460) @@ -46,7 +46,7 @@ bs_protos(generic_armv4); struct bus_space _base_tag = { /* cookie */ - .bs_cookie = (void *) 0, + .bs_privdata = (void *) 0, /* mapping/unmapping */ .bs_map = generic_bs_map, Modified: head/sys/arm/xilinx/zy7_bus_space.c ============================================================================== --- head/sys/arm/xilinx/zy7_bus_space.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/xilinx/zy7_bus_space.c Wed Jan 21 01:06:08 2015 (r277460) @@ -46,7 +46,7 @@ bs_protos(generic_armv4); struct bus_space _base_tag = { /* cookie */ - .bs_cookie = (void *) 0, + .bs_privdata = (void *) 0, /* mapping/unmapping */ .bs_map = generic_bs_map, Modified: head/sys/arm/xscale/i80321/i80321_space.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 01:06:08 2015 (r277460) @@ -182,7 +182,7 @@ i80321_bs_init(bus_space_tag_t bs, void { *bs = i80321_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; } void @@ -190,7 +190,7 @@ i80321_io_bs_init(bus_space_tag_t bs, vo { *bs = i80321_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; bs->bs_map = i80321_io_bs_map; bs->bs_unmap = i80321_io_bs_unmap; @@ -204,7 +204,7 @@ i80321_mem_bs_init(bus_space_tag_t bs, v { *bs = i80321_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; bs->bs_map = i80321_mem_bs_map; bs->bs_unmap = i80321_mem_bs_unmap; @@ -216,7 +216,7 @@ i80321_mem_bs_init(bus_space_tag_t bs, v /* *** Routines shared by i80321, PCI IO, and PCI MEM. *** */ int -i80321_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, +i80321_bs_subregion(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp) { @@ -225,7 +225,7 @@ i80321_bs_subregion(void *t, bus_space_h } void -i80321_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, +i80321_bs_barrier(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, bus_size_t len, int flags) { @@ -236,7 +236,7 @@ i80321_bs_barrier(void *t, bus_space_han extern struct i80321_softc *i80321_softc; int -i80321_io_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +i80321_io_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { struct i80321_softc *sc = i80321_softc; @@ -264,14 +264,14 @@ i80321_io_bs_map(void *t, bus_addr_t bpa } void -i80321_io_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) +i80321_io_bs_unmap(bus_space_tag_t tag, bus_space_handle_t h, bus_size_t size) { /* Nothing to do. */ } int -i80321_io_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, +i80321_io_bs_alloc(bus_space_tag_t tag, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, bus_space_handle_t *bshp) { @@ -280,7 +280,7 @@ i80321_io_bs_alloc(void *t, bus_addr_t r } void -i80321_io_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +i80321_io_bs_free(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t size) { panic("i80321_io_bs_free(): not implemented"); @@ -290,33 +290,23 @@ i80321_io_bs_free(void *t, bus_space_han /* *** Routines for PCI MEM. *** */ extern int badaddr_read(void *, int, void *); int -i80321_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +i80321_mem_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { - vm_paddr_t pa, endpa; - pa = trunc_page(bpa); - endpa = round_page(bpa + size); - - *bshp = (vm_offset_t)pmap_mapdev(pa, endpa - pa); - + *bshp = (vm_offset_t)pmap_mapdev(bpa, size); return (0); } void -i80321_mem_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) +i80321_mem_bs_unmap(bus_space_tag_t tag, bus_space_handle_t h, bus_size_t size) { - vm_offset_t va, endva; - - va = trunc_page((vm_offset_t)t); - endva = va + round_page(size); - /* Free the kernel virtual mapping. */ - kva_free(va, endva - va); + pmap_unmapdev((vm_offset_t)h, size); } int -i80321_mem_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, +i80321_mem_bs_alloc(bus_space_tag_t tag, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, bus_space_handle_t *bshp) { @@ -325,7 +315,7 @@ i80321_mem_bs_alloc(void *t, bus_addr_t } void -i80321_mem_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +i80321_mem_bs_free(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t size) { panic("i80321_mem_bs_free(): not implemented"); Modified: head/sys/arm/xscale/i8134x/i81342_space.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 00:00:41 2015 (r277459) +++ head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 01:06:08 2015 (r277460) @@ -183,7 +183,7 @@ i81342_bs_init(bus_space_tag_t bs, void { *bs = i81342_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; } void @@ -191,7 +191,7 @@ i81342_io_bs_init(bus_space_tag_t bs, vo { *bs = i81342_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; bs->bs_map = i81342_io_bs_map; bs->bs_unmap = i81342_io_bs_unmap; @@ -205,7 +205,7 @@ i81342_mem_bs_init(bus_space_tag_t bs, v { *bs = i81342_bs_tag_template; - bs->bs_cookie = cookie; + bs->bs_privdata = cookie; bs->bs_map = i81342_mem_bs_map; bs->bs_unmap = i81342_mem_bs_unmap; @@ -217,7 +217,7 @@ i81342_mem_bs_init(bus_space_tag_t bs, v /* *** Routines shared by i81342, PCI IO, and PCI MEM. *** */ int -i81342_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, +i81342_bs_subregion(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp) { @@ -226,7 +226,7 @@ i81342_bs_subregion(void *t, bus_space_h } void -i81342_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, +i81342_bs_barrier(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, bus_size_t len, int flags) { @@ -236,7 +236,7 @@ i81342_bs_barrier(void *t, bus_space_han /* *** Routines for PCI IO. *** */ int -i81342_io_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +i81342_io_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { @@ -245,14 +245,14 @@ i81342_io_bs_map(void *t, bus_addr_t bpa } void -i81342_io_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) +i81342_io_bs_unmap(bus_space_tag_t tag, bus_space_handle_t h, bus_size_t size) { /* Nothing to do. */ } int -i81342_io_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, +i81342_io_bs_alloc(bus_space_tag_t tag, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, bus_space_handle_t *bshp) { @@ -261,7 +261,7 @@ i81342_io_bs_alloc(void *t, bus_addr_t r } void -i81342_io_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +i81342_io_bs_free(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t size) { panic("i81342_io_bs_free(): not implemented"); @@ -272,10 +272,10 @@ i81342_io_bs_free(void *t, bus_space_han extern int badaddr_read(void *, int, void *); static vm_offset_t allocable = 0xe1000000; int -i81342_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +i81342_mem_bs_map(bus_space_tag_t tag, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { - struct i81342_pci_softc *sc = (struct i81342_pci_softc *)t; + struct i81342_pci_softc *sc = (struct i81342_pci_softc *)tag->bs_privdata; struct i81342_pci_map *tmp; vm_offset_t addr, endaddr; vm_paddr_t paddr; @@ -315,12 +315,12 @@ i81342_mem_bs_map(void *t, bus_addr_t bp } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:06:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DBCAA71; Wed, 21 Jan 2015 01:06:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E03D979; Wed, 21 Jan 2015 01:06:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L16FZW050703; Wed, 21 Jan 2015 01:06:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L16FBB050702; Wed, 21 Jan 2015 01:06:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201501210106.t0L16FBB050702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Jan 2015 01:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277461 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:06:15 -0000 Author: mjg Date: Wed Jan 21 01:06:14 2015 New Revision: 277461 URL: https://svnweb.freebsd.org/changeset/base/277461 Log: filedesc: plug a test for impossible condition in _fget Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 21 01:06:08 2015 (r277460) +++ head/sys/kern/kern_descrip.c Wed Jan 21 01:06:14 2015 (r277461) @@ -2439,8 +2439,7 @@ _fget(struct thread *td, int fd, struct int error; *fpp = NULL; - if (td == NULL || (fdp = td->td_proc->p_fd) == NULL) - return (EBADF); + fdp = td->td_proc->p_fd; if (needrightsp != NULL) needrights = *needrightsp; else From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:08:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35ACEC3A; Wed, 21 Jan 2015 01:08:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07B4E98A; Wed, 21 Jan 2015 01:08:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L17xmC050971; Wed, 21 Jan 2015 01:07:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L17xIQ050966; Wed, 21 Jan 2015 01:07:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501210107.t0L17xIQ050966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Jan 2015 01:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277462 - in head/contrib/elftoolchain: common readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:08:00 -0000 Author: emaste Date: Wed Jan 21 01:07:58 2015 New Revision: 277462 URL: https://svnweb.freebsd.org/changeset/base/277462 Log: redelf: Add missing R_X86_64_ relocation types PR: 196918 Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1570 Modified: head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Wed Jan 21 01:06:14 2015 (r277461) +++ head/contrib/elftoolchain/common/elfdefinitions.h Wed Jan 21 01:07:58 2015 (r277462) @@ -1948,11 +1948,17 @@ _ELF_DEFINE_RELOC(R_X86_64_TPOFF32, 23) _ELF_DEFINE_RELOC(R_X86_64_PC64, 24) \ _ELF_DEFINE_RELOC(R_X86_64_GOTOFF64, 25) \ _ELF_DEFINE_RELOC(R_X86_64_GOTPC32, 26) \ +_ELF_DEFINE_RELOC(R_X86_64_GOT64, 27) \ +_ELF_DEFINE_RELOC(R_X86_64_GOTPCREL64, 28) \ +_ELF_DEFINE_RELOC(R_X86_64_GOTPC64, 29) \ +_ELF_DEFINE_RELOC(R_X86_64_GOTPLT64, 30) \ +_ELF_DEFINE_RELOC(R_X86_64_PLTOFF64, 31) \ _ELF_DEFINE_RELOC(R_X86_64_SIZE32, 32) \ _ELF_DEFINE_RELOC(R_X86_64_SIZE64, 33) \ _ELF_DEFINE_RELOC(R_X86_64_GOTPC32_TLSDESC, 34) \ _ELF_DEFINE_RELOC(R_X86_64_TLSDESC_CALL, 35) \ -_ELF_DEFINE_RELOC(R_X86_64_TLSDESC, 36) +_ELF_DEFINE_RELOC(R_X86_64_TLSDESC, 36) \ +_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37) #define _ELF_DEFINE_RELOCATIONS() \ _ELF_DEFINE_386_RELOCATIONS() \ Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Jan 21 01:06:14 2015 (r277461) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Jan 21 01:07:58 2015 (r277462) @@ -1480,6 +1480,20 @@ r_type(unsigned int mach, unsigned int t case 21: return "R_X86_64_DTPOFF32"; case 22: return "R_X86_64_GOTTPOFF"; case 23: return "R_X86_64_TPOFF32"; + case 24: return "R_X86_64_PC64"; + case 25: return "R_X86_64_GOTOFF64"; + case 26: return "R_X86_64_GOTPC32"; + case 27: return "R_X86_64_GOT64"; + case 28: return "R_X86_64_GOTPCREL64"; + case 29: return "R_X86_64_GOTPC64"; + case 30: return "R_X86_64_GOTPLT64"; + case 31: return "R_X86_64_PLTOFF64"; + case 32: return "R_X86_64_SIZE32"; + case 33: return "R_X86_64_SIZE64"; + case 34: return "R_X86_64_GOTPC32_TLSDESC"; + case 35: return "R_X86_64_TLSDESC_CALL"; + case 36: return "R_X86_64_TLSDESC"; + case 37: return "R_X86_64_IRELATIVE"; default: return ""; } default: return ""; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:11:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAA3AE1E; Wed, 21 Jan 2015 01:11:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC080A4B; Wed, 21 Jan 2015 01:11:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L1BcWI054497; Wed, 21 Jan 2015 01:11:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L1BccO054496; Wed, 21 Jan 2015 01:11:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501210111.t0L1BccO054496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 21 Jan 2015 01:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277463 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:11:39 -0000 Author: delphij Date: Wed Jan 21 01:11:37 2015 New Revision: 277463 URL: https://svnweb.freebsd.org/changeset/base/277463 Log: Fix xz handling for files larger than 32K. Submitted by: Stefan Ehmann PR: bin/186861 MFC after: 2 weeks Modified: head/usr.bin/grep/file.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Wed Jan 21 01:07:58 2015 (r277462) +++ head/usr.bin/grep/file.c Wed Jan 21 01:11:37 2015 (r277463) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); static gzFile gzbufdesc; #ifndef WITHOUT_LZMA static lzma_stream lstrm = LZMA_STREAM_INIT; +static lzma_action laction; +static uint8_t lin_buf[MAXBUFSIZ]; #endif #ifndef WITHOUT_BZIP2 static BZFILE* bzbufdesc; @@ -123,34 +125,34 @@ grep_refill(struct file *f) #endif #ifndef WITHOUT_LZMA } else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { - lzma_action action = LZMA_RUN; - uint8_t in_buf[MAXBUFSIZ]; lzma_ret ret; + lstrm.next_out = buffer; - ret = (filebehave == FILE_XZ) ? - lzma_stream_decoder(&lstrm, UINT64_MAX, - LZMA_CONCATENATED) : - lzma_alone_decoder(&lstrm, UINT64_MAX); + do { + if (lstrm.avail_in == 0) { + lstrm.next_in = lin_buf; + nr = read(f->fd, lin_buf, MAXBUFSIZ); + + if (nr < 0) + return (-1); + else if (nr == 0) + laction = LZMA_FINISH; - if (ret != LZMA_OK) - return (-1); + lstrm.avail_in = nr; + } - lstrm.next_out = buffer; - lstrm.avail_out = MAXBUFSIZ; - lstrm.next_in = in_buf; - nr = read(f->fd, in_buf, MAXBUFSIZ); + ret = lzma_code(&lstrm, laction); + + if (ret != LZMA_OK && ret != LZMA_STREAM_END) + return (-1); + + if (lstrm.avail_out == 0 || ret == LZMA_STREAM_END) { + bufrem = MAXBUFSIZ - lstrm.avail_out; + lstrm.next_out = buffer; + lstrm.avail_out = MAXBUFSIZ; + } + } while (bufrem == 0 && ret != LZMA_STREAM_END); - if (nr < 0) - return (-1); - else if (nr == 0) - action = LZMA_FINISH; - - lstrm.avail_in = nr; - ret = lzma_code(&lstrm, action); - - if (ret != LZMA_OK && ret != LZMA_STREAM_END) - return (-1); - bufrem = MAXBUFSIZ - lstrm.avail_out; return (0); #endif /* WIHTOUT_LZMA */ } else @@ -291,6 +293,23 @@ grep_open(const char *path) (bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL) goto error2; #endif +#ifndef WITHOUT_LZMA + else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { + lzma_ret ret; + + ret = (filebehave == FILE_XZ) ? + lzma_stream_decoder(&lstrm, UINT64_MAX, + LZMA_CONCATENATED) : + lzma_alone_decoder(&lstrm, UINT64_MAX); + + if (ret != LZMA_OK) + goto error2; + + lstrm.avail_in = 0; + lstrm.avail_out = MAXBUFSIZ; + laction = LZMA_RUN; + } +#endif /* Fill read buffer, also catches errors early */ if (bufrem == 0 && grep_refill(f) != 0) From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:12:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99574F9F; Wed, 21 Jan 2015 01:12:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8578FA58; Wed, 21 Jan 2015 01:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L1CMSx055112; Wed, 21 Jan 2015 01:12:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L1CMOn055111; Wed, 21 Jan 2015 01:12:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501210112.t0L1CMOn055111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Jan 2015 01:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277464 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:12:22 -0000 Author: emaste Date: Wed Jan 21 01:12:21 2015 New Revision: 277464 URL: https://svnweb.freebsd.org/changeset/base/277464 Log: Add missing R_X86_64_ constants to elf_common.h PR: 196918 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Wed Jan 21 01:11:37 2015 (r277463) +++ head/sys/sys/elf_common.h Wed Jan 21 01:12:21 2015 (r277464) @@ -1223,6 +1223,19 @@ typedef struct { #define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ #define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ #define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ +#define R_X86_64_PC64 24 /* PC-relative 64 bit signed sym value. */ +#define R_X86_64_GOTOFF64 25 +#define R_X86_64_GOTPC32 26 +#define R_X86_64_GOT64 27 +#define R_X86_64_GOTPCREL64 28 +#define R_X86_64_GOTPC64 29 +#define R_X86_64_GOTPLT64 30 +#define R_X86_64_PLTOFF64 31 +#define R_X86_64_SIZE32 32 +#define R_X86_64_SIZE64 33 +#define R_X86_64_GOTPC32_TLSDESC 34 +#define R_X86_64_TLSDESC_CALL 35 +#define R_X86_64_TLSDESC 36 #define R_X86_64_IRELATIVE 37 From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:33:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F1C34A8 for ; Wed, 21 Jan 2015 01:33:44 +0000 (UTC) Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com [98.139.212.165]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4347CC47 for ; Wed, 21 Jan 2015 01:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421804016; bh=2Da6MbQLTKZ5E/m1aH5WjG+7typsmoKsSo+HsNPGiAY=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=KMpdToFRgvhx3hsDJ0joO8py0US7JPEatQDBAQ/Y27Kmf6W3bBTTeyVmDJSw9Fhl1RshB6V+rF5dQBsIBxLQtKDu/Jnsj6p5W05OISBy9Npy+zEv2wFamxPK6djEn7J5EGQwehBmTKGR45dt19nuMIdRJ2i690EXMdTBseFTOD4ar0WqVr8jx5mJTNRXdlAGYBAvCPO6pHNvXTrmOHimHGq4KT6kVBjfQOuemEy7rDDjtk+D+zNxT9QEjwlTtkcNLd+dy3jaKTUa6pI3KtpN3C+J96pw66KHXIyo9KQOmoHA9ZqFzZRTi1SXiPqkDChY/f75LF5Ck9OryAsrHFdhqw== Received: from [98.139.214.32] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 01:33:36 -0000 Received: from [98.139.211.206] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 01:33:36 -0000 Received: from [127.0.0.1] by smtp215.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 01:33:36 -0000 X-Yahoo-Newman-Id: 460484.29023.bm@smtp215.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: I9a1MbEVM1nLkC.fXs0A0J0BAJ6e7BEtoZ7dbtsI8WN5utE p9Adu8qUqAt2RboXZaxJALNSEHyMSwGmjnxBY0X.ry6vOI4ioaa.ZFaN33b9 BJo4iSmHFt0eTMZA52H9BZxHHqLFo3uOL6cVTMnqxgU5MTYsfQoLHVyYde.n 8aXHaE2A_Q.PfEePri44rR74FVyoa.puw2u4vpU8guTc22z1mnyjq0ROO5g3 W3joN3Ui1.gXu34c6RisLFBlZC1IAnNHJdaVzIiZRW_RRlLwzB8tTxJM6qHy utPILdHARrGUJgqwEyMlfse5Rgg1quZMTYoYHhd0ocDnjsN4.k_d6XmJMj70 n0gUxaC2H.2GkT2OuzOaaq6sb8jXR2nMxJ4l2YrPlgpcqpE_UYt4Aa4DB7NO 3KZKAiQ5BMy_F.ubfOGjOaKVJ1urxrFP9VMC8TrzNSuhP_P4SIQB149NJxw7 y8B3Srv9O_EBhufVaykyNzRnSYV0TP66hbPfkOnEDAaNDPqMs8gqjKToq98x QUEzetBrnV9XZHvN7ODk9FLA1fkk4iSBDsPbcNnI6KAmGoUhpnK2nrdBgRT2 JacBGyqHAFVJOYCqa34gPJ7dMaGURwMDA3EFJfQkMrQWThZtD452NJOHNYGJ Fdy6qGIzJpJpg2ha_ml4WBDe9UWu8hAi1Xskf4BGDCA2SYMuPL9q3faQy4ZH t31QdhuzBHDcbGxqIWnoURMa2Cg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BF01F2.4030502@FreeBSD.org> Date: Tue, 20 Jan 2015 20:33:38 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Navdeep Parhar , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <54BEFB79.6090806@FreeBSD.org> In-Reply-To: <54BEFB79.6090806@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:33:44 -0000 On 01/20/15 20:06, Navdeep Parhar wrote: > On 01/20/15 16:50, Pedro Giffuni wrote: >> >> On 01/20/15 18:21, Navdeep Parhar wrote: >>> The problem reported by Luigi has been fixed in r277225 already. >>> >>> Regards, >>> Navdeep >>> >> >> But the fix is rather ugly, isn't it? I would personally prefer to just >> kill the older >> gcc but in the meantime updating it so that it behaves like the updated >> gcc/clang would be better. IMHO. > > I'm not sure why you think the fix is ugly. Modifying the base > compiler to deal with minor stuff like this seems excessive and I > never even considered that. > "Modifying the base compiler to deal with minor stuff like this" is actually called "an update" since upstream already did it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 You could also call it "making it more compatible with clang and newer gcc" The base compiler is ugly as it can be but that's upstream's fault, not the fault those of us that were once condemned to add bandaids. Happily I am not planning to touch it anymore ;). Pedro. > Regards, > Navdeep > >> >> Pedro. >> >>> On 01/20/15 15:10, Pedro Giffuni wrote: >>>> Hi; >>>> >>>> I got this patch from the OpenBSD-tech list[1]. >>>> Perhaps this fixes the gcc issue? >>>> >>>> Apparently it's required for mesa too. >>>> >>>> Pedro. >>>> >>>> [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 >>>> >>>> On 01/06/15 15:33, Navdeep Parhar wrote: >>>>> On Tue, Jan 06, 2015 at 07:58:34PM +0100, Luigi Rizzo wrote: >>>>>> >>>>>> On Thu, Jan 1, 2015 at 12:19 AM, Navdeep Parhar >>>>>> wrote: >>>>>> >>>>>> Author: np >>>>>> Date: Wed Dec 31 23:19:16 2014 >>>>>> New Revision: 276485 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/276485 >>>>>> >>>>>> Log: >>>>>> cxgbe(4): major tx rework. >>>>>> >>>>>> >>>>>> FYI, this commit has some unnamed unions (eg. in t4_mp_ring.c) >>>>>> which prevent the kernel from compiling with our stock gcc >>>>>> and its standard kernel build flags (specifically -std=...). >>>>>> >>>>>> Adding the following in the kernel config >>>>>> >>>>>> makeoptions COPTFLAGS="-fms-extensions" >>>>>> >>>>>> seems to do the job >>>>>> >>>>>> I know it is unavoidable that we'll end up with gcc not working, >>>>>> but maybe we can still avoid unnamed unions. >>>>> There are two unresolved issues with mp_ring and I had to make the >>>>> driver amd64-only while I consider my options. >>>>> >>>>> - platforms where gcc is the default (and our version has problems >>>>> with >>>>> unnamed unions). This is simple to fix but reduces the >>>>> readability of >>>>> the code. But sure, if building head with gcc is popular then >>>>> that >>>>> trumps readability. I wonder if adding -fms-extensions just to >>>>> the >>>>> driver's build flags would be an acceptable compromise. >>>>> - platforms without the acq/rel versions of 64b cmpset. I think it >>>>> would be simple to add acq/rel variants to i386/pc98 and others >>>>> that >>>>> already have 64b cmpset. The driver will be permanently unplugged >>>>> from >>>>> whatever remains (only 32 bit powerpc I think). >>>>> >>>>> I'll try to sort all this out within the next couple of weeks. >>>>> >>>>> Regards, >>>>> Navdeep >>>>> >>>>>> cheers >>>>>> luigi >>>>>> >>>>>> >>>>>> a) Front load as much work as possible in if_transmit, before >>>>>> any driver >>>>>> lock or software queue has to get involved. >>>>>> >>>>>> b) Replace buf_ring with a brand new mp_ring (multiproducer >>>>>> ring). This >>>>>> is specifically for the tx multiqueue model where one of the >>>>>> if_transmit >>>>>> producer threads becomes the consumer and other producers >>>>>> carry on as >>>>>> usual. mp_ring is implemented as standalone code and it >>>>>> should be >>>>>> possible to use it in any driver with tx multiqueue. It also >>>>>> has: >>>>>> - the ability to enqueue/dequeue multiple items. This might >>>>>> become >>>>>> significant if packet batching is ever implemented. >>>>>> - an abdication mechanism to allow a thread to give up >>>>>> writing tx >>>>>> descriptors and have another if_transmit thread take over. >>>>>> A thread >>>>>> that's writing tx descriptors can end up doing so for an >>>>>> unbounded >>>>>> time period if a) there are other if_transmit threads >>>>>> continuously >>>>>> feeding the sofware queue, and b) the chip keeps up with >>>>>> whatever the >>>>>> thread is throwing at it. >>>>>> - accurate statistics about interesting events even when the >>>>>> stats come >>>>>> at the expense of additional branches/conditional code. >>>>>> >>>>>> The NIC txq lock is uncontested on the fast path at this >>>>>> point. I've >>>>>> left it there for synchronization with the control events >>>>>> (interface >>>>>> up/down, modload/unload). >>>>>> >>>>>> c) Add support for "type 1" coalescing work request in the >>>>>> normal NIC tx >>>>>> path. This work request is optimized for frames with a >>>>>> single >>>>>> item in >>>>>> the DMA gather list. These are very common when forwarding >>>>>> packets. >>>>>> Note that netmap tx in cxgbe already uses these "type 1" work >>>>>> requests. >>>>>> >>>>>> d) Do not request automatic cidx updates every 32 >>>>>> descriptors. Instead, >>>>>> request updates via bits in individual work requests (still >>>>>> every 32 >>>>>> descriptors approximately). Also, request an automatic final >>>>>> update >>>>>> when the queue idles after activity. This means NIC tx >>>>>> reclaim is still >>>>>> performed lazily but it will catch up quickly as soon as the >>>>>> queue >>>>>> idles. This seems to be the best middle ground and I'll >>>>>> probably do >>>>>> something similar for netmap tx as well. >>>>>> >>>>>> e) Implement a faster tx path for WRQs (used by TOE tx and >>>>>> control >>>>>> queues, _not_ by the normal NIC tx). Allow work requests to >>>>>> be written >>>>>> directly to the hardware descriptor ring if room is >>>>>> available. I will >>>>>> convert t4_tom and iw_cxgbe modules to this faster style >>>>>> gradually. >>>>>> >>>>>> MFC after: 2 months >>>>>> >>>>>> Added: >>>>>> head/sys/dev/cxgbe/t4_mp_ring.c (contents, props changed) >>>>>> head/sys/dev/cxgbe/t4_mp_ring.h (contents, props changed) >>>>>> Modified: >>>>>> head/sys/conf/files >>>>>> head/sys/dev/cxgbe/adapter.h >>>>>> head/sys/dev/cxgbe/t4_l2t.c >>>>>> head/sys/dev/cxgbe/t4_main.c >>>>>> head/sys/dev/cxgbe/t4_sge.c >>>>>> head/sys/modules/cxgbe/if_cxgbe/Makefile >>>>>> >>>>>> Modified: head/sys/conf/files >>>>>> >>>>>> =========================================================================== >>>>>> >>>>>> >>>>>> >>>>>> === >>>>>> --- head/sys/conf/files Wed Dec 31 22:52:43 2014 (r276484) >>>>>> +++ head/sys/conf/files Wed Dec 31 23:19:16 2014 (r276485) >>>>>> @@ -1142,6 +1142,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p >>>>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>>>> dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ >>>>>> compile-with "${NORMAL_C} -I$S/dev/cxgb" >>>>>> +dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ >>>>>> + compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>>>> dev/cxgbe/t4_main.c optional cxgbe pci \ >>>>>> compile-with "${NORMAL_C} -I$S/dev/cxgbe" >>>>>> dev/cxgbe/t4_netmap.c optional cxgbe pci \ >>>>>> >>>>>> Modified: head/sys/dev/cxgbe/adapter.h >>>>>> >>>>>> =========================================================================== >>>>>> >>>>>> >>>>>> >>>>>> === >>>>>> --- head/sys/dev/cxgbe/adapter.h Wed Dec 31 22:52:43 >>>>>> 2014 >>>>>> (r276484) >>>>>> +++ head/sys/dev/cxgbe/adapter.h Wed Dec 31 23:19:16 >>>>>> 2014 >>>>>> (r276485) >>>>>> @@ -152,7 +152,8 @@ enum { >>>>>> CL_METADATA_SIZE = CACHE_LINE_SIZE, >>>>>> >>>>>> SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR >>>>>> size in >>>>>> desc */ >>>>>> - TX_SGL_SEGS = 36, >>>>>> + TX_SGL_SEGS = 39, >>>>>> + TX_SGL_SEGS_TSO = 38, >>>>>> TX_WR_FLITS = SGE_MAX_WR_LEN / 8 >>>>>> }; >>>>>> >>>>>> @@ -273,6 +274,7 @@ struct port_info { >>>>>> struct timeval last_refreshed; >>>>>> struct port_stats stats; >>>>>> u_int tnl_cong_drops; >>>>>> + u_int tx_parse_error; >>>>>> >>>>>> eventhandler_tag vlan_c; >>>>>> >>>>>> @@ -308,23 +310,9 @@ struct tx_desc { >>>>>> __be64 flit[8]; >>>>>> }; >>>>>> >>>>>> -struct tx_map { >>>>>> - struct mbuf *m; >>>>>> - bus_dmamap_t map; >>>>>> -}; >>>>>> - >>>>>> -/* DMA maps used for tx */ >>>>>> -struct tx_maps { >>>>>> - struct tx_map *maps; >>>>>> - uint32_t map_total; /* # of DMA maps */ >>>>>> - uint32_t map_pidx; /* next map to be used */ >>>>>> - uint32_t map_cidx; /* reclaimed up to this >>>>>> index */ >>>>>> - uint32_t map_avail; /* # of available maps */ >>>>>> -}; >>>>>> - >>>>>> struct tx_sdesc { >>>>>> + struct mbuf *m; /* m_nextpkt linked chain of >>>>>> frames */ >>>>>> uint8_t desc_used; /* # of hardware descriptors >>>>>> used by the WR >>>>>> */ >>>>>> - uint8_t credits; /* NIC txq: # of frames sent >>>>>> out >>>>>> in the WR >>>>>> */ >>>>>> }; >>>>>> >>>>>> >>>>>> @@ -378,16 +366,12 @@ struct sge_iq { >>>>>> enum { >>>>>> EQ_CTRL = 1, >>>>>> EQ_ETH = 2, >>>>>> -#ifdef TCP_OFFLOAD >>>>>> EQ_OFLD = 3, >>>>>> -#endif >>>>>> >>>>>> /* eq flags */ >>>>>> - EQ_TYPEMASK = 7, /* 3 lsbits hold the >>>>>> type */ >>>>>> - EQ_ALLOCATED = (1 << 3), /* firmware resources >>>>>> allocated */ >>>>>> - EQ_DOOMED = (1 << 4), /* about to be >>>>>> destroyed */ >>>>>> - EQ_CRFLUSHED = (1 << 5), /* expecting an update >>>>>> from SGE */ >>>>>> - EQ_STALLED = (1 << 6), /* out of hw >>>>>> descriptors >>>>>> or dmamaps >>>>>> */ >>>>>> + EQ_TYPEMASK = 0x3, /* 2 lsbits hold the >>>>>> type (see >>>>>> above) */ >>>>>> + EQ_ALLOCATED = (1 << 2), /* firmware resources >>>>>> allocated */ >>>>>> + EQ_ENABLED = (1 << 3), /* open for business */ >>>>>> }; >>>>>> >>>>>> /* Listed in order of preference. Update t4_sysctls too if >>>>>> you >>>>>> change >>>>>> these */ >>>>>> @@ -402,32 +386,25 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB >>>>>> struct sge_eq { >>>>>> unsigned int flags; /* MUST be first */ >>>>>> unsigned int cntxt_id; /* SGE context id for the eq */ >>>>>> - bus_dma_tag_t desc_tag; >>>>>> - bus_dmamap_t desc_map; >>>>>> - char lockname[16]; >>>>>> struct mtx eq_lock; >>>>>> >>>>>> struct tx_desc *desc; /* KVA of descriptor ring */ >>>>>> - bus_addr_t ba; /* bus address of descriptor >>>>>> ring */ >>>>>> - struct sge_qstat *spg; /* status page, for >>>>>> convenience */ >>>>>> uint16_t doorbells; >>>>>> volatile uint32_t *udb; /* KVA of doorbell (lies within >>>>>> BAR2) */ >>>>>> u_int udb_qid; /* relative qid within the >>>>>> doorbell page */ >>>>>> - uint16_t cap; /* max # of desc, for >>>>>> convenience */ >>>>>> - uint16_t avail; /* available descriptors, for >>>>>> convenience * >>>>>> / >>>>>> - uint16_t qsize; /* size (# of entries) of the >>>>>> queue */ >>>>>> + uint16_t sidx; /* index of the entry with the >>>>>> status page >>>>>> */ >>>>>> uint16_t cidx; /* consumer idx (desc idx) */ >>>>>> uint16_t pidx; /* producer idx (desc idx) */ >>>>>> - uint16_t pending; /* # of descriptors used since >>>>>> last >>>>>> doorbell */ >>>>>> + uint16_t equeqidx; /* EQUEQ last requested at this >>>>>> pidx */ >>>>>> + uint16_t dbidx; /* pidx of the most recent >>>>>> doorbell */ >>>>>> uint16_t iqid; /* iq that gets egr_update for >>>>>> the eq */ >>>>>> uint8_t tx_chan; /* tx channel used by the eq */ >>>>>> - struct task tx_task; >>>>>> - struct callout tx_callout; >>>>>> + volatile u_int equiq; /* EQUIQ outstanding */ >>>>>> >>>>>> - /* stats */ >>>>>> - >>>>>> - uint32_t egr_update; /* # of SGE_EGR_UPDATE >>>>>> notifications for eq >>>>>> */ >>>>>> - uint32_t unstalled; /* recovered from stall */ >>>>>> + bus_dma_tag_t desc_tag; >>>>>> + bus_dmamap_t desc_map; >>>>>> + bus_addr_t ba; /* bus address of descriptor >>>>>> ring */ >>>>>> + char lockname[16]; >>>>>> }; >>>>>> >>>>>> struct sw_zone_info { >>>>>> @@ -499,18 +476,19 @@ struct sge_fl { >>>>>> struct cluster_layout cll_alt; /* alternate refill >>>>>> zone, layout */ >>>>>> }; >>>>>> >>>>>> +struct mp_ring; >>>>>> + >>>>>> /* txq: SGE egress queue + what's needed for Ethernet NIC */ >>>>>> struct sge_txq { >>>>>> struct sge_eq eq; /* MUST be first */ >>>>>> >>>>>> struct ifnet *ifp; /* the interface this txq >>>>>> belongs to */ >>>>>> - bus_dma_tag_t tx_tag; /* tag for transmit buffers */ >>>>>> - struct buf_ring *br; /* tx buffer ring */ >>>>>> + struct mp_ring *r; /* tx software ring */ >>>>>> struct tx_sdesc *sdesc; /* KVA of software descriptor >>>>>> ring */ >>>>>> - struct mbuf *m; /* held up due to temporary >>>>>> resource >>>>>> shortage */ >>>>>> - >>>>>> - struct tx_maps txmaps; >>>>>> + struct sglist *gl; >>>>>> + __be32 cpl_ctrl0; /* for convenience */ >>>>>> >>>>>> + struct task tx_reclaim_task; >>>>>> /* stats for common events first */ >>>>>> >>>>>> uint64_t txcsum; /* # of times hardware assisted >>>>>> with >>>>>> checksum */ >>>>>> @@ -519,13 +497,12 @@ struct sge_txq { >>>>>> uint64_t imm_wrs; /* # of work requests with >>>>>> immediate data * >>>>>> / >>>>>> uint64_t sgl_wrs; /* # of work requests with >>>>>> direct SGL */ >>>>>> uint64_t txpkt_wrs; /* # of txpkt work requests >>>>>> (not >>>>>> coalesced) >>>>>> */ >>>>>> - uint64_t txpkts_wrs; /* # of coalesced tx work >>>>>> requests */ >>>>>> - uint64_t txpkts_pkts; /* # of frames in coalesced tx >>>>>> work >>>>>> requests */ >>>>>> + uint64_t txpkts0_wrs; /* # of type0 coalesced tx work >>>>>> requests */ >>>>>> + uint64_t txpkts1_wrs; /* # of type1 coalesced tx work >>>>>> requests */ >>>>>> + uint64_t txpkts0_pkts; /* # of frames in type0 >>>>>> coalesced tx WRs */ >>>>>> + uint64_t txpkts1_pkts; /* # of frames in type1 >>>>>> coalesced tx WRs */ >>>>>> >>>>>> /* stats for not-that-common events */ >>>>>> - >>>>>> - uint32_t no_dmamap; /* no DMA map to load the >>>>>> mbuf */ >>>>>> - uint32_t no_desc; /* out of hardware >>>>>> descriptors */ >>>>>> } __aligned(CACHE_LINE_SIZE); >>>>>> >>>>>> /* rxq: SGE ingress queue + SGE free list + miscellaneous >>>>>> items */ >>>>>> @@ -574,7 +551,13 @@ struct wrqe { >>>>>> STAILQ_ENTRY(wrqe) link; >>>>>> struct sge_wrq *wrq; >>>>>> int wr_len; >>>>>> - uint64_t wr[] __aligned(16); >>>>>> + char wr[] __aligned(16); >>>>>> +}; >>>>>> + >>>>>> +struct wrq_cookie { >>>>>> + TAILQ_ENTRY(wrq_cookie) link; >>>>>> + int ndesc; >>>>>> + int pidx; >>>>>> }; >>>>>> >>>>>> /* >>>>>> @@ -585,17 +568,32 @@ struct sge_wrq { >>>>>> struct sge_eq eq; /* MUST be first */ >>>>>> >>>>>> struct adapter *adapter; >>>>>> + struct task wrq_tx_task; >>>>>> + >>>>>> + /* Tx desc reserved but WR not "committed" yet. */ >>>>>> + TAILQ_HEAD(wrq_incomplete_wrs , wrq_cookie) >>>>>> incomplete_wrs; >>>>>> >>>>>> - /* List of WRs held up due to lack of tx descriptors */ >>>>>> + /* List of WRs ready to go out as soon as >>>>>> descriptors are >>>>>> available. */ >>>>>> STAILQ_HEAD(, wrqe) wr_list; >>>>>> + u_int nwr_pending; >>>>>> + u_int ndesc_needed; >>>>>> >>>>>> /* stats for common events first */ >>>>>> >>>>>> - uint64_t tx_wrs; /* # of tx work requests */ >>>>>> + uint64_t tx_wrs_direct; /* # of WRs written directly to >>>>>> desc ring. >>>>>> */ >>>>>> + uint64_t tx_wrs_ss; /* # of WRs copied from scratch >>>>>> space. */ >>>>>> + uint64_t tx_wrs_copied; /* # of WRs queued and >>>>>> copied to >>>>>> desc ring. >>>>>> */ >>>>>> >>>>>> /* stats for not-that-common events */ >>>>>> >>>>>> - uint32_t no_desc; /* out of hardware >>>>>> descriptors */ >>>>>> + /* >>>>>> + * Scratch space for work requests that wrap around >>>>>> after reaching >>>>>> the >>>>>> + * status page, and some infomation about the last WR >>>>>> that used it. >>>>>> + */ >>>>>> + uint16_t ss_pidx; >>>>>> + uint16_t ss_len; >>>>>> + uint8_t ss[SGE_MAX_WR_LEN]; >>>>>> + >>>>>> } __aligned(CACHE_LINE_SIZE); >>>>>> >>>>>> >>>>>> @@ -744,7 +742,7 @@ struct adapter { >>>>>> struct sge sge; >>>>>> int lro_timeout; >>>>>> >>>>>> - struct taskqueue *tq[NCHAN]; /* taskqueues that >>>>>> flush >>>>>> data out * >>>>>> / >>>>>> + struct taskqueue *tq[NCHAN]; /* General purpose >>>>>> taskqueues */ >>>>>> struct port_info *port[MAX_NPORTS]; >>>>>> uint8_t chan_map[NCHAN]; >>>>>> >>>>>> @@ -978,12 +976,11 @@ static inline int >>>>>> tx_resume_threshold(struct sge_eq *eq) >>>>>> { >>>>>> >>>>>> - return (eq->qsize / 4); >>>>>> + /* not quite the same as qsize / 4, but this will >>>>>> do. */ >>>>>> + return (eq->sidx / 4); >>>>>> } >>>>>> >>>>>> /* t4_main.c */ >>>>>> -void t4_tx_task(void *, int); >>>>>> -void t4_tx_callout(void *); >>>>>> int t4_os_find_pci_capability(struct adapter *, int); >>>>>> int t4_os_pci_save_state(struct adapter *); >>>>>> int t4_os_pci_restore_state(struct adapter *); >>>>>> @@ -1024,16 +1021,15 @@ int t4_setup_adapter_queues(struct >>>>>> adapt >>>>>> int t4_teardown_adapter_queues(struct adapter *); >>>>>> int t4_setup_port_queues(struct port_info *); >>>>>> int t4_teardown_port_queues(struct port_info *); >>>>>> -int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, >>>>>> int); >>>>>> -void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); >>>>>> void t4_intr_all(void *); >>>>>> void t4_intr(void *); >>>>>> void t4_intr_err(void *); >>>>>> void t4_intr_evt(void *); >>>>>> void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, >>>>>> struct wrqe *); >>>>>> -int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf >>>>>> *); >>>>>> void t4_update_fl_bufsize(struct ifnet *); >>>>>> -int can_resume_tx(struct sge_eq *); >>>>>> +int parse_pkt(struct mbuf **); >>>>>> +void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie >>>>>> *); >>>>>> +void commit_wrq_wr(struct sge_wrq *, void *, struct >>>>>> wrq_cookie *); >>>>>> >>>>>> /* t4_tracer.c */ >>>>>> struct t4_tracer; >>>>>> >>>>>> Modified: head/sys/dev/cxgbe/t4_l2t.c >>>>>> >>>>>> =========================================================================== >>>>>> >>>>>> >>>>>> >>>>>> === >>>>>> --- head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 22:52:43 2014 >>>>>> (r276484) >>>>>> +++ head/sys/dev/cxgbe/t4_l2t.c Wed Dec 31 23:19:16 2014 >>>>>> (r276485) >>>>>> @@ -113,16 +113,15 @@ found: >>>>>> int >>>>>> t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int >>>>>> sync) >>>>>> { >>>>>> - struct wrqe *wr; >>>>>> + struct wrq_cookie cookie; >>>>>> struct cpl_l2t_write_req *req; >>>>>> int idx = e->idx + sc->vres.l2t.start; >>>>>> >>>>>> mtx_assert(&e->lock, MA_OWNED); >>>>>> >>>>>> - wr = alloc_wrqe(sizeof(*req), &sc->sge.mgmtq); >>>>>> - if (wr == NULL) >>>>>> + req = start_wrq_wr(&sc->sge.mgmtq, >>>>>> howmany(sizeof(*req), >>>>>> 16), & >>>>>> cookie); >>>>>> + if (req == NULL) >>>>>> return (ENOMEM); >>>>>> - req = wrtod(wr); >>>>>> >>>>>> INIT_TP_WR(req, 0); >>>>>> OPCODE_TID(req) = >>>>>> htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, >>>>>> idx | >>>>>> @@ -132,7 +131,7 @@ t4_write_l2e(struct adapter *sc, struct >>>>>> req->vlan = htons(e->vlan); >>>>>> memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); >>>>>> >>>>>> - t4_wrq_tx(sc, wr); >>>>>> + commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); >>>>>> >>>>>> if (sync && e->state != L2T_STATE_SWITCHING) >>>>>> e->state = L2T_STATE_SYNC_WRITE; >>>>>> >>>>>> Modified: head/sys/dev/cxgbe/t4_main.c >>>>>> >>>>>> =========================================================================== >>>>>> >>>>>> >>>>>> >>>>>> === >>>>>> --- head/sys/dev/cxgbe/t4_main.c Wed Dec 31 22:52:43 >>>>>> 2014 >>>>>> (r276484) >>>>>> +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 31 23:19:16 >>>>>> 2014 >>>>>> (r276485) >>>>>> @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); >>>>>> #include "common/t4_regs_values.h" >>>>>> #include "t4_ioctl.h" >>>>>> #include "t4_l2t.h" >>>>>> +#include "t4_mp_ring.h" >>>>>> >>>>>> /* T4 bus driver interface */ >>>>>> static int t4_probe(device_t); >>>>>> @@ -378,7 +379,8 @@ static void build_medialist(struct port_ >>>>>> static int cxgbe_init_synchronized(struct port_info *); >>>>>> static int cxgbe_uninit_synchronized(struct port_info *); >>>>>> static int setup_intr_handlers(struct adapter *); >>>>>> -static void quiesce_eq(struct adapter *, struct sge_eq *); >>>>>> +static void quiesce_txq(struct adapter *, struct sge_txq *); >>>>>> +static void quiesce_wrq(struct adapter *, struct sge_wrq *); >>>>>> static void quiesce_iq(struct adapter *, struct sge_iq *); >>>>>> static void quiesce_fl(struct adapter *, struct sge_fl *); >>>>>> static int t4_alloc_irq(struct adapter *, struct irq *, int >>>>>> rid, >>>>>> @@ -434,7 +436,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER >>>>>> static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); >>>>>> static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); >>>>>> #endif >>>>>> -static inline void txq_start(struct ifnet *, struct sge_txq >>>>>> *); >>>>>> static uint32_t fconf_to_mode(uint32_t); >>>>>> static uint32_t mode_to_fconf(uint32_t); >>>>>> static uint32_t fspec_to_fconf(struct t4_filter_specification >>>>>> *); >>>>>> @@ -1429,67 +1430,36 @@ cxgbe_transmit(struct ifnet *ifp, >>>>>> struct >>>>>> { >>>>>> struct port_info *pi = ifp->if_softc; >>>>>> struct adapter *sc = pi->adapter; >>>>>> - struct sge_txq *txq = &sc->sge.txq[pi->first_txq]; >>>>>> - struct buf_ring *br; >>>>>> + struct sge_txq *txq; >>>>>> + void *items[1]; >>>>>> int rc; >>>>>> >>>>>> M_ASSERTPKTHDR(m); >>>>>> + MPASS(m->m_nextpkt == NULL); /* not quite ready for >>>>>> this yet */ >>>>>> >>>>>> if (__predict_false(pi->link_cfg.link_ok == 0)) { >>>>>> m_freem(m); >>>>>> return (ENETDOWN); >>>>>> } >>>>>> >>>>>> - /* check if flowid is set */ >>>>>> - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>>>> - txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>>>> rsrv_noflowq)) >>>>>> - + pi->rsrv_noflowq); >>>>>> - br = txq->br; >>>>>> - >>>>>> - if (TXQ_TRYLOCK(txq) == 0) { >>>>>> - struct sge_eq *eq = &txq->eq; >>>>>> - >>>>>> - /* >>>>>> - * It is possible that t4_eth_tx finishes up >>>>>> and >>>>>> releases >>>>>> the >>>>>> - * lock between the TRYLOCK above and the >>>>>> drbr_enqueue >>>>>> here. We >>>>>> - * need to make sure that this mbuf doesn't >>>>>> just >>>>>> sit there >>>>>> in >>>>>> - * the drbr. >>>>>> - */ >>>>>> - >>>>>> - rc = drbr_enqueue(ifp, br, m); >>>>>> - if (rc == 0 && callout_pending(&eq->tx_callout) >>>>>> == 0 && >>>>>> - !(eq->flags & EQ_DOOMED)) >>>>>> - callout_reset(&eq->tx_callout, 1, >>>>>> t4_tx_callout, >>>>>> eq); >>>>>> + rc = parse_pkt(&m); >>>>>> + if (__predict_false(rc != 0)) { >>>>>> + MPASS(m == NULL); /* was >>>>>> freed >>>>>> already */ >>>>>> + atomic_add_int(&pi->tx_parse_error, 1); /* rare, >>>>>> atomic is >>>>>> ok */ >>>>>> return (rc); >>>>>> } >>>>>> >>>>>> - /* >>>>>> - * txq->m is the mbuf that is held up due to a >>>>>> temporary >>>>>> shortage >>>>>> of >>>>>> - * resources and it should be put on the wire first. >>>>>> Then what's >>>>>> in >>>>>> - * drbr and finally the mbuf that was just passed in >>>>>> to us. >>>>>> - * >>>>>> - * Return code should indicate the fate of the mbuf >>>>>> that >>>>>> was passed >>>>>> in >>>>>> - * this time. >>>>>> - */ >>>>>> - >>>>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>>>> - if (drbr_needs_enqueue(ifp, br) || txq->m) { >>>>>> - >>>>>> - /* Queued for transmission. */ >>>>>> - >>>>>> - rc = drbr_enqueue(ifp, br, m); >>>>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>>>> - (void) t4_eth_tx(ifp, txq, m); >>>>>> - TXQ_UNLOCK(txq); >>>>>> - return (rc); >>>>>> - } >>>>>> + /* Select a txq. */ >>>>>> + txq = &sc->sge.txq[pi->first_txq]; >>>>>> + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) >>>>>> + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi-> >>>>>> rsrv_noflowq)) + >>>>>> + pi->rsrv_noflowq); >>>>>> >>>>>> - /* Direct transmission. */ >>>>>> - rc = t4_eth_tx(ifp, txq, m); >>>>>> - if (rc != 0 && txq->m) >>>>>> - rc = 0; /* held, will be transmitted soon >>>>>> (hopefully) */ >>>>>> + items[0] = m; >>>>>> + rc = mp_ring_enqueue(txq->r, items, 1, 4096); >>>>>> + if (__predict_false(rc != 0)) >>>>>> + m_freem(m); >>>>>> >>>>>> - TXQ_UNLOCK(txq); >>>>>> return (rc); >>>>>> } >>>>>> >>>>>> @@ -1499,17 +1469,17 @@ cxgbe_qflush(struct ifnet *ifp) >>>>>> struct port_info *pi = ifp->if_softc; >>>>>> struct sge_txq *txq; >>>>>> int i; >>>>>> - struct mbuf *m; >>>>>> >>>>>> /* queues do not exist if !PORT_INIT_DONE. */ >>>>>> if (pi->flags & PORT_INIT_DONE) { >>>>>> for_each_txq(pi, i, txq) { >>>>>> TXQ_LOCK(txq); >>>>>> - m_freem(txq->m); >>>>>> - txq->m = NULL; >>>>>> - while ((m = >>>>>> buf_ring_dequeue_sc(txq->br)) != NULL) >>>>>> - m_freem(m); >>>>>> + txq->eq.flags &= ~EQ_ENABLED; >>>>>> TXQ_UNLOCK(txq); >>>>>> + while (!mp_ring_is_idle(txq->r)) { >>>>>> + mp_ring_check_drainage(txq->r, 0); >>>>>> + pause("qflush", 1); >>>>>> + } >>>>>> } >>>>>> } >>>>>> if_qflush(ifp); >>>>>> @@ -1564,7 +1534,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift >>>>>> struct sge_txq *txq; >>>>>> >>>>>> for_each_txq(pi, i, txq) >>>>>> - drops += txq->br->br_drops; >>>>>> + drops += >>>>>> counter_u64_fetch(txq->r->drops); >>>>>> } >>>>>> >>>>>> return (drops); >>>>>> @@ -3236,7 +3206,8 @@ cxgbe_init_synchronized(struct port_info >>>>>> { >>>>>> struct adapter *sc = pi->adapter; >>>>>> struct ifnet *ifp = pi->ifp; >>>>>> - int rc = 0; >>>>>> + int rc = 0, i; >>>>>> + struct sge_txq *txq; >>>>>> >>>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>>> >>>>>> @@ -3265,6 +3236,17 @@ cxgbe_init_synchronized(struct port_info >>>>>> } >>>>>> >>>>>> /* >>>>>> + * Can't fail from this point onwards. Review >>>>>> cxgbe_uninit_synchronized >>>>>> + * if this changes. >>>>>> + */ >>>>>> + >>>>>> + for_each_txq(pi, i, txq) { >>>>>> + TXQ_LOCK(txq); >>>>>> + txq->eq.flags |= EQ_ENABLED; >>>>>> + TXQ_UNLOCK(txq); >>>>>> + } >>>>>> + >>>>>> + /* >>>>>> * The first iq of the first port to come up is used >>>>>> for >>>>>> tracing. >>>>>> */ >>>>>> if (sc->traceq < 0) { >>>>>> @@ -3297,7 +3279,8 @@ cxgbe_uninit_synchronized(struct port_in >>>>>> { >>>>>> struct adapter *sc = pi->adapter; >>>>>> struct ifnet *ifp = pi->ifp; >>>>>> - int rc; >>>>>> + int rc, i; >>>>>> + struct sge_txq *txq; >>>>>> >>>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>>> >>>>>> @@ -3314,6 +3297,12 @@ cxgbe_uninit_synchronized(struct port_in >>>>>> return (rc); >>>>>> } >>>>>> >>>>>> + for_each_txq(pi, i, txq) { >>>>>> + TXQ_LOCK(txq); >>>>>> + txq->eq.flags &= ~EQ_ENABLED; >>>>>> + TXQ_UNLOCK(txq); >>>>>> + } >>>>>> + >>>>>> clrbit(&sc->open_device_map, pi->port_id); >>>>>> PORT_LOCK(pi); >>>>>> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >>>>>> @@ -3543,15 +3532,17 @@ port_full_uninit(struct port_info *pi) >>>>>> >>>>>> if (pi->flags & PORT_INIT_DONE) { >>>>>> >>>>>> - /* Need to quiesce queues. XXX: ctrl >>>>>> queues? */ >>>>>> + /* Need to quiesce queues. */ >>>>>> + >>>>>> + quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); >>>>>> >>>>>> for_each_txq(pi, i, txq) { >>>>>> - quiesce_eq(sc, &txq->eq); >>>>>> + quiesce_txq(sc, txq); >>>>>> } >>>>>> >>>>>> #ifdef TCP_OFFLOAD >>>>>> for_each_ofld_txq(pi, i, ofld_txq) { >>>>>> - quiesce_eq(sc, &ofld_txq->eq); >>>>>> + quiesce_wrq(sc, ofld_txq); >>>>>> } >>>>>> #endif >>>>>> >>>>>> @@ -3576,23 +3567,39 @@ port_full_uninit(struct port_info *pi) >>>>>> } >>>>>> >>>>>> static void >>>>>> -quiesce_eq(struct adapter *sc, struct sge_eq *eq) >>>>>> +quiesce_txq(struct adapter *sc, struct sge_txq *txq) >>>>>> { >>>>>> - EQ_LOCK(eq); >>>>>> - eq->flags |= EQ_DOOMED; >>>>>> + struct sge_eq *eq = &txq->eq; >>>>>> + struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; >>>>>> >>>>>> - /* >>>>>> - * Wait for the response to a credit flush if one's >>>>>> - * pending. >>>>>> - */ >>>>>> - while (eq->flags & EQ_CRFLUSHED) >>>>>> - mtx_sleep(eq, &eq->eq_lock, 0, "crflush", 0); >>>>>> - EQ_UNLOCK(eq); >>>>>> + (void) sc; /* unused */ >>>>>> >>>>>> - callout_drain(&eq->tx_callout); /* XXX: iffy */ >>>>>> - pause("callout", 10); /* Still iffy */ >>>>>> +#ifdef INVARIANTS >>>>>> + TXQ_LOCK(txq); >>>>>> + MPASS((eq->flags & EQ_ENABLED) == 0); >>>>>> + TXQ_UNLOCK(txq); >>>>>> +#endif >>>>>> >>>>>> - taskqueue_drain(sc->tq[eq->tx_chan], &eq->tx_task); >>>>>> + /* Wait for the mp_ring to empty. */ >>>>>> + while (!mp_ring_is_idle(txq->r)) { >>>>>> + mp_ring_check_drainage(txq->r, 0); >>>>>> + pause("rquiesce", 1); >>>>>> + } >>>>>> + >>>>>> + /* Then wait for the hardware to finish. */ >>>>>> + while (spg->cidx != htobe16(eq->pidx)) >>>>>> + pause("equiesce", 1); >>>>>> + >>>>>> + /* Finally, wait for the driver to reclaim all >>>>>> descriptors. */ >>>>>> + while (eq->cidx != eq->pidx) >>>>>> + pause("dquiesce", 1); >>>>>> +} >>>>>> + >>>>>> +static void >>>>>> +quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) >>>>>> +{ >>>>>> + >>>>>> + /* XXXTX */ >>>>>> } >>>>>> >>>>>> static void >>>>>> @@ -4892,6 +4899,9 @@ cxgbe_sysctls(struct port_info *pi) >>>>>> oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", >>>>>> CTLFLAG_RD, >>>>>> NULL, "port statistics"); >>>>>> children = SYSCTL_CHILDREN(oid); >>>>>> + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, >>>>>> "tx_parse_error", >>>>>> CTLFLAG_RD, >>>>>> + &pi->tx_parse_error, 0, >>>>>> + "# of tx packets with invalid length or # of >>>>>> segments"); >>>>>> >>>>>> #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ >>>>>> SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ >>>>>> @@ -6947,74 +6957,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) >>>>>> } >>>>>> #endif >>>>>> >>>>>> -static inline void >>>>>> -txq_start(struct ifnet *ifp, struct sge_txq *txq) >>>>>> -{ >>>>>> - struct buf_ring *br; >>>>>> - struct mbuf *m; >>>>>> - >>>>>> - TXQ_LOCK_ASSERT_OWNED(txq); >>>>>> - >>>>>> - br = txq->br; >>>>>> - m = txq->m ? txq->m : drbr_dequeue(ifp, br); >>>>>> - if (m) >>>>>> - t4_eth_tx(ifp, txq, m); >>>>>> -} >>>>>> - >>>>>> -void >>>>>> -t4_tx_callout(void *arg) >>>>>> -{ >>>>>> - struct sge_eq *eq = arg; >>>>>> - struct adapter *sc; >>>>>> - >>>>>> - if (EQ_TRYLOCK(eq) == 0) >>>>>> - goto reschedule; >>>>>> - >>>>>> - if (eq->flags & EQ_STALLED && !can_resume_tx(eq)) { >>>>>> - EQ_UNLOCK(eq); >>>>>> -reschedule: >>>>>> - if (__predict_true(!(eq->flags && EQ_DOOMED))) >>>>>> - callout_schedule(&eq->tx_callout, 1); >>>>>> - return; >>>>>> - } >>>>>> - >>>>>> - EQ_LOCK_ASSERT_OWNED(eq); >>>>>> - >>>>>> - if (__predict_true((eq->flags & EQ_DOOMED) == 0)) { >>>>>> - >>>>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>>>> - struct sge_txq *txq = arg; >>>>>> - struct port_info *pi = >>>>>> txq->ifp->if_softc; >>>>>> - >>>>>> - sc = pi->adapter; >>>>>> - } else { >>>>>> - struct sge_wrq *wrq = arg; >>>>>> - >>>>>> - sc = wrq->adapter; >>>>>> - } >>>>>> - >>>>>> - taskqueue_enqueue(sc->tq[eq->tx_chan], >>>>>> &eq->tx_task); >>>>>> - } >>>>>> - >>>>>> - EQ_UNLOCK(eq); >>>>>> -} >>>>>> - >>>>>> -void >>>>>> -t4_tx_task(void *arg, int count) >>>>>> -{ >>>>>> - struct sge_eq *eq = arg; >>>>>> - >>>>>> - EQ_LOCK(eq); >>>>>> - if ((eq->flags & EQ_TYPEMASK) == EQ_ETH) { >>>>>> - struct sge_txq *txq = arg; >>>>>> - txq_start(txq->ifp, txq); >>>>>> - } else { >>>>>> - struct sge_wrq *wrq = arg; >>>>>> - t4_wrq_tx_locked(wrq->adapter, wrq, NULL); >>>>>> - } >>>>>> - EQ_UNLOCK(eq); >>>>>> -} >>>>>> - >>>>>> static uint32_t >>>>>> fconf_to_mode(uint32_t fconf) >>>>>> { >>>>>> @@ -7452,9 +7394,9 @@ static int >>>>>> set_filter_wr(struct adapter *sc, int fidx) >>>>>> { >>>>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>>>> - struct wrqe *wr; >>>>>> struct fw_filter_wr *fwr; >>>>>> unsigned int ftid; >>>>>> + struct wrq_cookie cookie; >>>>>> >>>>>> ASSERT_SYNCHRONIZED_OP(sc); >>>>>> >>>>>> @@ -7473,12 +7415,10 @@ set_filter_wr(struct adapter *sc, >>>>>> int fi >>>>>> >>>>>> ftid = sc->tids.ftid_base + fidx; >>>>>> >>>>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>>>> - if (wr == NULL) >>>>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, >>>>>> howmany(sizeof(*fwr), >>>>>> 16), & >>>>>> cookie); >>>>>> + if (fwr == NULL) >>>>>> return (ENOMEM); >>>>>> - >>>>>> - fwr = wrtod(wr); >>>>>> - bzero(fwr, sizeof (*fwr)); >>>>>> + bzero(fwr, sizeof(*fwr)); >>>>>> >>>>>> fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); >>>>>> fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); >>>>>> @@ -7547,7 +7487,7 @@ set_filter_wr(struct adapter *sc, int fi >>>>>> f->pending = 1; >>>>>> sc->tids.ftids_in_use++; >>>>>> >>>>>> - t4_wrq_tx(sc, wr); >>>>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>>>> return (0); >>>>>> } >>>>>> >>>>>> @@ -7555,22 +7495,21 @@ static int >>>>>> del_filter_wr(struct adapter *sc, int fidx) >>>>>> { >>>>>> struct filter_entry *f = &sc->tids.ftid_tab[fidx]; >>>>>> - struct wrqe *wr; >>>>>> struct fw_filter_wr *fwr; >>>>>> unsigned int ftid; >>>>>> + struct wrq_cookie cookie; >>>>>> >>>>>> ftid = sc->tids.ftid_base + fidx; >>>>>> >>>>>> - wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); >>>>>> - if (wr == NULL) >>>>>> + fwr = start_wrq_wr(&sc->sge.mgmtq, >>>>>> howmany(sizeof(*fwr), >>>>>> 16), & >>>>>> cookie); >>>>>> + if (fwr == NULL) >>>>>> return (ENOMEM); >>>>>> - fwr = wrtod(wr); >>>>>> bzero(fwr, sizeof (*fwr)); >>>>>> >>>>>> t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id); >>>>>> >>>>>> f->pending = 1; >>>>>> - t4_wrq_tx(sc, wr); >>>>>> + commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); >>>>>> return (0); >>>>>> } >>>>>> >>>>>> @@ -8170,6 +8109,7 @@ t4_ioctl(struct cdev *dev, unsigned long >>>>>> >>>>>> /* MAC stats */ >>>>>> t4_clr_port_stats(sc, pi->tx_chan); >>>>>> + pi->tx_parse_error = 0; >>>>>> >>>>>> if (pi->flags & PORT_INIT_DONE) { >>>>>> struct sge_rxq *rxq; >>>>>> @@ -8192,24 +8132,24 @@ t4_ioctl(struct cdev *dev, unsigned >>>>>> long >>>>>> txq->imm_wrs = 0; >>>>>> txq->sgl_wrs = 0; >>>>>> txq->txpkt_wrs = 0; >>>>>> - txq->txpkts_wrs = 0; >>>>>> - txq->txpkts_pkts = 0; >>>>>> - txq->br->br_drops = 0; >>>>>> - txq->no_dmamap = 0; >>>>>> - txq->no_desc = 0; >>>>>> + txq->txpkts0_wrs = 0; >>>>>> + txq->txpkts1_wrs = 0; >>>>>> + txq->txpkts0_pkts = 0; >>>>>> + txq->txpkts1_pkts = 0; >>>>>> + mp_ring_reset_stats(txq->r); >>>>>> } >>>>>> >>>>>> #ifdef TCP_OFFLOAD >>>>>> /* nothing to clear for each >>>>>> ofld_rxq */ >>>>>> >>>>>> for_each_ofld_txq(pi, i, wrq) { >>>>>> - wrq->tx_wrs = 0; >>>>>> - wrq->no_desc = 0; >>>>>> + wrq->tx_wrs_direct = 0; >>>>>> + wrq->tx_wrs_copied = 0; >>>>>> } >>>>>> #endif >>>>>> wrq = &sc->sge.ctrlq[pi->port_id]; >>>>>> - wrq->tx_wrs = 0; >>>>>> - wrq->no_desc = 0; >>>>>> + wrq->tx_wrs_direct = 0; >>>>>> + wrq->tx_wrs_copied = 0; >>>>>> } >>>>>> break; >>>>>> } >>>>>> >>>>>> Added: head/sys/dev/cxgbe/t4_mp_ring.c >>>>>> >>>>>> =========================================================================== >>>>>> >>>>>> >>>>>> >>>>>> === >>>>>> --- /dev/null 00:00:00 1970 (empty, because file is newly >>>>>> added) >>>>>> +++ head/sys/dev/cxgbe/t4_mp_ring.c Wed Dec 31 23:19:16 >>>>>> 2014 >>>>>> (r276485) >>>>>> @@ -0,0 +1,364 @@ >>>>>> +/*- >>>>>> + * Copyright (c) 2014 Chelsio Communications, Inc. >>>>>> + * All rights reserved. >>>>>> + * Written by: Navdeep Parhar >>>>>> + * >>>>>> + * 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 "t4_mp_ring.h" >>>>>> + >>>>>> +union ring_state { >>>>>> + struct { >>>>>> + uint16_t pidx_head; >>>>>> + uint16_t pidx_tail; >>>>>> + uint16_t cidx; >>>>>> + uint16_t flags; >>>>>> + }; >>>>>> + uint64_t state; >>>>>> +}; >>>>>> + >>>>>> +enum { >>>>>> + IDLE = 0, /* consumer ran to completion, nothing >>>>>> more to do. >>>>>> */ >>>>>> + BUSY, /* consumer is running already, or will >>>>>> be shortly. >>>>>> */ >>>>>> + STALLED, /* consumer stopped due to lack of >>>>>> resources. */ >>>>>> + ABDICATED, /* consumer stopped even though there >>>>>> was work to >>>>>> be >>>>>> + done because it wants another thread >>>>>> to take >>>>>> over. */ >>>>>> +}; >>>>>> + >>>>>> +static inline uint16_t >>>>>> +space_available(struct mp_ring *r, union ring_state s) >>>>>> +{ >>>>>> + uint16_t x = r->size - 1; >>>>>> + >>>>>> + if (s.cidx == s.pidx_head) >>>>>> + return (x); >>>>>> + else if (s.cidx > s.pidx_head) >>>>>> + return (s.cidx - s.pidx_head - 1); >>>>>> + else >>>>>> + return (x - s.pidx_head + s.cidx); >>>>>> +} >>>>>> + >>>>>> +static inline uint16_t >>>>>> +increment_idx(struct mp_ring *r, uint16_t idx, uint16_t n) >>>>>> +{ >>>>>> + int x = r->size - idx; >>>>>> + >>>>>> + MPASS(x > 0); >>>>>> + return (x > n ? idx + n : n - x); >>>>>> +} >>>>>> + >>>>>> +/* Consumer is about to update the ring's state to s */ >>>>>> +static inline uint16_t >>>>>> +state_to_flags(union ring_state s, int abdicate) >>>>>> +{ >>>>>> + >>>>>> + if (s.cidx == s.pidx_tail) >>>>>> + return (IDLE); >>>>>> + else if (abdicate && s.pidx_tail != s.pidx_head) >>>>>> + return (ABDICATED); >>>>>> + >>>>>> + return (BUSY); >>>>>> +} >>>>>> + >>>>>> +/* >>>>>> + * Caller passes in a state, with a guarantee that there is >>>>>> work to do and >>>>>> that >>>>>> + * all items up to the pidx_tail in the state are visible. >>>>>> + */ >>>>>> +static void >>>>>> +drain_ring(struct mp_ring *r, union ring_state os, uint16_t >>>>>> prev, int >>>>>> budget) >>>>>> +{ >>>>>> + union ring_state ns; >>>>>> + int n, pending, total; >>>>>> + uint16_t cidx = os.cidx; >>>>>> + uint16_t pidx = os.pidx_tail; >>>>>> + >>>>>> + MPASS(os.flags == BUSY); >>>>>> + MPASS(cidx != pidx); >>>>>> + >>>>>> + if (prev == IDLE) >>>>>> + counter_u64_add(r->starts, 1); >>>>>> + pending = 0; >>>>>> + total = 0; >>>>>> + >>>>>> + while (cidx != pidx) { >>>>>> + >>>>>> + /* Items from cidx to pidx are available for >>>>>> consumption. * >>>>>> / >>>>>> + n = r->drain(r, cidx, pidx); >>>>>> + if (n == 0) { >>>>>> + critical_enter(); >>>>>> + do { >>>>>> + os.state = ns.state = r->state; >>>>>> + ns.cidx = cidx; >>>>>> + ns.flags = STALLED; >>>>>> + } while (atomic_cmpset_64(&r->state, >>>>>> os.state, >>>>>> + ns.state) == 0); >>>>>> + critical_exit(); >>>>>> + if (prev != STALLED) >>>>>> + counter_u64_add(r->stalls, 1); >>>>>> + else if (total > 0) { >>>>>> + counter_u64_add(r->restarts, 1); >>>>>> + counter_u64_add(r->stalls, 1); >>>>>> + } >>>>>> + break; >>>>>> + } >>>>>> + cidx = increment_idx(r, cidx, n); >>>>>> + pending += n; >>>>>> + total += n; >>>>>> + >>>>>> + /* >>>>>> + * We update the cidx only if we've caught up >>>>>> with the >>>>>> pidx, the >>>>>> + * real cidx is getting too far ahead of the >>>>>> one >>>>>> visible to >>>>>> + * everyone else, or we have exceeded our >>>>>> budget. >>>>>> + */ >>>>>> + if (cidx != pidx && pending < 64 && total < >>>>>> budget) >>>>>> + continue; >>>>>> + critical_enter(); >>>>>> + do { >>>>>> + os.state = ns.state = r->state; >>>>>> + ns.cidx = cidx; >>>>>> + ns.flags = state_to_flags(ns, total >= >>>>>> budget); >>>>>> + } while (atomic_cmpset_acq_64(&r->state, >>>>>> os.state, >>>>>> ns.state) == 0); >>>>>> + critical_exit(); >>>>>> + >>>>>> + if (ns.flags == ABDICATED) >>>>>> + counter_u64_add(r->abdications, 1); >>>>>> + if (ns.flags != BUSY) { >>>>>> + /* Wrong loop exit if we're going to >>>>>> stall. */ >>>>>> + MPASS(ns.flags != STALLED); >>>>>> + if (prev == STALLED) { >>>>>> + MPASS(total > 0); >>>>>> + counter_u64_add(r->restarts, 1); >>>>>> + } >>>>>> + break; >>>>>> + } >>>>>> + >>>>>> + /* >>>>>> + * The acquire style atomic above guarantees >>>>>> visibility of >>>>>> items >>>>>> + * associated with any pidx change that we >>>>>> notice here. >>>>>> + */ >>>>>> + pidx = ns.pidx_tail; >>>>>> + pending = 0; >>>>>> + } >>>>>> +} >>>>>> + >>>>>> +int >>>>>> +mp_ring_alloc(struct mp_ring **pr, int size, void *cookie, >>>>>> ring_drain_t >>>>>> drain, >>>>>> + ring_can_drain_t can_drain, struct malloc_type *mt, int >>>>>> flags) >>>>>> +{ >>>>>> + struct mp_ring *r; >>>>>> + >>>>>> + /* All idx are 16b so size can be 65536 at most */ >>>>>> + if (pr == NULL || size < 2 || size > 65536 || drain == >>>>>> NULL || >>>>>> + can_drain == NULL) >>>>>> + return (EINVAL); >>>>>> + *pr = NULL; >>>>>> + flags &= M_NOWAIT | M_WAITOK; >>>>>> + MPASS(flags != 0); >>>>>> + >>>>>> + r = malloc(__offsetof(struct mp_ring, items[size]), mt, >>>>>> flags | >>>>>> M_ZERO); >>>>>> + if (r == NULL) >>>>>> + return (ENOMEM); >>>>>> + r->size = size; >>>>>> + r->cookie = cookie; >>>>>> + r->mt = mt; >>>>>> + r->drain = drain; >>>>>> + r->can_drain = can_drain; >>>>>> + r->enqueues = counter_u64_alloc(flags); >>>>>> + r->drops = counter_u64_alloc(flags); >>>>>> + r->starts = counter_u64_alloc(flags); >>>>>> + r->stalls = counter_u64_alloc(flags); >>>>>> + r->restarts = counter_u64_alloc(flags); >>>>>> + r->abdications = counter_u64_alloc(flags); >>>>>> + if (r->enqueues == NULL || r->drops == NULL || >>>>>> r->starts >>>>>> == NULL || >>>>>> + r->stalls == NULL || r->restarts == NULL || >>>>>> + r->abdications == NULL) { >>>>>> + mp_ring_free(r); >>>>>> + return (ENOMEM); >>>>>> + } >>>>>> + >>>>>> + *pr = r; >>>>>> + return (0); >>>>>> +} >>>>>> + >>>>>> +void >>>>>> + >>>>>> +mp_ring_free(struct mp_ring *r) >>>>>> +{ >>>>>> + >>>>>> + if (r == NULL) >>>>>> + return; >>>>>> + >>>>>> + if (r->enqueues != NULL) >>>>>> + counter_u64_free(r->enqueues); >>>>>> + if (r->drops != NULL) >>>>>> + counter_u64_free(r->drops); >>>>>> + if (r->starts != NULL) >>>>>> + counter_u64_free(r->starts); >>>>>> + if (r->stalls != NULL) >>>>>> + counter_u64_free(r->stalls); >>>>>> + if (r->restarts != NULL) >>>>>> + counter_u64_free(r->restarts); >>>>>> + if (r->abdications != NULL) >>>>>> + counter_u64_free(r->abdications); >>>>>> + >>>>>> + free(r, r->mt); >>>>>> +} >>>>>> + >>>>>> +/* >>>>>> + * Enqueue n items and maybe drain the ring for some time. >>>>>> + * >>>>>> + * Returns an errno. >>>>>> + */ >>>>>> +int >>>>>> +mp_ring_enqueue(struct mp_ring *r, void **items, int n, int >>>>>> budget) >>>>>> +{ >>>>>> + union ring_state os, ns; >>>>>> + uint16_t pidx_start, pidx_stop; >>>>>> + int i; >>>>>> + >>>>>> + MPASS(items != NULL); >>>>>> + MPASS(n > 0); >>>>>> + >>>>>> >>>>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> -----------------------------------------+------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. >>>>>> dell'Informazione >>>>>> http://www.iet.unipi.it/~luigi/ . Universita` di Pisa >>>>>> TEL +39-050-2211611 . via Diotisalvi 2 >>>>>> Mobile +39-338-6809875 . 56122 PISA (Italy) >>>>>> -----------------------------------------+------------------------------- >>>>>> >>>>>> >>>>>> >>>> >>> >>> >> > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 01:40:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA725652; Wed, 21 Jan 2015 01:40:35 +0000 (UTC) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70898C79; Wed, 21 Jan 2015 01:40:35 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id et14so49421402pad.3; Tue, 20 Jan 2015 17:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5V4pju5HMDwceqK8mTnCRm/8Rs9Ikk6h35jnz5pcPVQ=; b=jREJ26/ITR+bumrzafvnLyFWn/lp5Jn/VC/StUy7gPJpkWJEP/yp6ZgbjrDkZcTYF9 rVzv0p0NUtpYQrLRBdeMB9lSYPawKXF24ibPPM4Ezhd3e1Ml+e2Rnp2ikKnfdfmlrANT c2t2fUlGCNlCEcdGp3V8pUBeb29dARxKW6YARw2QpVt9xi6hvpj7AbfFxNnm5jzjWSbU xGMXUGO0NxhakU/emNAUWRzY7SnurK31ovpt+v0i40lhaXUaT0f1a/+GGCCVRxK3ZdAx uXjXM4ParzleOVbvJZAw9cDTiH6pg/A7tfA1cT3nVJpedQay6jFkXYd0BwMlL3tXBKPM DTPA== X-Received: by 10.70.32.195 with SMTP id l3mr34110118pdi.41.1421804434933; Tue, 20 Jan 2015 17:40:34 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id cc3sm1215990pdb.67.2015.01.20.17.40.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 17:40:33 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54BF0390.8070003@FreeBSD.org> Date: Tue, 20 Jan 2015 17:40:32 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pedro Giffuni , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <54BEFB79.6090806@FreeBSD.org> <54BF01F2.4030502@FreeBSD.org> In-Reply-To: <54BF01F2.4030502@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 01:40:35 -0000 On 01/20/15 17:33, Pedro Giffuni wrote: > > On 01/20/15 20:06, Navdeep Parhar wrote: >> On 01/20/15 16:50, Pedro Giffuni wrote: >>> >>> On 01/20/15 18:21, Navdeep Parhar wrote: >>>> The problem reported by Luigi has been fixed in r277225 already. >>>> >>>> Regards, >>>> Navdeep >>>> >>> >>> But the fix is rather ugly, isn't it? I would personally prefer to just >>> kill the older >>> gcc but in the meantime updating it so that it behaves like the updated >>> gcc/clang would be better. IMHO. >> >> I'm not sure why you think the fix is ugly. Modifying the base >> compiler to deal with minor stuff like this seems excessive and I >> never even considered that. >> > > "Modifying the base compiler to deal with minor stuff like this" is > actually called > "an update" since upstream already did it: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 > > You could also call it "making it more compatible with clang and newer gcc" > > The base compiler is ugly as it can be but that's upstream's fault, not > the fault > those of us that were once condemned to add bandaids. Happily I am not > planning to touch it anymore ;). I'm not planning to touch it at all, and I'm happy too :-) Regards, Navdeep > > Pedro. > > >> Regards, >> Navdeep >> >>> >>> Pedro. >>> >>>> On 01/20/15 15:10, Pedro Giffuni wrote: >>>>> Hi; >>>>> >>>>> I got this patch from the OpenBSD-tech list[1]. >>>>> Perhaps this fixes the gcc issue? >>>>> >>>>> Apparently it's required for mesa too. >>>>> >>>>> Pedro. >>>>> >>>>> [1] http://article.gmane.org/gmane.os.openbsd.tech/40604 >>>>> From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:19:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id F3C60D4C; Wed, 21 Jan 2015 02:19:05 +0000 (UTC) Date: Wed, 21 Jan 2015 02:19:05 +0000 From: Alexey Dokuchaev To: Pedro Giffuni Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121021905.GA73548@FreeBSD.org> References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BEF7CF.9030505@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo , Navdeep Parhar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 02:19:06 -0000 On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: > But the fix is rather ugly, isn't it? I would personally prefer to just > kill the older gcc but in the meantime updating it so that it behaves > like the updated gcc/clang would be better. IMHO. Seconded. Putting extra harness on the code to avoid bugs in the compiler that were actually fixed upsteam is totally bogus. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:35:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 540E4FDB; Wed, 21 Jan 2015 02:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3532E1FA; Wed, 21 Jan 2015 02:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L2Z53H092389; Wed, 21 Jan 2015 02:35:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L2Z5rI092388; Wed, 21 Jan 2015 02:35:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210235.t0L2Z5rI092388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 02:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277465 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 02:35:05 -0000 Author: ian Date: Wed Jan 21 02:35:04 2015 New Revision: 277465 URL: https://svnweb.freebsd.org/changeset/base/277465 Log: Use the explicit member initializer style to init the bus_space struct. Fill in some formerly NULL members where the implementation function exists. Add a dummy function that panics and use it as a placeholder for thigns that are still unimplemented. Remove a few unused includes. Modified: head/sys/arm/arm/bus_space-v6.c Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Jan 21 01:12:21 2015 (r277464) +++ head/sys/arm/arm/bus_space-v6.c Wed Jan 21 02:35:04 2015 (r277465) @@ -34,125 +34,130 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include /* Prototypes for all the bus_space structure functions */ bs_protos(generic); bs_protos(generic_armv4); +static void +bs_unimplemented(void) +{ + + panic("unimplemented bus_space function called"); +} + +#define BS_UNIMPLEMENTED (void *)bs_unimplemented + /* * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. */ static struct bus_space _base_tag = { - /* cookie */ - (void *) 0, + /* privdata is whatever the implementer wants; unused in base tag */ + .bs_privdata = NULL, /* mapping/unmapping */ - generic_bs_map, - generic_bs_unmap, - generic_bs_subregion, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - generic_bs_alloc, - generic_bs_free, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - generic_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ - NULL, /* bs_r_1, Use inline code in bus.h */ - NULL, /* bs_r_2, Use inline code in bus.h */ - NULL, /* bs_r_4, Use inline code in bus.h */ - NULL, /* bs_r_8, Use inline code in bus.h */ + .bs_r_1 = NULL, /* Use inline code in bus.h */ + .bs_r_2 = NULL, /* Use inline code in bus.h */ + .bs_r_4 = NULL, /* Use inline code in bus.h */ + .bs_r_8 = NULL, /* Use inline code in bus.h */ /* read multiple */ - generic_bs_rm_1, - generic_armv4_bs_rm_2, - generic_bs_rm_4, - NULL, + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = BS_UNIMPLEMENTED, /* read region */ - generic_bs_rr_1, - generic_armv4_bs_rr_2, - generic_bs_rr_4, - NULL, + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = BS_UNIMPLEMENTED, /* write (single) */ - NULL, /* bs_w_1, Use inline code in bus.h */ - NULL, /* bs_w_2, Use inline code in bus.h */ - NULL, /* bs_w_4, Use inline code in bus.h */ - NULL, /* bs_w_8, Use inline code in bus.h */ + .bs_w_1 = NULL, /* Use inline code in bus.h */ + .bs_w_2 = NULL, /* Use inline code in bus.h */ + .bs_w_4 = NULL, /* Use inline code in bus.h */ + .bs_w_8 = NULL, /* Use inline code in bus.h */ /* write multiple */ - generic_bs_wm_1, - generic_armv4_bs_wm_2, - generic_bs_wm_4, - NULL, + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = BS_UNIMPLEMENTED, /* write region */ - generic_bs_wr_1, - generic_armv4_bs_wr_2, - generic_bs_wr_4, - NULL, + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = BS_UNIMPLEMENTED, /* set multiple */ - NULL, - NULL, - NULL, - NULL, + .bs_sm_1 = BS_UNIMPLEMENTED, + .bs_sm_2 = BS_UNIMPLEMENTED, + .bs_sm_4 = BS_UNIMPLEMENTED, + .bs_sm_8 = BS_UNIMPLEMENTED, /* set region */ - generic_bs_sr_1, - generic_armv4_bs_sr_2, - generic_bs_sr_4, - NULL, + .bs_sr_1 = generic_bs_sr_1, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = BS_UNIMPLEMENTED, /* copy */ - NULL, - generic_armv4_bs_c_2, - NULL, - NULL, + .bs_c_1 = BS_UNIMPLEMENTED, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = BS_UNIMPLEMENTED, + .bs_c_8 = BS_UNIMPLEMENTED, /* read stream (single) */ - NULL, /* bs_r_1_s, Use inline code in bus.h */ - NULL, /* bs_r_2_s, Use inline code in bus.h */ - NULL, /* bs_r_4_s, Use inline code in bus.h */ - NULL, /* bs_r_8_s, Use inline code in bus.h */ + .bs_r_1_s = NULL, /* Use inline code in bus.h */ + .bs_r_2_s = NULL, /* Use inline code in bus.h */ + .bs_r_4_s = NULL, /* Use inline code in bus.h */ + .bs_r_8_s = NULL, /* Use inline code in bus.h */ /* read multiple stream */ - NULL, - generic_armv4_bs_rm_2, /* bus_space_read_multi_stream_2 */ - NULL, - NULL, + .bs_rm_1_s = generic_bs_rm_1, + .bs_rm_2_s = generic_armv4_bs_rm_2, + .bs_rm_4_s = generic_bs_rm_4, + .bs_rm_8_s = BS_UNIMPLEMENTED, /* read region stream */ - NULL, - NULL, - NULL, - NULL, + .bs_rr_1_s = generic_bs_rr_1, + .bs_rr_2_s = generic_bs_rr_2, + .bs_rr_4_s = generic_bs_rr_4, + .bs_rr_8_s = BS_UNIMPLEMENTED, /* write stream (single) */ - NULL, /* bs_w_1_s, Use inline code in bus.h */ - NULL, /* bs_w_2_s, Use inline code in bus.h */ - NULL, /* bs_w_4_s, Use inline code in bus.h */ - NULL, /* bs_w_8_s, Use inline code in bus.h */ + .bs_w_1_s = NULL, /* Use inline code in bus.h */ + .bs_w_2_s = NULL, /* Use inline code in bus.h */ + .bs_w_4_s = NULL, /* Use inline code in bus.h */ + .bs_w_8_s = NULL, /* Use inline code in bus.h */ /* write multiple stream */ - NULL, - generic_armv4_bs_wm_2, /* bus_space_write_multi_stream_2 */ - NULL, - NULL, + .bs_wm_1_s = generic_bs_wm_1, + .bs_wm_2_s = generic_armv4_bs_wm_2, + .bs_wm_4_s = generic_bs_wm_4, + .bs_wm_8_s = BS_UNIMPLEMENTED, /* write region stream */ - NULL, - NULL, - NULL, - NULL + .bs_wr_1_s = generic_bs_wr_1, + .bs_wr_2_s = generic_bs_wr_4, + .bs_wr_4_s = generic_bs_wr_8, + .bs_wr_8_s = BS_UNIMPLEMENTED, }; bus_space_tag_t fdtbus_bs_tag = &_base_tag; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:49:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E91B16BA; Wed, 21 Jan 2015 02:49:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBD5A35D; Wed, 21 Jan 2015 02:49:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L2nKU4097612; Wed, 21 Jan 2015 02:49:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L2nKlL097609; Wed, 21 Jan 2015 02:49:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210249.t0L2nKlL097609@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 02:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277466 - in head/sys/arm: arm lpc xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 02:49:21 -0000 Author: ian Date: Wed Jan 21 02:49:19 2015 New Revision: 277466 URL: https://svnweb.freebsd.org/changeset/base/277466 Log: Use arm/bus_space-v6.c for all armv6 systems, the essentially identical files for lpc and xilinx aren't needed. Also, fix a couple paste-os. Deleted: head/sys/arm/lpc/lpc_space.c head/sys/arm/xilinx/zy7_bus_space.c Modified: head/sys/arm/arm/bus_space-v6.c head/sys/arm/lpc/files.lpc head/sys/arm/xilinx/files.zynq7 Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Jan 21 02:35:04 2015 (r277465) +++ head/sys/arm/arm/bus_space-v6.c Wed Jan 21 02:49:19 2015 (r277466) @@ -137,7 +137,7 @@ static struct bus_space _base_tag = { /* read region stream */ .bs_rr_1_s = generic_bs_rr_1, - .bs_rr_2_s = generic_bs_rr_2, + .bs_rr_2_s = generic_armv4_bs_rr_2, .bs_rr_4_s = generic_bs_rr_4, .bs_rr_8_s = BS_UNIMPLEMENTED, @@ -155,8 +155,8 @@ static struct bus_space _base_tag = { /* write region stream */ .bs_wr_1_s = generic_bs_wr_1, - .bs_wr_2_s = generic_bs_wr_4, - .bs_wr_4_s = generic_bs_wr_8, + .bs_wr_2_s = generic_armv4_bs_wr_2, + .bs_wr_4_s = generic_bs_wr_4, .bs_wr_8_s = BS_UNIMPLEMENTED, }; Modified: head/sys/arm/lpc/files.lpc ============================================================================== --- head/sys/arm/lpc/files.lpc Wed Jan 21 02:35:04 2015 (r277465) +++ head/sys/arm/lpc/files.lpc Wed Jan 21 02:49:19 2015 (r277466) @@ -1,9 +1,9 @@ # $FreeBSD$ +arm/arm/bus_space-v6.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard arm/arm/cpufunc_asm_armv5.S standard arm/lpc/lpc_machdep.c standard -arm/lpc/lpc_space.c standard arm/lpc/lpc_pwr.c standard arm/lpc/lpc_intc.c standard arm/lpc/lpc_timer.c standard Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Wed Jan 21 02:35:04 2015 (r277465) +++ head/sys/arm/xilinx/files.zynq7 Wed Jan 21 02:49:19 2015 (r277466) @@ -5,6 +5,7 @@ kern/kern_clocksource.c standard +arm/arm/bus_space-v6.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/cpufunc_asm_armv5.S standard @@ -18,7 +19,6 @@ arm/arm/pl310.c standard arm/xilinx/zy7_machdep.c standard arm/xilinx/zy7_l2cache.c standard -arm/xilinx/zy7_bus_space.c standard arm/xilinx/zy7_slcr.c standard arm/xilinx/zy7_devcfg.c standard arm/xilinx/zy7_mp.c optional smp From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:56:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1618889C; Wed, 21 Jan 2015 02:56:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0102760B; Wed, 21 Jan 2015 02:56:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L2uH6A002089; Wed, 21 Jan 2015 02:56:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L2uEOU002068; Wed, 21 Jan 2015 02:56:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210256.t0L2uEOU002068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 02:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277467 - in head/sys/arm: arm at91 cavium/cns11xx mv samsung/s3c2xx0 versatile xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 02:56:18 -0000 Author: ian Date: Wed Jan 21 02:56:13 2015 New Revision: 277467 URL: https://svnweb.freebsd.org/changeset/base/277467 Log: For some reason, all the arm bus_space functions that work with uint16 values have armv4 in the name. There's nothing armv4-special about them, so just use the same sort of names as all the other functions. Modified: head/sys/arm/arm/bus_space-v6.c head/sys/arm/arm/bus_space_asm_generic.S head/sys/arm/at91/at91.c head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/mv/bus_space.c head/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c head/sys/arm/versatile/bus_space.c head/sys/arm/versatile/versatile_pci_bus_space.c head/sys/arm/xscale/i80321/i80321_space.c head/sys/arm/xscale/i80321/obio_space.c head/sys/arm/xscale/i8134x/i81342_space.c head/sys/arm/xscale/i8134x/obio_space.c head/sys/arm/xscale/ixp425/ixp425_a4x_space.c head/sys/arm/xscale/ixp425/ixp425_space.c head/sys/arm/xscale/pxa/pxa_space.c Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/arm/bus_space-v6.c Wed Jan 21 02:56:13 2015 (r277467) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); static void bs_unimplemented(void) @@ -77,13 +76,13 @@ static struct bus_space _base_tag = { /* read multiple */ .bs_rm_1 = generic_bs_rm_1, - .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_2 = generic_bs_rm_2, .bs_rm_4 = generic_bs_rm_4, .bs_rm_8 = BS_UNIMPLEMENTED, /* read region */ .bs_rr_1 = generic_bs_rr_1, - .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_2 = generic_bs_rr_2, .bs_rr_4 = generic_bs_rr_4, .bs_rr_8 = BS_UNIMPLEMENTED, @@ -95,13 +94,13 @@ static struct bus_space _base_tag = { /* write multiple */ .bs_wm_1 = generic_bs_wm_1, - .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_2 = generic_bs_wm_2, .bs_wm_4 = generic_bs_wm_4, .bs_wm_8 = BS_UNIMPLEMENTED, /* write region */ .bs_wr_1 = generic_bs_wr_1, - .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_2 = generic_bs_wr_2, .bs_wr_4 = generic_bs_wr_4, .bs_wr_8 = BS_UNIMPLEMENTED, @@ -113,13 +112,13 @@ static struct bus_space _base_tag = { /* set region */ .bs_sr_1 = generic_bs_sr_1, - .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_2 = generic_bs_sr_2, .bs_sr_4 = generic_bs_sr_4, .bs_sr_8 = BS_UNIMPLEMENTED, /* copy */ .bs_c_1 = BS_UNIMPLEMENTED, - .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_2 = generic_bs_c_2, .bs_c_4 = BS_UNIMPLEMENTED, .bs_c_8 = BS_UNIMPLEMENTED, @@ -131,13 +130,13 @@ static struct bus_space _base_tag = { /* read multiple stream */ .bs_rm_1_s = generic_bs_rm_1, - .bs_rm_2_s = generic_armv4_bs_rm_2, + .bs_rm_2_s = generic_bs_rm_2, .bs_rm_4_s = generic_bs_rm_4, .bs_rm_8_s = BS_UNIMPLEMENTED, /* read region stream */ .bs_rr_1_s = generic_bs_rr_1, - .bs_rr_2_s = generic_armv4_bs_rr_2, + .bs_rr_2_s = generic_bs_rr_2, .bs_rr_4_s = generic_bs_rr_4, .bs_rr_8_s = BS_UNIMPLEMENTED, @@ -149,13 +148,13 @@ static struct bus_space _base_tag = { /* write multiple stream */ .bs_wm_1_s = generic_bs_wm_1, - .bs_wm_2_s = generic_armv4_bs_wm_2, + .bs_wm_2_s = generic_bs_wm_2, .bs_wm_4_s = generic_bs_wm_4, .bs_wm_8_s = BS_UNIMPLEMENTED, /* write region stream */ .bs_wr_1_s = generic_bs_wr_1, - .bs_wr_2_s = generic_armv4_bs_wr_2, + .bs_wr_2_s = generic_bs_wr_2, .bs_wr_4_s = generic_bs_wr_4, .bs_wr_8_s = BS_UNIMPLEMENTED, }; Modified: head/sys/arm/arm/bus_space_asm_generic.S ============================================================================== --- head/sys/arm/arm/bus_space_asm_generic.S Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/arm/bus_space_asm_generic.S Wed Jan 21 02:56:13 2015 (r277467) @@ -52,10 +52,10 @@ ENTRY(generic_bs_r_1) RET END(generic_bs_r_1) -ENTRY(generic_armv4_bs_r_2) +ENTRY(generic_bs_r_2) ldrh r0, [r1, r2] RET -END(generic_armv4_bs_r_2) +END(generic_bs_r_2) ENTRY(generic_bs_r_4) ldr r0, [r1, r2] @@ -71,10 +71,10 @@ ENTRY(generic_bs_w_1) RET END(generic_bs_w_1) -ENTRY(generic_armv4_bs_w_2) +ENTRY(generic_bs_w_2) strh r3, [r1, r2] RET -END(generic_armv4_bs_w_2) +END(generic_bs_w_2) ENTRY(generic_bs_w_4) str r3, [r1, r2] @@ -100,7 +100,7 @@ ENTRY(generic_bs_rm_1) RET END(generic_bs_rm_1) -ENTRY(generic_armv4_bs_rm_2) +ENTRY(generic_bs_rm_2) add r0, r1, r2 mov r1, r3 ldr r2, [sp, #0] @@ -113,7 +113,7 @@ ENTRY(generic_armv4_bs_rm_2) bne 1b RET -END(generic_armv4_bs_rm_2) +END(generic_bs_rm_2) ENTRY(generic_bs_rm_4) add r0, r1, r2 @@ -149,7 +149,7 @@ ENTRY(generic_bs_wm_1) RET END(generic_bs_wm_1) -ENTRY(generic_armv4_bs_wm_2) +ENTRY(generic_bs_wm_2) add r0, r1, r2 mov r1, r3 ldr r2, [sp, #0] @@ -162,7 +162,7 @@ ENTRY(generic_armv4_bs_wm_2) bne 1b RET -END(generic_armv4_bs_wm_2) +END(generic_bs_wm_2) ENTRY(generic_bs_wm_4) add r0, r1, r2 @@ -198,7 +198,7 @@ ENTRY(generic_bs_rr_1) RET END(generic_bs_rr_1) -ENTRY(generic_armv4_bs_rr_2) +ENTRY(generic_bs_rr_2) add r0, r1, r2 mov r1, r3 ldr r2, [sp, #0] @@ -211,7 +211,7 @@ ENTRY(generic_armv4_bs_rr_2) bne 1b RET -END(generic_armv4_bs_rr_2) +END(generic_bs_rr_2) ENTRY(generic_bs_rr_4) add r0, r1, r2 @@ -247,7 +247,7 @@ ENTRY(generic_bs_wr_1) RET END(generic_bs_wr_1) -ENTRY(generic_armv4_bs_wr_2) +ENTRY(generic_bs_wr_2) add r0, r1, r2 mov r1, r3 ldr r2, [sp, #0] @@ -260,7 +260,7 @@ ENTRY(generic_armv4_bs_wr_2) bne 1b RET -END(generic_armv4_bs_wr_2) +END(generic_bs_wr_2) ENTRY(generic_bs_wr_4) add r0, r1, r2 @@ -295,7 +295,7 @@ ENTRY(generic_bs_sr_1) RET END(generic_bs_sr_1) -ENTRY(generic_armv4_bs_sr_2) +ENTRY(generic_bs_sr_2) add r0, r1, r2 mov r1, r3 ldr r2, [sp, #0] @@ -307,7 +307,7 @@ ENTRY(generic_armv4_bs_sr_2) bne 1b RET -END(generic_armv4_bs_sr_2) +END(generic_bs_sr_2) ENTRY(generic_bs_sr_4) add r0, r1, r2 @@ -327,7 +327,7 @@ END(generic_bs_sr_4) * copy region */ -ENTRY(generic_armv4_bs_c_2) +ENTRY(generic_bs_c_2) add r0, r1, r2 ldr r2, [sp, #0] add r1, r2, r3 @@ -356,5 +356,5 @@ ENTRY(generic_armv4_bs_c_2) bne 3b RET -END(generic_armv4_bs_c_2) +END(generic_bs_c_2) Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/at91/at91.c Wed Jan 21 02:56:13 2015 (r277467) @@ -116,7 +116,6 @@ bus_dma_get_range_nb(void) } bs_protos(generic); -bs_protos(generic_armv4); struct bus_space at91_bs_tag = { /* cookie */ @@ -136,37 +135,37 @@ struct bus_space at91_bs_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, @@ -178,49 +177,49 @@ struct bus_space at91_bs_tag = { /* set region */ NULL, - generic_armv4_bs_sr_2, + generic_bs_sr_2, generic_bs_sr_4, NULL, /* copy */ NULL, - generic_armv4_bs_c_2, + generic_bs_c_2, NULL, NULL, /* read (single) stream */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple stream */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region stream */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) stream */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple stream */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region stream */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, }; Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/cavium/cns11xx/econa.c Wed Jan 21 02:56:13 2015 (r277467) @@ -57,7 +57,6 @@ unsigned int AHB_clock; unsigned int APB_clock; bs_protos(generic); -bs_protos(generic_armv4); struct bus_space econa_bs_tag = { /* cookie */ @@ -77,31 +76,31 @@ struct bus_space econa_bs_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, @@ -137,7 +136,7 @@ struct bus_space econa_bs_tag = { /* read multiple stream */ NULL, - generic_armv4_bs_rm_2, + generic_bs_rm_2, NULL, NULL, @@ -155,7 +154,7 @@ struct bus_space econa_bs_tag = { /* write multiple stream */ NULL, - generic_armv4_bs_wm_2, + generic_bs_wm_2, NULL, NULL, Modified: head/sys/arm/mv/bus_space.c ============================================================================== --- head/sys/arm/mv/bus_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/mv/bus_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); /* * The bus space tag. This is constant for all instances, so @@ -70,31 +69,31 @@ static struct bus_space _base_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, @@ -130,7 +129,7 @@ static struct bus_space _base_tag = { /* read multiple stream */ NULL, - generic_armv4_bs_rm_2, /* bus_space_read_multi_stream_2 */ + generic_bs_rm_2, /* bus_space_read_multi_stream_2 */ NULL, NULL, @@ -148,7 +147,7 @@ static struct bus_space _base_tag = { /* write multiple stream */ NULL, - generic_armv4_bs_wm_2, /* bus_space_write_multi_stream_2 */ + generic_bs_wm_2, /* bus_space_write_multi_stream_2 */ NULL, NULL, Modified: head/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c ============================================================================== --- head/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -90,7 +90,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); struct bus_space s3c2xx0_bs_tag = { /* cookie */ @@ -110,37 +109,37 @@ struct bus_space s3c2xx0_bs_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region */ generic_bs_wr_1, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, @@ -152,13 +151,13 @@ struct bus_space s3c2xx0_bs_tag = { /* set region */ generic_bs_sr_1, - generic_armv4_bs_sr_2, + generic_bs_sr_2, NULL, NULL, /* copy */ NULL, - generic_armv4_bs_c_2, + generic_bs_c_2, NULL, NULL, }; Modified: head/sys/arm/versatile/bus_space.c ============================================================================== --- head/sys/arm/versatile/bus_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/versatile/bus_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); struct bus_space _base_tag = { /* cookie */ @@ -62,37 +61,37 @@ struct bus_space _base_tag = { /* read (single) */ .bs_r_1 = generic_bs_r_1, - .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_2 = generic_bs_r_2, .bs_r_4 = generic_bs_r_4, .bs_r_8 = NULL, /* read multiple */ .bs_rm_1 = generic_bs_rm_1, - .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_2 = generic_bs_rm_2, .bs_rm_4 = generic_bs_rm_4, .bs_rm_8 = NULL, /* read region */ .bs_rr_1 = generic_bs_rr_1, - .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_2 = generic_bs_rr_2, .bs_rr_4 = generic_bs_rr_4, .bs_rr_8 = NULL, /* write (single) */ .bs_w_1 = generic_bs_w_1, - .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_2 = generic_bs_w_2, .bs_w_4 = generic_bs_w_4, .bs_w_8 = NULL, /* write multiple */ .bs_wm_1 = generic_bs_wm_1, - .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_2 = generic_bs_wm_2, .bs_wm_4 = generic_bs_wm_4, .bs_wm_8 = NULL, /* write region */ .bs_wr_1 = generic_bs_wr_1, - .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_2 = generic_bs_wr_2, .bs_wr_4 = generic_bs_wr_4, .bs_wr_8 = NULL, @@ -101,13 +100,13 @@ struct bus_space _base_tag = { /* set region */ .bs_sr_1 = NULL, - .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_2 = generic_bs_sr_2, .bs_sr_4 = generic_bs_sr_4, .bs_sr_8 = NULL, /* copy */ .bs_c_1 = NULL, - .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_2 = generic_bs_c_2, .bs_c_4 = NULL, .bs_c_8 = NULL, }; Modified: head/sys/arm/versatile/versatile_pci_bus_space.c ============================================================================== --- head/sys/arm/versatile/versatile_pci_bus_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/versatile/versatile_pci_bus_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); /* * Bus space that handles offsets in word for 1/2 bytes read/write access. @@ -61,37 +60,37 @@ static struct bus_space bus_space_pcimem /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region */ generic_bs_wr_1, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, Modified: head/sys/arm/xscale/i80321/i80321_space.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -64,7 +64,6 @@ bs_protos(i80321); bs_protos(i80321_io); bs_protos(i80321_mem); bs_protos(generic); -bs_protos(generic_armv4); /* * Template bus_space -- copied, and the bits that are NULL are @@ -88,37 +87,37 @@ const struct bus_space i80321_bs_tag_tem /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, @@ -130,49 +129,49 @@ const struct bus_space i80321_bs_tag_tem /* set region */ NULL, - generic_armv4_bs_sr_2, + generic_bs_sr_2, generic_bs_sr_4, NULL, /* copy */ NULL, - generic_armv4_bs_c_2, + generic_bs_c_2, NULL, NULL, /* read (single) stream */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple stream */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region stream */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) stream */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple stream */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region stream */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, }; Modified: head/sys/arm/xscale/i80321/obio_space.c ============================================================================== --- head/sys/arm/xscale/i80321/obio_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/i80321/obio_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); /* * The obio bus space tag. This is constant for all instances, so @@ -74,7 +73,7 @@ struct bus_space obio_bs_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, @@ -92,7 +91,7 @@ struct bus_space obio_bs_tag = { /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, Modified: head/sys/arm/xscale/i8134x/i81342_space.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -65,7 +65,6 @@ bs_protos(i81342); bs_protos(i81342_io); bs_protos(i81342_mem); bs_protos(generic); -bs_protos(generic_armv4); /* * Template bus_space -- copied, and the bits that are NULL are @@ -89,37 +88,37 @@ const struct bus_space i81342_bs_tag_tem /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, @@ -131,49 +130,49 @@ const struct bus_space i81342_bs_tag_tem /* set region */ NULL, - generic_armv4_bs_sr_2, + generic_bs_sr_2, generic_bs_sr_4, NULL, /* copy */ NULL, - generic_armv4_bs_c_2, + generic_bs_c_2, NULL, NULL, /* read (single) stream */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, /* read multiple stream */ generic_bs_rm_1, - generic_armv4_bs_rm_2, + generic_bs_rm_2, generic_bs_rm_4, NULL, /* read region stream */ generic_bs_rr_1, - generic_armv4_bs_rr_2, + generic_bs_rr_2, generic_bs_rr_4, NULL, /* write (single) stream */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, /* write multiple stream */ generic_bs_wm_1, - generic_armv4_bs_wm_2, + generic_bs_wm_2, generic_bs_wm_4, NULL, /* write region stream */ NULL, - generic_armv4_bs_wr_2, + generic_bs_wr_2, generic_bs_wr_4, NULL, }; Modified: head/sys/arm/xscale/i8134x/obio_space.c ============================================================================== --- head/sys/arm/xscale/i8134x/obio_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/i8134x/obio_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); /* * The obio bus space tag. This is constant for all instances, so @@ -74,7 +73,7 @@ struct bus_space obio_bs_tag = { /* read (single) */ generic_bs_r_1, - generic_armv4_bs_r_2, + generic_bs_r_2, generic_bs_r_4, NULL, @@ -92,7 +91,7 @@ struct bus_space obio_bs_tag = { /* write (single) */ generic_bs_w_1, - generic_armv4_bs_w_2, + generic_bs_w_2, generic_bs_w_4, NULL, Modified: head/sys/arm/xscale/ixp425/ixp425_a4x_space.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_a4x_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/ixp425/ixp425_a4x_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(a4x); bs_protos(generic); -bs_protos(generic_armv4); struct bus_space ixp425_a4x_bs_tag = { /* cookie */ Modified: head/sys/arm/xscale/ixp425/ixp425_space.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_space.c Wed Jan 21 02:49:19 2015 (r277466) +++ head/sys/arm/xscale/ixp425/ixp425_space.c Wed Jan 21 02:56:13 2015 (r277467) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); /* Proto types for all the bus_space structure functions */ bs_protos(generic); -bs_protos(generic_armv4); struct bus_space ixp425_bs_tag = { /* cookie */ @@ -79,37 +78,37 @@ struct bus_space ixp425_bs_tag = { /* read (single) */ .bs_r_1 = generic_bs_r_1, - .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_2 = generic_bs_r_2, .bs_r_4 = generic_bs_r_4, .bs_r_8 = NULL, /* read multiple */ .bs_rm_1 = generic_bs_rm_1, - .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_2 = generic_bs_rm_2, .bs_rm_4 = generic_bs_rm_4, .bs_rm_8 = NULL, /* read region */ .bs_rr_1 = generic_bs_rr_1, - .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_2 = generic_bs_rr_2, .bs_rr_4 = generic_bs_rr_4, .bs_rr_8 = NULL, /* write (single) */ .bs_w_1 = generic_bs_w_1, - .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_2 = generic_bs_w_2, .bs_w_4 = generic_bs_w_4, .bs_w_8 = NULL, /* write multiple */ .bs_wm_1 = generic_bs_wm_1, - .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_2 = generic_bs_wm_2, .bs_wm_4 = generic_bs_wm_4, .bs_wm_8 = NULL, /* write region */ .bs_wr_1 = generic_bs_wr_1, - .bs_wr_2 = generic_armv4_bs_wr_2, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:57:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E679A0F; Wed, 21 Jan 2015 02:57:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 408B161D; Wed, 21 Jan 2015 02:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L2vthK002320; Wed, 21 Jan 2015 02:57:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L2vtuF002319; Wed, 21 Jan 2015 02:57:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501210257.t0L2vtuF002319@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 21 Jan 2015 02:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277468 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 02:57:55 -0000 Author: nwhitehorn Date: Wed Jan 21 02:57:54 2015 New Revision: 277468 URL: https://svnweb.freebsd.org/changeset/base/277468 Log: On 64-bit PowerPC, use more native forms of the PPC 970 HID restore sequences, like are used to read the HIDs. This is both easier to read and avoids a miscompilation by GCC in certain circumstances. Also avoid double restoration of HID4 and HID5. MFC after: 2 weeks Modified: head/sys/powerpc/aim/mp_cpudep.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Wed Jan 21 02:56:13 2015 (r277467) +++ head/sys/powerpc/aim/mp_cpudep.c Wed Jan 21 02:57:54 2015 (r277468) @@ -58,7 +58,9 @@ SYSINIT(cpu_save_config, SI_SUB_CPU, SI_ void cpudep_ap_early_bootstrap(void) { +#ifndef __powerpc64__ register_t reg; +#endif __asm __volatile("mtsprg 0, %0" :: "r"(ap_pcpu)); powerpc_sync(); @@ -69,12 +71,17 @@ cpudep_ap_early_bootstrap(void) case IBM970MP: /* Restore HID4 and HID5, which are necessary for the MMU */ +#ifdef __powerpc64__ + mtspr(SPR_HID4, bsp_state[2]); powerpc_sync(); isync(); + mtspr(SPR_HID5, bsp_state[3]); powerpc_sync(); isync(); +#else __asm __volatile("ld %0, 16(%2); sync; isync; \ mtspr %1, %0; sync; isync;" : "=r"(reg) : "K"(SPR_HID4), "r"(bsp_state)); __asm __volatile("ld %0, 24(%2); sync; isync; \ mtspr %1, %0; sync; isync;" : "=r"(reg) : "K"(SPR_HID5), "r"(bsp_state)); +#endif powerpc_sync(); break; } @@ -292,9 +299,24 @@ cpudep_ap_setup() /* * The 970 has strange rules about how to update HID registers. * See Table 2-3, 970MP manual + * + * Note: HID4 and HID5 restored already in + * cpudep_ap_early_bootstrap() */ __asm __volatile("mtasr %0; sync" :: "r"(0)); + #ifdef __powerpc64__ + __asm __volatile(" \ + sync; isync; \ + mtspr %1, %0; \ + mfspr %0, %1; mfspr %0, %1; mfspr %0, %1; \ + mfspr %0, %1; mfspr %0, %1; mfspr %0, %1; \ + sync; isync" + :: "r"(bsp_state[0]), "K"(SPR_HID0)); + __asm __volatile("sync; isync; \ + mtspr %1, %0; mtspr %1, %0; sync; isync" + :: "r"(bsp_state[1]), "K"(SPR_HID1)); + #else __asm __volatile(" \ ld %0,0(%2); \ sync; isync; \ @@ -306,12 +328,7 @@ cpudep_ap_setup() __asm __volatile("ld %0, 8(%2); sync; isync; \ mtspr %1, %0; mtspr %1, %0; sync; isync" : "=r"(reg) : "K"(SPR_HID1), "r"(bsp_state)); - __asm __volatile("ld %0, 16(%2); sync; isync; \ - mtspr %1, %0; sync; isync;" - : "=r"(reg) : "K"(SPR_HID4), "r"(bsp_state)); - __asm __volatile("ld %0, 24(%2); sync; isync; \ - mtspr %1, %0; sync; isync;" - : "=r"(reg) : "K"(SPR_HID5), "r"(bsp_state)); + #endif powerpc_sync(); break; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:06:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8A97EC0; Wed, 21 Jan 2015 03:06:15 +0000 (UTC) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B58986E; Wed, 21 Jan 2015 03:06:15 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id y20so13898805ier.1; Tue, 20 Jan 2015 19:06:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=XnfDN6uau3SUVa0rOuS8c+nh/CUuqjSpD4oYXNhuArc=; b=aN3dvDsUwie/gHPQ3GOM3V2oPtIkBQtm0qa6QudU2wmgmbto4MlOPP+aOgD8nXx/Ff JDIKD1g9Mz5T3V6wwN/REclP+Q6EKiZD1y6G+nHPKyDczImYM8JQy2OFdQg/hIgs2JMY ntkM+RNnrRZhAusv/jRUbfrAElwUnnFcvAT5CDQLGCTgPFQxgH5FVzBYr0d+LJL1drHQ IMZOaHMCLukiFANnyaqzwPvTXGVTogK02wkMhYKalQ5jFEVVo7GE3kawWpjRKL1okyc2 DD8z/gdVpqFN+0kSfYqJD+sJrkXUYRm9nPclsj/EqqhpLEWiV+BbnNgD4o4lQj8hJ28k H+QQ== MIME-Version: 1.0 X-Received: by 10.50.107.7 with SMTP id gy7mr31337762igb.49.1421809574767; Tue, 20 Jan 2015 19:06:14 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Tue, 20 Jan 2015 19:06:14 -0800 (PST) In-Reply-To: <20150121021905.GA73548@FreeBSD.org> References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> Date: Tue, 20 Jan 2015 19:06:14 -0800 X-Google-Sender-Auth: Dzq68BveNLVYWqDZ1UV1YcFnX1w Message-ID: Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe From: Adrian Chadd To: Alexey Dokuchaev Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , Navdeep Parhar , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:06:15 -0000 On 20 January 2015 at 18:19, Alexey Dokuchaev wrote: > On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: >> But the fix is rather ugly, isn't it? I would personally prefer to just >> kill the older gcc but in the meantime updating it so that it behaves >> like the updated gcc/clang would be better. IMHO. > > Seconded. Putting extra harness on the code to avoid bugs in the compiler > that were actually fixed upsteam is totally bogus. Right, but: * not all of us work on compilers; * not all of us want to currently be working on compilers; * some of us have to use the gcc that's in tree; * .. and apparently updating that gcc to something > 4.2 is verboten. So if someone wants to help Navdeep by backporting those options, please do. I bet he'd love the help. -adrian From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:22:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06D2C341; Wed, 21 Jan 2015 03:22:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7D8FA14; Wed, 21 Jan 2015 03:22:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L3Mbg0016711; Wed, 21 Jan 2015 03:22:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L3Mb74016710; Wed, 21 Jan 2015 03:22:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210322.t0L3Mb74016710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 03:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277469 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:22:38 -0000 Author: ian Date: Wed Jan 21 03:22:37 2015 New Revision: 277469 URL: https://svnweb.freebsd.org/changeset/base/277469 Log: The mv/bus_space.c file is essentially identical to arm/bus_space-v6.c, so just use it. Deleted: head/sys/arm/mv/bus_space.c Modified: head/sys/arm/mv/files.mv Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Wed Jan 21 02:57:54 2015 (r277468) +++ head/sys/arm/mv/files.mv Wed Jan 21 03:22:37 2015 (r277469) @@ -12,6 +12,7 @@ # - JTAG/ICE # - Vector Floating Point (VFP) unit # +arm/arm/bus_space-v6.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard @@ -21,7 +22,6 @@ arm/arm/cpufunc_asm_armv7.S standard arm/arm/cpufunc_asm_sheeva.S standard arm/arm/cpufunc_asm_pj4b.S standard -arm/mv/bus_space.c standard arm/mv/gpio.c standard arm/mv/mv_common.c standard arm/mv/mv_localbus.c standard From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:24:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BB9B498; Wed, 21 Jan 2015 03:24:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED15A22; Wed, 21 Jan 2015 03:24:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L3OKHw016957; Wed, 21 Jan 2015 03:24:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L3OJ96016954; Wed, 21 Jan 2015 03:24:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210324.t0L3OJ96016954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 03:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277470 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:24:20 -0000 Author: ian Date: Wed Jan 21 03:24:18 2015 New Revision: 277470 URL: https://svnweb.freebsd.org/changeset/base/277470 Log: Move bs_unimplemented() to bus_space_generic.c so it can be shared. Modified: head/sys/arm/arm/bus_space-v6.c head/sys/arm/arm/bus_space_generic.c head/sys/arm/include/bus.h Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Jan 21 03:22:37 2015 (r277469) +++ head/sys/arm/arm/bus_space-v6.c Wed Jan 21 03:24:18 2015 (r277470) @@ -39,15 +39,6 @@ __FBSDID("$FreeBSD$"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); -static void -bs_unimplemented(void) -{ - - panic("unimplemented bus_space function called"); -} - -#define BS_UNIMPLEMENTED (void *)bs_unimplemented - /* * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Wed Jan 21 03:22:37 2015 (r277469) +++ head/sys/arm/arm/bus_space_generic.c Wed Jan 21 03:24:18 2015 (r277470) @@ -53,6 +53,13 @@ __FBSDID("$FreeBSD$"); #include #include +void +generic_bs_unimplemented(void) +{ + + panic("unimplemented bus_space function called"); +} + /* Prototypes for all the bus_space structure functions */ bs_protos(generic); Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Wed Jan 21 03:22:37 2015 (r277469) +++ head/sys/arm/include/bus.h Wed Jan 21 03:24:18 2015 (r277470) @@ -730,6 +730,9 @@ bs_c_2_proto(f); \ bs_c_4_proto(f); \ bs_c_8_proto(f); +void generic_bs_unimplemented(void); +#define BS_UNIMPLEMENTED (void *)generic_bs_unimplemented + #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t) #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:28:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74A88719; Wed, 21 Jan 2015 03:28:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 562DAA47; Wed, 21 Jan 2015 03:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L3S8V5017622; Wed, 21 Jan 2015 03:28:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L3S7t0017620; Wed, 21 Jan 2015 03:28:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210328.t0L3S7t0017620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 03:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277471 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:28:08 -0000 Author: ian Date: Wed Jan 21 03:28:07 2015 New Revision: 277471 URL: https://svnweb.freebsd.org/changeset/base/277471 Log: Use explicit initializer style, fill in missing functions. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Jan 21 03:24:18 2015 (r277470) +++ head/sys/arm/at91/at91.c Wed Jan 21 03:28:07 2015 (r277471) @@ -118,110 +118,110 @@ bus_dma_get_range_nb(void) bs_protos(generic); struct bus_space at91_bs_tag = { - /* cookie */ - (void *) 0, + /* privdata is whatever the implementer wants; unused in base tag */ + .bs_privdata = NULL, /* mapping/unmapping */ - at91_bs_map, - at91_bs_unmap, - at91_bs_subregion, + .bs_map = at91_bs_map, + .bs_unmap = at91_bs_unmap, + .bs_subregion = at91_bs_subregion, /* allocation/deallocation */ - NULL, - NULL, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - at91_barrier, + .bs_barrier = at91_barrier, /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, + .bs_r_1 = NULL, /* Use inline code in bus.h */ + .bs_r_2 = NULL, /* Use inline code in bus.h */ + .bs_r_4 = NULL, /* Use inline code in bus.h */ + .bs_r_8 = NULL, /* Use inline code in bus.h */ /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = BS_UNIMPLEMENTED, /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = BS_UNIMPLEMENTED, /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, + .bs_w_1 = NULL, /* Use inline code in bus.h */ + .bs_w_2 = NULL, /* Use inline code in bus.h */ + .bs_w_4 = NULL, /* Use inline code in bus.h */ + .bs_w_8 = NULL, /* Use inline code in bus.h */ /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = BS_UNIMPLEMENTED, /* write region */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = BS_UNIMPLEMENTED, /* set multiple */ - NULL, - NULL, - NULL, - NULL, + .bs_sm_1 = BS_UNIMPLEMENTED, + .bs_sm_2 = BS_UNIMPLEMENTED, + .bs_sm_4 = BS_UNIMPLEMENTED, + .bs_sm_8 = BS_UNIMPLEMENTED, /* set region */ - NULL, - generic_bs_sr_2, - generic_bs_sr_4, - NULL, + .bs_sr_1 = generic_bs_sr_1, + .bs_sr_2 = generic_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = BS_UNIMPLEMENTED, /* copy */ - NULL, - generic_bs_c_2, - NULL, - NULL, - - /* read (single) stream */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, + .bs_c_1 = BS_UNIMPLEMENTED, + .bs_c_2 = generic_bs_c_2, + .bs_c_4 = BS_UNIMPLEMENTED, + .bs_c_8 = BS_UNIMPLEMENTED, + + /* read stream (single) */ + .bs_r_1_s = NULL, /* Use inline code in bus.h */ + .bs_r_2_s = NULL, /* Use inline code in bus.h */ + .bs_r_4_s = NULL, /* Use inline code in bus.h */ + .bs_r_8_s = NULL, /* Use inline code in bus.h */ /* read multiple stream */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, + .bs_rm_1_s = generic_bs_rm_1, + .bs_rm_2_s = generic_bs_rm_2, + .bs_rm_4_s = generic_bs_rm_4, + .bs_rm_8_s = BS_UNIMPLEMENTED, /* read region stream */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) stream */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, + .bs_rr_1_s = generic_bs_rr_1, + .bs_rr_2_s = generic_bs_rr_2, + .bs_rr_4_s = generic_bs_rr_4, + .bs_rr_8_s = BS_UNIMPLEMENTED, + + /* write stream (single) */ + .bs_w_1_s = NULL, /* Use inline code in bus.h */ + .bs_w_2_s = NULL, /* Use inline code in bus.h */ + .bs_w_4_s = NULL, /* Use inline code in bus.h */ + .bs_w_8_s = NULL, /* Use inline code in bus.h */ /* write multiple stream */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, + .bs_wm_1_s = generic_bs_wm_1, + .bs_wm_2_s = generic_bs_wm_2, + .bs_wm_4_s = generic_bs_wm_4, + .bs_wm_8_s = BS_UNIMPLEMENTED, /* write region stream */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, + .bs_wr_1_s = generic_bs_wr_1, + .bs_wr_2_s = generic_bs_wr_2, + .bs_wr_4_s = generic_bs_wr_4, + .bs_wr_8_s = BS_UNIMPLEMENTED, }; #ifndef FDT Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Wed Jan 21 03:24:18 2015 (r277470) +++ head/sys/arm/at91/files.at91 Wed Jan 21 03:28:07 2015 (r277471) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard arm/at91/at91_machdep.c standard arm/at91/at91_aic.c standard From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:36:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E79FB98F for ; Wed, 21 Jan 2015 03:36:20 +0000 (UTC) Received: from nm41-vm8.bullet.mail.bf1.yahoo.com (nm41-vm8.bullet.mail.bf1.yahoo.com [216.109.114.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD7DB1F for ; Wed, 21 Jan 2015 03:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421811372; bh=1BWGXyNgwveDHOJxtW6yFCzWyFbSK1ZfGCS7oVlmhdQ=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=BX7P5T35d/F/ZEXVrVj44WoVaBTfkP8514nY/GP2HPa9tpDdJSs1hHqi7PlAsMo4H4dPojsg26mjznSLW0Djxw995QUgT88Jlc2QvyOWS0hXU+DmCYKFe/atSsnx5sIoQPZFa+jC4q4T9qN4H6Nl6dE5aUxyeoOqhIgoZlX4gDJJczth0SZy+VcaS6JAPSTOlWk5m290qsJHAMhNUnzWz/YZ+35IVzl+SQ3wOdiNH2Z4WndNyXgifheospsqYRBOg3Yl2c+vY1/dlePSNB06l6PwfAN0tkmhm0qqFe/c7ELfgL7a3qmEwAaNTh8ual0/2wxKsyJip/mI33aughdfMg== Received: from [66.196.81.173] by nm41.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:36:12 -0000 Received: from [98.139.211.205] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:36:12 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:36:12 -0000 X-Yahoo-Newman-Id: 604478.25420.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: UejmnnsVM1lVfP0BOSa_d0kE9wZACn9W2WIdXXOoI9l2y9N DQsvmkC.L.fcsW.K81klVXqAhgxjgL045Qcca1B5ww8.2brYKi83NMq4raos 5sfNs6vmA1rmDwvoksJnYOxVSKzRs99EuvftO2LhNx4SdqtoFLs_4PK9Huge YBvMlUbDazUGxrYOhbcDNVHhhn2uZp7UzlFb12MjMgvcdn856lyKsZs0dlqG PgZ0R_.MIr1qF.9i1CbhmX.Bceb8eMiEgdCySi8XFFd.MxhQx7.avPQJqvYd KESzW6q.WQdU8ZSZh2HPklBj_XfhNUkuUgmYU0_bVUv0uIT8fWyBdwyu7AZn a3eCSqFeNJnRfJKPUtTMB1U8kqGXT1Gm69Nu3xW83B1YsSPaHh.WSlVwBaIa Ka4bRF.zlqLbSIupSKLguKRSUWUYef1R7RdaJ8ftfiNgImtiJiYxBlUMqYKN YWCsFugFGi7K6piEa0lY8.FSKwJTxDFO45Y1VqSdDI6wJ15QnVWR8NhZuYgV dNbghuZr9.6zlC3RJgPl77Jld7bCDtVbbW_tbzmr5lH2IbEpBZ4yuAmkx4lh hS..r1ndhUHVvoFbZICttQYp0P7n8P3Y- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BF1EB0.2080901@FreeBSD.org> Date: Tue, 20 Jan 2015 22:36:16 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:36:21 -0000 On 01/20/15 22:06, Adrian Chadd wrote: > On 20 January 2015 at 18:19, Alexey Dokuchaev wrote: >> On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: >>> But the fix is rather ugly, isn't it? I would personally prefer to just >>> kill the older gcc but in the meantime updating it so that it behaves >>> like the updated gcc/clang would be better. IMHO. >> Seconded. Putting extra harness on the code to avoid bugs in the compiler >> that were actually fixed upsteam is totally bogus. > Right, but: > > * not all of us work on compilers; > * not all of us want to currently be working on compilers; > * some of us have to use the gcc that's in tree; > * .. and apparently updating that gcc to something > 4.2 is verboten. The external toolchain can't be that bad(?). > So if someone wants to help Navdeep by backporting those options, Hmm .. didn't I post a patch? > please do. I bet he'd love the help. > Ugh he doesn't and TBH, I don't care enough to look for consensus either. I find it interesting, and even funny that even the extreme copyleft are predicting clang will take over gcc: http://youtu.be/-ItFjEG3LaA Cheers, Pedro. > > -adrian > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:44:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71585BC5; Wed, 21 Jan 2015 03:44:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B6DEBFB; Wed, 21 Jan 2015 03:44:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L3iYDx026493; Wed, 21 Jan 2015 03:44:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L3iU7d026467; Wed, 21 Jan 2015 03:44:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210344.t0L3iU7d026467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 03:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277472 - in head/sys/arm: allwinner allwinner/a20 altera/socfpga arm broadcom/bcm2835 freescale/imx freescale/vybrid lpc mv rockchip samsung/exynos ti xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:44:34 -0000 Author: ian Date: Wed Jan 21 03:44:29 2015 New Revision: 277472 URL: https://svnweb.freebsd.org/changeset/base/277472 Log: Rename bus_space-v6.c to bus_space_base.c, because it's not v6-specific and now some v5 Marvell systems are using it. Only define fdt_bus_tag if option FDT is defined. Added: head/sys/arm/arm/bus_space_base.c - copied, changed from r277470, head/sys/arm/arm/bus_space-v6.c Deleted: head/sys/arm/arm/bus_space-v6.c Modified: head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/files.a10 head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/lpc/files.lpc head/sys/arm/mv/files.mv head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/ti/files.ti head/sys/arm/xilinx/files.zynq7 Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/allwinner/a20/files.a20 Wed Jan 21 03:44:29 2015 (r277472) @@ -17,7 +17,7 @@ arm/allwinner/a10_ehci.c optional ehci arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard -arm/arm/bus_space-v6.c standard -arm/allwinner/a10_common.c standard +arm/arm/bus_space_base.c standard +arm/allwinner/a10_common.c standard arm/allwinner/a10_machdep.c standard arm/allwinner/a20/a20_mp.c optional smp Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/allwinner/files.a10 Wed Jan 21 03:44:29 2015 (r277472) @@ -19,5 +19,5 @@ arm/allwinner/a20/a20_cpu_cfg.c standar arm/allwinner/aintc.c standard arm/allwinner/if_emac.c optional emac arm/allwinner/timer.c standard -arm/arm/bus_space-v6.c standard -#arm/allwinner/console.c standard +arm/arm/bus_space_base.c standard +#arm/allwinner/console.c standard Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/altera/socfpga/files.socfpga Wed Jan 21 03:44:29 2015 (r277472) @@ -9,7 +9,7 @@ arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard Copied and modified: head/sys/arm/arm/bus_space_base.c (from r277470, head/sys/arm/arm/bus_space-v6.c) ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Jan 21 03:24:18 2015 (r277470, copy source) +++ head/sys/arm/arm/bus_space_base.c Wed Jan 21 03:44:29 2015 (r277472) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + /* Prototypes for all the bus_space structure functions */ bs_protos(generic); @@ -43,7 +45,7 @@ bs_protos(generic); * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. */ -static struct bus_space _base_tag = { +static struct bus_space arm_base_tag = { /* privdata is whatever the implementer wants; unused in base tag */ .bs_privdata = NULL, @@ -150,4 +152,6 @@ static struct bus_space _base_tag = { .bs_wr_8_s = BS_UNIMPLEMENTED, }; -bus_space_tag_t fdtbus_bs_tag = &_base_tag; +#ifdef FDT +bus_space_tag_t fdtbus_bs_tag = &arm_base_tag; +#endif Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Wed Jan 21 03:44:29 2015 (r277472) @@ -15,7 +15,7 @@ arm/broadcom/bcm2835/bcm2835_spi.c opti arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/cpufunc_asm_arm11.S standard Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/freescale/imx/files.imx51 Wed Jan 21 03:44:29 2015 (r277472) @@ -10,7 +10,7 @@ kern/kern_clocksource.c standard arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx51_machdep.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard # Dummy serial console #arm/freescale/imx/console.c standard Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/freescale/imx/files.imx53 Wed Jan 21 03:44:29 2015 (r277472) @@ -10,7 +10,7 @@ kern/kern_clocksource.c standard arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx53_machdep.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard # Special serial console for debuging early boot code #arm/freescale/imx/console.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/freescale/imx/files.imx6 Wed Jan 21 03:44:29 2015 (r277472) @@ -15,7 +15,7 @@ kern/kern_clocksource.c standard # arm/arm/gic.c standard arm/arm/pl310.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/freescale/vybrid/files.vybrid Wed Jan 21 03:44:29 2015 (r277472) @@ -9,7 +9,7 @@ arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard Modified: head/sys/arm/lpc/files.lpc ============================================================================== --- head/sys/arm/lpc/files.lpc Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/lpc/files.lpc Wed Jan 21 03:44:29 2015 (r277472) @@ -1,5 +1,5 @@ # $FreeBSD$ -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard arm/arm/cpufunc_asm_armv5.S standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/mv/files.mv Wed Jan 21 03:44:29 2015 (r277472) @@ -12,7 +12,7 @@ # - JTAG/ICE # - Vector Floating Point (VFP) unit # -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/rockchip/files.rk30xx Wed Jan 21 03:44:29 2015 (r277472) @@ -11,7 +11,7 @@ arm/arm/cpufunc_asm_armv7.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/rockchip/rk30xx_common.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/samsung/exynos/files.exynos5 Wed Jan 21 03:44:29 2015 (r277472) @@ -9,7 +9,7 @@ arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/gic.c standard arm/arm/generic_timer.c standard Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/ti/files.ti Wed Jan 21 03:44:29 2015 (r277472) @@ -2,7 +2,7 @@ kern/kern_clocksource.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/cpufunc_asm_armv5.S standard Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Wed Jan 21 03:28:07 2015 (r277471) +++ head/sys/arm/xilinx/files.zynq7 Wed Jan 21 03:44:29 2015 (r277472) @@ -5,7 +5,7 @@ kern/kern_clocksource.c standard -arm/arm/bus_space-v6.c standard +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/cpufunc_asm_armv5.S standard From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:52:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9ED3E11; Wed, 21 Jan 2015 03:52:53 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 833DDCCA; Wed, 21 Jan 2015 03:52:53 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id t0L3qlrv029482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Jan 2015 19:52:47 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id t0L3qhJQ029481; Tue, 20 Jan 2015 19:52:43 -0800 (PST) (envelope-from sgk) Date: Tue, 20 Jan 2015 19:52:43 -0800 From: Steve Kargl To: Pedro Giffuni Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121035243.GA29469@troutmask.apl.washington.edu> References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF1EB0.2080901@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:52:53 -0000 On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: > > On 01/20/15 22:06, Adrian Chadd wrote: > > * .. and apparently updating that gcc to something > 4.2 is verboten. > > The external toolchain can't be that bad(?). > Are the ever change knobs documented somewhere? > > please do. I bet he'd love the help. > > > Ugh he doesn't and TBH, I don't care enough to look for > consensus either. > > I find it interesting, and even funny that even the extreme > copyleft are predicting clang will take over gcc: > > http://youtu.be/-ItFjEG3LaA > Clang won't take over gcc anytime soon. Fortran, ada? -- Steve From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:53:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0254BF52 for ; Wed, 21 Jan 2015 03:53:48 +0000 (UTC) Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com [98.139.212.165]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D657CD5 for ; Wed, 21 Jan 2015 03:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421812425; bh=KT35l4+WwRRV4TlrL/FpraeW5TsTCd6QSqaJfjRoH04=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=gVermKzwYdRLL9xuYon16yB44t1yOHmF3HAERng2DScESgBRV72MtYMn/kvrzewF3ZN87i5Rp9ydaDwnrt75kYkp6ttWM4CQl+xzYPLQqsBynTc2S9LSOZ6iPWu0TkZwA0EczRdnIMu70WS1vpKMsR/vasNSm9Kd9X9wEIIshhM+LsPam5i5uVkWqzHsHtZdnFB6LZm6FxOFkmfrR2ejKNE0fzvT1KfqbfF9N7jT8/b5sSUl9Cknmxwv4V4Gs27pveQEsAyXKeo+ASBxHtCvRjiRGxt2hvEH27/sgbz/sGwSrhNQuhsIVE1kN1/pgGyinVPT1erAmwKZvgozkx52DA== Received: from [98.139.215.141] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:53:45 -0000 Received: from [68.142.230.73] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:53:45 -0000 Received: from [127.0.0.1] by smtp230.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 03:53:45 -0000 X-Yahoo-Newman-Id: 570115.37348.bm@smtp230.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: SXAb8p8VM1mzgQ4x142nJmfIHU3KgcWNT3fFGB.Jzu7ZGRK zzsRfoUczsNGo3LaJFHGrlY9JcY7eQDgWgUDO6ymRRBu5Teeu7M.yE8JtRB6 XtaITp_YBf9Ve8DSLMIz0QhS.7X7IlV5_W283j6V6vxofzXLJz_c9pmH1B99 Dw6BPHvkw5nQkrQJP_FRDi_qScIsEVEezrUzzGuxN.C0JwTjDh.uxTUIcdvQ R_Db8so_WQOTRruEURXZfVkI.T_U6_Xf2DnD6opI40JGFY8mQ2R2hXwQTDxC FCCadKrdkQEpkY6qcQT1rCzDb4PiJk0R9EgMklYDvNp0BPLik4KvWi5iXMkQ oUvNR8lwZP_5VllOh.k_eQarOi6qfRdmLmtgbOzQtGgTWlPF9hnqunEHORw1 C.srGmj7SPgslIleK.QUyOsS8xdEUmo4B2yvKGsiomxOi18qeLlSiCnUVQe9 nNm.rT9VMU7Myf4OED4YMxF269UGYcWJLkKd97ATv1g42it7OnKq0gNyyTrc 85e5wrqg0gQoieVcBqRG_v5GQJ6aTid37JuiB1YmfIF3nQcW6FLw4bTgScnN eE795nKgMyAOv3B5s_BglEIVbhd6QIAfQ4WQ- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BF22BD.4080304@FreeBSD.org> Date: Tue, 20 Jan 2015 22:53:33 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "src-committers@freebsd.org" Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> In-Reply-To: <54BF1EB0.2080901@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:53:48 -0000 On 01/20/15 22:36, Pedro Giffuni wrote: > > ... > > I find it interesting, and even funny that even the extreme > copyleft are predicting clang will take over gcc: > > http://youtu.be/-ItFjEG3LaA > Actually I should apologize for publishing that link, it is rather poorly argumented and is not subject for a technical list. It's also boring (around 21:00 and 60:00 are the only "interesting" and controversial comments). Please let's not discuss that crap in the technical lists. Sorry again, Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 03:59:11 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31B7617E; Wed, 21 Jan 2015 03:59:11 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A9DCF9; Wed, 21 Jan 2015 03:59:10 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id t0L3x8UX021332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 20 Jan 2015 19:59:08 -0800 Message-ID: <54BF240C.2090107@freebsd.org> Date: Tue, 20 Jan 2015 19:59:08 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc References: <201501201621.t0KGLx26096724@svn.freebsd.org> <20150120191438.GL42409@kib.kiev.ua> In-Reply-To: <20150120191438.GL42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVacb8wDZv0nddrVr10W1s6eMKnHJOWqR0nYT6S+PdCVoOGT3fWV1nyrKbPMDkNTki2bK4U+k+F9tS5JWRFpKlWb91Sdq6JSHcs= X-Sonic-ID: C;st+L2SGh5BGO8JCx7jkJAQ== M;vMjU2SGh5BGO8JCx7jkJAQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 03:59:11 -0000 On 01/20/15 11:14, Konstantin Belousov wrote: > On Tue, Jan 20, 2015 at 04:21:59PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Tue Jan 20 16:21:59 2015 >> New Revision: 277421 >> URL: https://svnweb.freebsd.org/changeset/base/277421 >> >> Log: >> There does not seem to be any reason to acquire GIANT here. Follow amd64 >> in removing it. >> >> MFC after: 1 month >> >> Modified: >> head/sys/powerpc/powerpc/mem.c >> >> Modified: head/sys/powerpc/powerpc/mem.c >> ============================================================================== >> --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 (r277420) >> +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 (r277421) >> @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, >> cnt = 0; >> error = 0; >> >> - GIANT_REQUIRED; >> - > This is not an acquisition, to be pedantic. Really, it is cdevsw which > has D_NEEDGIANT flag which acquires Giant. After architectures get > rid of GIANT_REQUIRED, flag can be removed. > Just so I understand, you are not objecting to this commit, right? Just pointing out that (a) my commit message was wrong and that (b) once all architectures make this change (presumably more involved) we can get rid of the D_NEEDGIANT in /sys/dev/mem/memdev.c? -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:06:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2FAC36C; Wed, 21 Jan 2015 04:06:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFAA0DC6; Wed, 21 Jan 2015 04:06:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L46biM036171; Wed, 21 Jan 2015 04:06:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L46a5C036167; Wed, 21 Jan 2015 04:06:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210406.t0L46a5C036167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 04:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277473 - in head/sys/arm: arm include versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 04:06:38 -0000 Author: ian Date: Wed Jan 21 04:06:36 2015 New Revision: 277473 URL: https://svnweb.freebsd.org/changeset/base/277473 Log: The versatile platform had two copies of a bus_space that are essentially duplicates of the standard arm base bus_space, so just use it. Deleted: head/sys/arm/versatile/bus_space.c head/sys/arm/versatile/versatile_pci_bus_space.c head/sys/arm/versatile/versatile_pci_bus_space.h Modified: head/sys/arm/arm/bus_space_base.c head/sys/arm/include/bus.h head/sys/arm/versatile/files.versatile head/sys/arm/versatile/versatile_pci.c Modified: head/sys/arm/arm/bus_space_base.c ============================================================================== --- head/sys/arm/arm/bus_space_base.c Wed Jan 21 03:44:29 2015 (r277472) +++ head/sys/arm/arm/bus_space_base.c Wed Jan 21 04:06:36 2015 (r277473) @@ -45,7 +45,7 @@ bs_protos(generic); * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. */ -static struct bus_space arm_base_tag = { +static struct bus_space arm_base_bus_space = { /* privdata is whatever the implementer wants; unused in base tag */ .bs_privdata = NULL, @@ -153,5 +153,7 @@ static struct bus_space arm_base_tag = { }; #ifdef FDT -bus_space_tag_t fdtbus_bs_tag = &arm_base_tag; +bus_space_tag_t fdtbus_bs_tag = &arm_base_bus_space; #endif + +bus_space_tag_t arm_base_bs_tag = &arm_base_bus_space; Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Wed Jan 21 03:44:29 2015 (r277472) +++ head/sys/arm/include/bus.h Wed Jan 21 04:06:36 2015 (r277473) @@ -245,6 +245,7 @@ struct bus_space { bus_size_t, const uint64_t *, bus_size_t); }; +extern bus_space_tag_t arm_base_bs_tag; /* * Utility macros; INTERNAL USE ONLY. Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Wed Jan 21 03:44:29 2015 (r277472) +++ head/sys/arm/versatile/files.versatile Wed Jan 21 04:06:36 2015 (r277473) @@ -1,5 +1,6 @@ # $FreeBSD$ +arm/arm/bus_space_base.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm11.S standard @@ -7,14 +8,12 @@ arm/arm/cpufunc_asm_arm11x6.S standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_armv6.S standard -arm/versatile/bus_space.c standard arm/versatile/pl050.c optional sc arm/versatile/sp804.c standard arm/versatile/versatile_machdep.c standard arm/versatile/versatile_clcd.c optional sc arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci -arm/versatile/versatile_pci_bus_space.c optional pci arm/versatile/versatile_sic.c standard arm/versatile/versatile_timer.c standard Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Wed Jan 21 03:44:29 2015 (r277472) +++ head/sys/arm/versatile/versatile_pci.c Wed Jan 21 04:06:36 2015 (r277473) @@ -355,7 +355,7 @@ versatile_pci_activate_resource(device_t vaddr = (vm_offset_t)pmap_mapdev(rman_get_start(r), rman_get_size(r)); rman_set_bushandle(r, vaddr); - rman_set_bustag(r, versatile_bus_space_pcimem); + rman_set_bustag(r, arm_base_bs_tag); res = rman_activate_resource(r); break; case SYS_RES_IRQ: From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:19:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE14B719; Wed, 21 Jan 2015 04:19:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBAC3ECB; Wed, 21 Jan 2015 04:19:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L4Jtex041348; Wed, 21 Jan 2015 04:19:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L4JtCa041347; Wed, 21 Jan 2015 04:19:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210419.t0L4JtCa041347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 04:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277474 - head/sys/arm/versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 04:19:56 -0000 Author: ian Date: Wed Jan 21 04:19:54 2015 New Revision: 277474 URL: https://svnweb.freebsd.org/changeset/base/277474 Log: Remove a no-longer-used include. Modified: head/sys/arm/versatile/versatile_pci.c Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Wed Jan 21 04:06:36 2015 (r277473) +++ head/sys/arm/versatile/versatile_pci.c Wed Jan 21 04:19:54 2015 (r277474) @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #define MEM_SYS 0 #define MEM_CORE 1 #define MEM_BASE 2 From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:20:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07A09858 for ; Wed, 21 Jan 2015 04:20:02 +0000 (UTC) Received: from nm25-vm1.bullet.mail.bf1.yahoo.com (nm25-vm1.bullet.mail.bf1.yahoo.com [98.139.212.155]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A01B3ED1 for ; Wed, 21 Jan 2015 04:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1421813993; bh=q6v02lzm07YXZ08R1xnFF3OPcSp7z1Q1vubKkPcRpXM=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=LCFO44jMDfIp1A8CgfnC0hP8000AgiDvXSbzd4dsKeQ18VbL4XiGHSHi53qhDCFa6YiuzaHWKJ3VpL6ewijc/R4B9K1dsz7YvWwk8I42pIR0sScnnmf5Mnszt82VR4xQna4tYaWlo24+n1YjMHX8JVqhm/QHK4AYV+h0WOkyWlNiZdWOnvMthqQ32nQAv4+pCxGVjh1PHa+0tcJMYxLZ2X/BAY1e5qGCP90nyD2Did1PB5gg/L4X/BpHSReCjrQzA6KxM3Vy2MP6Zcl8aP8rtNcAuLcnWbHGKDroPTs8Cd/0DV77+qkBxzGX3aYt4rZ8eFfgPK42CbGPcgIgjECmcg== Received: from [98.139.212.151] by nm25.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 04:19:53 -0000 Received: from [98.139.213.8] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 04:19:53 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 21 Jan 2015 04:19:53 -0000 X-Yahoo-Newman-Id: 591322.72942.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: YfhJ62sVM1nJTg6FNB3LcqZwOfeN8XiASWCEKM_EW.6UzKK hODhugUXExOLCdQ5XoIJE6cZz8h8xaUCEVj3dY3j8DDTJ8vSkgvKRz0t4UV5 uWW2pJvedFdzS89YmK_17mOwjLuyWfRnlv8Un7ISplVwOijUqtorphIn.UxD Mx6x1woM4STRlHjWWXr5A1Ut4UUucyuYb9Fy3v9MXJJIg_H6.qU4zpFN1zY0 diO1FT6uS29Cct5FXZwWFL.ccoDONP_jlcVKb1PW2ZEbCXSnCQuzlUd_jT3W 2xHA_e0ciiPaYYs5jDg8XamxQxoFanKYE42sxo3wHuhnOdR_r2sdbjw6vT9z KuTBMigvu_PJ5UqmjjRQpUnsCtpGkNgMoIIZjYgDeu9iXCP4aqT2tB2yAxX0 1FtOol7U7FijEB94DDnIb5slvysAe6LVXB9mN1cpFMMaKVOiudhJ7owU0w4a ylPNwegwoYWjJlIRzE_qdcnShubpFsHeu.zivbBHVwFPDZM4aj9rJWMJezbl naZH7tSPJiXfL9yFZsH_QhP_THvRwsQ2LONUjW1RezRoOt8vMT6ClXfPmzex _57dOfsonFRTdjUEk86wYN.U31shFmwfSpXhHWpyJWUr.LbMX.Wkojgy6VOz PIHkKpxR46jeB1_5gXLqwipOY.WjXMSc5jCnW_lP7RO25 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54BF28EE.1070801@FreeBSD.org> Date: Tue, 20 Jan 2015 23:19:58 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Steve Kargl Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121035243.GA29469@troutmask.apl.washington.edu> In-Reply-To: <20150121035243.GA29469@troutmask.apl.washington.edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 04:20:02 -0000 On 01/20/15 22:52, Steve Kargl wrote: > On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: >> On 01/20/15 22:06, Adrian Chadd wrote: >>> * .. and apparently updating that gcc to something > 4.2 is verboten. >> The external toolchain can't be that bad(?). >> > Are the ever change knobs documented somewhere? > https://wiki.freebsd.org/ExternalToolchain >>> please do. I bet he'd love the help. >>> >> Ugh he doesn't and TBH, I don't care enough to look for >> consensus either. >> >> I find it interesting, and even funny that even the extreme >> copyleft are predicting clang will take over gcc: >> >> http://youtu.be/-ItFjEG3LaA >> > Clang won't take over gcc anytime soon. > Fortran, ada? > OK, I do use fortran and even when not everyone uses fortran it's still very difficult to avoid pulling in a version of gcc when installing very basic ports (I recall some X stuff still requires it), but there is already interest to make clang the default compiler in some linux distribution (I forgot which, sorry), so it will not happen soon but it may very well happen. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:22:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 596CCB9D; Wed, 21 Jan 2015 04:22:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46D7FF7B; Wed, 21 Jan 2015 04:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L4MLjB045445; Wed, 21 Jan 2015 04:22:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L4MK59045443; Wed, 21 Jan 2015 04:22:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210422.t0L4MK59045443@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 04:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277475 - head/sys/arm/cavium/cns11xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 04:22:21 -0000 Author: ian Date: Wed Jan 21 04:22:20 2015 New Revision: 277475 URL: https://svnweb.freebsd.org/changeset/base/277475 Log: Use the base arm bus_space instead of an identical local copy. Modified: head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/cavium/cns11xx/files.econa Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Wed Jan 21 04:19:54 2015 (r277474) +++ head/sys/arm/cavium/cns11xx/econa.c Wed Jan 21 04:22:20 2015 (r277475) @@ -56,116 +56,7 @@ unsigned int CPU_clock = 200000000; unsigned int AHB_clock; unsigned int APB_clock; -bs_protos(generic); - -struct bus_space econa_bs_tag = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - generic_bs_map, - generic_bs_unmap, - generic_bs_subregion, - - /* allocation/deallocation */ - generic_bs_alloc, - generic_bs_free, - - /* barrier */ - generic_bs_barrier, - - /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, - - /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, - - /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, - - /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, - - /* write region */ - NULL, - NULL, - NULL, - NULL, - - /* set multiple */ - NULL, - NULL, - NULL, - NULL, - - /* set region */ - NULL, - NULL, - NULL, - NULL, - - /* copy */ - NULL, - NULL, - NULL, - NULL, - - /* read (single) stream */ - NULL, - NULL, - NULL, - NULL, - - /* read multiple stream */ - NULL, - generic_bs_rm_2, - NULL, - NULL, - - /* read region stream */ - NULL, - NULL, - NULL, - NULL, - - /* write (single) stream */ - NULL, - NULL, - NULL, - NULL, - - /* write multiple stream */ - NULL, - generic_bs_wm_2, - NULL, - NULL, - - /* write region stream */ - NULL, - NULL, - NULL, - NULL -}; - -bus_space_tag_t obio_tag = &econa_bs_tag; +bus_space_tag_t obio_tag; static int econa_probe(device_t dev) @@ -464,8 +355,10 @@ econa_attach(device_t dev) struct econa_softc *sc = device_get_softc(dev); int i; + obio_tag = arm_base_bs_tag; + econa_softc = sc; - sc->ec_st = &econa_bs_tag; + sc->ec_st = arm_base_bs_tag; sc->ec_sh = ECONA_IO_BASE; sc->dev = dev; if (bus_space_subregion(sc->ec_st, sc->ec_sh, ECONA_PIC_BASE, @@ -547,7 +440,7 @@ econa_alloc_resource(device_t dev, devic rle->res = rman_reserve_resource(&sc->ec_mem_rman, start, end, count, flags, child); if (rle->res != NULL) { - rman_set_bustag(rle->res, &econa_bs_tag); + rman_set_bustag(rle->res, arm_base_bs_tag); rman_set_bushandle(rle->res, start); } break; Modified: head/sys/arm/cavium/cns11xx/files.econa ============================================================================== --- head/sys/arm/cavium/cns11xx/files.econa Wed Jan 21 04:19:54 2015 (r277474) +++ head/sys/arm/cavium/cns11xx/files.econa Wed Jan 21 04:22:20 2015 (r277475) @@ -6,6 +6,7 @@ arm/cavium/cns11xx/timer.c standard arm/cavium/cns11xx/uart_bus_ec.c optional uart arm/cavium/cns11xx/uart_cpu_ec.c optional uart dev/uart/uart_dev_ns8250.c optional uart +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/cavium/cns11xx/ehci_ebus.c optional ehci arm/cavium/cns11xx/ohci_ec.c optional ohci From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:28:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31686D69; Wed, 21 Jan 2015 04:28:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135D0FB8; Wed, 21 Jan 2015 04:28:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L4SKTh046184; Wed, 21 Jan 2015 04:28:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L4SKrY046177; Wed, 21 Jan 2015 04:28:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210428.t0L4SKrY046177@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 04:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277476 - head/sys/arm/samsung/s3c2xx0 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 04:28:21 -0000 Author: ian Date: Wed Jan 21 04:28:19 2015 New Revision: 277476 URL: https://svnweb.freebsd.org/changeset/base/277476 Log: Use the base arm bus_space instead of an identical local copy. Modified: head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 head/sys/arm/samsung/s3c2xx0/s3c24x0.c head/sys/arm/samsung/s3c2xx0/s3c2xx0var.h head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Modified: head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 ============================================================================== --- head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Wed Jan 21 04:22:20 2015 (r277475) +++ head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Wed Jan 21 04:28:19 2015 (r277476) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/arm/bus_space_base.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0.c ============================================================================== --- head/sys/arm/samsung/s3c2xx0/s3c24x0.c Wed Jan 21 04:22:20 2015 (r277475) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0.c Wed Jan 21 04:28:19 2015 (r277476) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #define S3C2XX0_XTAL_CLK 12000000 +bus_space_tag_t s3c2xx0_bs_tag; + #define IPL_LEVELS 13 u_int irqmasks[IPL_LEVELS]; @@ -349,7 +351,7 @@ s3c24x0_alloc_resource(device_t bus, dev panic("Unable to map address space %#lX-%#lX", start, end); - rman_set_bustag(res, &s3c2xx0_bs_tag); + rman_set_bustag(res, s3c2xx0_bs_tag); rman_set_bushandle(res, start); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res)) { @@ -442,8 +444,9 @@ s3c24x0_attach(device_t dev) unsigned int i, j; u_long irqmax; + s3c2xx0_bs_tag = arm_base_bs_tag; s3c2xx0_softc = &(sc->sc_sx); - sc->sc_sx.sc_iot = iot = &s3c2xx0_bs_tag; + sc->sc_sx.sc_iot = iot = s3c2xx0_bs_tag; s3c2xx0_softc->s3c2xx0_irq_rman.rm_type = RMAN_ARRAY; s3c2xx0_softc->s3c2xx0_irq_rman.rm_descr = "S3C24X0 IRQs"; s3c2xx0_softc->s3c2xx0_mem_rman.rm_type = RMAN_ARRAY; @@ -641,7 +644,7 @@ cpu_reset(void) { (void) disable_interrupts(PSR_I|PSR_F); - bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_wdt_ioh, WDT_WTCON, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_wdt_ioh, WDT_WTCON, WTCON_ENABLE | WTCON_CLKSEL_16 | WTCON_ENRST); for(;;); } @@ -651,9 +654,9 @@ s3c24x0_sleep(int mode __unused) { int reg; - reg = bus_space_read_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_clkman_ioh, + reg = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_clkman_ioh, CLKMAN_CLKCON); - bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_clkman_ioh, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_clkman_ioh, CLKMAN_CLKCON, reg | CLKCON_IDLE); } @@ -664,15 +667,15 @@ arm_get_next_irq(int last __unused) uint32_t intpnd; int irq, subirq; - if ((irq = bus_space_read_4(&s3c2xx0_bs_tag, + if ((irq = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTOFFSET)) != 0) { /* Clear the pending bit */ - intpnd = bus_space_read_4(&s3c2xx0_bs_tag, + intpnd = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTPND); - bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_SRCPND, intpnd); - bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTPND, intpnd); switch (irq) { @@ -682,9 +685,9 @@ arm_get_next_irq(int last __unused) case S3C24X0_INT_UART2: /* Find the sub IRQ */ subirq = 0x7ff; - subirq &= bus_space_read_4(&s3c2xx0_bs_tag, + subirq &= bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_SUBSRCPND); - subirq &= ~(bus_space_read_4(&s3c2xx0_bs_tag, + subirq &= ~(bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK)); if (subirq == 0) return (irq); @@ -692,7 +695,7 @@ arm_get_next_irq(int last __unused) subirq = ffs(subirq) - 1; /* Clear the sub irq pending bit */ - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_SUBSRCPND, (1 << subirq)); @@ -716,9 +719,9 @@ arm_get_next_irq(int last __unused) case S3C24X0_INT_8_23: /* Find the external interrupt being called */ subirq = 0x7fffff; - subirq &= bus_space_read_4(&s3c2xx0_bs_tag, + subirq &= bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_gpio_ioh, GPIO_EINTPEND); - subirq &= ~bus_space_read_4(&s3c2xx0_bs_tag, + subirq &= ~bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_gpio_ioh, GPIO_EINTMASK); if (subirq == 0) return (irq); @@ -726,7 +729,7 @@ arm_get_next_irq(int last __unused) subirq = ffs(subirq) - 1; /* Clear the external irq pending bit */ - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_gpio_ioh, GPIO_EINTPEND, (1 << subirq)); @@ -748,22 +751,22 @@ arm_mask_irq(uintptr_t irq) irq -= S3C24X0_EXTIRQ_MIN; } if (irq < S3C24X0_SUBIRQ_MIN) { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK); mask |= (1 << irq); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK, mask); } else if (irq < S3C24X0_EXTIRQ_MIN) { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK); mask |= (1 << (irq - S3C24X0_SUBIRQ_MIN)); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK, mask); } else { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_gpio_ioh, GPIO_EINTMASK); mask |= (1 << (irq - S3C24X0_EXTIRQ_MIN)); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, GPIO_EINTMASK, mask); } } @@ -778,22 +781,22 @@ arm_unmask_irq(uintptr_t irq) irq -= S3C24X0_EXTIRQ_MIN; } if (irq < S3C24X0_SUBIRQ_MIN) { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK); mask &= ~(1 << irq); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK, mask); } else if (irq < S3C24X0_EXTIRQ_MIN) { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK); mask &= ~(1 << (irq - S3C24X0_SUBIRQ_MIN)); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK, mask); } else { - mask = bus_space_read_4(&s3c2xx0_bs_tag, + mask = bus_space_read_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_gpio_ioh, GPIO_EINTMASK); mask &= ~(1 << (irq - S3C24X0_EXTIRQ_MIN)); - bus_space_write_4(&s3c2xx0_bs_tag, + bus_space_write_4(s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, GPIO_EINTMASK, mask); } } Modified: head/sys/arm/samsung/s3c2xx0/s3c2xx0var.h ============================================================================== --- head/sys/arm/samsung/s3c2xx0/s3c2xx0var.h Wed Jan 21 04:22:20 2015 (r277475) +++ head/sys/arm/samsung/s3c2xx0/s3c2xx0var.h Wed Jan 21 04:28:19 2015 (r277476) @@ -74,7 +74,7 @@ struct s3c2xx0_ivar { typedef void *s3c2xx0_chipset_tag_t; -extern struct bus_space s3c2xx0_bs_tag; +extern bus_space_tag_t s3c2xx0_bs_tag; extern struct s3c2xx0_softc *s3c2xx0_softc; extern struct arm32_bus_dma_tag s3c2xx0_bus_dma; Modified: head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c ============================================================================== --- head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Wed Jan 21 04:22:20 2015 (r277475) +++ head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Wed Jan 21 04:28:19 2015 (r277476) @@ -61,7 +61,7 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(&uart_s3c2410_class); di->bas.chan = 0; - di->bas.bst = &s3c2xx0_bs_tag; + di->bas.bst = s3c2xx0_bs_tag; di->bas.bsh = s3c2410_uart_vaddr; di->bas.regshft = 0; di->bas.rclk = s3c2410_pclk; @@ -69,7 +69,7 @@ uart_cpu_getdev(int devtype, struct uart di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = &s3c2xx0_bs_tag; + uart_bus_space_io = s3c2xx0_bs_tag; uart_bus_space_mem = NULL; return (0); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 05:05:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E70906A8; Wed, 21 Jan 2015 05:05:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D31EF3CF; Wed, 21 Jan 2015 05:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L55B3c065373; Wed, 21 Jan 2015 05:05:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L558XE065355; Wed, 21 Jan 2015 05:05:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210505.t0L558XE065355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 05:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277477 - in head/sys/arm/xscale: i80321 i8134x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 05:05:12 -0000 Author: ian Date: Wed Jan 21 05:05:07 2015 New Revision: 277477 URL: https://svnweb.freebsd.org/changeset/base/277477 Log: Use the base arm bus_space instead of an identical local copy. Deleted: head/sys/arm/xscale/i80321/obio_space.c Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/files.ep80219 head/sys/arm/xscale/i80321/files.i80219 head/sys/arm/xscale/i80321/files.i80321 head/sys/arm/xscale/i80321/files.iq31244 head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i80321/obio.c head/sys/arm/xscale/i80321/obiovar.h head/sys/arm/xscale/i80321/uart_cpu_i80321.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/i8134x/files.i81342 head/sys/arm/xscale/i8134x/obio.c head/sys/arm/xscale/i8134x/obiovar.h head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Wed Jan 21 05:05:07 2015 (r277477) @@ -312,7 +312,7 @@ initarm(struct arm_boot_params *abp) * registers. */ i80321_calibrate_delay(); - i80321_sdram_bounds(&obio_bs_tag, IQ80321_80321_VBASE + VERDE_MCU_BASE, + i80321_sdram_bounds(obio_bs_tag, IQ80321_80321_VBASE + VERDE_MCU_BASE, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); Modified: head/sys/arm/xscale/i80321/files.ep80219 ============================================================================== --- head/sys/arm/xscale/i80321/files.ep80219 Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/files.ep80219 Wed Jan 21 05:05:07 2015 (r277477) @@ -6,7 +6,6 @@ arm/xscale/i80321/iq80321.c standard arm/xscale/i80321/ep80219_machdep.c standard arm/xscale/i80321/obio.c standard -arm/xscale/i80321/obio_space.c standard arm/xscale/i80321/uart_cpu_i80321.c optional uart arm/xscale/i80321/uart_bus_i80321.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/xscale/i80321/files.i80219 ============================================================================== --- head/sys/arm/xscale/i80321/files.i80219 Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/files.i80219 Wed Jan 21 05:05:07 2015 (r277477) @@ -2,6 +2,7 @@ # # IOP Specific # +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/xscale/i80321/i80321.c standard Modified: head/sys/arm/xscale/i80321/files.i80321 ============================================================================== --- head/sys/arm/xscale/i80321/files.i80321 Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/files.i80321 Wed Jan 21 05:05:07 2015 (r277477) @@ -1,4 +1,5 @@ #$FreeBSD$ +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/xscale/i80321/i80321.c standard Modified: head/sys/arm/xscale/i80321/files.iq31244 ============================================================================== --- head/sys/arm/xscale/i80321/files.iq31244 Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/files.iq31244 Wed Jan 21 05:05:07 2015 (r277477) @@ -3,7 +3,6 @@ arm/xscale/i80321/iq80321.c standard arm/xscale/i80321/iq31244_machdep.c standard arm/xscale/i80321/iq31244_7seg.c optional iq31244_7seg arm/xscale/i80321/obio.c standard -arm/xscale/i80321/obio_space.c standard arm/xscale/i80321/uart_cpu_i80321.c optional uart arm/xscale/i80321/uart_bus_i80321.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Wed Jan 21 05:05:07 2015 (r277477) @@ -313,7 +313,7 @@ initarm(struct arm_boot_params *abp) * registers. */ i80321_calibrate_delay(); - i80321_sdram_bounds(&obio_bs_tag, IQ80321_80321_VBASE + VERDE_MCU_BASE, + i80321_sdram_bounds(obio_bs_tag, IQ80321_80321_VBASE + VERDE_MCU_BASE, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); Modified: head/sys/arm/xscale/i80321/obio.c ============================================================================== --- head/sys/arm/xscale/i80321/obio.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/obio.c Wed Jan 21 05:05:07 2015 (r277477) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +bus_space_tag_t obio_bs_tag; + int obio_probe(device_t); int obio_attach(device_t); @@ -72,7 +74,8 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - sc->oba_st = &obio_bs_tag; + obio_bs_tag = arm_base_bs_tag; + sc->oba_st = obio_bs_tag; sc->oba_addr = IQ80321_OBIO_BASE; sc->oba_size = IQ80321_OBIO_SIZE; sc->oba_rman.rm_type = RMAN_ARRAY; Modified: head/sys/arm/xscale/i80321/obiovar.h ============================================================================== --- head/sys/arm/xscale/i80321/obiovar.h Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/obiovar.h Wed Jan 21 05:05:07 2015 (r277477) @@ -53,6 +53,6 @@ struct obio_softc { struct rman oba_irq_rman; }; -extern struct bus_space obio_bs_tag; +extern bus_space_tag_t obio_bs_tag; #endif /* _IQ80321_OBIOVAR_H_ */ Modified: head/sys/arm/xscale/i80321/uart_cpu_i80321.c ============================================================================== --- head/sys/arm/xscale/i80321/uart_cpu_i80321.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i80321/uart_cpu_i80321.c Wed Jan 21 05:05:07 2015 (r277477) @@ -53,14 +53,14 @@ uart_cpu_getdev(int devtype, struct uart { di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = &obio_bs_tag; + di->bas.bst = obio_bs_tag; di->bas.regshft = 0; di->bas.rclk = 0; di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = &obio_bs_tag; + uart_bus_space_io = obio_bs_tag; uart_bus_space_mem = NULL; di->bas.bsh = 0xfe800000; return (0); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Wed Jan 21 05:05:07 2015 (r277477) @@ -293,7 +293,7 @@ initarm(struct arm_boot_params *abp) cpu_setup(""); i80321_calibrate_delay(); - i81342_sdram_bounds(&obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); + i81342_sdram_bounds(obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); /* Set stack for exception handlers */ Modified: head/sys/arm/xscale/i8134x/files.i81342 ============================================================================== --- head/sys/arm/xscale/i8134x/files.i81342 Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i8134x/files.i81342 Wed Jan 21 05:05:07 2015 (r277477) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/cpufunc_asm_xscale_c3.S standard @@ -9,7 +10,6 @@ arm/xscale/i8134x/i81342_mcu.c standard arm/xscale/i8134x/i81342_pci.c optional pci arm/xscale/i8134x/i81342_space.c standard arm/xscale/i8134x/obio.c standard -arm/xscale/i8134x/obio_space.c standard arm/xscale/i8134x/uart_bus_i81342.c optional uart arm/xscale/i8134x/uart_cpu_i81342.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/xscale/i8134x/obio.c ============================================================================== --- head/sys/arm/xscale/i8134x/obio.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i8134x/obio.c Wed Jan 21 05:05:07 2015 (r277477) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +bus_space_tag_t obio_bs_tag; static int obio_probe(device_t dev) @@ -68,7 +69,8 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - sc->oba_st = &obio_bs_tag; + obio_bs_tag = arm_base_bs_tag; + sc->oba_st = obio_bs_tag; sc->oba_rman.rm_type = RMAN_ARRAY; sc->oba_rman.rm_descr = "OBIO I/O"; if (rman_init(&sc->oba_rman) != 0 || Modified: head/sys/arm/xscale/i8134x/obiovar.h ============================================================================== --- head/sys/arm/xscale/i8134x/obiovar.h Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i8134x/obiovar.h Wed Jan 21 05:05:07 2015 (r277477) @@ -50,6 +50,6 @@ struct obio_softc { struct rman oba_irq_rman; }; -extern struct bus_space obio_bs_tag; +extern bus_space_tag_t obio_bs_tag; #endif /* _IQ80321_OBIOVAR_H_ */ Modified: head/sys/arm/xscale/i8134x/uart_cpu_i81342.c ============================================================================== --- head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Wed Jan 21 04:28:19 2015 (r277476) +++ head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Wed Jan 21 05:05:07 2015 (r277477) @@ -54,14 +54,14 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = &obio_bs_tag; + di->bas.bst = obio_bs_tag; di->bas.regshft = 2; di->bas.rclk = 33334000; di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = &obio_bs_tag; + uart_bus_space_io = obio_bs_tag; uart_bus_space_mem = NULL; di->bas.bsh = IOP34X_UART0_VADDR; return (0); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 05:10:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85A1B81E; Wed, 21 Jan 2015 05:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67A15660; Wed, 21 Jan 2015 05:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L5AOM3068362; Wed, 21 Jan 2015 05:10:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L5ANwA068360; Wed, 21 Jan 2015 05:10:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210510.t0L5ANwA068360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 05:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277478 - in head/sys/arm/xscale: i80321 i8134x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 05:10:24 -0000 Author: ian Date: Wed Jan 21 05:10:23 2015 New Revision: 277478 URL: https://svnweb.freebsd.org/changeset/base/277478 Log: Use the base arm bus_space instead of an identical local copy. Modified: head/sys/arm/xscale/i80321/i80321_space.c head/sys/arm/xscale/i8134x/i81342_space.c Modified: head/sys/arm/xscale/i80321/i80321_space.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 05:05:07 2015 (r277477) +++ head/sys/arm/xscale/i80321/i80321_space.c Wed Jan 21 05:10:23 2015 (r277478) @@ -63,124 +63,12 @@ __FBSDID("$FreeBSD$"); bs_protos(i80321); bs_protos(i80321_io); bs_protos(i80321_mem); -bs_protos(generic); - -/* - * Template bus_space -- copied, and the bits that are NULL are - * filled in. - */ -const struct bus_space i80321_bs_tag_template = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - NULL, - NULL, - i80321_bs_subregion, - - /* allocation/deallocation */ - NULL, - NULL, - - /* barrier */ - i80321_bs_barrier, - - /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, - - /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, - - /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, - - /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, - - /* write region */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, - - /* set multiple */ - NULL, - NULL, - NULL, - NULL, - - /* set region */ - NULL, - generic_bs_sr_2, - generic_bs_sr_4, - NULL, - - /* copy */ - NULL, - generic_bs_c_2, - NULL, - NULL, - - /* read (single) stream */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, - - /* read multiple stream */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, - - /* read region stream */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) stream */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, - - /* write multiple stream */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, - - /* write region stream */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, -}; void i80321_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i80321_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; } @@ -188,7 +76,7 @@ void i80321_io_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i80321_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; bs->bs_map = i80321_io_bs_map; @@ -202,7 +90,7 @@ void i80321_mem_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i80321_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; bs->bs_map = i80321_mem_bs_map; Modified: head/sys/arm/xscale/i8134x/i81342_space.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 05:05:07 2015 (r277477) +++ head/sys/arm/xscale/i8134x/i81342_space.c Wed Jan 21 05:10:23 2015 (r277478) @@ -64,124 +64,12 @@ __FBSDID("$FreeBSD$"); bs_protos(i81342); bs_protos(i81342_io); bs_protos(i81342_mem); -bs_protos(generic); - -/* - * Template bus_space -- copied, and the bits that are NULL are - * filled in. - */ -const struct bus_space i81342_bs_tag_template = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - NULL, - NULL, - i81342_bs_subregion, - - /* allocation/deallocation */ - NULL, - NULL, - - /* barrier */ - i81342_bs_barrier, - - /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, - - /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, - - /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, - - /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, - - /* write region */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, - - /* set multiple */ - NULL, - NULL, - NULL, - NULL, - - /* set region */ - NULL, - generic_bs_sr_2, - generic_bs_sr_4, - NULL, - - /* copy */ - NULL, - generic_bs_c_2, - NULL, - NULL, - - /* read (single) stream */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - NULL, - - /* read multiple stream */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - NULL, - - /* read region stream */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - NULL, - - /* write (single) stream */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - NULL, - - /* write multiple stream */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - NULL, - - /* write region stream */ - NULL, - generic_bs_wr_2, - generic_bs_wr_4, - NULL, -}; void i81342_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i81342_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; } @@ -189,7 +77,7 @@ void i81342_io_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i81342_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; bs->bs_map = i81342_io_bs_map; @@ -203,7 +91,7 @@ void i81342_mem_bs_init(bus_space_tag_t bs, void *cookie) { - *bs = i81342_bs_tag_template; + *bs = *arm_base_bs_tag; bs->bs_privdata = cookie; bs->bs_map = i81342_mem_bs_map; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 05:23:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 750F3A4D; Wed, 21 Jan 2015 05:23:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 624C37AB; Wed, 21 Jan 2015 05:23:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L5NADs074470; Wed, 21 Jan 2015 05:23:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L5NA57074469; Wed, 21 Jan 2015 05:23:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210523.t0L5NA57074469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 05:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277479 - head/sys/arm/xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 05:23:10 -0000 Author: ian Date: Wed Jan 21 05:23:09 2015 New Revision: 277479 URL: https://svnweb.freebsd.org/changeset/base/277479 Log: Use explicit initializer style, fill in missing functions as unimplemented. Modified: head/sys/arm/xscale/pxa/pxa_space.c Modified: head/sys/arm/xscale/pxa/pxa_space.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_space.c Wed Jan 21 05:10:23 2015 (r277478) +++ head/sys/arm/xscale/pxa/pxa_space.c Wed Jan 21 05:23:09 2015 (r277479) @@ -65,73 +65,109 @@ bs_protos(pxa); */ struct bus_space _base_tag = { /* cookie */ - (void *) 0, + .bs_privdata = NULL, /* mapping/unmapping */ - generic_bs_map, - generic_bs_unmap, - generic_bs_subregion, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - generic_bs_alloc, - generic_bs_free, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - generic_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ - pxa_bs_r_1, - pxa_bs_r_2, - pxa_bs_r_4, - NULL, + .bs_r_1 = pxa_bs_r_1, + .bs_r_2 = pxa_bs_r_2, + .bs_r_4 = pxa_bs_r_4, + .bs_r_8 = BS_UNIMPLEMENTED, /* read multiple */ - pxa_bs_rm_1, - pxa_bs_rm_2, - NULL, - NULL, + .bs_rm_1 = pxa_bs_rm_1, + .bs_rm_2 = pxa_bs_rm_2, + .bs_rm_4 = BS_UNIMPLEMENTED, + .bs_rm_8 = BS_UNIMPLEMENTED, /* read region */ - pxa_bs_rr_1, - NULL, - NULL, - NULL, + .bs_rr_1 = pxa_bs_rr_1, + .bs_rr_2 = BS_UNIMPLEMENTED, + .bs_rr_4 = BS_UNIMPLEMENTED, + .bs_rr_8 = BS_UNIMPLEMENTED, /* write (single) */ - pxa_bs_w_1, - pxa_bs_w_2, - pxa_bs_w_4, - NULL, + .bs_w_1 = pxa_bs_w_1, + .bs_w_2 = pxa_bs_w_2, + .bs_w_4 = pxa_bs_w_4, + .bs_w_8 = BS_UNIMPLEMENTED, /* write multiple */ - pxa_bs_wm_1, - pxa_bs_wm_2, - NULL, - NULL, + .bs_wm_1 = pxa_bs_wm_1, + .bs_wm_2 = pxa_bs_wm_2, + .bs_wm_4 = BS_UNIMPLEMENTED, + .bs_wm_8 = BS_UNIMPLEMENTED, /* write region */ - NULL, - NULL, - NULL, - NULL, + .bs_wr_1 = BS_UNIMPLEMENTED, + .bs_wr_2 = BS_UNIMPLEMENTED, + .bs_wr_4 = BS_UNIMPLEMENTED, + .bs_wr_8 = BS_UNIMPLEMENTED, /* set multiple */ - NULL, - NULL, - NULL, - NULL, + .bs_sm_1 = BS_UNIMPLEMENTED, + .bs_sm_2 = BS_UNIMPLEMENTED, + .bs_sm_4 = BS_UNIMPLEMENTED, + .bs_sm_8 = BS_UNIMPLEMENTED, /* set region */ - NULL, - NULL, - NULL, - NULL, + .bs_sr_1 = BS_UNIMPLEMENTED, + .bs_sr_2 = BS_UNIMPLEMENTED, + .bs_sr_4 = BS_UNIMPLEMENTED, + .bs_sr_8 = BS_UNIMPLEMENTED, /* copy */ - NULL, - NULL, - NULL, - NULL, + .bs_c_1 = BS_UNIMPLEMENTED, + .bs_c_2 = BS_UNIMPLEMENTED, + .bs_c_4 = BS_UNIMPLEMENTED, + .bs_c_8 = BS_UNIMPLEMENTED, + + /* read stream (single) */ + .bs_r_1_s = BS_UNIMPLEMENTED, + .bs_r_2_s = BS_UNIMPLEMENTED, + .bs_r_4_s = BS_UNIMPLEMENTED, + .bs_r_8_s = BS_UNIMPLEMENTED, + + /* read multiple stream */ + .bs_rm_1_s = BS_UNIMPLEMENTED, + .bs_rm_2_s = BS_UNIMPLEMENTED, + .bs_rm_4_s = BS_UNIMPLEMENTED, + .bs_rm_8_s = BS_UNIMPLEMENTED, + + /* read region stream */ + .bs_rr_1_s = BS_UNIMPLEMENTED, + .bs_rr_2_s = BS_UNIMPLEMENTED, + .bs_rr_4_s = BS_UNIMPLEMENTED, + .bs_rr_8_s = BS_UNIMPLEMENTED, + + /* write stream (single) */ + .bs_w_1_s = BS_UNIMPLEMENTED, + .bs_w_2_s = BS_UNIMPLEMENTED, + .bs_w_4_s = BS_UNIMPLEMENTED, + .bs_w_8_s = BS_UNIMPLEMENTED, + + /* write multiple stream */ + .bs_wm_1_s = BS_UNIMPLEMENTED, + .bs_wm_2_s = BS_UNIMPLEMENTED, + .bs_wm_4_s = BS_UNIMPLEMENTED, + .bs_wm_8_s = BS_UNIMPLEMENTED, + + /* write region stream */ + .bs_wr_1_s = BS_UNIMPLEMENTED, + .bs_wr_2_s = BS_UNIMPLEMENTED, + .bs_wr_4_s = BS_UNIMPLEMENTED, + .bs_wr_8_s = BS_UNIMPLEMENTED, }; static struct bus_space _obio_tag; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 05:31:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8580DBEC; Wed, 21 Jan 2015 05:31:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7283886B; Wed, 21 Jan 2015 05:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L5VtOc078995; Wed, 21 Jan 2015 05:31:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L5VtJs078993; Wed, 21 Jan 2015 05:31:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501210531.t0L5VtJs078993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 05:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277480 - in head/sys/arm: samsung/s3c2xx0 xscale/i8134x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 05:31:55 -0000 Author: ian Date: Wed Jan 21 05:31:54 2015 New Revision: 277480 URL: https://svnweb.freebsd.org/changeset/base/277480 Log: Remove a couple files that are no longer used (functionality take over by arm/bus_space_base.c). Deleted: head/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c head/sys/arm/xscale/i8134x/obio_space.c Modified: head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Modified: head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 ============================================================================== --- head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Wed Jan 21 05:23:09 2015 (r277479) +++ head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Wed Jan 21 05:31:54 2015 (r277480) @@ -7,7 +7,6 @@ arm/samsung/s3c2xx0/board_ln2410sbc.c op arm/samsung/s3c2xx0/s3c24x0_rtc.c standard arm/samsung/s3c2xx0/s3c24x0_machdep.c standard arm/samsung/s3c2xx0/s3c24x0.c standard -arm/samsung/s3c2xx0/s3c2xx0_space.c standard arm/samsung/s3c2xx0/s3c24x0_clk.c standard arm/samsung/s3c2xx0/uart_bus_s3c2410.c optional uart arm/samsung/s3c2xx0/uart_cpu_s3c2410.c optional uart From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 05:53:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1122DEA5; Wed, 21 Jan 2015 05:53:50 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8DFEA05; Wed, 21 Jan 2015 05:53:49 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id bj1so50654003pad.9; Tue, 20 Jan 2015 21:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=80w0iMhzauGcQpIeSKDAVl68ZDdm98ofM8li9iYtp2U=; b=uBc3DPG1tX3gFyKsqMdmPz6oM7bmBJcS8R6HJirFo7e+5be89X9DyNzt0Uma18fIhZ OErfsVq637LWaVn79EpqatyN4/lGu/24RoZj66N/b2v3novM4LQvTtaYHZls/D4Vm5zG Gc4rcPuiDyE816n/eKt4D1gtbkI13cYXq9YRyshshWFAdmVo2DsdGP5oMOS3brqH+ruH CNSxoSJiACwcqWOeb9nDutfj5fW3wswWQWyPzcVqPIxvlwghThxJz/BVdB3AX0Hn5SOm 7frL9366Dn+zxfiH+MpAuLtK4CqetVZyBOvXcDNfnMyK5hLm+CiX7FP+9RwXbqw8WpKG Yo4A== X-Received: by 10.70.91.201 with SMTP id cg9mr24449679pdb.57.1421819629437; Tue, 20 Jan 2015 21:53:49 -0800 (PST) Received: from ox ([24.6.44.228]) by mx.google.com with ESMTPSA id ds16sm1732557pdb.65.2015.01.20.21.53.47 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 21:53:48 -0800 (PST) Sender: Navdeep Parhar Date: Tue, 20 Jan 2015 21:53:40 -0800 From: Navdeep Parhar To: Pedro Giffuni Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121055329.GB3307@ox> Mail-Followup-To: Pedro Giffuni , Adrian Chadd , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF1EB0.2080901@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 05:53:50 -0000 On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: > > On 01/20/15 22:06, Adrian Chadd wrote: > >On 20 January 2015 at 18:19, Alexey Dokuchaev wrote: > >>On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: > >>>But the fix is rather ugly, isn't it? I would personally prefer to just > >>>kill the older gcc but in the meantime updating it so that it behaves > >>>like the updated gcc/clang would be better. IMHO. > >>Seconded. Putting extra harness on the code to avoid bugs in the compiler > >>that were actually fixed upsteam is totally bogus. > >Right, but: > > > >* not all of us work on compilers; > >* not all of us want to currently be working on compilers; > >* some of us have to use the gcc that's in tree; > >* .. and apparently updating that gcc to something > 4.2 is verboten. > > The external toolchain can't be that bad(?). > > >So if someone wants to help Navdeep by backporting those options, > > Hmm .. didn't I post a patch? > > >please do. I bet he'd love the help. > > > Ugh he doesn't and TBH, I don't care enough to look for > consensus either. Let's please just move on from this discussion then. I am not familiar with gcc internals so I can't vouch for this patch, and gcc is the default compiler on platforms that I cannot test. Given that, it would be reckless of me to push a gcc patch just to get it to play nice with one single file in the tree. High risk, little reward (given that -fms-extensions can be applied to just the file in question without disturbing anything else in the tree). Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 07:54:17 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E6A8C6F; Wed, 21 Jan 2015 07:54:17 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F6B6D2; Wed, 21 Jan 2015 07:54:16 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0L7sBaO012198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jan 2015 09:54:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0L7sBaO012198 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0L7sAfU012197; Wed, 21 Jan 2015 09:54:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Jan 2015 09:54:10 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc Message-ID: <20150121075410.GM42409@kib.kiev.ua> References: <201501201621.t0KGLx26096724@svn.freebsd.org> <20150120191438.GL42409@kib.kiev.ua> <54BF240C.2090107@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF240C.2090107@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 07:54:17 -0000 On Tue, Jan 20, 2015 at 07:59:08PM -0800, Nathan Whitehorn wrote: > > On 01/20/15 11:14, Konstantin Belousov wrote: > > On Tue, Jan 20, 2015 at 04:21:59PM +0000, Nathan Whitehorn wrote: > >> Author: nwhitehorn > >> Date: Tue Jan 20 16:21:59 2015 > >> New Revision: 277421 > >> URL: https://svnweb.freebsd.org/changeset/base/277421 > >> > >> Log: > >> There does not seem to be any reason to acquire GIANT here. Follow amd64 > >> in removing it. > >> > >> MFC after: 1 month > >> > >> Modified: > >> head/sys/powerpc/powerpc/mem.c > >> > >> Modified: head/sys/powerpc/powerpc/mem.c > >> ============================================================================== > >> --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 (r277420) > >> +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 (r277421) > >> @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, > >> cnt = 0; > >> error = 0; > >> > >> - GIANT_REQUIRED; > >> - > > This is not an acquisition, to be pedantic. Really, it is cdevsw which > > has D_NEEDGIANT flag which acquires Giant. After architectures get > > rid of GIANT_REQUIRED, flag can be removed. > > > Just so I understand, you are not objecting to this commit, right? Absolutely not, this is the right thing to do. > Just > pointing out that (a) my commit message was wrong and that (b) once all > architectures make this change (presumably more involved) we can get rid > of the D_NEEDGIANT in /sys/dev/mem/memdev.c? Exactly. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:00:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58BC9E56; Wed, 21 Jan 2015 08:00:19 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D28F976D; Wed, 21 Jan 2015 08:00:18 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::5529:9fa5:cf6:9530] (unknown [IPv6:2001:7b8:3a7:0:5529:9fa5:cf6:9530]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2A1F85C2E; Wed, 21 Jan 2015 09:00:08 +0100 (CET) Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CE364395-FE82-4164-9419-8596551839E5"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b4 From: Dimitry Andric In-Reply-To: <20150121055329.GB3307@ox> Date: Wed, 21 Jan 2015 09:00:03 +0100 Message-Id: <98838DA6-1969-4764-83DE-71F7BB568E23@FreeBSD.org> References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121055329.GB3307@ox> To: Navdeep Parhar X-Mailer: Apple Mail (2.1993) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:00:19 -0000 --Apple-Mail=_CE364395-FE82-4164-9419-8596551839E5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 21 Jan 2015, at 06:53, Navdeep Parhar wrote: >=20 > On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: >>=20 >> On 01/20/15 22:06, Adrian Chadd wrote: >>> On 20 January 2015 at 18:19, Alexey Dokuchaev = wrote: >>>> On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: >>>>> But the fix is rather ugly, isn't it? I would personally prefer to = just >>>>> kill the older gcc but in the meantime updating it so that it = behaves >>>>> like the updated gcc/clang would be better. IMHO. >>>> Seconded. Putting extra harness on the code to avoid bugs in the = compiler >>>> that were actually fixed upsteam is totally bogus. >>> Right, but: >>>=20 >>> * not all of us work on compilers; >>> * not all of us want to currently be working on compilers; >>> * some of us have to use the gcc that's in tree; >>> * .. and apparently updating that gcc to something > 4.2 is = verboten. >>=20 >> The external toolchain can't be that bad(?). >>=20 >>> So if someone wants to help Navdeep by backporting those options, >>=20 >> Hmm .. didn't I post a patch? >>=20 >>> please do. I bet he'd love the help. >>>=20 >> Ugh he doesn't and TBH, I don't care enough to look for >> consensus either. >=20 > Let's please just move on from this discussion then. I am not = familiar > with gcc internals so I can't vouch for this patch, and gcc is the > default compiler on platforms that I cannot test. Given that, it = would > be reckless of me to push a gcc patch just to get it to play nice with > one single file in the tree. High risk, little reward (given that > -fms-extensions can be applied to just the file in question without > disturbing anything else in the tree). Alternatively, just use the ${GCC_MS_EXTENSIONS} Makefile macro, which I specifically introduced for this issue. See e.g. sys/modules/ibcore/Makefile for an example. -Dimitry --Apple-Mail=_CE364395-FE82-4164-9419-8596551839E5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlS/XIYACgkQsF6jCi4glqMLNgCfTU7AL+edjlRlCpRA1CDPdFnZ k4QAni+w/Q/CjcwMiY9RLVLD5NJ3apiD =wRrZ -----END PGP SIGNATURE----- --Apple-Mail=_CE364395-FE82-4164-9419-8596551839E5-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:01:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47021FBC; Wed, 21 Jan 2015 08:01:45 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0B531813; Wed, 21 Jan 2015 08:01:44 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 6313F7E820; Wed, 21 Jan 2015 18:51:47 +1100 (EST) Message-ID: <54BF5A7B.2080601@freebsd.org> Date: Wed, 21 Jan 2015 18:51:23 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Will Andrews , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r275832 - head/tools/tools/nanobsd References: <201412161759.sBGHx6ZL016021@svn.freebsd.org> In-Reply-To: <201412161759.sBGHx6ZL016021@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:01:45 -0000 Hi Will, On 12/17/14 04:59, Will Andrews wrote: > Author: will > Date: Tue Dec 16 17:59:05 2014 > New Revision: 275832 > URL: https://svnweb.freebsd.org/changeset/base/275832 > > Log: > Make NanoBSD source-able from other scripts. > > Summary: > This change converts NanoBSD into a two-script bundle. > - defaults.sh contains all non-CLI code. Most NanoBSD code is moved into > this file. > - nanobsd.sh now consists just of a command line interface that calls into > functions in defaults.sh. > > Test Plan: Run NanoBSD using a previously-working configuration. > > Reviewers: imp > > Reviewed By: imp > > Differential Revision: https://reviews.freebsd.org/D1321 > > Added: > head/tools/tools/nanobsd/defaults.sh (contents, props changed) > Modified: > head/tools/tools/nanobsd/nanobsd.sh I think this change introduced a bug - I'm seeing nanobsd error out with the "NANO_TOOLS directory does not exist" message. The problem is that NANO_TOOLS is initialised to "tools/tools/nanobsd", and you changed the test in nanobsd.sh to *not* check for "${NANO_SRC}/${NANO_TOOLS}", which errors out except if the cwd is ${NANO_SRC}. You tweak NANO_TOOLS appropriately in set_defaults_and_export() but it's run after the dir test. There are a couple of ways to fix but I'll leave it to you to decide which you prefer. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:04:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34CB31C3; Wed, 21 Jan 2015 08:04:54 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB3383E; Wed, 21 Jan 2015 08:04:53 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id rd18so12197255iec.7; Wed, 21 Jan 2015 00:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=siZcRpcqeEw4NW1dGHTFfnsoGnSyzh88r/dIN1PhpgY=; b=BnvKUVU95oCanzGrJBqX9XF2l/yAtQw799ckE/EuGcNb0jxfXOl8Ss53lu76OZBiVK nxI/ANDaKVJGQldYDrcKDdRj1kE/pFp46Ck66CiSmU0HFt2YzQ+NGHzEGwy8ohpcT33E 9NTEFG4SXYZy0hwK66vLdHssJIQEGMawtCSLcxRjk0SlWhnZYHazJ59VbJHDIwSy8afD JYD42Mv99ppXxJHUfDF9TFb4q/dxk8SRBrkoSVi+GVYxWL8N0ho/keGgT33u04HxmxrP 5mzuJfAzFOddKZL0hM0c9dEZOQ+OSun9yxRDVVK/E2n5dZAa2qNTXq73M+i5zdIrIkDT EJdg== MIME-Version: 1.0 X-Received: by 10.42.62.71 with SMTP id x7mr38299744ich.61.1421827493405; Wed, 21 Jan 2015 00:04:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Wed, 21 Jan 2015 00:04:53 -0800 (PST) In-Reply-To: <201501202229.t0KMTReZ071739@svn.freebsd.org> References: <201501202229.t0KMTReZ071739@svn.freebsd.org> Date: Wed, 21 Jan 2015 00:04:53 -0800 X-Google-Sender-Auth: QoLERBqr3ptBsyGfzL2nLxJzI6o Message-ID: Subject: Re: svn commit: r277449 - head/sys/cddl/compat/opensolaris/sys From: Adrian Chadd To: Will Andrews Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:04:54 -0000 ... common/sys/zfs_context.h:538 ? -a On 20 January 2015 at 14:29, Will Andrews wrote: > Author: will > Date: Tue Jan 20 22:29:27 2015 > New Revision: 277449 > URL: https://svnweb.freebsd.org/changeset/base/277449 > > Log: > NSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec) > > Modified: > head/sys/cddl/compat/opensolaris/sys/time.h > > Modified: head/sys/cddl/compat/opensolaris/sys/time.h > ============================================================================== > --- head/sys/cddl/compat/opensolaris/sys/time.h Tue Jan 20 22:27:45 2015 (r277448) > +++ head/sys/cddl/compat/opensolaris/sys/time.h Tue Jan 20 22:29:27 2015 (r277449) > @@ -51,7 +51,7 @@ typedef longlong_t hrtime_t; > #endif > > #define SEC_TO_TICK(sec) ((sec) * hz) > -#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) > +#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / hz)) > > #ifdef _KERNEL > static __inline hrtime_t > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:06:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4312330; Wed, 21 Jan 2015 08:06:35 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6A285E; Wed, 21 Jan 2015 08:06:34 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6BB821FE023; Wed, 21 Jan 2015 09:06:31 +0100 (CET) Message-ID: <54BF5E39.5030007@selasky.org> Date: Wed, 21 Jan 2015 09:07:21 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:06:35 -0000 On 01/21/15 01:49, Adrian Chadd wrote: > You should totally try say, 100,000 active TCP connections on a box. > See what happens to swi0 (clock). > > TL;DR - the lock contention sucks and it takes a chunk of the core up. > The lock contention is highly not good. > > That's why I'd like to see both the callout stuff in its > slightly-better-defined-and-sane state from you/and/ make it so TCP > can use it. > > I'll have to double-check to see if the RSS stuff is all lined up > correctly so we can use it when we create the callouts (well, at inpcb > creation time, right), rather than when we first schedule them. Then > we can experiment with having the initial CPU be specified at callout > create time rather than expecting to be able to move it when we first > schedule it. > > Or, hm, maybe have it so we don't have a CPU chosen until the first > time we schedule the timeout, and if it hasn't been scheduled before, > allow the CPU to be set? Because at that point we aren't migrating it > off f timeout_cpu - it's never been added to it in the first place. Hi Adrian, What you are saying is correct. If you set the initial c_cpu value when the callout is initialized it will run on SWI#X instead of SWI#0. This is fully allowed, so maybe a callout_init_cpu() would be appropriate, to set the initial CPU number for callouts. With regard to the callout the c_cpu value can be different from zero, only the it must remain fixed/constant when there is no lock protecting updates to it! Kip and Gleb: Does adding a callout_init_cpu() function which can be used for existing callouts and in conjunction with CALLOUT_MPSAFE change anything? --HPS From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:10:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51D524C9; Wed, 21 Jan 2015 08:10:59 +0000 (UTC) Received: from mail-pd0-x234.google.com (mail-pd0-x234.google.com [IPv6:2607:f8b0:400e:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1054190E; Wed, 21 Jan 2015 08:10:59 +0000 (UTC) Received: by mail-pd0-f180.google.com with SMTP id ft15so19167103pdb.11; Wed, 21 Jan 2015 00:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=0re12HAM00huPv1f8FonSDKeE/E+z+5peK76Z6B2YLQ=; b=aGrwCvxcMTvPrzraQ6nVjh1U3/WbecHaVIs8SgkuKNz2Cj/GMLKTXhW3el8hGkIwHn m1T9OzhzSOp9gWMOHp6vJZLWZzlUZBDxjVnppYr07JC556ApQgHUio4GhNy5CsUUgP5I 8i8RThZDSz3Yy8f13gSKL18LGIKbBsC21ax4U9dOckn/ZxIdeLzfv1Zm9xhyFFPm2JFx 6U2ZfYA9jPWwIfvNQU0NTngN6sG1noarEBISg3BZGqOm0vnWaAZ3VK2wogKUV+3j0uYH fmyfB8EG3Ku7wu/OW/T/PhkWh/7lBuGGbY57xTvi4MkgynSRP4fyvvDnWScCq8btBl4p l0ig== X-Received: by 10.68.68.167 with SMTP id x7mr28703767pbt.23.1421827858497; Wed, 21 Jan 2015 00:10:58 -0800 (PST) Received: from ox ([24.6.44.228]) by mx.google.com with ESMTPSA id xc7sm5089872pbc.29.2015.01.21.00.10.56 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 Jan 2015 00:10:57 -0800 (PST) Sender: Navdeep Parhar Date: Wed, 21 Jan 2015 00:10:50 -0800 From: Navdeep Parhar To: Dimitry Andric Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121081050.GA4505@ox> Mail-Followup-To: Dimitry Andric , Pedro Giffuni , Adrian Chadd , Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121055329.GB3307@ox> <98838DA6-1969-4764-83DE-71F7BB568E23@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98838DA6-1969-4764-83DE-71F7BB568E23@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:10:59 -0000 On Wed, Jan 21, 2015 at 09:00:03AM +0100, Dimitry Andric wrote: > On 21 Jan 2015, at 06:53, Navdeep Parhar wrote: > > > > On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: > >> > >> On 01/20/15 22:06, Adrian Chadd wrote: > >>> On 20 January 2015 at 18:19, Alexey Dokuchaev wrote: > >>>> On Tue, Jan 20, 2015 at 07:50:23PM -0500, Pedro Giffuni wrote: > >>>>> But the fix is rather ugly, isn't it? I would personally prefer to just > >>>>> kill the older gcc but in the meantime updating it so that it behaves > >>>>> like the updated gcc/clang would be better. IMHO. > >>>> Seconded. Putting extra harness on the code to avoid bugs in the compiler > >>>> that were actually fixed upsteam is totally bogus. > >>> Right, but: > >>> > >>> * not all of us work on compilers; > >>> * not all of us want to currently be working on compilers; > >>> * some of us have to use the gcc that's in tree; > >>> * .. and apparently updating that gcc to something > 4.2 is verboten. > >> > >> The external toolchain can't be that bad(?). > >> > >>> So if someone wants to help Navdeep by backporting those options, > >> > >> Hmm .. didn't I post a patch? > >> > >>> please do. I bet he'd love the help. > >>> > >> Ugh he doesn't and TBH, I don't care enough to look for > >> consensus either. > > > > Let's please just move on from this discussion then. I am not familiar > > with gcc internals so I can't vouch for this patch, and gcc is the > > default compiler on platforms that I cannot test. Given that, it would > > be reckless of me to push a gcc patch just to get it to play nice with > > one single file in the tree. High risk, little reward (given that > > -fms-extensions can be applied to just the file in question without > > disturbing anything else in the tree). > > Alternatively, just use the ${GCC_MS_EXTENSIONS} Makefile macro, which > I specifically introduced for this issue. Ah, a rose with another name. I'm happy to use this but it's not clear why there is a GCC in the macro's name when clang deals with -fms-extensions just as well. (It's not even clear why the longer ${GCC_MS_EXTENSIONS} should be preferred to -fms-extentions. Isn't this like #define ONE 1 ?) In any case I'm perfectly fine with any change that doesn't involve a commit from me to gcc. Regards, Navdeep > > See e.g. sys/modules/ibcore/Makefile for an example. > > -Dimitry > From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:16:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6BBE68A; Wed, 21 Jan 2015 08:16:13 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4741B93E; Wed, 21 Jan 2015 08:16:13 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0L8G6tr025128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jan 2015 10:16:07 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0L8G6tr025128 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0L8G6kF025127; Wed, 21 Jan 2015 10:16:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Jan 2015 10:16:06 +0200 From: Konstantin Belousov To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150121081606.GN42409@kib.kiev.ua> References: <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , Sean Bruno , Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:16:13 -0000 On Tue, Jan 20, 2015 at 04:37:44PM -0800, K. Macy wrote: > I would pick stability over performance any day. However, it _seems_ > to me, and maybe I simply don't understand some key details, that the > fix consisted of largely single-threading the callout system. And as I > say I may simply not understand the specifics, but this sort of large > scale disabling does not constitute a fix but is a workaround. It's > more like disabling preemption because it fixes a panic. Yes, it might > "fix" a whole array of bugs that crop up but it could not be seen as a > fix to an otherwise working system. Well, this is not a complete truth. Let me try to explain my understanding, I spent some time actually looking at the new code. Would be nice if corrections to my understanding is posted, if needed. Now, when callout_reset() is directed to change cpu, the change only happens when the callout is associated with a lock, and that lock is owned by the caller of callout_reset(). There are two consequences. One, which is good, is significant simplification of the migration code, together with the drain. This is exactly the place where there bugs which make my head hurt, see e.g. r234952 and r243901. Note that some callouts follow this pattern already, e.g. process timers after r243869. Another consequence, which is very visible and which causes the roar, is that all lockless callers of callout_reset_on(9) now silently changed the behaviour to callout_reset(9). There is no audit performed to identify such callers, and there is no even a plan to fix them. The answer to the complains seems to be 'if you think that the fix is needed, go and fix'. My impression is that some set of vocal active developers consider the second consequence unacceptable, myself included. IMO, committing the change, however good the consequence one is, without fixing the consequence two, is inappropriate. And the onus of doing this is on the person doing the change. Yes, it is very interesting is the change actually good WRT fixing migration, since indeed there is serious reduction in the migration amount due to locked callout_reset() being not universally used. It is possible that the bugs are only covered. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:17:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 335487E7; Wed, 21 Jan 2015 08:17:17 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A25B955; Wed, 21 Jan 2015 08:17:17 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id t0L8HGqV030347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 00:17:16 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id t0L8HEXG030346; Wed, 21 Jan 2015 00:17:14 -0800 (PST) (envelope-from sgk) Date: Wed, 21 Jan 2015 00:17:14 -0800 From: Steve Kargl To: Pedro Giffuni Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121081714.GA30318@troutmask.apl.washington.edu> References: <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121035243.GA29469@troutmask.apl.washington.edu> <54BF28EE.1070801@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF28EE.1070801@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Luigi Rizzo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:17:17 -0000 On Tue, Jan 20, 2015 at 11:19:58PM -0500, Pedro Giffuni wrote: > > On 01/20/15 22:52, Steve Kargl wrote: > > On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: > >> On 01/20/15 22:06, Adrian Chadd wrote: > >>> * .. and apparently updating that gcc to something > 4.2 is verboten. > >> The external toolchain can't be that bad(?). > >> > > Are the ever change knobs documented somewhere? > > > https://wiki.freebsd.org/ExternalToolchain > IHMO, the wiki is not proper documentation. 'man src.conf' should have the information needed. -- Steve From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:30:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C565BE07; Wed, 21 Jan 2015 08:30:42 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84948AB6; Wed, 21 Jan 2015 08:30:42 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id h15so12821867igd.4; Wed, 21 Jan 2015 00:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=NPa3ITGGVwhcqgJDhW+hGoNqPGiOdkJb5Pc8YuX8yjw=; b=UM2Kxea2eD0q7PHgPfixKYKw+foAtdy8W5ZHexNtJ+DLag7lpGQMYErIrGzDZPaKIj 3IjaUwBubED+h9/G1GyvH3EYrE1YPnPMspHF6M98Jz9X9AhyjePMHwSljpQAEUAcIJDL 9OOL9P6f28DAB4uusMaOSvuZe2wQzWKJbQelyvIrDPeTCQfwGULJrnuPUwB6uLmXljHI L2eGlHCrjNG7SsExceQazgCqwjYKS51gPXjbO05s/+8sTpoe2J9qnNjP5HqHlYt2Y2MS onTqH045Ai6fxx+RmjUW2iAdzjg0HsfbGWQ1ENWUB7j/YJ7i3I/ImjsNV3mvHIQK71TU OFPg== X-Received: by 10.50.30.130 with SMTP id s2mr16779714igh.11.1421829041846; Wed, 21 Jan 2015 00:30:41 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:90a0:7b5d:1762:3e7d? ([2601:8:ab80:7d6:90a0:7b5d:1762:3e7d]) by mx.google.com with ESMTPSA id lr3sm5100054igb.22.2015.01.21.00.30.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 00:30:41 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_783034A3-2D28-4476-B95B-8A28DB4A8D3C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe From: Garrett Cooper In-Reply-To: <20150121081714.GA30318@troutmask.apl.washington.edu> Date: Wed, 21 Jan 2015 00:30:38 -0800 Message-Id: <6DB81A6F-FF7A-4E39-829C-EADE06D7C61D@gmail.com> References: <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121035243.GA29469@troutmask.apl.washington.edu> <54BF28EE.1070801@FreeBSD.org> <20150121081714.GA30318@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1878.6) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:30:43 -0000 --Apple-Mail=_783034A3-2D28-4476-B95B-8A28DB4A8D3C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 21, 2015, at 0:17, Steve Kargl = wrote: > On Tue, Jan 20, 2015 at 11:19:58PM -0500, Pedro Giffuni wrote: >>=20 >> On 01/20/15 22:52, Steve Kargl wrote: >>> On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: >>>> On 01/20/15 22:06, Adrian Chadd wrote: >>>>> * .. and apparently updating that gcc to something > 4.2 is = verboten. >>>> The external toolchain can't be that bad(?). >>>>=20 >>> Are the ever change knobs documented somewhere? >>>=20 >> https://wiki.freebsd.org/ExternalToolchain >=20 > IHMO, the wiki is not proper documentation. 'man src.conf' > should have the information needed. build(7) seems like a more appropriate area, but I wholeheartedly agree. Thanks! --Apple-Mail=_783034A3-2D28-4476-B95B-8A28DB4A8D3C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUv2OvAAoJEMZr5QU6S73eu4YH/jkCHsyhHVP519o7GPQE/CBr k9ZSqz13PDBu42YEZSltnIsa9MXhdt2qerSRAKBmbofcEDkmWiLA3ViOzg+uKTZK jAxpVhoImfP+mhTqAUeVDWqB+V5QCcVCa+unzxGgSoGpVVP7v5iig8hY4VYrnmDH XxGQQ+SalihvX2NBt264VUgwE4iTs4Y0c8gazCzhvV/+Y2zue6JIp7ilPC80GSkW xfLYwZJjeBQiSSa2ayIr1Nk7Yz5AGULmjiRFc/3/WyXs6RlG+F27LniUnLGr1dtt PWWjGxB+wfqMLk4ztrUsE7yH+WsyYl1l5Rh0aE5nkGj/9vf+W8230UsMF+u3va0= =E5B8 -----END PGP SIGNATURE----- --Apple-Mail=_783034A3-2D28-4476-B95B-8A28DB4A8D3C-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:31:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1957F45; Wed, 21 Jan 2015 08:31:24 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87E42B56; Wed, 21 Jan 2015 08:31:24 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B91B31FE023; Wed, 21 Jan 2015 09:31:21 +0100 (CET) Message-ID: <54BF640B.6000700@selasky.org> Date: Wed, 21 Jan 2015 09:32:11 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: sbruno@freebsd.org, "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> In-Reply-To: <54BEEA7F.1070301@ignoranthack.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:31:25 -0000 On 01/21/15 00:53, Sean Bruno wrote: > Unkown to me. Nor am I aware of anyone else who ever hit our panics > either. Our environment, and the failure, was only seen in the Intel > 10GE space (ixgbe). This is an artifact of our use cases, and hasn't > been expanded nor tested in our environment with other vendor interfaces. > > sean Hi, I've seen this with Mellanox hardware when running some special tests, but not during regular use yet. That was the reason for going into the callout subsystem in the first place. 40GE. Also I would like to mention during the heat of this discussion, that during X-mas this year, I had a very heavy discussion with Attilio and a few other FreeBSD developers, who's name was on a patch (r220456) that changed how the return value of "callout_active()" works. "callout_active()" is heavily used inside the TCP stack and what was found is there is a potential race related to migrating the callout from one CPU to the other, which in turn might give other symptoms than a spinlock hang. FYI: https://svnweb.freebsd.org/base?view=revision&revision=225057 Cite: "If the newly scheduled thread wants to acquire the old queue it will just spin forever." This description reminds me very much of what "Jason Wolfe", others and myself have seen. Konstantin, you're responsible for r220456 (Approved by: kib). I would like to ask what investigation you did to ensure that you solved the problem as described in the commit message and didn't introduce a new one? In r220456 the "callout_reset_on()" function was changed in a way that directly conflicts with how the TCP stack works, by not always ensuring that "callout_active()" returns non-zero after a callout is restarted! See return at line 821: > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?revision=225057&view=markup&pathrev=225057#l821 Kib: Any comments? --HPS From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:32:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5047149; Wed, 21 Jan 2015 08:32:38 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 389D5B6A; Wed, 21 Jan 2015 08:32:38 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id bs8so30955626wib.1; Wed, 21 Jan 2015 00:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=uVOaf4Wr5qh1JKi0g3pWB9VJohZmLyOG2EPtxn5OWWM=; b=pDKL6fJDldGg70UY+xbS0fQ1ZQ26F52yx0+k7ZBS0WWw39YBaHRp8FVQtNAn03VDgj gTSksN75EdezVVbm0dA4QZXJsMcdCfM2cd8nFM+jrAffOB2EwT2rlxcuiwDOOFO0IDoZ rVDlLeEIlLWPRhdrIInkGmdO3nmSlE3lP5R0go2+ovSdgNxHXtCiDCLHmbgxHgDf1WBZ dyo1jvLsDZiZXbmLV5AzzzPao9U6AwnULtHhz8mkimqhoCzFvop7qpVu1Rn28h5HPXE9 R5uDpcKY/vnQvopB3g8WZMyBQl5irPEAANS1NmbMAmujIbwm0j8KbhvCoo5IKSklFko9 owbg== X-Received: by 10.194.104.196 with SMTP id gg4mr21211047wjb.31.1421829156674; Wed, 21 Jan 2015 00:32:36 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id fc6sm6243508wib.12.2015.01.21.00.32.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 00:32:35 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 21 Jan 2015 09:32:33 +0100 From: Baptiste Daroussin To: Steve Kargl Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121083233.GL13897@ivaldir.etoilebsd.net> References: <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121035243.GA29469@troutmask.apl.washington.edu> <54BF28EE.1070801@FreeBSD.org> <20150121081714.GA30318@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CqfQkoYPE/jGoa5Q" Content-Disposition: inline In-Reply-To: <20150121081714.GA30318@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:32:38 -0000 --CqfQkoYPE/jGoa5Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 21, 2015 at 12:17:14AM -0800, Steve Kargl wrote: > On Tue, Jan 20, 2015 at 11:19:58PM -0500, Pedro Giffuni wrote: > >=20 > > On 01/20/15 22:52, Steve Kargl wrote: > > > On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: > > >> On 01/20/15 22:06, Adrian Chadd wrote: > > >>> * .. and apparently updating that gcc to something > 4.2 is verbote= n. > > >> The external toolchain can't be that bad(?). > > >> > > > Are the ever change knobs documented somewhere? > > > > > https://wiki.freebsd.org/ExternalToolchain > >=20 >=20 > IHMO, the wiki is not proper documentation. 'man src.conf' > should have the information needed. >=20 Planned into build(7) but not yet done as it is work in progress aka some k= nobs might or might not change Bapt --CqfQkoYPE/jGoa5Q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlS/ZCEACgkQ8kTtMUmk6ExzBACgn8jQ3gnbULKOAPgVDhlgsa5n NzQAoKBt9+LB4W/NOhdrcLj/UeIOZR45 =tx0M -----END PGP SIGNATURE----- --CqfQkoYPE/jGoa5Q-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:51:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E6753D5; Wed, 21 Jan 2015 08:51:07 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B276BD25; Wed, 21 Jan 2015 08:51:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0L8p0xC035613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jan 2015 10:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0L8p0xC035613 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0L8p08Z035612; Wed, 21 Jan 2015 10:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Jan 2015 10:51:00 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150121085100.GQ42409@kib.kiev.ua> References: <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BF640B.6000700@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF640B.6000700@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Adrian Chadd , "src-committers@freebsd.org" , "K. Macy" , Jason Wolfe , "svn-src-all@freebsd.org" , sbruno@freebsd.org, Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:51:07 -0000 On Wed, Jan 21, 2015 at 09:32:11AM +0100, Hans Petter Selasky wrote: > On 01/21/15 00:53, Sean Bruno wrote: > > Unkown to me. Nor am I aware of anyone else who ever hit our panics > > either. Our environment, and the failure, was only seen in the Intel > > 10GE space (ixgbe). This is an artifact of our use cases, and hasn't > > been expanded nor tested in our environment with other vendor interfaces. > > > > sean > > Hi, > > I've seen this with Mellanox hardware when running some special tests, > but not during regular use yet. That was the reason for going into the > callout subsystem in the first place. 40GE. > > Also I would like to mention during the heat of this discussion, that > during X-mas this year, I had a very heavy discussion with Attilio and a > few other FreeBSD developers, who's name was on a patch (r220456) that > changed how the return value of "callout_active()" works. > "callout_active()" is heavily used inside the TCP stack and what was > found is there is a potential race related to migrating the callout from > one CPU to the other, which in turn might give other symptoms than a > spinlock hang. > > FYI: > > https://svnweb.freebsd.org/base?view=revision&revision=225057 > > Cite: "If the newly scheduled thread wants to acquire the old queue it > will just spin forever." > > This description reminds me very much of what "Jason Wolfe", others and > myself have seen. > > Konstantin, you're responsible for r220456 (Approved by: kib). I would I definitely do not see anything related to my freefall login in the log message for r220456, nor I participated in any way in the work which lead to that revision. If you mean r225057, note that approval by re != review. > like to ask what investigation you did to ensure that you solved the > problem as described in the commit message and didn't introduce a new one? > > In r220456 the "callout_reset_on()" function was changed in a way that > directly conflicts with how the TCP stack works, by not always ensuring > that "callout_active()" returns non-zero after a callout is restarted! > See return at line 821: > > > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?revision=225057&view=markup&pathrev=225057#l821 > > Kib: Any comments? With the re hat on, explanation for the proposed commit looked reasonable, and committer provided enough evidence that change got adequate testing. Since change fixed a bug, and this is exactly what re wants to see during release cycle, I see no reason why commit should be denied. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:55:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E30B5570; Wed, 21 Jan 2015 08:55:02 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id C4613D59; Wed, 21 Jan 2015 08:55:02 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id E923873000; Wed, 21 Jan 2015 08:54:59 +0000 (UTC) Date: Wed, 21 Jan 2015 08:54:53 +0000 From: Andrew Turner To: Ian Lepore Subject: Re: svn commit: r277467 - in head/sys/arm: arm at91 cavium/cns11xx mv samsung/s3c2xx0 versatile xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa Message-ID: <20150121085453.794657f9@bender.lan> In-Reply-To: <201501210256.t0L2uEOU002068@svn.freebsd.org> References: <201501210256.t0L2uEOU002068@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 08:55:03 -0000 On Wed, 21 Jan 2015 02:56:14 +0000 (UTC) Ian Lepore wrote: > Author: ian > Date: Wed Jan 21 02:56:13 2015 > New Revision: 277467 > URL: https://svnweb.freebsd.org/changeset/base/277467 > > Log: > For some reason, all the arm bus_space functions that work with > uint16 values have armv4 in the name. There's nothing armv4-special > about them, so just use the same sort of names as all the other > functions. This is because ARMv3 lacked half word load and store instructions. We got this code from NetBSD who appears to have support for these older ARM processors. Andrew From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 09:01:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4CC1836; Wed, 21 Jan 2015 09:01:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFF4AE25; Wed, 21 Jan 2015 09:01:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0L91neY077089; Wed, 21 Jan 2015 09:01:49 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0L91nTT077088; Wed, 21 Jan 2015 09:01:49 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201501210901.t0L91nTT077088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 21 Jan 2015 09:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277481 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 09:01:49 -0000 Author: kevlo Date: Wed Jan 21 09:01:48 2015 New Revision: 277481 URL: https://svnweb.freebsd.org/changeset/base/277481 Log: Typo: ivalid -> invalid. Modified: head/sys/dev/mii/mii.c Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Wed Jan 21 05:31:54 2015 (r277480) +++ head/sys/dev/mii/mii.c Wed Jan 21 09:01:48 2015 (r277481) @@ -374,7 +374,7 @@ mii_attach(device_t dev, device_t *miibu } if (offloc != MII_OFFSET_ANY && (offloc < 0 || offloc >= MII_NPHY)) { - printf("%s: ivalid offloc %d\n", __func__, offloc); + printf("%s: invalid offloc %d\n", __func__, offloc); return (EINVAL); } @@ -383,7 +383,7 @@ mii_attach(device_t dev, device_t *miibu phymax = MII_NPHY - 1; } else { if (phyloc < 0 || phyloc >= MII_NPHY) { - printf("%s: ivalid phyloc %d\n", __func__, phyloc); + printf("%s: invalid phyloc %d\n", __func__, phyloc); return (EINVAL); } phymin = phymax = phyloc; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 09:06:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0B97BA6; Wed, 21 Jan 2015 09:06:49 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76CF6E60; Wed, 21 Jan 2015 09:06:49 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9EBF81FE023; Wed, 21 Jan 2015 10:06:46 +0100 (CET) Message-ID: <54BF6C58.7010500@selasky.org> Date: Wed, 21 Jan 2015 10:07:36 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BF640B.6000700@selasky.org> <20150121085100.GQ42409@kib.kiev.ua> In-Reply-To: <20150121085100.GQ42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , "K. Macy" , Jason Wolfe , "svn-src-all@freebsd.org" , sbruno@freebsd.org, Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 09:06:50 -0000 On 01/21/15 09:51, Konstantin Belousov wrote: > On Wed, Jan 21, 2015 at 09:32:11AM +0100, Hans Petter Selasky wrote: >> On 01/21/15 00:53, Sean Bruno wrote: >>> Unkown to me. Nor am I aware of anyone else who ever hit our panics >>> either. Our environment, and the failure, was only seen in the Intel >>> 10GE space (ixgbe). This is an artifact of our use cases, and hasn't >>> been expanded nor tested in our environment with other vendor interfaces. >>> >>> sean >> Hi, >> >> I've seen this with Mellanox hardware when running some special tests, >> but not during regular use yet. That was the reason for going into the >> callout subsystem in the first place. 40GE. >> >> Also I would like to mention during the heat of this discussion, that >> during X-mas this year, I had a very heavy discussion with Attilio and a >> few other FreeBSD developers, who's name was on a patch (r220456) that >> changed how the return value of "callout_active()" works. >> "callout_active()" is heavily used inside the TCP stack and what was >> found is there is a potential race related to migrating the callout from >> one CPU to the other, which in turn might give other symptoms than a >> spinlock hang. >> >> FYI: >> >> https://svnweb.freebsd.org/base?view=revision&revision=225057 >> >> Cite: "If the newly scheduled thread wants to acquire the old queue it >> will just spin forever." >> >> This description reminds me very much of what "Jason Wolfe", others and >> myself have seen. >> >> Konstantin, you're responsible for r220456 (Approved by: kib). I would > I definitely do not see anything related to my freefall login in the > log message for r220456, nor I participated in any way in the work > which lead to that revision. > > If you mean r225057, note that approval by re != review. Yes, I meant r225057. >> like to ask what investigation you did to ensure that you solved the >> problem as described in the commit message and didn't introduce a new one? >> >> In r220456 the "callout_reset_on()" function was changed in a way that >> directly conflicts with how the TCP stack works, by not always ensuring >> that "callout_active()" returns non-zero after a callout is restarted! >> See return at line 821: >> >>> https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?revision=225057&view=markup&pathrev=225057#l821 >> >> Kib: Any comments? > > With the re hat on, explanation for the proposed commit looked reasonable, > and committer provided enough evidence that change got adequate testing. > Since change fixed a bug, and this is exactly what re wants to see > during release cycle, I see no reason why commit should be denied. The problem is Attilio is no longer an active committer and he was not been very willing to do more work in this area. When people writing code in an area no longer respond - what should we do? --HPS From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 10:29:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6C4389D; Wed, 21 Jan 2015 10:29:17 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE92A75; Wed, 21 Jan 2015 10:29:17 +0000 (UTC) Received: from [192.168.3.3] (unknown [77.243.161.229]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 79B415C2E; Wed, 21 Jan 2015 11:29:10 +0100 (CET) Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B7B5B89E-F8B2-4B2E-8504-13F1DBECE44D"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b4 From: Dimitry Andric In-Reply-To: <20150121081050.GA4505@ox> Date: Wed, 21 Jan 2015 11:29:02 +0100 Message-Id: <5FC194F0-9D47-4B71-87E7-82EB81CA63D0@FreeBSD.org> References: <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> <54BF1EB0.2080901@FreeBSD.org> <20150121055329.GB3307@ox> <98838DA6-1969-4764-83DE-71F7BB568E23@FreeBSD.org> <20150121081050.GA4505@ox> To: Navdeep Parhar X-Mailer: Apple Mail (2.1993) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 10:29:18 -0000 --Apple-Mail=_B7B5B89E-F8B2-4B2E-8504-13F1DBECE44D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 21 Jan 2015, at 09:10, Navdeep Parhar wrote: >=20 > On Wed, Jan 21, 2015 at 09:00:03AM +0100, Dimitry Andric wrote: >> On 21 Jan 2015, at 06:53, Navdeep Parhar wrote: >>>=20 >>> On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote: ... >> Alternatively, just use the ${GCC_MS_EXTENSIONS} Makefile macro, = which >> I specifically introduced for this issue. >=20 > Ah, a rose with another name. I'm happy to use this but it's not = clear why > there is a GCC in the macro's name when clang deals with = -fms-extensions > just as well. It's because only gcc (in base) requires this flag to support anonymous unions, whereas clang also supports them without the flag. None of the sources requiring this flag use actual Microsoft C extensions. > (It's not even clear why the longer ${GCC_MS_EXTENSIONS} > should be preferred to -fms-extentions. Isn't this like #define ONE 1 = ?) Using -fms-extensions with clang can lead to other trouble, since it is stricter about conflicts with Microsoft-reserved type names. Last time I ran into this problem, several of our system headers tried to override type names which are reserved by Microsoft, leading to compile errors. Meanwhile, that issue may have been solved, but the crutches are still there. Instead of the macro, you could also use: CFLAGS.gcc+=3D -fms-extensions But note that this flag is probably superfluous with newer gcc's, so using the macro is still a better solution, because the compiler version can be checked in a central location, such as sys/conf/kern.mk. > In any case I'm perfectly fine with any change that doesn't involve a = commit > from me to gcc. Fixing this version of gcc is not really worth the trouble, indeed. -Dimitry --Apple-Mail=_B7B5B89E-F8B2-4B2E-8504-13F1DBECE44D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlS/f3UACgkQsF6jCi4glqMWPwCgwrIw7uS9Jz9jB2p3+dlHvDTI 9xUAoIJFk6l/0A2L61ryz4myYQvnAw0M =FYha -----END PGP SIGNATURE----- --Apple-Mail=_B7B5B89E-F8B2-4B2E-8504-13F1DBECE44D-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 10:47:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16652C92; Wed, 21 Jan 2015 10:47:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015B7C98; Wed, 21 Jan 2015 10:47:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LAlSLw026803; Wed, 21 Jan 2015 10:47:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LAlSI2026802; Wed, 21 Jan 2015 10:47:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501211047.t0LAlSI2026802@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 21 Jan 2015 10:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277484 - head/cddl/contrib/opensolaris/lib/libzpool/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 10:47:29 -0000 Author: ngie Date: Wed Jan 21 10:47:28 2015 New Revision: 277484 URL: https://svnweb.freebsd.org/changeset/base/277484 Log: Follow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same named parameters Reported by: Ben Perrault , Willem Jan Withagen Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Jan 21 09:45:48 2015 (r277483) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Jan 21 10:47:28 2015 (r277484) @@ -535,7 +535,7 @@ extern vnode_t *rootdir; extern void delay(clock_t ticks); #define SEC_TO_TICK(sec) ((sec) * hz) -#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) +#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / hz)) #define gethrestime_sec() time(NULL) #define gethrestime(t) \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 10:54:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 69FA7F5B; Wed, 21 Jan 2015 10:54:51 +0000 (UTC) Date: Wed, 21 Jan 2015 10:54:51 +0000 From: Alexey Dokuchaev To: Adrian Chadd Subject: Re: svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe Message-ID: <20150121105451.GA65826@FreeBSD.org> References: <201412312319.sBVNJHca031041@svn.freebsd.org> <20150106203344.GB26068@ox> <54BEE07A.3070207@FreeBSD.org> <54BEE305.6020905@FreeBSD.org> <54BEF7CF.9030505@FreeBSD.org> <20150121021905.GA73548@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , Navdeep Parhar , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 10:54:51 -0000 On Tue, Jan 20, 2015 at 07:06:14PM -0800, Adrian Chadd wrote: > On 20 January 2015 at 18:19, Alexey Dokuchaev wrote: > > Seconded. Putting extra harness on the code to avoid bugs in the > > compiler that were actually fixed upsteam is totally bogus. > > Right, but: > [...] > * some of us have to use the gcc that's in tree; > * .. and apparently updating that gcc to something > 4.2 is verboten. To be clear: I did not suggest moving to external toolchain (I hate to do it myself). I was talking about merging the fix to base gcc4.2 (provided that it can be licensed under GPLv2). Now that most people had lost their interest in 8.x, it can be a problem of organizational nature, but not technical. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 13:03:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55540F68; Wed, 21 Jan 2015 13:03:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41616D7D; Wed, 21 Jan 2015 13:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LD3JBF092969; Wed, 21 Jan 2015 13:03:19 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LD3JM4092968; Wed, 21 Jan 2015 13:03:19 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201501211303.t0LD3JM4092968@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 21 Jan 2015 13:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277485 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 13:03:19 -0000 Author: rrs Date: Wed Jan 21 13:03:18 2015 New Revision: 277485 URL: https://svnweb.freebsd.org/changeset/base/277485 Log: Fix minor errors found by coverity. Thanks Gleb for the pointers to the email! Modified: head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Jan 21 10:47:28 2015 (r277484) +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Jan 21 13:03:18 2015 (r277485) @@ -1808,6 +1808,9 @@ process_file(char *filename) if (cnts == NULL) { /* Nothing we can do */ printf("Nothing to do -- no counters built\n"); + if (io) { + fclose(io); + } return; } lace_cpus_together(); @@ -2044,7 +2047,7 @@ get_cpuid_set(void) printf("No memory3 allocation fails at startup?\n"); exit(-1); } - memset(more, sz, 0); + memset(more, 0, sz); memcpy(more, valid_pmcs, sz); pmc_allocated_cnt *= 2; free(valid_pmcs); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 13:48:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E72D2D6; Wed, 21 Jan 2015 13:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDE99276; Wed, 21 Jan 2015 13:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LDm60M013772; Wed, 21 Jan 2015 13:48:06 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LDm6BY013771; Wed, 21 Jan 2015 13:48:06 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201501211348.t0LDm6BY013771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 21 Jan 2015 13:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277486 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 13:48:07 -0000 Author: gavin Date: Wed Jan 21 13:48:06 2015 New Revision: 277486 URL: https://svnweb.freebsd.org/changeset/base/277486 Log: "softc" is short for "software context", use that phrase in the device_get_softc(9) man page. MFC after: 1 week Modified: head/share/man/man9/device_get_softc.9 Modified: head/share/man/man9/device_get_softc.9 ============================================================================== --- head/share/man/man9/device_get_softc.9 Wed Jan 21 13:03:18 2015 (r277485) +++ head/share/man/man9/device_get_softc.9 Wed Jan 21 13:48:06 2015 (r277486) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 2, 2005 +.Dd January 21, 2015 .Dt DEVICE_GET_SOFTC 9 .Os .Sh NAME @@ -40,7 +40,7 @@ .Ft void * .Fn device_get_softc "device_t dev" .Sh DESCRIPTION -Return the driver-specific state of +Return the driver-specific software context of .Fa dev . The softc is automatically allocated and zeroed when the device is attached. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 14:01:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46EE5C0C; Wed, 21 Jan 2015 14:01:12 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0705A684; Wed, 21 Jan 2015 14:01:11 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id D9FBA7E820; Thu, 22 Jan 2015 01:01:09 +1100 (EST) Message-ID: <54BFB10C.9080004@freebsd.org> Date: Thu, 22 Jan 2015 01:00:44 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Adrian Chadd , Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 14:01:12 -0000 On 01/20/15 09:22, Adrian Chadd wrote: > Yeah, it looks like you set c_cpu to timeout_cpu in > _callout_init_locked(), but then you only handle the case of the CPU > being changed in certain circumstances. You aren't handling the CPU > being initialised when the callout is first added. > > And, callout_restart_async() calls callout_lock(), which calls > CC_LOCK() on the callout CPU, which initially is zero. Then, it never > seems to be 'moved' into the correct CPU, even though it's being > called with a CPU id. > > So, if I am reading this all correctly, you aren't really handling > multi CPU callwheels at all. ;) > > In my instance, I'm seeing quite a lot of lock contention between the > userland threads, the network RX threads and the clock thread, all > contending on a single callout wheel being used for TCP timers. One of > the early goals for fixing up the RSS stuff in -HEAD was to make > per-CPU (Well, per-RSS-bucket really) TCP timers not contend with the > NIC RX processing path, and now it does. :( To clarify, you're seeing this with net.inet.tcp.per_cpu_timers=1? Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 15:24:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDAF539C for ; Wed, 21 Jan 2015 15:24:08 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC1EFB0 for ; Wed, 21 Jan 2015 15:24:08 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id hn18so8779604igb.2 for ; Wed, 21 Jan 2015 07:24:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=0wzgE+1s5H0tO1AVLt9Z0zI9qev1wW48KMp4KzoRJOs=; b=Az2wMUZ4khMfaBjaYnNgqaRuhSjqxUvNRnRBmFCNNYBHP/OQ6w1hdPxShTAoHEy3Of 6D0XVZHL0301lJIAmqhWSHI1lKVaRNJ1vbXxQs6K946YE7/wNw0SOXtqrFPaaM9z8v4T LpJmv8IRUlgyPe7xXs5z473vtJRJ4f/9g90JumHKgeRWtW2jwh07MjaPjSIZj9C5VIMS jFz5C7uB4nXyTKUgzN7/vZyyFyhUWiIiTL9T+eVVXurd0IeN617rvkkNgMQVmIiRZtZ3 5wcaB9GdzIFBP3SsPSzPIfquEJEP6mIpoV9Xo6ZCVdHE6bChSGOExDnroDfiroxwmdLN mDgA== X-Gm-Message-State: ALoCoQnjUOV5/FgZN6jlAxHHSKsB65/B6qVin7U3LZfGyp34fM6NuftIDB1OnlCDP2hrnqKgRC65 X-Received: by 10.50.137.99 with SMTP id qh3mr5101114igb.9.1421853842312; Wed, 21 Jan 2015 07:24:02 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id kt1sm5966846igb.20.2015.01.21.07.24.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 07:24:01 -0800 (PST) Date: Wed, 21 Jan 2015 08:23:59 -0700 From: Will Andrews To: Lawrence Stewart Subject: Re: svn commit: r275832 - head/tools/tools/nanobsd Message-ID: <20150121152352.GB38973@sol.firepipe.net> References: <201412161759.sBGHx6ZL016021@svn.freebsd.org> <54BF5A7B.2080601@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BwCQnh7xodEAoBMC" Content-Disposition: inline In-Reply-To: <54BF5A7B.2080601@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org, Will Andrews X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 15:24:08 -0000 --BwCQnh7xodEAoBMC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 21, 2015 at 06:51:23PM +1100, Lawrence Stewart wrote: > I think this change introduced a bug - I'm seeing nanobsd error out with > the "NANO_TOOLS directory does not exist" message. >=20 > The problem is that NANO_TOOLS is initialised to "tools/tools/nanobsd", > and you changed the test in nanobsd.sh to *not* check for > "${NANO_SRC}/${NANO_TOOLS}", which errors out except if the cwd is > ${NANO_SRC}. >=20 > You tweak NANO_TOOLS appropriately in set_defaults_and_export() but it's > run after the dir test. There are a couple of ways to fix but I'll leave > it to you to decide which you prefer. Will this work for you? https://people.freebsd.org/~will/patches/nanobsd.sh.diff This also fixes another bug where NANO_PMAKE would be modified too early. Thanks, --Will. --BwCQnh7xodEAoBMC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlS/xIcACgkQF47idPgWcsVNYgCeJnWbAyN3HCbnEOMjjDdDyjcS Nr8AoIjuvgf7DM/Jr6x9NJr/gYhTvvmn =qGsa -----END PGP SIGNATURE----- --BwCQnh7xodEAoBMC-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:09:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34303C8D; Wed, 21 Jan 2015 16:09:17 +0000 (UTC) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB2996C6; Wed, 21 Jan 2015 16:09:16 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id y20so16596247ier.1; Wed, 21 Jan 2015 08:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=bFJBZfQSywHnL1WtZHiyOUVxBuZplov8XDyrOieWhGQ=; b=UT+UKnXlcN0appnO9uaD+Wd6/U0aH8vMjXV0v5UqzLZhJvCh33ZYwcIxCrM4Lk3/qb 4hkEYUrv7iw3BKnwk6W0l1RYavry57TQJatEoVqIWCSTzGZlVkIYm7R2iTHiZydVtg/A C9ZfJXllMi4Gkd6E2+N8eREsazdrJxvXXfhniFY/al4uWeWtCy7P2q7bHSLtLqCfhGr4 axbQmtOS6oZkPI8axRYrQMi2Pbc5vJc5Vhvbs7/stE5T4IwHdbZ3PUWGQGPjH3i2DA9J cQGieKayfKN/3Vtey7rgObWW5f4GI14RkANGxi8Uw1yMAJiEIHivkqouP96UE2akI16B PqDw== MIME-Version: 1.0 X-Received: by 10.50.93.70 with SMTP id cs6mr5348158igb.6.1421856556360; Wed, 21 Jan 2015 08:09:16 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Wed, 21 Jan 2015 08:09:16 -0800 (PST) In-Reply-To: <54BFB10C.9080004@freebsd.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BFB10C.9080004@freebsd.org> Date: Wed, 21 Jan 2015 08:09:16 -0800 X-Google-Sender-Auth: ZPygylGb3oQI4pCDTJd48UsJkLk Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Lawrence Stewart Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:09:17 -0000 On 21 January 2015 at 06:00, Lawrence Stewart wrote: > On 01/20/15 09:22, Adrian Chadd wrote: >> Yeah, it looks like you set c_cpu to timeout_cpu in >> _callout_init_locked(), but then you only handle the case of the CPU >> being changed in certain circumstances. You aren't handling the CPU >> being initialised when the callout is first added. >> >> And, callout_restart_async() calls callout_lock(), which calls >> CC_LOCK() on the callout CPU, which initially is zero. Then, it never >> seems to be 'moved' into the correct CPU, even though it's being >> called with a CPU id. >> >> So, if I am reading this all correctly, you aren't really handling >> multi CPU callwheels at all. ;) >> >> In my instance, I'm seeing quite a lot of lock contention between the >> userland threads, the network RX threads and the clock thread, all >> contending on a single callout wheel being used for TCP timers. One of >> the early goals for fixing up the RSS stuff in -HEAD was to make >> per-CPU (Well, per-RSS-bucket really) TCP timers not contend with the >> NIC RX processing path, and now it does. :( > > To clarify, you're seeing this with net.inet.tcp.per_cpu_timers=1? Yup, RSS enables that by default. -adrian From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:10:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C335DD8; Wed, 21 Jan 2015 16:10:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85FDF6D3; Wed, 21 Jan 2015 16:10:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LGAdl7085450; Wed, 21 Jan 2015 16:10:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LGAcMg085437; Wed, 21 Jan 2015 16:10:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501211610.t0LGAcMg085437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Jan 2015 16:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:10:39 -0000 Author: kib Date: Wed Jan 21 16:10:37 2015 New Revision: 277487 URL: https://svnweb.freebsd.org/changeset/base/277487 Log: An update for the i915 GPU driver, which brings the code up to Linux commit 4d93914ae3db4a897ead4b. Some related drm infrastructure changes are imported as needed. Biggest update is the rewrite of the i915 gem io to more closely follow Linux model, althought the mechanism used by FreeBSD port is different. Sponsored by: The FreeBSD Foundation MFC after: 2 month Added: head/sys/dev/drm2/i915/i915_gem_stolen.c (contents, props changed) head/sys/dev/drm2/i915/intel_ddi.c (contents, props changed) head/sys/dev/drm2/i915/intel_pm.c (contents, props changed) Modified: head/sys/dev/drm2/drm.h head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_crtc.c head/sys/dev/drm2/drm_crtc.h head/sys/dev/drm2/drm_crtc_helper.c head/sys/dev/drm2/drm_crtc_helper.h head/sys/dev/drm2/drm_drv.c head/sys/dev/drm2/drm_edid.c head/sys/dev/drm2/drm_edid.h head/sys/dev/drm2/drm_edid_modes.h head/sys/dev/drm2/drm_fb_helper.c head/sys/dev/drm2/drm_ioctl.c head/sys/dev/drm2/drm_irq.c head/sys/dev/drm2/drm_memory.c head/sys/dev/drm2/drm_mode.h head/sys/dev/drm2/drm_pciids.h head/sys/dev/drm2/drm_stub.c head/sys/dev/drm2/i915/i915_debug.c head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_context.c head/sys/dev/drm2/i915/i915_gem_evict.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_tiling.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/i915_suspend.c head/sys/dev/drm2/i915/intel_bios.c head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/drm2/i915/intel_hdmi.c head/sys/dev/drm2/i915/intel_iic.c head/sys/dev/drm2/i915/intel_lvds.c head/sys/dev/drm2/i915/intel_modes.c head/sys/dev/drm2/i915/intel_overlay.c head/sys/dev/drm2/i915/intel_panel.c head/sys/dev/drm2/i915/intel_ringbuffer.c head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/dev/drm2/i915/intel_sdvo.c head/sys/dev/drm2/i915/intel_sprite.c head/sys/dev/drm2/i915/intel_tv.c head/sys/dev/drm2/radeon/atombios_encoders.c head/sys/dev/drm2/radeon/radeon_legacy_encoders.c head/sys/modules/drm2/i915kms/Makefile Modified: head/sys/dev/drm2/drm.h ============================================================================== --- head/sys/dev/drm2/drm.h Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drm.h Wed Jan 21 16:10:37 2015 (r277487) @@ -1018,6 +1018,9 @@ struct drm_event_vblank { #define DRM_CAP_PRIME 0x5 #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 +#define DRM_PRIME_CAP_IMPORT 0x1 +#define DRM_PRIME_CAP_EXPORT 0x2 + #include "drm_mode.h" /** @@ -1126,6 +1129,8 @@ struct drm_event_vblank { #define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) #define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) #define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) +#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) +#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) #define DRM_IOCTL_MM_INIT DRM_IOWR(0xc0, struct drm_mm_init_arg) #define DRM_IOCTL_MM_TAKEDOWN DRM_IOWR(0xc1, struct drm_mm_type_arg) Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drmP.h Wed Jan 21 16:10:37 2015 (r277487) @@ -1246,6 +1246,7 @@ int drm_ati_pcigart_cleanup(struct drm_d /* Cache management (drm_memory.c) */ void drm_clflush_pages(vm_page_t *pages, unsigned long num_pages); +void drm_clflush_virt_range(char *addr, unsigned long length); /* Locking IOCTL support (drm_drv.c) */ int drm_lock(struct drm_device *dev, void *data, Modified: head/sys/dev/drm2/drm_crtc.c ============================================================================== --- head/sys/dev/drm2/drm_crtc.c Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drm_crtc.c Wed Jan 21 16:10:37 2015 (r277487) @@ -352,7 +352,7 @@ void drm_framebuffer_cleanup(struct drm_ * @funcs: callbacks for the new CRTC * * LOCKING: - * Caller must hold mode config lock. + * Takes mode_config lock. * * Inits a new object created as base part of an driver crtc object. * @@ -372,8 +372,11 @@ int drm_crtc_init(struct drm_device *dev if (ret) goto out; + crtc->base.properties = &crtc->properties; + list_add_tail(&crtc->head, &dev->mode_config.crtc_list); dev->mode_config.num_crtc++; + out: sx_xunlock(&dev->mode_config.mutex); @@ -474,6 +477,7 @@ int drm_connector_init(struct drm_device if (ret) goto out; + connector->base.properties = &connector->properties; connector->dev = dev; connector->funcs = funcs; connector->connector_type = connector_type; @@ -582,6 +586,7 @@ int drm_plane_init(struct drm_device *de if (ret) goto out; + plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; plane->format_types = malloc(sizeof(uint32_t) * format_count, @@ -1399,11 +1404,7 @@ int drm_mode_getconnector(struct drm_dev } connector = obj_to_connector(obj); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] != 0) { - props_count++; - } - } + props_count = connector->properties.count; for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { if (connector->encoder_ids[i] != 0) { @@ -1456,21 +1457,19 @@ int drm_mode_getconnector(struct drm_dev copied = 0; prop_ptr = (uint32_t *)(uintptr_t)(out_resp->props_ptr); prop_values = (uint64_t *)(uintptr_t)(out_resp->prop_values_ptr); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] != 0) { - if (copyout(&connector->property_ids[i], - prop_ptr + copied, sizeof(uint32_t))) { - ret = EFAULT; - goto out; - } + for (i = 0; i < connector->properties.count; i++) { + if (copyout(&connector->properties.ids[i], + prop_ptr + copied, sizeof(uint32_t))) { + ret = EFAULT; + goto out; + } - if (copyout(&connector->property_values[i], - prop_values + copied, sizeof(uint64_t))) { - ret = EFAULT; - goto out; - } - copied++; + if (copyout(&connector->properties.values[i], + prop_values + copied, sizeof(uint64_t))) { + ret = EFAULT; + goto out; } + copied++; } } out_resp->count_props = props_count; @@ -1808,7 +1807,7 @@ int drm_mode_setcrtc(struct drm_device * struct drm_display_mode *mode = NULL; struct drm_mode_set set; uint32_t *set_connectors_ptr; - int ret = 0; + int ret; int i; if (!drm_core_check_feature(dev, DRIVER_MODESET)) @@ -2070,7 +2069,7 @@ int drm_mode_addfb(struct drm_device *de ret = -dev->mode_config.funcs->fb_create(dev, file_priv, &r, &fb); if (ret != 0) { - DRM_ERROR("could not create framebuffer, error %d\n", ret); + DRM_DEBUG_KMS("could not create framebuffer, error %d\n", ret); goto out; } @@ -2152,6 +2151,47 @@ static int format_check(struct drm_mode_ } } +static int framebuffer_check(struct drm_mode_fb_cmd2 *r) +{ + int ret, hsub, vsub, num_planes, i; + + ret = format_check(r); + if (ret) { + DRM_DEBUG_KMS("bad framebuffer format 0x%08x\n", r->pixel_format); + return ret; + } + + hsub = drm_format_horz_chroma_subsampling(r->pixel_format); + vsub = drm_format_vert_chroma_subsampling(r->pixel_format); + num_planes = drm_format_num_planes(r->pixel_format); + + if (r->width == 0 || r->width % hsub) { + DRM_DEBUG_KMS("bad framebuffer width %u\n", r->height); + return -EINVAL; + } + + if (r->height == 0 || r->height % vsub) { + DRM_DEBUG_KMS("bad framebuffer height %u\n", r->height); + return -EINVAL; + } + + for (i = 0; i < num_planes; i++) { + unsigned int width = r->width / (i != 0 ? hsub : 1); + + if (!r->handles[i]) { + DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); + return -EINVAL; + } + + if (r->pitches[i] < drm_format_plane_cpp(r->pixel_format, i) * width) { + DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); + return -EINVAL; + } + } + + return 0; +} + /** * drm_mode_addfb2 - add an FB to the graphics configuration * @inode: inode from the ioctl @@ -2181,21 +2221,19 @@ int drm_mode_addfb2(struct drm_device *d return (EINVAL); if ((config->min_width > r->width) || (r->width > config->max_width)) { - DRM_ERROR("bad framebuffer width %d, should be >= %d && <= %d\n", + DRM_DEBUG_KMS("bad framebuffer width %d, should be >= %d && <= %d\n", r->width, config->min_width, config->max_width); return (EINVAL); } if ((config->min_height > r->height) || (r->height > config->max_height)) { - DRM_ERROR("bad framebuffer height %d, should be >= %d && <= %d\n", + DRM_DEBUG_KMS("bad framebuffer height %d, should be >= %d && <= %d\n", r->height, config->min_height, config->max_height); return (EINVAL); } - ret = format_check(r); - if (ret) { - DRM_ERROR("bad framebuffer format 0x%08x\n", r->pixel_format); - return ret; - } + ret = framebuffer_check(r); + if (ret) + return -ret; sx_xlock(&dev->mode_config.mutex); @@ -2204,7 +2242,7 @@ int drm_mode_addfb2(struct drm_device *d ret = -dev->mode_config.funcs->fb_create(dev, file_priv, r, &fb); if (ret != 0) { - DRM_ERROR("could not create framebuffer, error %d\n", ret); + DRM_DEBUG_KMS("could not create framebuffer, error %d\n", ret); goto out; } @@ -2335,7 +2373,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de struct drm_framebuffer *fb; unsigned flags; int num_clips; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return (EINVAL); @@ -2530,7 +2568,7 @@ int drm_mode_attachmode_ioctl(struct drm struct drm_display_mode *mode; struct drm_mode_object *obj; struct drm_mode_modeinfo *umode = &mode_cmd->mode; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; @@ -2584,7 +2622,7 @@ int drm_mode_detachmode_ioctl(struct drm struct drm_connector *connector; struct drm_display_mode mode; struct drm_mode_modeinfo *umode = &mode_cmd->mode; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; @@ -2672,6 +2710,33 @@ struct drm_property *drm_property_create return property; } +struct drm_property *drm_property_create_bitmask(struct drm_device *dev, + int flags, const char *name, + const struct drm_prop_enum_list *props, + int num_values) +{ + struct drm_property *property; + int i, ret; + + flags |= DRM_MODE_PROP_BITMASK; + + property = drm_property_create(dev, flags, name, num_values); + if (!property) + return NULL; + + for (i = 0; i < num_values; i++) { + ret = drm_property_add_enum(property, i, + props[i].type, + props[i].name); + if (ret) { + drm_property_destroy(dev, property); + return NULL; + } + } + + return property; +} + struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, const char *name, uint64_t min, uint64_t max) @@ -2695,7 +2760,14 @@ int drm_property_add_enum(struct drm_pro { struct drm_property_enum *prop_enum; - if (!(property->flags & DRM_MODE_PROP_ENUM)) + if (!(property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK))) + return -EINVAL; + + /* + * Bitmask enum properties have the additional constraint of values + * from 0 to 63 + */ + if ((property->flags & DRM_MODE_PROP_BITMASK) && (value > 63)) return -EINVAL; if (!list_empty(&property->enum_blob_list)) { @@ -2736,56 +2808,71 @@ void drm_property_destroy(struct drm_dev free(property, DRM_MEM_KMS); } -int drm_connector_attach_property(struct drm_connector *connector, +void drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val) { - int i; - - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == 0) { - connector->property_ids[i] = property->base.id; - connector->property_values[i] = init_val; - break; - } - } - - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + drm_object_attach_property(&connector->base, property, init_val); } int drm_connector_property_set_value(struct drm_connector *connector, struct drm_property *property, uint64_t value) { + return drm_object_property_set_value(&connector->base, property, value); +} + +int drm_connector_property_get_value(struct drm_connector *connector, + struct drm_property *property, uint64_t *val) +{ + return drm_object_property_get_value(&connector->base, property, val); +} + +void drm_object_attach_property(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t init_val) +{ + int count = obj->properties->count; + + if (count == DRM_OBJECT_MAX_PROPERTY) { + printf("Failed to attach object property (type: 0x%x). Please " + "increase DRM_OBJECT_MAX_PROPERTY by 1 for each time " + "you see this message on the same object type.\n", + obj->type); + return; + } + + obj->properties->ids[count] = property->base.id; + obj->properties->values[count] = init_val; + obj->properties->count++; +} + +int drm_object_property_set_value(struct drm_mode_object *obj, + struct drm_property *property, uint64_t val) +{ int i; - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == property->base.id) { - connector->property_values[i] = value; - break; + for (i = 0; i < obj->properties->count; i++) { + if (obj->properties->ids[i] == property->base.id) { + obj->properties->values[i] = val; + return 0; } } - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + return -EINVAL; } -int drm_connector_property_get_value(struct drm_connector *connector, +int drm_object_property_get_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val) { int i; - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == property->base.id) { - *val = connector->property_values[i]; - break; + for (i = 0; i < obj->properties->count; i++) { + if (obj->properties->ids[i] == property->base.id) { + *val = obj->properties->values[i]; + return 0; } } - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + return -EINVAL; } int drm_mode_getproperty_ioctl(struct drm_device *dev, @@ -2817,7 +2904,7 @@ int drm_mode_getproperty_ioctl(struct dr } property = obj_to_property(obj); - if (property->flags & DRM_MODE_PROP_ENUM) { + if (property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) { list_for_each_entry(prop_enum, &property->enum_blob_list, head) enum_count++; } else if (property->flags & DRM_MODE_PROP_BLOB) { @@ -2842,7 +2929,7 @@ int drm_mode_getproperty_ioctl(struct dr } out_resp->count_values = value_count; - if (property->flags & DRM_MODE_PROP_ENUM) { + if (property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) { if ((out_resp->count_enum_blobs >= enum_count) && enum_count) { copied = 0; enum_ptr = (struct drm_mode_property_enum *)(uintptr_t)out_resp->enum_blob_ptr; @@ -2965,7 +3052,7 @@ int drm_mode_connector_update_edid_prope struct edid *edid) { struct drm_device *dev = connector->dev; - int ret = 0, size; + int ret, size; if (connector->edid_blob_ptr) drm_property_destroy_blob(dev, connector->edid_blob_ptr); @@ -2988,75 +3075,202 @@ int drm_mode_connector_update_edid_prope return ret; } +static bool drm_property_change_is_valid(struct drm_property *property, + u64 value) +{ + if (property->flags & DRM_MODE_PROP_IMMUTABLE) + return false; + if (property->flags & DRM_MODE_PROP_RANGE) { + if (value < property->values[0] || value > property->values[1]) + return false; + return true; + } else if (property->flags & DRM_MODE_PROP_BITMASK) { + int i; + u64 valid_mask = 0; + for (i = 0; i < property->num_values; i++) + valid_mask |= (1ULL << property->values[i]); + return !(value & ~valid_mask); + } else { + int i; + for (i = 0; i < property->num_values; i++) + if (property->values[i] == value) + return true; + return false; + } +} + int drm_mode_connector_property_set_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_mode_connector_set_property *out_resp = data; - struct drm_mode_object *obj; - struct drm_property *property; - struct drm_connector *connector; + struct drm_mode_connector_set_property *conn_set_prop = data; + struct drm_mode_obj_set_property obj_set_prop = { + .value = conn_set_prop->value, + .prop_id = conn_set_prop->prop_id, + .obj_id = conn_set_prop->connector_id, + .obj_type = DRM_MODE_OBJECT_CONNECTOR + }; + + /* It does all the locking and checking we need */ + return drm_mode_obj_set_property_ioctl(dev, &obj_set_prop, file_priv); +} + +static int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_connector *connector = obj_to_connector(obj); + + /* Do DPMS ourselves */ + if (property == connector->dev->mode_config.dpms_property) { + if (connector->funcs->dpms) + (*connector->funcs->dpms)(connector, (int)value); + ret = 0; + } else if (connector->funcs->set_property) + ret = connector->funcs->set_property(connector, property, value); + + /* store the property value if successful */ + if (!ret) + drm_connector_property_set_value(connector, property, value); + return ret; +} + +static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ int ret = -EINVAL; + struct drm_crtc *crtc = obj_to_crtc(obj); + + if (crtc->funcs->set_property) + ret = crtc->funcs->set_property(crtc, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + +static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_plane *plane = obj_to_plane(obj); + + if (plane->funcs->set_property) + ret = plane->funcs->set_property(plane, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + +int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_mode_obj_get_properties *arg = data; + struct drm_mode_object *obj; + int ret = 0; int i; + int copied = 0; + int props_count = 0; + uint32_t __user *props_ptr; + uint64_t __user *prop_values_ptr; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; sx_xlock(&dev->mode_config.mutex); - obj = drm_mode_object_find(dev, out_resp->connector_id, DRM_MODE_OBJECT_CONNECTOR); + obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); if (!obj) { + ret = -EINVAL; + goto out; + } + if (!obj->properties) { + ret = -EINVAL; goto out; } - connector = obj_to_connector(obj); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == out_resp->prop_id) - break; + props_count = obj->properties->count; + + /* This ioctl is called twice, once to determine how much space is + * needed, and the 2nd time to fill it. */ + if ((arg->count_props >= props_count) && props_count) { + copied = 0; + props_ptr = (uint32_t __user *)(unsigned long)(arg->props_ptr); + prop_values_ptr = (uint64_t __user *)(unsigned long) + (arg->prop_values_ptr); + for (i = 0; i < props_count; i++) { + if (copyout(props_ptr + copied, + &obj->properties->ids[i], sizeof(uint32_t))) { + ret = -EFAULT; + goto out; + } + if (copyout(prop_values_ptr + copied, + &obj->properties->values[i], sizeof(uint64_t))) { + ret = -EFAULT; + goto out; + } + copied++; + } } + arg->count_props = props_count; +out: + sx_xunlock(&dev->mode_config.mutex); + return ret; +} - if (i == DRM_CONNECTOR_MAX_PROPERTY) { +int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_mode_obj_set_property *arg = data; + struct drm_mode_object *arg_obj; + struct drm_mode_object *prop_obj; + struct drm_property *property; + int ret = -EINVAL; + int i; + + if (!drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + + sx_xlock(&dev->mode_config.mutex); + + arg_obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); + if (!arg_obj) + goto out; + if (!arg_obj->properties) goto out; - } - obj = drm_mode_object_find(dev, out_resp->prop_id, DRM_MODE_OBJECT_PROPERTY); - if (!obj) { + for (i = 0; i < arg_obj->properties->count; i++) + if (arg_obj->properties->ids[i] == arg->prop_id) + break; + + if (i == arg_obj->properties->count) goto out; - } - property = obj_to_property(obj); - if (property->flags & DRM_MODE_PROP_IMMUTABLE) + prop_obj = drm_mode_object_find(dev, arg->prop_id, + DRM_MODE_OBJECT_PROPERTY); + if (!prop_obj) goto out; + property = obj_to_property(prop_obj); - if (property->flags & DRM_MODE_PROP_RANGE) { - if (out_resp->value < property->values[0]) - goto out; + if (!drm_property_change_is_valid(property, arg->value)) + goto out; - if (out_resp->value > property->values[1]) - goto out; - } else { - int found = 0; - for (i = 0; i < property->num_values; i++) { - if (property->values[i] == out_resp->value) { - found = 1; - break; - } - } - if (!found) { - goto out; - } + switch (arg_obj->type) { + case DRM_MODE_OBJECT_CONNECTOR: + ret = drm_mode_connector_set_obj_prop(arg_obj, property, + arg->value); + break; + case DRM_MODE_OBJECT_CRTC: + ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value); + break; + case DRM_MODE_OBJECT_PLANE: + ret = drm_mode_plane_set_obj_prop(arg_obj, property, arg->value); + break; } - /* Do DPMS ourselves */ - if (property == connector->dev->mode_config.dpms_property) { - if (connector->funcs->dpms) - (*connector->funcs->dpms)(connector, (int) out_resp->value); - ret = 0; - } else if (connector->funcs->set_property) - ret = connector->funcs->set_property(connector, property, out_resp->value); - - /* store the property value if successful */ - if (!ret) - drm_connector_property_set_value(connector, property, out_resp->value); out: sx_xunlock(&dev->mode_config.mutex); return ret; @@ -3176,6 +3390,11 @@ int drm_mode_gamma_get_ioctl(struct drm_ } crtc = obj_to_crtc(obj); + if (crtc->funcs->gamma_set == NULL) { + ret = -ENOSYS; + goto out; + } + /* memcpy into gamma store */ if (crtc_lut->gamma_size != crtc->gamma_size) { ret = -EINVAL; @@ -3417,3 +3636,136 @@ void drm_fb_get_bpp_depth(uint32_t forma break; } } + +/** + * drm_format_num_planes - get the number of planes for format + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The number of planes used by the specified pixel format. + */ +int drm_format_num_planes(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: + return 3; + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + return 2; + default: + return 1; + } +} + +/** + * drm_format_plane_cpp - determine the bytes per pixel value + * @format: pixel format (DRM_FORMAT_*) + * @plane: plane index + * + * RETURNS: + * The bytes per pixel value for the specified plane. + */ +int drm_format_plane_cpp(uint32_t format, int plane) +{ + unsigned int depth; + int bpp; + + if (plane >= drm_format_num_planes(format)) + return 0; + + switch (format) { + case DRM_FORMAT_YUYV: + case DRM_FORMAT_YVYU: + case DRM_FORMAT_UYVY: + case DRM_FORMAT_VYUY: + return 2; + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + return plane ? 2 : 1; + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: + return 1; + default: + drm_fb_get_bpp_depth(format, &depth, &bpp); + return bpp >> 3; + } +} + +/** + * drm_format_horz_chroma_subsampling - get the horizontal chroma subsampling factor + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The horizontal chroma subsampling factor for the + * specified pixel format. + */ +int drm_format_horz_chroma_subsampling(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + return 4; + case DRM_FORMAT_YUYV: + case DRM_FORMAT_YVYU: + case DRM_FORMAT_UYVY: + case DRM_FORMAT_VYUY: + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + return 2; + default: + return 1; + } +} + +/** + * drm_format_vert_chroma_subsampling - get the vertical chroma subsampling factor + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The vertical chroma subsampling factor for the + * specified pixel format. + */ +int drm_format_vert_chroma_subsampling(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + return 4; + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + return 2; + default: + return 1; + } +} Modified: head/sys/dev/drm2/drm_crtc.h ============================================================================== --- head/sys/dev/drm2/drm_crtc.h Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drm_crtc.h Wed Jan 21 16:10:37 2015 (r277487) @@ -47,6 +47,14 @@ struct i2c_adapter; struct drm_mode_object { uint32_t id; uint32_t type; + struct drm_object_properties *properties; +}; + +#define DRM_OBJECT_MAX_PROPERTY 16 +struct drm_object_properties { + int count; + uint32_t ids[DRM_OBJECT_MAX_PROPERTY]; + uint64_t values[DRM_OBJECT_MAX_PROPERTY]; }; /* @@ -295,7 +303,8 @@ struct drm_plane; * @mode_fixup: fixup proposed mode * @mode_set: set the desired mode on the CRTC * @gamma_set: specify color ramp for CRTC - * @destroy: deinit and free object. + * @destroy: deinit and free object + * @set_property: called when a property is changed * * The drm_crtc_funcs structure is the central CRTC management structure * in the DRM. Each CRTC controls one or more connectors (note that the name @@ -339,6 +348,8 @@ struct drm_crtc_funcs { int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event); + int (*set_property)(struct drm_crtc *crtc, + struct drm_property *property, uint64_t val); }; /** @@ -347,6 +358,7 @@ struct drm_crtc_funcs { * @x: x position on screen * @y: y position on screen * @funcs: CRTC control functions + * @properties: property tracking for this CRTC * * Each CRTC may have one or more connectors associated with it. This structure * allows the CRTC to be controlled. @@ -382,6 +394,8 @@ struct drm_crtc { /* if you are using the helper */ void *helper_private; + + struct drm_object_properties properties; }; @@ -431,7 +445,6 @@ struct drm_encoder_funcs { }; #define DRM_CONNECTOR_MAX_UMODES 16 -#define DRM_CONNECTOR_MAX_PROPERTY 16 #define DRM_CONNECTOR_LEN 32 #define DRM_CONNECTOR_MAX_ENCODER 2 @@ -511,8 +524,7 @@ struct drm_connector { struct list_head user_modes; struct drm_property_blob *edid_blob_ptr; - u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; - uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; + struct drm_object_properties properties; uint8_t polled; /* DRM_CONNECTOR_POLL_* */ @@ -543,6 +555,7 @@ struct drm_connector { * @update_plane: update the plane configuration * @disable_plane: shut down the plane * @destroy: clean up plane resources + * @set_property: called when a property is changed */ struct drm_plane_funcs { int (*update_plane)(struct drm_plane *plane, @@ -553,6 +566,8 @@ struct drm_plane_funcs { uint32_t src_w, uint32_t src_h); int (*disable_plane)(struct drm_plane *plane); void (*destroy)(struct drm_plane *plane); + int (*set_property)(struct drm_plane *plane, + struct drm_property *property, uint64_t val); }; /** @@ -570,6 +585,7 @@ struct drm_plane_funcs { * @enabled: enabled flag * @funcs: helper functions * @helper_private: storage for drver layer + @properties: property tracking for this plane */ struct drm_plane { struct drm_device *dev; @@ -592,6 +608,8 @@ struct drm_plane { const struct drm_plane_funcs *funcs; void *helper_private; + + struct drm_object_properties properties; }; /** @@ -806,6 +824,15 @@ extern int drm_connector_property_set_va extern int drm_connector_property_get_value(struct drm_connector *connector, struct drm_property *property, uint64_t *value); +void drm_object_attach_property(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t init_val); +extern int drm_object_property_set_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t val); +extern int drm_object_property_get_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t *value); extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); extern void drm_framebuffer_set_object(struct drm_device *dev, unsigned long handle); @@ -818,7 +845,7 @@ extern int drmfb_remove(struct drm_devic extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); extern bool drm_crtc_in_use(struct drm_crtc *crtc); -extern int drm_connector_attach_property(struct drm_connector *connector, +extern void drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val); extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, const char *name, int num_values); @@ -826,6 +853,10 @@ extern struct drm_property *drm_property const char *name, const struct drm_prop_enum_list *props, int num_values); +struct drm_property *drm_property_create_bitmask(struct drm_device *dev, + int flags, const char *name, + const struct drm_prop_enum_list *props, + int num_values); struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, const char *name, uint64_t min, uint64_t max); @@ -921,7 +952,8 @@ extern int drm_add_modes_noedid(struct d extern int drm_edid_header_is_valid(const u8 *raw_edid); extern bool drm_edid_is_valid(struct edid *edid); struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, - int hsize, int vsize, int fresh); + int hsize, int vsize, int fresh, + bool rb); extern int drm_mode_create_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); @@ -929,7 +961,16 @@ extern int drm_mode_mmap_dumb_ioctl(stru void *data, struct drm_file *file_priv); extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); +extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, int *bpp); +extern int drm_format_num_planes(uint32_t format); +extern int drm_format_plane_cpp(uint32_t format, int plane); +extern int drm_format_horz_chroma_subsampling(uint32_t format); +extern int drm_format_vert_chroma_subsampling(uint32_t format); + #endif /* __DRM_CRTC_H__ */ Modified: head/sys/dev/drm2/drm_crtc_helper.c ============================================================================== --- head/sys/dev/drm2/drm_crtc_helper.c Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drm_crtc_helper.c Wed Jan 21 16:10:37 2015 (r277487) @@ -549,7 +549,7 @@ int drm_crtc_helper_set_config(struct dr int count = 0, ro, fail = 0; struct drm_crtc_helper_funcs *crtc_funcs; struct drm_mode_set save_set; - int ret = 0; + int ret; int i; DRM_DEBUG_KMS("\n"); Modified: head/sys/dev/drm2/drm_crtc_helper.h ============================================================================== --- head/sys/dev/drm2/drm_crtc_helper.h Wed Jan 21 13:48:06 2015 (r277486) +++ head/sys/dev/drm2/drm_crtc_helper.h Wed Jan 21 16:10:37 2015 (r277487) @@ -78,7 +78,7 @@ struct drm_encoder_helper_funcs { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:13:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F85CF85; Wed, 21 Jan 2015 16:13:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8FB7DE; Wed, 21 Jan 2015 16:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LGDcKV088669; Wed, 21 Jan 2015 16:13:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LGDcLg088668; Wed, 21 Jan 2015 16:13:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501211613.t0LGDcLg088668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Jan 2015 16:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277488 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:13:38 -0000 Author: kib Date: Wed Jan 21 16:13:37 2015 New Revision: 277488 URL: https://svnweb.freebsd.org/changeset/base/277488 Log: Fix bug in r276630. Do not allow pthread_sigmask() to block SIGCANCEL. Reported and tested by: royger Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Wed Jan 21 16:10:37 2015 (r277487) +++ head/lib/libthr/thread/thr_sig.c Wed Jan 21 16:13:37 2015 (r277488) @@ -604,7 +604,8 @@ __weak_reference(_pthread_sigmask, pthre int _pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) { - if (_sigprocmask(how, set, oset)) + + if (__thr_sigprocmask(how, set, oset)) return (errno); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:32:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A31BC7BF; Wed, 21 Jan 2015 16:32:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F871A53; Wed, 21 Jan 2015 16:32:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LGWt0h098071; Wed, 21 Jan 2015 16:32:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LGWtOR098070; Wed, 21 Jan 2015 16:32:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501211632.t0LGWtOR098070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Jan 2015 16:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:32:55 -0000 Author: kib Date: Wed Jan 21 16:32:54 2015 New Revision: 277489 URL: https://svnweb.freebsd.org/changeset/base/277489 Log: Do not assert that the new pipepair mutex is not initialized. The backing memory contains garbage and might trigger the assertion. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Jan 21 16:13:37 2015 (r277488) +++ head/sys/kern/sys_pipe.c Wed Jan 21 16:32:54 2015 (r277489) @@ -318,7 +318,7 @@ pipe_zone_init(void *mem, int size, int pp = (struct pipepair *)mem; - mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF); + mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF | MTX_NEW); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:41:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8609DC7C; Wed, 21 Jan 2015 16:41:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB57B7E; Wed, 21 Jan 2015 16:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LGf992099875; Wed, 21 Jan 2015 16:41:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LGf59R099855; Wed, 21 Jan 2015 16:41:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201501211641.t0LGf59R099855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 21 Jan 2015 16:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277490 - in head/lib/libthr: . arch/amd64 arch/amd64/amd64 arch/amd64/include arch/arm arch/arm/arm arch/arm/include arch/common arch/i386 arch/i386/i386 arch/i386/include arch/mips ar... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:41:09 -0000 Author: andrew Date: Wed Jan 21 16:41:05 2015 New Revision: 277490 URL: https://svnweb.freebsd.org/changeset/base/277490 Log: Merge all the copies of _tcb_ctor and _tcb_dtor. The amd64, i386, and sparc64 versions were identical, with the one difference where the former two used inline asm instead of _tcb_get. I have compared the function before and after replacing the asm with _tcb_get and found the object files to be identical. The arm, mips, and powerpc versions were almost identical. The only difference was the powerpc version used an alignment of 1 where arm and mips used 16. As this is an increase in alignment is will be safe. Along with this arm, mips, and powerpc all passed, when initial was true, the value returned from _tcb_get as the first argument to _rtld_allocate_tls. This would then return this pointer back to the caller. We can remove these extra calls by checking if initial is set and setting the thread control block directly. As this is what the sparc64 code does we can use it directly. As after these observations all the architectures can now have identical code we can merge them into a common file. Differential Revision: https://reviews.freebsd.org/D1556 Reviewed by: kib Sponsored by: The FreeBSD Foundation Added: head/lib/libthr/arch/common/ head/lib/libthr/thread/thr_ctrdtr.c - copied, changed from r277373, head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Deleted: head/lib/libthr/arch/amd64/amd64/pthread_md.c head/lib/libthr/arch/arm/Makefile.inc head/lib/libthr/arch/arm/arm/ head/lib/libthr/arch/i386/i386/pthread_md.c head/lib/libthr/arch/mips/Makefile.inc head/lib/libthr/arch/mips/mips/ head/lib/libthr/arch/powerpc/Makefile.inc head/lib/libthr/arch/powerpc/powerpc/ head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Modified: head/lib/libthr/Makefile head/lib/libthr/arch/amd64/Makefile.inc head/lib/libthr/arch/amd64/include/pthread_md.h head/lib/libthr/arch/arm/include/pthread_md.h head/lib/libthr/arch/i386/Makefile.inc head/lib/libthr/arch/i386/include/pthread_md.h head/lib/libthr/arch/mips/include/pthread_md.h head/lib/libthr/arch/powerpc/include/pthread_md.h head/lib/libthr/arch/sparc64/Makefile.inc head/lib/libthr/arch/sparc64/include/pthread_md.h head/lib/libthr/thread/Makefile.inc head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/Makefile Wed Jan 21 16:41:05 2015 (r277490) @@ -45,7 +45,9 @@ PRECIOUSLIB= .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} +.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc) .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" +.endif .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" Modified: head/lib/libthr/arch/amd64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/amd64/Makefile.inc Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/amd64/Makefile.inc Wed Jan 21 16:41:05 2015 (r277490) @@ -1,3 +1,3 @@ #$FreeBSD$ -SRCS+= pthread_md.c _umtx_op_err.S +SRCS+= _umtx_op_err.S Modified: head/lib/libthr/arch/amd64/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/amd64/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/amd64/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -77,9 +77,6 @@ struct tcb { __result; \ }) -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *tcb); - static __inline void _tcb_set(struct tcb *tcb) { Modified: head/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/arm/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/arm/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -47,12 +47,6 @@ struct tcb { struct pthread *tcb_thread; /* our hook */ }; -/* - * The tcb constructors. - */ -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *); - /* Called from the thread to set its private data. */ static __inline void _tcb_set(struct tcb *tcb) Modified: head/lib/libthr/arch/i386/Makefile.inc ============================================================================== --- head/lib/libthr/arch/i386/Makefile.inc Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/i386/Makefile.inc Wed Jan 21 16:41:05 2015 (r277490) @@ -1,3 +1,3 @@ # $FreeBSD$ -SRCS+= pthread_md.c _umtx_op_err.S +SRCS+= _umtx_op_err.S Modified: head/lib/libthr/arch/i386/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/i386/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/i386/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -76,12 +76,6 @@ struct tcb { __result; \ }) -/* - * The constructors. - */ -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *tcb); - /* Called from the thread to set its private data. */ static __inline void _tcb_set(struct tcb *tcb) Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/mips/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -50,12 +50,6 @@ struct tcb { struct pthread *tcb_thread; }; -/* - * The tcb constructors. - */ -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *); - /* Called from the thread to set its private data. */ static __inline void _tcb_set(struct tcb *tcb) Modified: head/lib/libthr/arch/powerpc/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/powerpc/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/powerpc/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -55,9 +55,6 @@ struct tcb { struct pthread *tcb_thread; }; -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *); - static __inline void _tcb_set(struct tcb *tcb) { Modified: head/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/sparc64/Makefile.inc Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/sparc64/Makefile.inc Wed Jan 21 16:41:05 2015 (r277490) @@ -1,3 +1,3 @@ # $FreeBSD$ -SRCS+= _umtx_op_err.S pthread_md.c +SRCS+= _umtx_op_err.S Modified: head/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jan 21 16:41:05 2015 (r277490) @@ -50,12 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -/* - * The tcb constructors. - */ -struct tcb *_tcb_ctor(struct pthread *, int); -void _tcb_dtor(struct tcb *); - /* Called from the thread to set its private data. */ static __inline void _tcb_set(struct tcb *tcb) Modified: head/lib/libthr/thread/Makefile.inc ============================================================================== --- head/lib/libthr/thread/Makefile.inc Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/thread/Makefile.inc Wed Jan 21 16:41:05 2015 (r277490) @@ -14,6 +14,7 @@ SRCS+= \ thr_cond.c \ thr_condattr.c \ thr_create.c \ + thr_ctrdtr.c \ thr_detach.c \ thr_equal.c \ thr_event.c \ Copied and modified: head/lib/libthr/thread/thr_ctrdtr.c (from r277373, head/lib/libthr/arch/sparc64/sparc64/pthread_md.c) ============================================================================== --- head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Mon Jan 19 07:29:28 2015 (r277373, copy source) +++ head/lib/libthr/thread/thr_ctrdtr.c Wed Jan 21 16:41:05 2015 (r277490) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pthread_md.h" +#include "thr_private.h" struct tcb * _tcb_ctor(struct pthread *thread, int initial) Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Jan 21 16:32:54 2015 (r277489) +++ head/lib/libthr/thread/thr_private.h Wed Jan 21 16:41:05 2015 (r277490) @@ -928,6 +928,9 @@ int __thr_sigwait(const sigset_t *set, i int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info); int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp); +struct tcb *_tcb_ctor(struct pthread *, int); +void _tcb_dtor(struct tcb *); + __END_DECLS #endif /* !_THR_PRIVATE_H */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 16:52:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12C9DF84; Wed, 21 Jan 2015 16:52:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEB28CAF; Wed, 21 Jan 2015 16:52:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LGqOxm007883; Wed, 21 Jan 2015 16:52:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LGqOWm007882; Wed, 21 Jan 2015 16:52:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201501211652.t0LGqOWm007882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 21 Jan 2015 16:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277491 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 16:52:25 -0000 Author: andrew Date: Wed Jan 21 16:52:24 2015 New Revision: 277491 URL: https://svnweb.freebsd.org/changeset/base/277491 Log: Update the parsing of the cpu node. We are unable to use the reg property as the cpu id on arm64 as it may use two cells. In it's place we can use the device id. It is expected we will use the reg data on arm64 to enable cores so we still need to read and store it even if it is not yet used. Differential Revision: https://reviews.freebsd.org/D1555 Reviewed by: nwhitehorn Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Wed Jan 21 16:41:05 2015 (r277490) +++ head/sys/dev/ofw/ofw_cpu.c Wed Jan 21 16:52:24 2015 (r277491) @@ -51,6 +51,10 @@ static const struct ofw_bus_devinfo *ofw static MALLOC_DEFINE(M_OFWCPU, "ofwcpu", "OFW CPU device information"); +struct ofw_cpulist_softc { + pcell_t sc_addr_cells; +}; + static device_method_t ofw_cpulist_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_cpulist_probe), @@ -74,7 +78,7 @@ static device_method_t ofw_cpulist_metho static driver_t ofw_cpulist_driver = { "cpulist", ofw_cpulist_methods, - 0 + sizeof(struct ofw_cpulist_softc) }; static devclass_t ofw_cpulist_devclass; @@ -100,12 +104,18 @@ ofw_cpulist_probe(device_t dev) static int ofw_cpulist_attach(device_t dev) { + struct ofw_cpulist_softc *sc; phandle_t root, child; device_t cdev; struct ofw_bus_devinfo *dinfo; + sc = device_get_softc(dev); root = ofw_bus_get_node(dev); + sc->sc_addr_cells = 1; + OF_getencprop(root, "#address-cells", &sc->sc_addr_cells, + sizeof(sc->sc_addr_cells)); + for (child = OF_child(root); child != 0; child = OF_peer(child)) { dinfo = malloc(sizeof(*dinfo), M_OFWCPU, M_WAITOK | M_ZERO); @@ -141,6 +151,8 @@ static int ofw_cpu_read_ivar(device_t de struct ofw_cpu_softc { struct pcpu *sc_cpu_pcpu; uint32_t sc_nominal_mhz; + boolean_t sc_reg_valid; + pcell_t sc_reg[2]; }; static device_method_t ofw_cpu_methods[] = { @@ -185,17 +197,39 @@ ofw_cpu_probe(device_t dev) static int ofw_cpu_attach(device_t dev) { + struct ofw_cpulist_softc *psc; struct ofw_cpu_softc *sc; phandle_t node; - uint32_t cell; + pcell_t cell; + int rv; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); - if (OF_getencprop(node, "reg", &cell, sizeof(cell)) < 0) { - cell = device_get_unit(dev); - device_printf(dev, "missing 'reg' property, using %u\n", cell); + psc = device_get_softc(device_get_parent(dev)); + + if (nitems(sc->sc_reg) < psc->sc_addr_cells) { + if (bootverbose) + device_printf(dev, "Too many address cells\n"); + return (EINVAL); } - sc->sc_cpu_pcpu = pcpu_find(cell); + + node = ofw_bus_get_node(dev); + + /* Read and validate the reg property for use later */ + sc->sc_reg_valid = false; + rv = OF_getencprop(node, "reg", sc->sc_reg, sizeof(sc->sc_reg)); + if (rv < 0) + device_printf(dev, "missing 'reg' property\n"); + else if ((rv % 4) != 0) { + if (bootverbose) + device_printf(dev, "Malformed reg property\n"); + } else if ((rv / 4) != psc->sc_addr_cells) { + if (bootverbose) + device_printf(dev, "Invalid reg size %u\n", rv); + } else + sc->sc_reg_valid = true; + + sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev)); + if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) { if (bootverbose) device_printf(dev, From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 17:03:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB91B338; Wed, 21 Jan 2015 17:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7782DFC; Wed, 21 Jan 2015 17:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LH3CfN012801; Wed, 21 Jan 2015 17:03:12 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LH3COB012800; Wed, 21 Jan 2015 17:03:12 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211703.t0LH3COB012800@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 17:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277492 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 17:03:12 -0000 Author: will Date: Wed Jan 21 17:03:11 2015 New Revision: 277492 URL: https://svnweb.freebsd.org/changeset/base/277492 Log: Add vfs.zfs.reference_tracking_enable sysctl/tunable. This is primarily for developer/debugging use; it enables built-in tagged tracking of refcounts inside ZFS. It can only be enabled from the loader, since it modifies how in-core state is managed. Default remains disabled. MFC after: 1 week Sponsored by: Spectra Logic Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Wed Jan 21 16:52:24 2015 (r277491) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Wed Jan 21 17:03:11 2015 (r277492) @@ -30,6 +30,10 @@ #ifdef _KERNEL int reference_tracking_enable = FALSE; /* runs out of memory too easily */ +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, reference_tracking_enable, CTLFLAG_RDTUN, + &reference_tracking_enable, 0, + "Track reference holders to refcount_t objects, used mostly by ZFS"); #else int reference_tracking_enable = TRUE; #endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:02:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD0084C4; Wed, 21 Jan 2015 18:02:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97366EE; Wed, 21 Jan 2015 18:02:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LI2TAX041507; Wed, 21 Jan 2015 18:02:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LI2TJt041506; Wed, 21 Jan 2015 18:02:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201501211802.t0LI2TJt041506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Jan 2015 18:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277494 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:02:29 -0000 Author: mjg Date: Wed Jan 21 18:02:28 2015 New Revision: 277494 URL: https://svnweb.freebsd.org/changeset/base/277494 Log: filedesc: fix whitespace nits in fget and fget_read No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 21 17:59:32 2015 (r277493) +++ head/sys/kern/kern_descrip.c Wed Jan 21 18:02:28 2015 (r277494) @@ -2499,7 +2499,7 @@ int fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { - return(_fget(td, fd, fpp, 0, rightsp, NULL)); + return (_fget(td, fd, fpp, 0, rightsp, NULL)); } int @@ -2514,7 +2514,7 @@ int fget_read(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { - return(_fget(td, fd, fpp, FREAD, rightsp, NULL)); + return (_fget(td, fd, fpp, FREAD, rightsp, NULL)); } int From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:05:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD9D467F; Wed, 21 Jan 2015 18:05:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99F65782; Wed, 21 Jan 2015 18:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LI5hI3041967; Wed, 21 Jan 2015 18:05:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LI5hmt041966; Wed, 21 Jan 2015 18:05:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201501211805.t0LI5hmt041966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Jan 2015 18:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277495 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:05:43 -0000 Author: mjg Date: Wed Jan 21 18:05:42 2015 New Revision: 277495 URL: https://svnweb.freebsd.org/changeset/base/277495 Log: filedesc: return 0 from badfo_close The only potential in-tree consumer (_fdrop) special-cased it and returns 0 0 on its own instead of calling badfo_close. Remove the special case since it is not needed and very unlikely to encounter anyway. No objections from: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 21 18:02:28 2015 (r277494) +++ head/sys/kern/kern_descrip.c Wed Jan 21 18:05:42 2015 (r277495) @@ -2680,11 +2680,9 @@ _fdrop(struct file *fp, struct thread *t { int error; - error = 0; if (fp->f_count != 0) panic("fdrop: count %d", fp->f_count); - if (fp->f_ops != &badfileops) - error = fo_close(fp, td); + error = fo_close(fp, td); atomic_subtract_int(&openfiles, 1); crfree(fp->f_cred); free(fp->f_advice, M_FADVISE); @@ -3664,7 +3662,7 @@ static int badfo_close(struct file *fp, struct thread *td) { - return (EBADF); + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:15:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FED9A3D; Wed, 21 Jan 2015 18:15:18 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA958A9; Wed, 21 Jan 2015 18:15:16 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0LIFC3P080849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 21:15:12 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0LIFC2n080848; Wed, 21 Jan 2015 21:15:12 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Jan 2015 21:15:12 +0300 From: Gleb Smirnoff To: sbruno@freebsd.org Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150121181512.GE15484@FreeBSD.org> References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BEF154.3030606@ignoranthack.me> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , "K. Macy" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:15:18 -0000 Sean, On Tue, Jan 20, 2015 at 04:22:44PM -0800, Sean Bruno wrote: S> In our universe, this commit (right or wrong) resolved our panics. I S> think that there is some room for improvement based on the commentary S> in this thread, but some people do indeed prefer stability over S> performance. I hope we can come to a middle ground somewhere here. Sorry, but this sounds very much like alchemy. We poured this stuff into that stuff and yield in gold precipitate. We don't understand what's going on, but let's record the recipe into our tome of aclhemy wisdom. So alchemy never came to a scientific level, and chemistry evolved as science only when researchers started to measure, explain and understand. If we treat our precious kernel in alchemy way, we will follow the path of alchemy, except that it took centuries for alchemy to die, and for a software product it would take a few years. So, for me Kip ideas sound very sensible. There could be a race somewhere else. You tweak callout subsystem in any direction, timings of events in kernel shift, your race is hidden. If we fix problems w/o understanding them, we are going alchemy way. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:22:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 790F4C96; Wed, 21 Jan 2015 18:22:27 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 05A3498D; Wed, 21 Jan 2015 18:22:25 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0LIMN9p080881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 21:22:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0LIMNdv080880; Wed, 21 Jan 2015 21:22:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Jan 2015 21:22:23 +0300 From: Gleb Smirnoff To: Gavin Atkinson Subject: Re: svn commit: r277486 - head/share/man/man9 Message-ID: <20150121182223.GF15484@FreeBSD.org> References: <201501211348.t0LDm6BY013771@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501211348.t0LDm6BY013771@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:22:27 -0000 On Wed, Jan 21, 2015 at 01:48:06PM +0000, Gavin Atkinson wrote: G> Author: gavin G> Date: Wed Jan 21 13:48:06 2015 G> New Revision: 277486 G> URL: https://svnweb.freebsd.org/changeset/base/277486 G> G> Log: G> "softc" is short for "software context", use that phrase in the G> device_get_softc(9) man page. Thanks for making this term official :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:24:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FAC5E21; Wed, 21 Jan 2015 18:24:49 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3F39AF; Wed, 21 Jan 2015 18:24:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0LIOiUU080895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Jan 2015 21:24:44 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0LIOiaY080894; Wed, 21 Jan 2015 21:24:44 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Jan 2015 21:24:44 +0300 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: svn commit: r277489 - head/sys/kern Message-ID: <20150121182444.GG15484@FreeBSD.org> References: <201501211632.t0LGWtOR098070@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501211632.t0LGWtOR098070@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:24:49 -0000 On Wed, Jan 21, 2015 at 04:32:55PM +0000, Konstantin Belousov wrote: K> Author: kib K> Date: Wed Jan 21 16:32:54 2015 K> New Revision: 277489 K> URL: https://svnweb.freebsd.org/changeset/base/277489 K> K> Log: K> Do not assert that the new pipepair mutex is not initialized. The K> backing memory contains garbage and might trigger the assertion. I have touched dozen of places in kernel where I do explicit M_ZERO on allocation just to satisfy later assertion in the mtx_init. Is the correct fix to use MTX_NEW? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:25:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7694F60; Wed, 21 Jan 2015 18:25:18 +0000 (UTC) Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com [IPv6:2607:f8b0:400d:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88DE29B8; Wed, 21 Jan 2015 18:25:18 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id k15so34398691qaq.9; Wed, 21 Jan 2015 10:25:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lBf5bGaqtDf4uHeLIjp9DGrI5IltOXhpfaE04npc6nU=; b=EqD/gjh6Au9C2uP3xFLC5Qh66mIpDUZvkgmqhToz3P3wp49tLE2SqZL0YDRU6C80Ct 0EPL/wOd45vcAPmaz3nl7g6kyAUJYQiaextxd8mdShxV2z+E5QMSaEGa38rIax2aspKv QZmc0TurWKGf8CXYFkyCJ3YAaRxM4A5dH1wDA7ywa3rozPXrzG4wOCxUj/E2Rf21TOEz RmrYDIxCNo17MFaE8qOhfK6/Zm/fDY0xJaLK9PpfjMGt0H7A/hcFmYISvvagGImoCXMI CtQDBXwUCI2Vk41CJX2nRtYhd7xuBad9ADILlKnkPWNQkMaFiXhOFhSdlQv0YL6BHmAf VmpQ== MIME-Version: 1.0 X-Received: by 10.224.131.4 with SMTP id v4mr44128233qas.99.1421864717626; Wed, 21 Jan 2015 10:25:17 -0800 (PST) Sender: hiren.panchasara@gmail.com Received: by 10.96.73.69 with HTTP; Wed, 21 Jan 2015 10:25:17 -0800 (PST) In-Reply-To: <20150121182223.GF15484@FreeBSD.org> References: <201501211348.t0LDm6BY013771@svn.freebsd.org> <20150121182223.GF15484@FreeBSD.org> Date: Wed, 21 Jan 2015 10:25:17 -0800 X-Google-Sender-Auth: ldXHNQQO_NHX7ssXLhMMwH2OTO8 Message-ID: Subject: Re: svn commit: r277486 - head/share/man/man9 From: hiren panchasara To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , Gavin Atkinson , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:25:18 -0000 On Wed, Jan 21, 2015 at 10:22 AM, Gleb Smirnoff wrote: > On Wed, Jan 21, 2015 at 01:48:06PM +0000, Gavin Atkinson wrote: > G> Author: gavin > G> Date: Wed Jan 21 13:48:06 2015 > G> New Revision: 277486 > G> URL: https://svnweb.freebsd.org/changeset/base/277486 > G> > G> Log: > G> "softc" is short for "software context", use that phrase in the > G> device_get_softc(9) man page. > > Thanks for making this term official :) Heh, yes. Thanks Gavin! cheers, Hiren From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:32:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3061C6; Wed, 21 Jan 2015 18:32:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16BE1A95; Wed, 21 Jan 2015 18:32:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LIWrum055770; Wed, 21 Jan 2015 18:32:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LIWrvJ055769; Wed, 21 Jan 2015 18:32:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201501211832.t0LIWrvJ055769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Jan 2015 18:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277496 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:32:54 -0000 Author: mjg Date: Wed Jan 21 18:32:53 2015 New Revision: 277496 URL: https://svnweb.freebsd.org/changeset/base/277496 Log: filedesc: avoid spurious copying of capabilities in fget_unlocked We obtain a stable copy and store it in local 'fde' variable. Storing another copy (based on aforementioned variable) does not serve any purpose. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 21 18:05:42 2015 (r277495) +++ head/sys/kern/kern_descrip.c Wed Jan 21 18:32:53 2015 (r277496) @@ -2337,7 +2337,7 @@ fget_unlocked(struct filedesc *fdp, int u_int count; #ifdef CAPABILITIES seq_t seq; - cap_rights_t haverights; + cap_rights_t *haverights; int error; #endif @@ -2367,9 +2367,9 @@ fget_unlocked(struct filedesc *fdp, int if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - haverights = *cap_rights_fde(&fde); + haverights = cap_rights_fde(&fde); if (needrightsp != NULL) { - error = cap_check(&haverights, needrightsp); + error = cap_check(haverights, needrightsp); if (error != 0) return (error); if (cap_rights_is_set(needrightsp, CAP_FCNTL)) { @@ -2408,7 +2408,7 @@ fget_unlocked(struct filedesc *fdp, int *fpp = fp; if (haverightsp != NULL) { #ifdef CAPABILITIES - *haverightsp = haverights; + *haverightsp = *haverights; #else CAP_ALL(haverightsp); #endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 18:45:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23069615; Wed, 21 Jan 2015 18:45:56 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6849BC8; Wed, 21 Jan 2015 18:45:55 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id c9so15071835qcz.6; Wed, 21 Jan 2015 10:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; bh=Xfz19WtKI47/G2x+sPKfgC2NauE9r6yPA5sNA2vK8EI=; b=COSyImytRuZsBsqiJOuS+PCo9nMgxr/4LasPM/XZkcoNgX7r1O9+HSg/mN1vDe+DSE XvZsyZ0x6iODITCdEidrg99/Th54sqLXOCeUpwLEu/TtoHW4jtaD8AgwqkImcFNkTx33 0IeGfl5mNvaNQNPy27sDlVJhcR7HHq6+N4LActjDuh1FXEH46LH+bQNWPlcmuE//sOIH Etl9XNAriBvBIhOEWTVUT8N3h8DVa9RgiVLzKGGqlDaaSksGf4YJP828TfphmdK0m5Jy n4Og3KSRC6hxiOo1Fjle7NuwgOTR1+qX4bb1VH27A9I1ZY1cR8bZHqzpqpojNHMFUgr5 R1uA== X-Received: by 10.229.68.202 with SMTP id w10mr38591293qci.13.1421865954771; Wed, 21 Jan 2015 10:45:54 -0800 (PST) Received: from ?IPv6:2001:470:e4fc:1::1017? ([2001:470:e4fc:1::1017]) by mx.google.com with ESMTPSA id d62sm930371qga.15.2015.01.21.10.45.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 10:45:53 -0800 (PST) Message-ID: <1421865947.6315.1.camel@gmail.com> Subject: Re: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms From: Shawn Webb To: Konstantin Belousov Date: Wed, 21 Jan 2015 13:45:47 -0500 In-Reply-To: <201501211610.t0LGAcMg085437@svn.freebsd.org> References: <201501211610.t0LGAcMg085437@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-7ziGbE9XsQvKWFGRcKwd" X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 18:45:56 -0000 --=-7ziGbE9XsQvKWFGRcKwd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-01-21 at 16:10 +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Jan 21 16:10:37 2015 > New Revision: 277487 > URL: https://svnweb.freebsd.org/changeset/base/277487 >=20 > Log: > An update for the i915 GPU driver, which brings the code up to Linux > commit 4d93914ae3db4a897ead4b. Some related drm infrastructure > changes are imported as needed. > =20 > Biggest update is the rewrite of the i915 gem io to more closely > follow Linux model, althought the mechanism used by FreeBSD port is > different. Hey Kostik, This causes my Haswell laptop to just display a blank screen on bootup. Is there something I should be doing? I just have i915kms_load=3D"YES" in /boot/loader.conf. Thanks, Shawn --=-7ziGbE9XsQvKWFGRcKwd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCgAGBQJUv/PbAAoJEGqEZY9SRW7uIngP/iu4mpNQb6jYrODywdLnPd3K zwCT2uPSOt5B0of6FRZ4i4qGsvLhLMhK8mpoN7QTEpsBrVj7ToZXMv6Jy+4qbfbC PyyVxsYywLNNsFO6AMWFTUqUTmpOn9DyHVyA/VN5mtXZILgOmDE82CeB6NiryI/K +KE03v26Ogywn1na0ObohzkTeYDL/Ynt8hixkqsvnJM+Rbdmg/Vy+JtWmS9Cka/m zQ2Ql6vGyII+utqmxpQkl9bi4IWK209p2fX2Gx0GwVkZ2UixgAhtu4H8mnxESzsX /RlZszFjq5NzC+tqkpAufP5VeviVR6igRRBDyiLoDMyF699XqvNF75/hNdKaHwon kuJHUt5iSAdfsFZ3gRUTbuMt3RmK2CUwJNpDjhMqAJhFyuPPqiYAgASIgsy5R16N mzLDRDDEEi97BXa1UcrJ+OeJlA8XkqegRiN8T5k1cfGESbjZww+5/4gPOzcWEd76 2Air8WXjJG5wCs8vkMzusSOMae223uQvQlM7EoFxkOUas2vShWK2EUf7oCtNVkxt /N3ax74ZczzF6MmocUT5Z2DesjknaYTCKTJA+3VKnClthQAZ5/afPGg8EvilfKFu IgTUaQWwAsbXcAU7QsM32Ef4yvOyFS92etFEU4gol2CdLynXHoIv7ya7zyFIL6If 7LGlz+omYU/BP8PHnHm6 =FzNd -----END PGP SIGNATURE----- --=-7ziGbE9XsQvKWFGRcKwd-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:04:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41857BBA; Wed, 21 Jan 2015 19:04:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DF94E12; Wed, 21 Jan 2015 19:04:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJ4u4p070279; Wed, 21 Jan 2015 19:04:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJ4u3R070278; Wed, 21 Jan 2015 19:04:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501211904.t0LJ4u3R070278@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Jan 2015 19:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277497 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:04:56 -0000 Author: emaste Date: Wed Jan 21 19:04:55 2015 New Revision: 277497 URL: https://svnweb.freebsd.org/changeset/base/277497 Log: Remove addr2line from cross elftoolchain tools list It is not required, and there is no reason to install it just because it came with the binutils cross tools. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jan 21 18:32:53 2015 (r277496) +++ head/Makefile.inc1 Wed Jan 21 19:04:55 2015 (r277497) @@ -1428,7 +1428,6 @@ _binutils= gnu/usr.bin/binutils .endif .if ${MK_ELFTOOLCHAIN_TOOLS} != "no" _elftctools= lib/libelftc \ - usr.bin/addr2line \ usr.bin/elfcopy \ usr.bin/nm \ usr.bin/size \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:07:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8277D38; Wed, 21 Jan 2015 19:07:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3BA7E3F; Wed, 21 Jan 2015 19:07:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJ7kY3070721; Wed, 21 Jan 2015 19:07:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJ7kBl070713; Wed, 21 Jan 2015 19:07:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501211907.t0LJ7kBl070713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 21 Jan 2015 19:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277498 - in head/sys/powerpc: aim include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:07:47 -0000 Author: nwhitehorn Date: Wed Jan 21 19:07:45 2015 New Revision: 277498 URL: https://svnweb.freebsd.org/changeset/base/277498 Log: Make 64-bit AIM trap handlers relocatable by changing all absolute branch instructions to call through pointers instead. In general, these are set implicitly through relocation processing. One has to be set explicitly in machdep.c, however, to fit one handler in the tiny (8 instruction) space available. Reviewed by: andreast Differential revision: D1554 Tested on: UP and SMP G5, Cell, POWER5+ Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/trap.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Wed Jan 21 19:04:55 2015 (r277497) +++ head/sys/powerpc/aim/machdep.c Wed Jan 21 19:07:45 2015 (r277498) @@ -238,7 +238,7 @@ extern void *trapcode64; #endif extern void *rstcode, *rstsize; -extern void *trapcode, *trapsize; +extern void *trapcode, *trapsize, *trapcode2; extern void *slbtrap, *slbtrapsize; extern void *alitrap, *alisize; extern void *dsitrap, *dsisize; @@ -506,6 +506,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ generictrap = &trapcode; /* Set TOC base so that the interrupt code can get at it */ + *((void **)TRAP_GENTRAP) = &trapcode2; *((register_t *)TRAP_TOCBASE) = toc; #endif Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Wed Jan 21 19:04:55 2015 (r277497) +++ head/sys/powerpc/aim/trap_subr64.S Wed Jan 21 19:07:45 2015 (r277498) @@ -302,8 +302,13 @@ CNAME(rstcode): insrdi %r9,%r8,1,0 mtmsrd %r9 isync + bl 1f + .llong cpu_reset +1: mflr %r9 + ld %r9,0(%r9) + mtlr %r9 - ba cpu_reset + blr CNAME(rstsize) = . - CNAME(rstcode) cpu_reset: @@ -342,16 +347,20 @@ cpu_reset: /* * This code gets copied to all the trap vectors - * (except ISI/DSI, ALI, and the interrupts) + * (except ISI/DSI, ALI, and the interrupts). Has to fit in 8 instructions! */ .globl CNAME(trapcode),CNAME(trapsize) + .p2align 3 CNAME(trapcode): mtsprg1 %r1 /* save SP */ mflr %r1 /* Save the old LR in r1 */ mtsprg2 %r1 /* And then in SPRG2 */ + li %r1,TRAP_GENTRAP + ld %r1,0(%r1) + mtlr %r1 li %r1, 0xA0 /* How to get the vector from LR */ - bla generictrap /* LR & SPRG3 is exception # */ + blrl /* Branch to generictrap */ CNAME(trapsize) = .-CNAME(trapcode) /* @@ -361,6 +370,7 @@ CNAME(trapsize) = .-CNAME(trapcode) * the only time this can be called. */ .globl CNAME(slbtrap),CNAME(slbtrapsize) + .p2align 3 CNAME(slbtrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -369,17 +379,31 @@ CNAME(slbtrap): std %r2,(PC_SLBSAVE+104)(%r1) mfsrr1 %r2 /* test kernel mode */ mtcr %r2 - bf 17,1f /* branch if PSL_PR is false */ + bf 17,2f /* branch if PSL_PR is false */ /* User mode */ ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ mtcr %r2 ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2 */ mflr %r1 /* Save the old LR in r1 */ mtsprg2 %r1 /* And then in SPRG2 */ + /* 52 bytes so far */ + bl 1f + .llong generictrap +1: mflr %r1 + ld %r1,0(%r1) + mtlr %r1 li %r1, 0x80 /* How to get the vector from LR */ - bla generictrap /* LR & SPRG3 is exception # */ -1: mflr %r2 /* Save the old LR in r2 */ - bla kern_slbtrap + blrl /* Branch to generictrap */ + /* 84 bytes */ +2: mflr %r2 /* Save the old LR in r2 */ + nop + bl 3f /* Begin dance to jump to kern_slbtrap*/ + .llong kern_slbtrap +3: mflr %r1 + ld %r1,0(%r1) + mtlr %r1 + GET_CPUINFO(%r1) + blrl /* 124 bytes -- 4 to spare */ CNAME(slbtrapsize) = .-CNAME(slbtrap) kern_slbtrap: @@ -518,6 +542,16 @@ CNAME(alitrap): mflr %r28 /* save LR */ mfcr %r29 /* save CR */ + /* Begin dance to branch to s_trap in a bit */ + b 1f + .p2align 3 +1: nop + bl 1f + .llong s_trap +1: mflr %r31 + ld %r31,0(%r31) + mtlr %r31 + /* Put our exception vector in SPRG3 */ li %r31, EXC_ALI mtsprg3 %r31 @@ -525,13 +559,12 @@ CNAME(alitrap): /* Test whether we already had PR set */ mfsrr1 %r31 mtcr %r31 - bla s_trap + blrl CNAME(alisize) = .-CNAME(alitrap) /* * Similar to the above for DSI - * Has to handle BAT spills - * and standard pagetable spills + * Has to handle standard pagetable spills */ .globl CNAME(dsitrap),CNAME(dsisize) CNAME(dsitrap): @@ -542,14 +575,18 @@ CNAME(dsitrap): std %r29,(PC_DISISAVE+CPUSAVE_R29)(%r1) std %r30,(PC_DISISAVE+CPUSAVE_R30)(%r1) std %r31,(PC_DISISAVE+CPUSAVE_R31)(%r1) - mfsprg1 %r1 /* restore SP */ mfcr %r29 /* save CR */ mfxer %r30 /* save XER */ mtsprg2 %r30 /* in SPRG2 */ mfsrr1 %r31 /* test kernel mode */ mtcr %r31 mflr %r28 /* save LR (SP already saved) */ - bla disitrap + bl 1f /* Begin branching to disitrap */ + .llong disitrap +1: mflr %r1 + ld %r1,0(%r1) + mtlr %r1 + blrl /* Branch to generictrap */ CNAME(dsisize) = .-CNAME(dsitrap) /* @@ -624,7 +661,7 @@ realtrap: bl restore_kernsrs /* enable kernel mapping */ mfsprg2 %r29 mr %r28,%r27 - ba s_trap + b s_trap /* * generictrap does some standard setup for trap handling to minimize @@ -636,6 +673,8 @@ realtrap: * SPRG2 - Original LR */ + .globl CNAME(trapcode2) +trapcode2: generictrap: /* Save R1 for computing the exception vector */ mtsprg3 %r1 @@ -657,6 +696,7 @@ generictrap: mfsprg3 %r31 ori %r31,%r31,0xff00 mflr %r30 + addi %r30,%r30,-4 /* The branch instruction, not the next */ and %r30,%r30,%r31 mtsprg3 %r30 @@ -804,9 +844,16 @@ CNAME(dblow): mfsprg2 %r29 /* ... and r29 */ mflr %r1 /* save LR */ mtsprg2 %r1 /* And then in SPRG2 */ + + nop /* Begin branching to generictrap */ + bl 9f + .llong generictrap +9: mflr %r1 + ld %r1,0(%r1) + mtlr %r1 li %r1, 0 /* How to get the vector from LR */ + blrl /* Branch to generictrap */ - bla generictrap /* and we look like a generic trap */ 1: GET_CPUINFO(%r1) std %r27,(PC_DBSAVE+CPUSAVE_R27)(%r1) /* free r27 */ @@ -816,6 +863,11 @@ CNAME(dblow): std %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ std %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ - bla dbtrap + bl 9f /* Begin branch */ + .llong dbtrap +9: mflr %r1 + ld %r1,0(%r1) + mtlr %r1 + blrl /* Branch to generictrap */ CNAME(dbsize) = .-CNAME(dblow) #endif /* KDB */ Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Wed Jan 21 19:04:55 2015 (r277497) +++ head/sys/powerpc/include/trap.h Wed Jan 21 19:07:45 2015 (r277498) @@ -123,7 +123,8 @@ /* DTrace trap opcode. */ #define EXC_DTRACE 0x7c810808 -/* Magic pointer to store TOC base for trap handlers on ppc64 */ +/* Magic pointer to store TOC base and other info for trap handlers on ppc64 */ +#define TRAP_GENTRAP 0x1f0 #define TRAP_TOCBASE 0x1f8 #ifndef LOCORE From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:09:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB2B9E93; Wed, 21 Jan 2015 19:09:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD5A1E51; Wed, 21 Jan 2015 19:09:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJ9Gxp070945; Wed, 21 Jan 2015 19:09:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJ9G5Z070942; Wed, 21 Jan 2015 19:09:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501211909.t0LJ9G5Z070942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 21 Jan 2015 19:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277499 - in head/sys/powerpc: aim powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:09:17 -0000 Author: nwhitehorn Date: Wed Jan 21 19:09:15 2015 New Revision: 277499 URL: https://svnweb.freebsd.org/changeset/base/277499 Log: Make sure to relocate tmpstk with everything else and avoid processing non-relative relocations that the UART code makes for absent modules. Modified: head/sys/powerpc/aim/locore64.S head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Wed Jan 21 19:07:45 2015 (r277498) +++ head/sys/powerpc/aim/locore64.S Wed Jan 21 19:09:15 2015 (r277499) @@ -126,9 +126,14 @@ ASENTRY_NOPROF(__start) ld %r1,0(%r2) add %r2,%r1,%r2 + /* Get load offset */ + ld %r31,-0x8000(%r2) /* First TOC entry is TOC base */ + subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ + /* Set up the stack pointer */ ld %r1,TOC_REF(tmpstk)(%r2) addi %r1,%r1,TMPSTKSZ-96 + add %r1,%r1,%r31 /* Relocate kernel */ std %r3,48(%r1) @@ -140,8 +145,7 @@ ASENTRY_NOPROF(__start) 1: mflr %r3 ld %r4,0(%r3) add %r3,%r4,%r3 - ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */ - subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */ + mr %r4,%r31 bl elf_reloc_self nop ld %r3,48(%r1) Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Wed Jan 21 19:07:45 2015 (r277498) +++ head/sys/powerpc/powerpc/elf64_machdep.c Wed Jan 21 19:09:15 2015 (r277499) @@ -226,6 +226,8 @@ elf_reloc_self(Elf_Dyn *dynp, Elf_Addr r */ relalim = (Elf_Rela *)((caddr_t)rela + relasz); for (; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) != R_PPC_RELATIVE) + continue; where = (Elf_Addr *)(relocbase + rela->r_offset); *where = (Elf_Addr)(relocbase + rela->r_addend); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:11:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A5C991; Wed, 21 Jan 2015 19:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17104EFB; Wed, 21 Jan 2015 19:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJBFTa072253; Wed, 21 Jan 2015 19:11:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJBFPV072252; Wed, 21 Jan 2015 19:11:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501211911.t0LJBFPV072252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 21 Jan 2015 19:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277500 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:11:16 -0000 Author: nwhitehorn Date: Wed Jan 21 19:11:15 2015 New Revision: 277500 URL: https://svnweb.freebsd.org/changeset/base/277500 Log: Add POWER7+ and POWER8 to the list of CPUs with 32 SLB slots. This is mostly a no-op since all currently-supported instances of these CPUs give the number of SLB slots in the device tree, but keep it here as well just in case. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Wed Jan 21 19:09:15 2015 (r277499) +++ head/sys/powerpc/aim/machdep.c Wed Jan 21 19:11:15 2015 (r277500) @@ -394,6 +394,9 @@ powerpc_init(vm_offset_t fdt, vm_offset_ break; #ifdef __powerpc64__ case IBMPOWER7: + case IBMPOWER7PLUS: + case IBMPOWER8: + case IBMPOWER8E: /* XXX: get from ibm,slb-size in device tree */ n_slbs = 32; break; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:20:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3EA841D; Wed, 21 Jan 2015 19:20:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02967B; Wed, 21 Jan 2015 19:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJKbT7076657; Wed, 21 Jan 2015 19:20:37 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJKbh3076656; Wed, 21 Jan 2015 19:20:37 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211920.t0LJKbh3076656@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 19:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277501 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:20:37 -0000 Author: will Date: Wed Jan 21 19:20:36 2015 New Revision: 277501 URL: https://svnweb.freebsd.org/changeset/base/277501 Log: Eliminate an #ifdef illumos for zfs_ioc_rename(). Since allow_mounted is a FreeBSD-specific change, default to B_TRUE, then locally check for the magic bit. Unconditionally check allow_mounted below. Convert the setting of allow_mounted to an explicit boolean. MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 672578 (in part) on 2013/07/19 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 21 19:11:15 2015 (r277500) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 21 19:20:36 2015 (r277501) @@ -3751,10 +3751,12 @@ static int zfs_ioc_rename(zfs_cmd_t *zc) { boolean_t recursive = zc->zc_cookie & 1; + char *at; + boolean_t allow_mounted = B_TRUE; + #ifdef __FreeBSD__ - boolean_t allow_mounted = zc->zc_cookie & 2; + allow_mounted = (zc->zc_cookie & 2) != 0; #endif - char *at; zc->zc_value[sizeof (zc->zc_value) - 1] = '\0'; if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || @@ -3769,11 +3771,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) return (SET_ERROR(EXDEV)); *at = '\0'; -#ifdef illumos - if (zc->zc_objset_type == DMU_OST_ZFS) { -#else if (zc->zc_objset_type == DMU_OST_ZFS && allow_mounted) { -#endif error = dmu_objset_find(zc->zc_name, recursive_unmount, at + 1, recursive ? DS_FIND_CHILDREN : 0); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:23:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BC875C7; Wed, 21 Jan 2015 19:23:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88989AD; Wed, 21 Jan 2015 19:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJNle1079880; Wed, 21 Jan 2015 19:23:47 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJNl1M079878; Wed, 21 Jan 2015 19:23:47 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501211923.t0LJNl1M079878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 21 Jan 2015 19:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277502 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:23:47 -0000 Author: gonzo Date: Wed Jan 21 19:23:46 2015 New Revision: 277502 URL: https://svnweb.freebsd.org/changeset/base/277502 Log: Remove "#define DEBUG" that conflicts with "option DEBUG" in kernel config Modified: head/sys/arm/ti/ti_mbox.c head/sys/arm/ti/ti_pruss.c Modified: head/sys/arm/ti/ti_mbox.c ============================================================================== --- head/sys/arm/ti/ti_mbox.c Wed Jan 21 19:20:36 2015 (r277501) +++ head/sys/arm/ti/ti_mbox.c Wed Jan 21 19:23:46 2015 (r277502) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include "mbox_if.h" -#define DEBUG #ifdef DEBUG #define DPRINTF(fmt, ...) do { \ printf("%s: ", __func__); \ Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Wed Jan 21 19:20:36 2015 (r277501) +++ head/sys/arm/ti/ti_pruss.c Wed Jan 21 19:23:46 2015 (r277502) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEBUG #ifdef DEBUG #define DPRINTF(fmt, ...) do { \ printf("%s: ", __func__); \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:25:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 721507A0; Wed, 21 Jan 2015 19:25:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8EFDA; Wed, 21 Jan 2015 19:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJPw2a080229; Wed, 21 Jan 2015 19:25:58 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJPwHO080228; Wed, 21 Jan 2015 19:25:58 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211925.t0LJPwHO080228@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 19:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277503 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:25:58 -0000 Author: will Date: Wed Jan 21 19:25:57 2015 New Revision: 277503 URL: https://svnweb.freebsd.org/changeset/base/277503 Log: Ignore sync requests from the system syncher, i.e. VFS_SYNC(waitfor=MNT_LAZY). ZFS already commits outstanding data every zfs_txg_timeout seconds, so these syncs are unnecessarily intrusive. Submitted by: gibbs Sponsored by: Spectra Logic MFSpectraBSD: 1105759 on 2014/12/11 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 21 19:23:46 2015 (r277502) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 21 19:25:57 2015 (r277503) @@ -132,6 +132,13 @@ zfs_sync(vfs_t *vfsp, int waitfor) if (panicstr) return (0); + /* + * Ignore the system syncher. ZFS already commits async data + * at zfs_txg_timeout intervals. + */ + if (waitfor == MNT_LAZY) + return (0); + if (vfsp != NULL) { /* * Sync a specific filesystem. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:30:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E791A35; Wed, 21 Jan 2015 19:30:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8B2140; Wed, 21 Jan 2015 19:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJU2o4080849; Wed, 21 Jan 2015 19:30:02 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJU2Ci080847; Wed, 21 Jan 2015 19:30:02 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211930.t0LJU2Ci080847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 19:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277504 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:30:02 -0000 Author: will Date: Wed Jan 21 19:30:01 2015 New Revision: 277504 URL: https://svnweb.freebsd.org/changeset/base/277504 Log: Remove commented log messages. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Wed Jan 21 19:25:57 2015 (r277503) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Wed Jan 21 19:30:01 2015 (r277504) @@ -2090,7 +2090,6 @@ zil_replay(objset_t *os, void *arg, zil_ zil_destroy(zilog, B_TRUE); return; } - //printf("ZFS: Replaying ZIL on %s...\n", os->os->os_spa->spa_name); zr.zr_replay = replay_func; zr.zr_arg = arg; @@ -2112,7 +2111,6 @@ zil_replay(objset_t *os, void *arg, zil_ zil_destroy(zilog, B_FALSE); txg_wait_synced(zilog->zl_dmu_pool, zilog->zl_destroy_txg); zilog->zl_replay = B_FALSE; - //printf("ZFS: Replay of ZIL on %s finished.\n", os->os->os_spa->spa_name); } boolean_t From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:32:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3177BC7E; Wed, 21 Jan 2015 19:32:41 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E81E81FC; Wed, 21 Jan 2015 19:32:40 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id h15so15516121igd.4; Wed, 21 Jan 2015 11:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1GqEDi7gEt8jQHrCYD9/Gd/oti/xFNJg3KauapIZxvA=; b=ewlT8PZUQ54KCZmke0XDebCTxLe4U1saQSDSU1l6b3aOncCDAz98rBkVAL97s+xmyJ EbLauRoZ+Oldr8piS5hTrTt4z9V+tUpS7lDy30tkSq5dk9dV33fCo4FC7KdsuJgz5my6 +H5rDWTa3yM6EaGs0RPckUQu1eZ0/G6EndyxclTzsMBWUeXAoVcYiwwHIu35IoGnG5IP +T5pNnN6harZi2vGNWckNP/YIVgh9CM50NppndaI/dE4vUcDKz+nktjFxzklp3ktyH39 MyUmzIkZUh8xohO6AfUjBpaOLLd10MY8kFr8tq2SXUXzwTrzcO4m5fw0VLKNQ3DhB2AJ B+hA== MIME-Version: 1.0 X-Received: by 10.50.107.72 with SMTP id ha8mr6787052igb.32.1421868759842; Wed, 21 Jan 2015 11:32:39 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Wed, 21 Jan 2015 11:32:39 -0800 (PST) In-Reply-To: <20150121181512.GE15484@FreeBSD.org> References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> Date: Wed, 21 Jan 2015 11:32:39 -0800 X-Google-Sender-Auth: eF7Ur-d1yWJCVhBd7Wqt6recUB4 Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , "K. Macy" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:32:41 -0000 On 21 January 2015 at 10:15, Gleb Smirnoff wrote: > Sean, > > On Tue, Jan 20, 2015 at 04:22:44PM -0800, Sean Bruno wrote: > S> In our universe, this commit (right or wrong) resolved our panics. I > S> think that there is some room for improvement based on the commentary > S> in this thread, but some people do indeed prefer stability over > S> performance. I hope we can come to a middle ground somewhere here. > > Sorry, but this sounds very much like alchemy. We poured this stuff > into that stuff and yield in gold precipitate. We don't understand > what's going on, but let's record the recipe into our tome of aclhemy > wisdom. > > So alchemy never came to a scientific level, and chemistry evolved > as science only when researchers started to measure, explain and > understand. > > If we treat our precious kernel in alchemy way, we will follow > the path of alchemy, except that it took centuries for alchemy to > die, and for a software product it would take a few years. > > So, for me Kip ideas sound very sensible. There could be a race > somewhere else. You tweak callout subsystem in any direction, > timings of events in kernel shift, your race is hidden. > > If we fix problems w/o understanding them, we are going alchemy way. Hi, I don't think it's quite this bad. They originally found that things were spinning for way too long. Hans found something similar and determined/concluded that the migration code in callouts was racy-by-design and dramatically simplified it and also put very hard constraints on what is a valid situation to support migrating from one callwheel to another. Now we have fallout which we can either address or back out until the callout stuff is again reviewed/fixed. I don't think it's as alchemic as is being promoted. -a From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:53:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5825D18D; Wed, 21 Jan 2015 19:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 397EF639; Wed, 21 Jan 2015 19:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJrsnh094200; Wed, 21 Jan 2015 19:53:54 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJrrCi094194; Wed, 21 Jan 2015 19:53:53 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211953.t0LJrrCi094194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 19:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277505 - head/sys/dev/dcons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:53:54 -0000 Author: will Date: Wed Jan 21 19:53:52 2015 New Revision: 277505 URL: https://svnweb.freebsd.org/changeset/base/277505 Log: Garbage collect dragonfly and legacy FreeBSD system support from dcons(4). Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110990 on 2015/01/06 Modified: head/sys/dev/dcons/dcons.c head/sys/dev/dcons/dcons_crom.c head/sys/dev/dcons/dcons_os.h Modified: head/sys/dev/dcons/dcons.c ============================================================================== --- head/sys/dev/dcons/dcons.c Wed Jan 21 19:30:01 2015 (r277504) +++ head/sys/dev/dcons/dcons.c Wed Jan 21 19:53:52 2015 (r277505) @@ -37,11 +37,9 @@ #include -#if defined(__DragonFly__) || defined(_BOOT) -#include "dcons.h" #if defined(_BOOT) +#include "dcons.h" #include "stand.h" -#endif #else #include #endif Modified: head/sys/dev/dcons/dcons_crom.c ============================================================================== --- head/sys/dev/dcons/dcons_crom.c Wed Jan 21 19:30:01 2015 (r277504) +++ head/sys/dev/dcons/dcons_crom.c Wed Jan 21 19:53:52 2015 (r277505) @@ -46,40 +46,25 @@ #include #include -#ifdef __DragonFly__ -#include -#include -#include -#include "dcons.h" -#include "dcons_os.h" -#else #include #include #include #include #include -#endif #include -#define EXPOSE_IDT_ADDR 1 - -#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR) +#if (defined(__i386__) || defined(__amd64__)) #include #include #include #include /* for idt */ #endif + static bus_addr_t dcons_paddr; -#if __FreeBSD_version >= 500000 static int force_console = 0; TUNABLE_INT("hw.firewire.dcons_crom.force_console", &force_console); -#endif - -#ifndef CSRVAL_VENDOR_PRIVATE -#define NEED_NEW_DRIVER -#endif #define ADDR_HI(x) (((x) >> 24) & 0xffffff) #define ADDR_LO(x) ((x) & 0xffffff) @@ -115,8 +100,7 @@ dcons_crom_probe(device_t dev) return (0); } -#ifndef NEED_NEW_DRIVER -#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR) +#if (defined(__i386__) || defined(__amd64__)) static void dcons_crom_expose_idt(struct dcons_crom_softc *sc) { @@ -129,6 +113,7 @@ dcons_crom_expose_idt(struct dcons_crom_ crom_add_entry(&sc->unit, DCONS_CSR_KEY_RESET_LO, ADDR_LO(idt_paddr)); } #endif + static void dcons_crom_post_busreset(void *arg) { @@ -149,11 +134,10 @@ dcons_crom_post_busreset(void *arg) crom_add_simple_text(src, &sc->unit, &sc->ver, "dcons"); crom_add_entry(&sc->unit, DCONS_CSR_KEY_HI, ADDR_HI(dcons_paddr)); crom_add_entry(&sc->unit, DCONS_CSR_KEY_LO, ADDR_LO(dcons_paddr)); -#if (defined(__i386__) || defined(__amd64__)) && defined(EXPOSE_IDT_ADDR) +#if (defined(__i386__) || defined(__amd64__)) dcons_crom_expose_idt(sc); #endif } -#endif static void dmamap_cb(void *arg, bus_dma_segment_t *segments, int seg, int error) @@ -168,11 +152,7 @@ dmamap_cb(void *arg, bus_dma_segment_t * bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_PREWRITE); device_printf(sc->fd.dev, -#if __FreeBSD_version < 500000 - "bus_addr 0x%x\n", sc->bus_addr); -#else "bus_addr 0x%jx\n", (uintmax_t)sc->bus_addr); -#endif if (dcons_paddr != 0) { /* XXX */ device_printf(sc->fd.dev, "dcons_paddr is already set\n"); @@ -182,11 +162,9 @@ dmamap_cb(void *arg, bus_dma_segment_t * dcons_conf->dma_map = sc->dma_map; dcons_paddr = sc->bus_addr; -#if __FreeBSD_version >= 500000 /* Force to be the high-level console */ if (force_console) cnselect(dcons_conf->cdev); -#endif } static void @@ -200,10 +178,6 @@ dcons_crom_poll(void *p, int arg) static int dcons_crom_attach(device_t dev) { -#ifdef NEED_NEW_DRIVER - printf("dcons_crom: you need newer firewire driver\n"); - return (-1); -#else struct dcons_crom_softc *sc; int error; @@ -227,10 +201,8 @@ dcons_crom_attach(device_t dev) /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ BUS_DMA_ALLOCNOW, -#if __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, -#endif &sc->dma_tag); if (error != 0) return (error); @@ -245,7 +217,6 @@ dcons_crom_attach(device_t dev) sc->ehand = EVENTHANDLER_REGISTER(dcons_poll, dcons_crom_poll, (void *)sc, 0); return (0); -#endif } static int Modified: head/sys/dev/dcons/dcons_os.h ============================================================================== --- head/sys/dev/dcons/dcons_os.h Wed Jan 21 19:30:01 2015 (r277504) +++ head/sys/dev/dcons/dcons_os.h Wed Jan 21 19:53:52 2015 (r277505) @@ -34,7 +34,6 @@ * $FreeBSD$ */ - typedef void (*dcons_poll_fn)(void *, int); EVENTHANDLER_DECLARE(dcons_poll, dcons_poll_fn); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:59:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 401FD69E; Wed, 21 Jan 2015 19:59:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE0168B; Wed, 21 Jan 2015 19:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LJxAuR095010; Wed, 21 Jan 2015 19:59:10 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LJxAKG095009; Wed, 21 Jan 2015 19:59:10 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501211959.t0LJxAKG095009@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 19:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277506 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 19:59:10 -0000 Author: will Date: Wed Jan 21 19:59:09 2015 New Revision: 277506 URL: https://svnweb.freebsd.org/changeset/base/277506 Log: Fix one cause of firewire panics. sys/dev/firewire/firewire.c: In fw_xfer_unload(), clear the FWXF_INQ flag on the xfer under protection of the FW_GMTX, after the xfer is removeed from the tx/rx queue. Otherwise it is possible for the xfer to be removed again (corrupting the list or immediately panicing) from another thread that has found this xfer in the transaction label table. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110200 on 2015/01/02 Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Wed Jan 21 19:53:52 2015 (r277505) +++ head/sys/dev/firewire/firewire.c Wed Jan 21 19:59:09 2015 (r277506) @@ -1166,6 +1166,7 @@ fw_xfer_unload(struct fw_xfer *xfer) s = splfw(); FW_GLOCK(xfer->fc); STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link); + xfer->flag &= ~FWXF_INQ; #if 0 xfer->q->queued--; #endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:02:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 772AA84E; Wed, 21 Jan 2015 20:02:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F65799; Wed, 21 Jan 2015 20:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LK2Hqw099438; Wed, 21 Jan 2015 20:02:17 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LK2HEK099437; Wed, 21 Jan 2015 20:02:17 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212002.t0LK2HEK099437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277507 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:02:17 -0000 Author: will Date: Wed Jan 21 20:02:16 2015 New Revision: 277507 URL: https://svnweb.freebsd.org/changeset/base/277507 Log: Fix a FWXF_INQ race in the firewire driver. sys/dev/firewire/firewire.c: In fw_xfer_unload() expand lock coverage so that the test for FWXF_INQ doesn't race with it being cleared in another thread. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110207 on 2015/01/02 Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Wed Jan 21 19:59:09 2015 (r277506) +++ head/sys/dev/firewire/firewire.c Wed Jan 21 20:02:16 2015 (r277507) @@ -1022,9 +1022,7 @@ static void fw_tl_free(struct firewire_comm *fc, struct fw_xfer *xfer) { struct fw_xfer *txfer; - int s; - s = splfw(); mtx_lock(&fc->tlabel_lock); if (xfer->tl < 0) { mtx_unlock(&fc->tlabel_lock); @@ -1042,14 +1040,12 @@ fw_tl_free(struct firewire_comm *fc, str fw_dump_hdr(&xfer->recv.hdr, "recv"); kdb_backtrace(); mtx_unlock(&fc->tlabel_lock); - splx(s); return; } STAILQ_REMOVE(&fc->tlabels[xfer->tl], xfer, fw_xfer, tlabel); xfer->tl = -1; mtx_unlock(&fc->tlabel_lock); - splx(s); return; } @@ -1157,22 +1153,18 @@ fw_xfer_done(struct fw_xfer *xfer) void fw_xfer_unload(struct fw_xfer *xfer) { - int s; if (xfer == NULL) return; + FW_GLOCK(xfer->fc); if (xfer->flag & FWXF_INQ) { - printf("fw_xfer_free FWXF_INQ\n"); - s = splfw(); - FW_GLOCK(xfer->fc); STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link); xfer->flag &= ~FWXF_INQ; #if 0 xfer->q->queued--; #endif - FW_GUNLOCK(xfer->fc); - splx(s); } + FW_GUNLOCK(xfer->fc); if (xfer->fc != NULL) { /* * Ensure that any tlabel owner can't access this From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:03:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90B9B9CC; Wed, 21 Jan 2015 20:03:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 636EF7B0; Wed, 21 Jan 2015 20:03:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LK3loQ099843; Wed, 21 Jan 2015 20:03:47 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LK3lHX099841; Wed, 21 Jan 2015 20:03:47 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212003.t0LK3lHX099841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277508 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:03:47 -0000 Author: will Date: Wed Jan 21 20:03:46 2015 New Revision: 277508 URL: https://svnweb.freebsd.org/changeset/base/277508 Log: Fix panic in firewire and creation of invalid config ROM. sys/boot/i386/libfirewire/firewire.c: sys/dev/firewire/firewire.c: Fix configuration ROM generation count wrapping logic so that the generation count is never outside of allowed limits (0x2 -> 0xF). sys/dev/firewire/firewire.c: In fw_xfer_unload(), xfer->fc may be NULL. Protect against this before taking the fc lock. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110685 on 2015/01/05 Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Wed Jan 21 20:02:16 2015 (r277507) +++ head/sys/dev/firewire/firewire.c Wed Jan 21 20:03:46 2015 (r277508) @@ -761,8 +761,15 @@ fw_busreset(struct firewire_comm *fc, ui src = &fc->crom_src_buf->src; crom_load(src, newrom, CROMSIZE); if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) { - if (src->businfo.generation++ > FW_MAX_GENERATION) + /* Bump generation and reload. */ + src->businfo.generation++; + + /* Handle generation count wraps. */ + if (src->businfo.generation < FW_GENERATION_CHANGEABLE) src->businfo.generation = FW_GENERATION_CHANGEABLE; + + /* Recalculate CRC to account for generation change. */ + crom_load(src, newrom, CROMSIZE); bcopy(newrom, fc->config_rom, CROMSIZE); } free(newrom, M_FW); @@ -1156,16 +1163,18 @@ fw_xfer_unload(struct fw_xfer *xfer) if (xfer == NULL) return; - FW_GLOCK(xfer->fc); - if (xfer->flag & FWXF_INQ) { - STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link); - xfer->flag &= ~FWXF_INQ; -#if 0 - xfer->q->queued--; -#endif - } - FW_GUNLOCK(xfer->fc); + if (xfer->fc != NULL) { + FW_GLOCK(xfer->fc); + if (xfer->flag & FWXF_INQ) { + STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link); + xfer->flag &= ~FWXF_INQ; + #if 0 + xfer->q->queued--; + #endif + } + FW_GUNLOCK(xfer->fc); + /* * Ensure that any tlabel owner can't access this * xfer after it's freed. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:05:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C217EB1B; Wed, 21 Jan 2015 20:05:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE7177BC; Wed, 21 Jan 2015 20:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LK5BDj000426; Wed, 21 Jan 2015 20:05:11 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LK5BQI000423; Wed, 21 Jan 2015 20:05:11 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212005.t0LK5BQI000423@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277509 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:05:12 -0000 Author: will Date: Wed Jan 21 20:05:10 2015 New Revision: 277509 URL: https://svnweb.freebsd.org/changeset/base/277509 Log: Properly lock accesss to the firewire_comm->devices list. sys/dev/firewire/firewire.c: Add missing FW_GLOCK/UNLOCK() usage to fw_noderesolve_nodeid(). sys/dev/firewire/firewire.c: sys/dev/firewire/fwmem.c: Remove no-op splfw() calls from functions that have been audited for proper lock usage. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110992 on 2015/01/06 Modified: head/sys/dev/firewire/firewire.c head/sys/dev/firewire/fwmem.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Wed Jan 21 20:03:46 2015 (r277508) +++ head/sys/dev/firewire/firewire.c Wed Jan 21 20:05:10 2015 (r277509) @@ -146,13 +146,12 @@ struct fw_device * fw_noderesolve_nodeid(struct firewire_comm *fc, int dst) { struct fw_device *fwdev; - int s; - s = splfw(); + FW_GLOCK(fc); STAILQ_FOREACH(fwdev, &fc->devices, link) if (fwdev->dst == dst && fwdev->status != FWDEVINVAL) break; - splx(s); + FW_GUNLOCK(fc); return fwdev; } @@ -164,15 +163,12 @@ struct fw_device * fw_noderesolve_eui64(struct firewire_comm *fc, struct fw_eui64 *eui) { struct fw_device *fwdev; - int s; - s = splfw(); FW_GLOCK(fc); STAILQ_FOREACH(fwdev, &fc->devices, link) if (FW_EUI64_EQUAL(fwdev->eui, *eui)) break; FW_GUNLOCK(fc); - splx(s); if (fwdev == NULL) return NULL; @@ -301,9 +297,7 @@ static void fw_asystart(struct fw_xfer *xfer) { struct firewire_comm *fc = xfer->fc; - int s; - s = splfw(); /* Protect from interrupt/timeout */ FW_GLOCK(fc); xfer->flag = FWXF_INQ; @@ -312,7 +306,6 @@ fw_asystart(struct fw_xfer *xfer) xfer->q->queued++; #endif FW_GUNLOCK(fc); - splx(s); /* XXX just queue for mbuf */ if (xfer->mbuf == NULL) xfer->q->start(fc); @@ -332,6 +325,7 @@ firewire_probe(device_t dev) return (0); } +/* Just use a per-packet callout? */ static void firewire_xfer_timeout(void *arg, int pending) { @@ -340,7 +334,7 @@ firewire_xfer_timeout(void *arg, int pen struct timeval tv; struct timeval split_timeout; STAILQ_HEAD(, fw_xfer) xfer_timeout; - int i, s; + int i; split_timeout.tv_sec = 0; split_timeout.tv_usec = 200 * 1000; /* 200 msec */ @@ -349,9 +343,8 @@ firewire_xfer_timeout(void *arg, int pen timevalsub(&tv, &split_timeout); STAILQ_INIT(&xfer_timeout); - s = splfw(); mtx_lock(&fc->tlabel_lock); - for (i = 0; i < 0x40; i++) { + for (i = 0; i < nitems(fc->tlabels); i++) { while ((xfer = STAILQ_FIRST(&fc->tlabels[i])) != NULL) { if ((xfer->flag & FWXF_SENT) == 0) /* not sent yet */ @@ -370,7 +363,6 @@ firewire_xfer_timeout(void *arg, int pen } } mtx_unlock(&fc->tlabel_lock); - splx(s); fc->timeout(fc); STAILQ_FOREACH_SAFE(xfer, &xfer_timeout, tlabel, txfer) Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Wed Jan 21 20:03:46 2015 (r277508) +++ head/sys/dev/firewire/fwmem.c Wed Jan 21 20:05:10 2015 (r277509) @@ -348,12 +348,11 @@ fwmem_strategy(struct bio *bp) struct fw_device *fwdev; struct fw_xfer *xfer; struct cdev *dev; - int err = 0, s, iolen; + int err = 0, iolen; dev = bp->bio_dev; /* XXX check request length */ - s = splfw(); fms = dev->si_drv1; fwdev = fw_noderesolve_eui64(fms->sc->fc, &fms->eui); if (fwdev == NULL) { @@ -395,7 +394,6 @@ fwmem_strategy(struct bio *bp) /* XXX */ bp->bio_resid = bp->bio_bcount - iolen; error: - splx(s); if (err != 0) { if (fwmem_debug) printf("%s: err=%d\n", __func__, err); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:06:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8649C75; Wed, 21 Jan 2015 20:06:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A542B7D4; Wed, 21 Jan 2015 20:06:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LK6QOZ000770; Wed, 21 Jan 2015 20:06:26 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LK6Qp7000769; Wed, 21 Jan 2015 20:06:26 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212006.t0LK6Qp7000769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277510 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:06:26 -0000 Author: will Date: Wed Jan 21 20:06:25 2015 New Revision: 277510 URL: https://svnweb.freebsd.org/changeset/base/277510 Log: Fix firewire panic when issuing a reply to an unhandled asynchronous remote dma request (DMA request that the hardware cannot automatically handle). sys/dev/firewire/firewire.c In fw_rcv(), add missing early return in the error path for DMA requests to unregistered regions. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110993 on 2015/01/06 Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Wed Jan 21 20:05:10 2015 (r277509) +++ head/sys/dev/firewire/firewire.c Wed Jan 21 20:06:25 2015 (r277510) @@ -2030,6 +2030,7 @@ fw_rcv(struct fw_rcv_buf *rb) rb->xfer->hand = fw_xfer_free; if (fw_asyreq(rb->fc, -1, rb->xfer)) fw_xfer_free(rb->xfer); + return; } len = 0; for (i = 0; i < rb->nvec; i++) From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:08:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E0A9DD3; Wed, 21 Jan 2015 20:08:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6487EC; Wed, 21 Jan 2015 20:08:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LK8PjL001310; Wed, 21 Jan 2015 20:08:25 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LK8PhR001309; Wed, 21 Jan 2015 20:08:25 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212008.t0LK8PhR001309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277511 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:08:25 -0000 Author: will Date: Wed Jan 21 20:08:24 2015 New Revision: 277511 URL: https://svnweb.freebsd.org/changeset/base/277511 Log: Fix remote DMA based firewire debugging when targeting systems with more than 4GB of physical memory. To remotely debug the system 'stealthy' which has a kernel with this change installed and firewire properly configured: % fwcontrol -m stealthy (or stealthy's firewire EUI64) % kgdb kernel /dev/fwmem0.0 sys/dev/firewire/fwohci.c: Rather than hard code the upper limit for hw based automatic responses to remote DMA requests at 4GB, program the hardware using Maxmem, the page number one higher than the highest physical page detected in the system. While here, garbage collect more useless splfw() calls. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110994 on 2015/01/06 Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Wed Jan 21 20:06:25 2015 (r277510) +++ head/sys/dev/firewire/fwohci.c Wed Jan 21 20:08:24 2015 (r277511) @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -188,6 +189,7 @@ static void fwohci_task_dma(void *, int) #define OHCI_PREQLO 0x118 #define OHCI_PREQLOCLR 0x11c #define OHCI_PREQUPPER 0x120 +#define OHCI_PREQUPPER_MAX 0xffff0000 #define OHCI_SID_BUF 0x64 #define OHCI_SID_CNT 0x68 @@ -854,7 +856,7 @@ fwohci_execute_db2(void *arg, bus_dma_se static void fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch) { - int i, s; + int i; int tcode, hdr_len, pl_off; int fsegment = -1; uint32_t off; @@ -880,7 +882,6 @@ fwohci_start(struct fwohci_softc *sc, st if (dbch->flags & FWOHCI_DBCH_FULL) return; - s = splfw(); db_tr = dbch->top; txloop: xfer = STAILQ_FIRST(&dbch->xferq.q); @@ -1030,7 +1031,6 @@ kick: } dbch->top = db_tr; - splx(s); return; } @@ -1821,6 +1821,7 @@ static void fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count) { struct firewire_comm *fc = (struct firewire_comm *)sc; + uintmax_t prequpper; uint32_t node_id, plen; FW_GLOCK_ASSERT(fc); @@ -1852,8 +1853,17 @@ fwohci_intr_core(struct fwohci_softc *sc /* allow from all nodes */ OWRITE(sc, OHCI_PREQHI, 0x7fffffff); OWRITE(sc, OHCI_PREQLO, 0xffffffff); - /* 0 to 4GB region */ - OWRITE(sc, OHCI_PREQUPPER, 0x10000); + prequpper = ((uintmax_t)Maxmem << PAGE_SHIFT) >> 16; + if (prequpper > OHCI_PREQUPPER_MAX) { + device_printf(fc->dev, + "Physical memory size of 0x%jx exceeds " + "fire wire address space. Limiting dma " + "to memory below 0x%jx\n", + (uintmax_t)Maxmem << PAGE_SHIFT, + (uintmax_t)OHCI_PREQUPPER_MAX << 16); + prequpper = OHCI_PREQUPPER_MAX; + } + OWRITE(sc, OHCI_PREQUPPER, prequpper & 0xffffffff); } /* Set ATRetries register */ OWRITE(sc, OHCI_ATRETRY, 1<<(13 + 16) | 0xfff); @@ -2171,7 +2181,7 @@ fwohci_rbuf_update(struct fwohci_softc * struct fw_bulkxfer *chunk; struct fw_xferq *ir; uint32_t stat; - int s, w = 0, ldesc; + int w = 0, ldesc; ir = fc->ir[dmach]; ldesc = sc->ir[dmach].ndesc - 1; @@ -2179,7 +2189,6 @@ fwohci_rbuf_update(struct fwohci_softc * #if 0 dump_db(sc, dmach); #endif - s = splfw(); if ((ir->flag & FWXFERQ_HANDLER) == 0) FW_GLOCK(fc); fwdma_sync_multiseg_all(sc->ir[dmach].am, BUS_DMASYNC_POSTREAD); @@ -2218,7 +2227,6 @@ fwohci_rbuf_update(struct fwohci_softc * } if ((ir->flag & FWXFERQ_HANDLER) == 0) FW_GUNLOCK(fc); - splx(s); if (w == 0) return; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:11:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D348CF47; Wed, 21 Jan 2015 20:11:03 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEB1892; Wed, 21 Jan 2015 20:11:03 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id v8so34546942qal.7; Wed, 21 Jan 2015 12:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=BFQAAUfCG9RQiwqwCiRFouTHDGduMFou8laiARS74GM=; b=h1z8kXxaDDBZRq4PrCFHjUjvYT9naVLUiJjfXsfimD2ZoBNupcIMk3naIftYecqgyH B9DukKiGdmHB2yC7IXyVapLlrUPSOsEfNBqVNgnmOp3qMd8DU6qadM0Gg/jE4NOCSnK2 gSAOhVre8VPaksDRG9aOA53KOG7fwZIyswdxZ6Icl0n2QUZ7w1HVK8MNAJO1+GMaCJ+Y iBpgXeVNW/98+M4o8MjYKxaXgVzw9OJgor7sXtOndanPdJk7dhrYnxcgMbrTtqmfUINi phze74XTHK3jZ3GLp/TQNOxWX/j0agquXjPmD/qS2EikoeHrDOqcBTGt/vNlQl5dzJPT E9iA== X-Received: by 10.224.121.142 with SMTP id h14mr71963385qar.80.1421871062623; Wed, 21 Jan 2015 12:11:02 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.140.39.209 with HTTP; Wed, 21 Jan 2015 12:10:42 -0800 (PST) In-Reply-To: <201501211904.t0LJ4u3R070278@svn.freebsd.org> References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> From: Ed Maste Date: Wed, 21 Jan 2015 15:10:42 -0500 X-Google-Sender-Auth: XgjtqPk9tAL10sfbMo1lTL4jhSE Message-ID: Subject: Re: svn commit: r277497 - head To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:11:03 -0000 On 21 January 2015 at 14:04, Ed Maste wrote: > > Author: emaste > Date: Wed Jan 21 19:04:55 2015 > New Revision: 277497 > URL: https://svnweb.freebsd.org/changeset/base/277497 > > Log: > Remove addr2line from cross elftoolchain tools list > > It is not required, and there is no reason to install it just because it > came with the binutils cross tools. I left some detail out of this commit message and it confused a couple of people, so to be clear: this doesn't remove addr2line from the world build, only the cross-tools stage. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:12:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 794DE15D; Wed, 21 Jan 2015 20:12:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6556A8A0; Wed, 21 Jan 2015 20:12:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LKCapp005879; Wed, 21 Jan 2015 20:12:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LKCZAd005877; Wed, 21 Jan 2015 20:12:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501212012.t0LKCZAd005877@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 20:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277512 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:12:36 -0000 Author: ian Date: Wed Jan 21 20:12:35 2015 New Revision: 277512 URL: https://svnweb.freebsd.org/changeset/base/277512 Log: Micro-optimize the new arm inline bus_space implementation by grouping all the data the inline functions access together at the start of the bus_space struct. The start-of part isn't so important, it's the grouping-together that's the point: now all the most-accessed data should be in one cache line. Suggested by: cognet Modified: head/sys/arm/arm/bus_space_base.c head/sys/arm/include/bus.h Modified: head/sys/arm/arm/bus_space_base.c ============================================================================== --- head/sys/arm/arm/bus_space_base.c Wed Jan 21 20:08:24 2015 (r277511) +++ head/sys/arm/arm/bus_space_base.c Wed Jan 21 20:12:35 2015 (r277512) @@ -150,7 +150,7 @@ static struct bus_space arm_base_bus_spa .bs_wr_2_s = generic_bs_wr_2, .bs_wr_4_s = generic_bs_wr_4, .bs_wr_8_s = BS_UNIMPLEMENTED, -}; +} __aligned(CACHE_LINE_SIZE); #ifdef FDT bus_space_tag_t fdtbus_bs_tag = &arm_base_bus_space; Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Wed Jan 21 20:08:24 2015 (r277511) +++ head/sys/arm/include/bus.h Wed Jan 21 20:12:35 2015 (r277512) @@ -79,9 +79,27 @@ #define BUS_SPACE_MAP_LINEAR 0x02 #define BUS_SPACE_MAP_PREFETCHABLE 0x04 +/* + * Bus space for ARM. + * + * The functions used most often are grouped together at the beginning to ensure + * that all the data fits into a single cache line. The inline implementations + * of single read/write access these values a lot. + */ struct bus_space { - /* cookie */ - void *bs_privdata; + /* Read/write single and barrier: the most commonly used functions. */ + uint8_t (*bs_r_1)(bus_space_tag_t, bus_space_handle_t, bus_size_t); + uint32_t (*bs_r_4)(bus_space_tag_t, bus_space_handle_t, bus_size_t); + void (*bs_w_1)(bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t); + void (*bs_w_4)(bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint32_t); + void (*bs_barrier)(bus_space_tag_t, bus_space_handle_t, + bus_size_t, bus_size_t, int); + + /* Backlink to parent (if copied), and implementation private data. */ + struct bus_space *bs_parent; + void *bs_privdata; /* mapping/unmapping */ int (*bs_map) (bus_space_tag_t, bus_addr_t, bus_size_t, @@ -97,15 +115,8 @@ struct bus_space { void (*bs_free) (bus_space_tag_t, bus_space_handle_t, bus_size_t); - /* get kernel virtual address */ - /* barrier */ - void (*bs_barrier) (bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, int); - - /* read (single) */ - uint8_t (*bs_r_1) (bus_space_tag_t, bus_space_handle_t, bus_size_t); + /* Read single, the less commonly used functions. */ uint16_t (*bs_r_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t); - uint32_t (*bs_r_4) (bus_space_tag_t, bus_space_handle_t, bus_size_t); uint64_t (*bs_r_8) (bus_space_tag_t, bus_space_handle_t, bus_size_t); /* read multiple */ @@ -128,13 +139,9 @@ struct bus_space { void (*bs_rr_8) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint64_t *, bus_size_t); - /* write (single) */ - void (*bs_w_1) (bus_space_tag_t, bus_space_handle_t, - bus_size_t, uint8_t); + /* Write single, the less commonly used functions. */ void (*bs_w_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint16_t); - void (*bs_w_4) (bus_space_tag_t, bus_space_handle_t, - bus_size_t, uint32_t); void (*bs_w_8) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint64_t); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:20:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30B82381; Wed, 21 Jan 2015 20:20:22 +0000 (UTC) Received: from smtp4.ore.mailhop.org (smtp4.ore.mailhop.org [54.149.240.58]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCDB8FA; Wed, 21 Jan 2015 20:20:21 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YE1l8-0000rc-O0; Wed, 21 Jan 2015 20:20:14 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0LKKEjs063758; Wed, 21 Jan 2015 13:20:14 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX182l9yFJrrwK3vM5Gik1MiT Message-ID: <1421871614.14601.387.camel@freebsd.org> Subject: Re: svn commit: r277497 - head From: Ian Lepore To: Ed Maste Date: Wed, 21 Jan 2015 13:20:14 -0700 In-Reply-To: References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:20:22 -0000 On Wed, 2015-01-21 at 15:10 -0500, Ed Maste wrote: > On 21 January 2015 at 14:04, Ed Maste wrote: > > > > Author: emaste > > Date: Wed Jan 21 19:04:55 2015 > > New Revision: 277497 > > URL: https://svnweb.freebsd.org/changeset/base/277497 > > > > Log: > > Remove addr2line from cross elftoolchain tools list > > > > It is not required, and there is no reason to install it just because it > > came with the binutils cross tools. > > I left some detail out of this commit message and it confused a couple > of people, so to be clear: this doesn't remove addr2line from the > world build, only the cross-tools stage. > This is still not good for me. I use the cross-addr2line tool all the time, and objdump and other such tools. I have many different sandboxes with different arch builds of different freebsd versions, and each one is a self-contained little development world that includes the cross tools that are known to work with that source base. I don't think there's a single addr2line binary I can install that will work with every object on the system. If the time spent building these things is bothering people, maybe we need a WITH_CROSS_BINUTILS knob or something? -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:22:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A40A541; Wed, 21 Jan 2015 20:22:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDFC9AA; Wed, 21 Jan 2015 20:22:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LKMs0Y011244; Wed, 21 Jan 2015 20:22:54 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LKMsul011243; Wed, 21 Jan 2015 20:22:54 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212022.t0LKMsul011243@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277513 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:22:54 -0000 Author: will Date: Wed Jan 21 20:22:53 2015 New Revision: 277513 URL: https://svnweb.freebsd.org/changeset/base/277513 Log: Change 1112791 by kenm@ken.spectrabsd8 on 2015/01/15 16:45:13 Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards. The newer boards don't have the response field that indicates whether the SCSI status byte is present. You have to just look to see whether it is non-zero. The code was looking to see whether the sense length was valid before propagating the SCSI status byte (and sense information) up the stack. With a status like Reservation Conflict, there is no sense information, only the SCSI status byte. So it wasn't getting correctly returned. isp.c: In isp_intr(), if we are on a 2400 or 2500 type board and get a response, look at the actual contents of the SCSI status value and set the RQSF_GOT_STATUS flag accordingly so that return any SCSI status value we get. The RQSF_GOT_SENSE flag will get set later on if there is actual sense information returned. Submitted by: ken MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1112791 on 2015/01/15 Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Jan 21 20:12:35 2015 (r277512) +++ head/sys/dev/isp/isp_freebsd.c Wed Jan 21 20:22:53 2015 (r277513) @@ -5123,19 +5123,34 @@ isp_action(struct cam_sim *sim, union cc break; #endif case XPT_RESET_DEV: /* BDR the specified SCSI device */ + { + struct isp_fc *fc; bus = cam_sim_bus(xpt_path_sim(ccb->ccb_h.path)); tgt = ccb->ccb_h.target_id; tgt |= (bus << 16); + if (IS_FC(isp)) + fc = ISP_FC_PC(isp, bus); + else + fc = NULL; error = isp_control(isp, ISPCTL_RESET_DEV, bus, tgt); if (error) { ccb->ccb_h.status = CAM_REQ_CMP_ERR; } else { + /* + * If we have a FC device, reset the Command + * Reference Number, because the target will expect + * that we re-start the CRN at 1 after a reset. + */ + if (fc != NULL) + isp_fcp_reset_crn(fc, tgt, /*tgt_set*/ 1); + ccb->ccb_h.status = CAM_REQ_CMP; } xpt_done(ccb); break; + } case XPT_ABORT: /* Abort the specified CCB */ { union ccb *accb = ccb->cab.abort_ccb; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:27:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B243E6C7; Wed, 21 Jan 2015 20:27:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0F99D2; Wed, 21 Jan 2015 20:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LKRCCw011846; Wed, 21 Jan 2015 20:27:12 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LKRCGU011845; Wed, 21 Jan 2015 20:27:12 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212027.t0LKRCGU011845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277514 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:27:12 -0000 Author: will Date: Wed Jan 21 20:27:11 2015 New Revision: 277514 URL: https://svnweb.freebsd.org/changeset/base/277514 Log: Force commit to record the correct log for r277513. If the user sends an XPT_RESET_DEV CCB, make sure to reset the Fibre Channel Command Reference Number if we're running on a FC controller. We send a SCSI Target Reset when we get this CCB, and as a result need to reset the CRN to 1 on the next command. isp_freebsd.c: In the XPT_RESET_DEV implementation in isp_action(), reset the CRN if we're on a FC controller. Submitted by: ken MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1112787 on 2015/01/15 Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Jan 21 20:22:53 2015 (r277513) +++ head/sys/dev/isp/isp_freebsd.c Wed Jan 21 20:27:11 2015 (r277514) @@ -29,6 +29,7 @@ */ #include __FBSDID("$FreeBSD$"); + #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:32:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC74D8DE; Wed, 21 Jan 2015 20:32:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9177AAD; Wed, 21 Jan 2015 20:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LKWbVD016020; Wed, 21 Jan 2015 20:32:37 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LKWbbZ016019; Wed, 21 Jan 2015 20:32:37 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501212032.t0LKWbbZ016019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 21 Jan 2015 20:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277515 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:32:38 -0000 Author: will Date: Wed Jan 21 20:32:36 2015 New Revision: 277515 URL: https://svnweb.freebsd.org/changeset/base/277515 Log: Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards. The newer boards don't have the response field that indicates whether the SCSI status byte is present. You have to just look to see whether it is non-zero. The code was looking to see whether the sense length was valid before propagating the SCSI status byte (and sense information) up the stack. With a status like Reservation Conflict, there is no sense information, only the SCSI status byte. So it wasn't getting correctly returned. isp.c: In isp_intr(), if we are on a 2400 or 2500 type board and get a response, look at the actual contents of the SCSI status value and set the RQSF_GOT_STATUS flag accordingly so that return any SCSI status value we get. The RQSF_GOT_SENSE flag will get set later on if there is actual sense information returned. Submitted by: ken MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1112791 on 2015/01/15 Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Jan 21 20:27:11 2015 (r277514) +++ head/sys/dev/isp/isp.c Wed Jan 21 20:32:36 2015 (r277515) @@ -5224,7 +5224,10 @@ again: } scsi_status = sp2->req_scsi_status; completion_status = sp2->req_completion_status; - req_state_flags = 0; + if ((scsi_status & 0xff) != 0) + req_state_flags = RQSF_GOT_STATUS; + else + req_state_flags = 0; resid = sp2->req_resid; } else if (etype == RQSTYPE_RESPONSE) { isp_get_response(isp, (ispstatusreq_t *) hp, sp); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 21:31:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45501394; Wed, 21 Jan 2015 21:31:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 316C998; Wed, 21 Jan 2015 21:31:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LLVR1V043541; Wed, 21 Jan 2015 21:31:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LLVRN9043540; Wed, 21 Jan 2015 21:31:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501212131.t0LLVRN9043540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 21 Jan 2015 21:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277516 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 21:31:27 -0000 Author: ian Date: Wed Jan 21 21:31:26 2015 New Revision: 277516 URL: https://svnweb.freebsd.org/changeset/base/277516 Log: Move the __aligned() declaration to where it will actually do something. Modified: head/sys/arm/arm/bus_space_base.c Modified: head/sys/arm/arm/bus_space_base.c ============================================================================== --- head/sys/arm/arm/bus_space_base.c Wed Jan 21 20:32:36 2015 (r277515) +++ head/sys/arm/arm/bus_space_base.c Wed Jan 21 21:31:26 2015 (r277516) @@ -45,7 +45,7 @@ bs_protos(generic); * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. */ -static struct bus_space arm_base_bus_space = { +static struct bus_space arm_base_bus_space __aligned(CACHE_LINE_SIZE) = { /* privdata is whatever the implementer wants; unused in base tag */ .bs_privdata = NULL, @@ -150,7 +150,7 @@ static struct bus_space arm_base_bus_spa .bs_wr_2_s = generic_bs_wr_2, .bs_wr_4_s = generic_bs_wr_4, .bs_wr_8_s = BS_UNIMPLEMENTED, -} __aligned(CACHE_LINE_SIZE); +}; #ifdef FDT bus_space_tag_t fdtbus_bs_tag = &arm_base_bus_space; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 21:44:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74065733; Wed, 21 Jan 2015 21:44:50 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F03D8275; Wed, 21 Jan 2015 21:44:49 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0LLiket081992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Jan 2015 00:44:46 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0LLijNW081991; Thu, 22 Jan 2015 00:44:45 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 22 Jan 2015 00:44:45 +0300 From: Gleb Smirnoff To: Craig Rodrigues , Nikos Vassiliadis Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150121214445.GL15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150107204631.GG15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150107204631.GG15484@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 21:44:50 -0000 On Wed, Jan 07, 2015 at 11:46:31PM +0300, Gleb Smirnoff wrote: T> On Tue, Jan 06, 2015 at 09:03:04AM +0000, Craig Rodrigues wrote: T> C> Author: rodrigc T> C> Date: Tue Jan 6 09:03:03 2015 T> C> New Revision: 276747 T> C> URL: https://svnweb.freebsd.org/changeset/base/276747 T> C> T> C> Log: T> C> Instead of creating a purge thread for every vnet, create T> C> a single purge thread and clean up all vnets from this thread. T> C> T> C> PR: 194515 T> C> Differential Revision: D1315 T> C> Submitted by: Nikos Vassiliadis T> T> I am not sure that this is a good idea. The core idea of VNETs T> is that they are isolated from each other. If we serialize purging, T> then vnets are strongly affecting each other. T> T> AFAIU, from the PR there is some panic fixed. What is the actual bug T> and why couldn't it be fixed with having per-vnet thread? So, after closer inspection, this commit is a completely messed up. You blindly remove kproc_exit(). What do you think would happen on 'kldunload -f pf'? You removed PF_RULES_RLOCK(). Cool! Now the purging thread doesn't acquire the pf lock. You substitute rw_sleep() with tsleep(). And the latter requires Giant to be held. If you tried your change with INVARIANTS, it would panic immediately. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 21:45:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBE52960; Wed, 21 Jan 2015 21:45:49 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73139284; Wed, 21 Jan 2015 21:45:49 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id f12so34279654qad.10; Wed, 21 Jan 2015 13:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=zn3YlwbWNLxwsPpjyNWpUf2QoxpPlOzy+cgJG2ypob0=; b=F75tVP5iaQvxxismKHc7OQuoU1+kKz7pVqdDgfMs4Qt2d+Ps0mDC09aDFQ54ZrsIWb lEyvL07fxl0vVVKFUMwp7KfOtNGfrHMq7QfQOHuHf5wyFw5BfWao6n7WUSxZBisyGAzz wsvCPn3TMO3F2MqQKyn6FxqQg1Tyb9v2f90lWXdWplZLtJjVg21CjqQybXKOjexGnWjS EXpxDam48LHGbAA3GTAJY/FczfjWDsXXjAVMIAlefSSnyqN+Md2cGJYhkyixVrk98pTN awPCJeSjE99ZfVvKMmgEUq/lzOkWTlpl0Vrs4j31bxGXfdI6eKLikPyI3pFd3yjRQnMX NcqQ== X-Received: by 10.224.121.142 with SMTP id h14mr72848851qar.80.1421876748640; Wed, 21 Jan 2015 13:45:48 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.140.39.209 with HTTP; Wed, 21 Jan 2015 13:45:28 -0800 (PST) In-Reply-To: <1421871614.14601.387.camel@freebsd.org> References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> <1421871614.14601.387.camel@freebsd.org> From: Ed Maste Date: Wed, 21 Jan 2015 16:45:28 -0500 X-Google-Sender-Auth: 6znzmrxtPR-U43sGIVtiOXJJIfk Message-ID: Subject: Re: svn commit: r277497 - head To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 21:45:49 -0000 On 21 January 2015 at 15:20, Ian Lepore wrote: > I don't think > there's a single addr2line binary I can install that will work with > every object on the system. There is, in fact - ELF Tool Chain's addr2line will work regardless of the object's architecture. However, I'm happy enough to revert this change (and add a comment about non-build use cases) if you like. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 21:49:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B08C2C; Wed, 21 Jan 2015 21:49:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1F92F2; Wed, 21 Jan 2015 21:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0LLn3vu049760; Wed, 21 Jan 2015 21:49:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0LLn3CF049759; Wed, 21 Jan 2015 21:49:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501212149.t0LLn3CF049759@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Jan 2015 21:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277517 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 21:49:04 -0000 Author: emaste Date: Wed Jan 21 21:49:03 2015 New Revision: 277517 URL: https://svnweb.freebsd.org/changeset/base/277517 Log: Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL ELF Tool Chain tools need libelf and libdwarf. Submitted by: jmallett (earlier version) Reviewed by: jmallett Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jan 21 21:31:26 2015 (r277516) +++ head/Makefile.inc1 Wed Jan 21 21:49:03 2015 (r277517) @@ -1292,12 +1292,16 @@ _clang_tblgen= \ usr.bin/clang/clang-tblgen .endif +# ELF Tool Chain libraries are needed for ELF tools and dtrace tools. # dtrace tools are required for older bootstrap env and cross-build # pre libdwarf -.if ${MK_CDDL} != "no" && (${BOOTSTRAPPING} < 1100006 \ - || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) -_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ - lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge +.if ${BOOTSTRAPPING} < 1100006 || (${MACHINE} != ${TARGET} || \ + ${MACHINE_ARCH} != ${TARGET_ARCH}) +_elftoolchain_libs= lib/libelf lib/libdwarf +.if ${MK_CDDL} != "no" +_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf cddl/usr.bin/ctfconvert \ + cddl/usr.bin/ctfmerge +.endif .endif # Default to building the GPL DTC, but build the BSDL one if users explicitly @@ -1324,6 +1328,7 @@ bootstrap-tools: .MAKE .for _tool in \ ${_clang_tblgen} \ ${_kerberos5_bootstrap_tools} \ + ${_elftoolchain_libs} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 22:15:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01CFB395; Wed, 21 Jan 2015 22:15:28 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DDB7E8; Wed, 21 Jan 2015 22:15:28 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t0LMFMvh088737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jan 2015 14:15:22 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t0LMFL2H088736; Wed, 21 Jan 2015 14:15:21 -0800 (PST) (envelope-from jmg) Date: Wed, 21 Jan 2015 14:15:21 -0800 From: John-Mark Gurney To: Adrian Chadd Subject: Re: svn commit: r277204 - head/sys/amd64/conf Message-ID: <20150121221520.GY1949@funkthat.com> References: <201501150042.t0F0g7Um018059@svn.freebsd.org> <20150115132303.GA245@zxy.spb.ru> <368B22F3-5607-46F8-B8D2-13CA59E94861@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Wed, 21 Jan 2015 14:15:22 -0800 (PST) Cc: src-committers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Warner Losh , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 22:15:29 -0000 Adrian Chadd wrote this message on Fri, Jan 16, 2015 at 10:43 -0800: > When I've done what you're doing, I end up having these options in my > minimal config file so opt_xxx.h is correctly populated. That way when > I point SYSDIR (or whichever variable it is) at the configured kernel > directory with the opt_xxx.h files, it all works out correctly. > > (I still think we shouldn't be relying on "defaults", but should ship > the opt_xxx.h files or something to derive the opt_xxx.h and makefile > config bits so things like external module building is possible > against a kernel. Or, we just kill all module options that change > behaviour/ABI of things in an incompatible way.) I have the commands that are able to stash the opt files in a kernel section, and then be able to extract them again so that when you build a kernel module it will use the correct options to match the kernel.. This is most useful for things like PAE which have a big impact... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 22:54:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01CEDC61; Wed, 21 Jan 2015 22:54:33 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id B8377BBA; Wed, 21 Jan 2015 22:54:32 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 52D437E839; Thu, 22 Jan 2015 09:54:30 +1100 (EST) Message-ID: <54C02E0C.6060506@freebsd.org> Date: Thu, 22 Jan 2015 09:54:04 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Will Andrews Subject: Re: svn commit: r275832 - head/tools/tools/nanobsd References: <201412161759.sBGHx6ZL016021@svn.freebsd.org> <54BF5A7B.2080601@freebsd.org> <20150121152352.GB38973@sol.firepipe.net> In-Reply-To: <20150121152352.GB38973@sol.firepipe.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org, Will Andrews X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 22:54:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/22/15 02:23, Will Andrews wrote: > On Wed, Jan 21, 2015 at 06:51:23PM +1100, Lawrence Stewart wrote: >> I think this change introduced a bug - I'm seeing nanobsd error >> out with the "NANO_TOOLS directory does not exist" message. >> >> The problem is that NANO_TOOLS is initialised to >> "tools/tools/nanobsd", and you changed the test in nanobsd.sh to >> *not* check for "${NANO_SRC}/${NANO_TOOLS}", which errors out >> except if the cwd is ${NANO_SRC}. >> >> You tweak NANO_TOOLS appropriately in set_defaults_and_export() >> but it's run after the dir test. There are a couple of ways to >> fix but I'll leave it to you to decide which you prefer. > > Will this work for you? > > https://people.freebsd.org/~will/patches/nanobsd.sh.diff > > This also fixes another bug where NANO_PMAKE would be modified too > early. Yes, looks good to me and fixes the issue I reported. Please commit. Cheers, Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJUwC4GXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4RkIyRTlBMzM5RUE3OEExNUUxREI4QTI5 QTUwQkNGQ0Y0MEQ5QjA5AAoJEJpQvPz0DZsJ40QP+gOt9Sl11w5jLOxwfEYYKNCb AjFkwhpmbAlpLMFR7OR7DvlRG6svHaO7RzK7pTbEHID3igdSx3+NRpBE+tyAe8fC dl2hSmGLcGq6007HCGOZGW181tfv9BrRRxKwEXEP7sGhByR5hyFy0JweaLr0TpGb 8CruuZ3hUjDEaTMIBPhBaMWMNsWHJy6Qszj3iE8FwFnmMLnC9yXbfKTXP3iT88wd y+Aq86Y5NT4HytcbWOaNa6mvQTsZfxnFIVppN+u3AWpgzhh76HzOgeFKK4Wj32/j eK3v/hi/aSmOaW5AKR10n2ADutjFvMLaHhMVVIOIBTJ6KQ7W38PGR4/sTqbxkAqa AUsTm53Bz9w3fjr4YhNzOtu0nwgcD1LyUJKnwoyUig97BL8Ogphj+I/4rzB150uD dnvgLoqY8Qh2ck0eciFiKZdY9k5t0cpQPNwpRl/L+wssKbdKGg4/0Ob5/fy9HVkx JrcrkmNyIMpLsN683OMNgvbIB5ow6Ya2cNmJtHVS8N8sJ7/Sd4RYPfEWIk7UUX9b lv+NQm42CyERE98TvE6felmb+iLFF79D2e0wJAis+pbDf8KlMIC3DBjdXls+BEZm 048o1sulxUuo2YMnQHF1sP6bZgeCwI9LslJGlXmLG8WA2oL5I9GJfnkwyD6rbJyx 668QEgpTzhLuAUBXGMT8 =QGdi -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 23:15:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31041362; Wed, 21 Jan 2015 23:15:28 +0000 (UTC) Received: from smtp6.ore.mailhop.org (smtp6.ore.mailhop.org [54.149.35.133]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9BEDB0; Wed, 21 Jan 2015 23:15:27 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp6.ore.mailhop.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YE39P-0007WJ-R3; Wed, 21 Jan 2015 21:49:23 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0LLnKXb064488; Wed, 21 Jan 2015 14:49:20 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1/oCugHKej9yN9Vkikf17Bn Message-ID: <1421876960.14601.390.camel@freebsd.org> Subject: Re: svn commit: r277497 - head From: Ian Lepore To: Ed Maste Date: Wed, 21 Jan 2015 14:49:20 -0700 In-Reply-To: References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> <1421871614.14601.387.camel@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 23:15:28 -0000 On Wed, 2015-01-21 at 16:45 -0500, Ed Maste wrote: > On 21 January 2015 at 15:20, Ian Lepore wrote: > > I don't think > > there's a single addr2line binary I can install that will work with > > every object on the system. > > There is, in fact - ELF Tool Chain's addr2line will work regardless of > the object's architecture. > > However, I'm happy enough to revert this change (and add a comment > about non-build use cases) if you like. Do you mean the new one you're working on? Because that doesn't seem to be true of the one installed on my 10-stable system right now. If it is true of the new one, that's a much better solution, and I can get by until it's ready for prime time, I think. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 23:38:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8C98C19; Wed, 21 Jan 2015 23:38:48 +0000 (UTC) Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8070C6A; Wed, 21 Jan 2015 23:38:48 +0000 (UTC) Received: by mail-yk0-f174.google.com with SMTP id 131so8517013ykp.5; Wed, 21 Jan 2015 15:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8OMk8ZyDfJ5iO/5a42lN/FX2AkyFpSu+phMwURKEdEs=; b=WAsICYQVdpdartmx30WHMILlMN8OdxxEwLIBIsvbre2Vs4EV5x0OSKwaNvGK2lPXLe SIx1+zLlIArAKY9XOqeA11wbswRAC/6fVQ+E0uaML51h3AnZ3JfG906ijf1nIDqsuzKM gDi6E+rSRk/668ou69Smq8zIAR70T2vf4aUkLAurHmOee4hbN6uOr3k7GdTKJoWpM7BC tEsLV/iFMRkr253ITqTlD4emmdjjYU1UYQB8oP2N8kLtizZ3Oa7Yd6fcMVmkkSYFtSVi xuUP0iTmV48fkErLsLCSpHCGYVvzHJGLDujSq2CeluQRP22oW00MHkHTT4oUGeOyTA1I BJcw== MIME-Version: 1.0 X-Received: by 10.170.44.4 with SMTP id 4mr5972319ykm.101.1421883527531; Wed, 21 Jan 2015 15:38:47 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Wed, 21 Jan 2015 15:38:47 -0800 (PST) In-Reply-To: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> Date: Wed, 21 Jan 2015 15:38:47 -0800 X-Google-Sender-Auth: vW1M_N2egVIk1Uym597yF86LjyU Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 23:38:48 -0000 > They originally found that things were spinning for way too long. > > Hans found something similar and determined/concluded that the > migration code in callouts was racy-by-design and dramatically > simplified it and also put very hard constraints on what is a valid > situation to support migrating from one callwheel to another. Now we > have fallout which we can either address or back out until the callout > stuff is again reviewed/fixed. > > I don't think it's as alchemic as is being promoted. Let's not get drawn into semantic debates. To me alchemy implies voodoo debugging, whereas this is, in part, disabling functionality that exposes races - which is more like disabling preemption or fine grained locking. Normally I would advocate backing this out on the basis of precedence. That is to say, back it out so that developers will get it right the first time. However, it appears that hps@ and some others don't understand what was done wrong. So I'm going to state some basic premises and then the implied basic guidelines required of a commit that were not met. If these guidelines are violated by a change in the future I will agitate for a rapid back out. Premises: A) A performance regression is a bug every bit as much as a locking race. Stability OR performance (where we are talking about _current_ performance) is a false dichotomy. - This means that a change that fixes a bug by introducing a substantial performance regression does not constitute a fix. B) Existing behavior and performance characteristics should not be adversely changed unless there is widespread consensus. - Sometimes it is necessary to "break" a KPI but that should not be discovered by svn or scanning back through the mailing lists. Guidelines: A) Performance should not measurably regress. B) If a KPI changes behavior e.g. callout_reset_on being crippled, all clients need to be updated so that they maintain their current behavior by the committer changing the KPI. The client code maintainers aren't responsible for reacting to these types of changes. That is OK for marginal architectures like sun4v or pc98. C) If there is a non-zero possibility that these changes break the client code, committers who have touched that code in the last few years should be notified. HPS: Your change failed to meet these guidelines. Some of us are upset because these guidelines are fairly fundamental for the on-going viability of FreeBSD. Due to linguistic / time zone / cultural differences these expectations have not been adequately communicated to you. You are not in the USB sandbox where others need for your support outweighs the inconvenience of random breakage. It sounds like you are making progress towards updating the concerns that have been voiced. If kib's observations are in fact comprehensive then adding a callout_init_cpu function and updating all clients so that their callouts continue to be scheduled on a CPU other than the BSP will suffice and we can all move on. Thanks in advance. -K From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:02:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 896061E1 for ; Thu, 22 Jan 2015 00:02:24 +0000 (UTC) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFCB366 for ; Thu, 22 Jan 2015 00:02:24 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so4382307pad.7 for ; Wed, 21 Jan 2015 16:02:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=pj+XAipv+1zDq0JT5C57Pi51xsjzZwF2Z0ubn1i6TkM=; b=mbTelq5oyl1yQdyCtPrXxPgiv37nSSZGeiL6aLNANZTKsKpJvXi+DG4Azrpv6b4kin +UdAOX/Aq7MxboyGpYTutsO1g00ALF2UIGpNnSuAlQ8HMrwr9Cmo9fVSkO0XQKOGXtHK 0L23NeDEGUmY3JWgHQyCb7CyiXrgSzHp1uxoRGtLsXDoFI5fNimVC2aK/vmI5egxqfI6 ZfT4gKKxJ7pagO5cjlz976SkqogtwGdJLbifDPW3wPmwynSiZ6+UMPL32SRxIO6vqAZ+ NoDp/gOCtAdCHzeCQSaaiAcxdQJbsLT7uVnNi6Wo9coWWU0bw7WiV871qLiSSgJq3nnt IeNw== X-Gm-Message-State: ALoCoQkVm7NSg5ZO+9ucQxYt6yQjzIGaR92LOYqTA5zfK7wo4H0RTIDzfr5MAX9aB+clt+dO7EuJ X-Received: by 10.70.46.69 with SMTP id t5mr32605830pdm.167.1421884937743; Wed, 21 Jan 2015 16:02:17 -0800 (PST) Received: from bsdimp.corp.netflix.com ([69.53.237.72]) by mx.google.com with ESMTPSA id zk9sm7410858pac.1.2015.01.21.16.02.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 16:02:17 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Warner Losh In-Reply-To: Date: Wed, 21 Jan 2015 17:02:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> To: "K. Macy" X-Mailer: Apple Mail (2.1993) X-Mailman-Approved-At: Thu, 22 Jan 2015 00:05:04 +0000 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:02:24 -0000 > On Jan 21, 2015, at 4:38 PM, K. Macy wrote: >=20 >> They originally found that things were spinning for way too long. >>=20 >> Hans found something similar and determined/concluded that the >> migration code in callouts was racy-by-design and dramatically >> simplified it and also put very hard constraints on what is a valid >> situation to support migrating from one callwheel to another. Now we >> have fallout which we can either address or back out until the = callout >> stuff is again reviewed/fixed. >>=20 >> I don't think it's as alchemic as is being promoted. >=20 >=20 > Let's not get drawn into semantic debates. To me alchemy implies > voodoo debugging, whereas this is, in part, disabling functionality > that exposes races - which is more like disabling preemption or fine > grained locking. >=20 >=20 > Normally I would advocate backing this out on the basis of precedence. > That is to say, back it out so that developers will get it right the > first time. However, it appears that hps@ and some others don't > understand what was done wrong. So I'm going to state some basic > premises and then the implied basic guidelines required of a commit > that were not met. If these guidelines are violated by a change in the > future I will agitate for a rapid back out. >=20 > Premises: > A) A performance regression is a bug every bit as much as a locking > race. Stability OR performance (where we are talking about _current_ > performance) is a false dichotomy. > - This means that a change that fixes a bug by introducing a > substantial performance regression does not constitute a fix. > B) Existing behavior and performance characteristics should not be > adversely changed unless there is widespread consensus. > - Sometimes it is necessary to "break" a KPI but that should not be > discovered by svn or scanning back through the mailing lists. >=20 > Guidelines: > A) Performance should not measurably regress. > B) If a KPI changes behavior e.g. callout_reset_on being crippled, all > clients need to be updated so that they maintain their current > behavior by the committer changing the KPI. The client code > maintainers aren't responsible for reacting to these types of changes. > That is OK for marginal architectures like sun4v or pc98. > C) If there is a non-zero possibility that these changes break the > client code, committers who have touched that code in the last few > years should be notified. >=20 >=20 >=20 > HPS: Your change failed to meet these guidelines. Some of us are upset > because these guidelines are fairly fundamental for the on-going > viability of FreeBSD. Due to linguistic / time zone / cultural > differences these expectations have not been adequately communicated > to you. You are not in the USB sandbox where others need for your > support outweighs the inconvenience of random breakage. >=20 > It sounds like you are making progress towards updating the concerns > that have been voiced. If kib's observations are in fact comprehensive > then adding a callout_init_cpu function and updating all clients so > that their callouts continue to be scheduled on a CPU other than the > BSP will suffice and we can all move on. Is there some reason that we can=E2=80=99t back things out, break things = down into smaller pieces and have everything pass through phabric with a wide ranging review? Given the fundamental nature of these changes, they really need better review and doing it after the fact seems to be to be too risky. I=E2=80=99m not debating that this =E2=80=9Cfixes=E2=80=9D = some issues, but given the performance regression, it sure seems like we may need a different solution to be implemented and hashing that out in a branch might be the best approach. Warner= From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:07:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 407194A1; Thu, 22 Jan 2015 00:07:58 +0000 (UTC) Received: from mail-yh0-x22d.google.com (mail-yh0-x22d.google.com [IPv6:2607:f8b0:4002:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E356C3BC; Thu, 22 Jan 2015 00:07:57 +0000 (UTC) Received: by mail-yh0-f45.google.com with SMTP id f73so2901034yha.4; Wed, 21 Jan 2015 16:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fukvA1q/YeADEtLNqJTfgyJEmkIYtYCZ4eQ6fLn0/ik=; b=apKb45UF5fpyZIfSIUinZQB62x9qTY8Yov+ssvi3IhI+ztrGkYB9cjwqipafZI78Yc K8/JoIJVEHTZ2t0s0vB+DI8UnjswiybLPT+QQtbP0M6ctRYqs5KESe9KFq2R/zm+hzer TMJYLQqr39sZ9tYHZNFl1Y8KW8/GAOBhVS6kKEthJXy6MclO6IjIN4N3MHSqptiGF55Y o2nc30BSYfmjTI3OU9jfkBzK1OH0us/bSAFoLC10uYMXOITfQ/6VSEFPuHuxEMcoZoR+ jMKeh2la3THMSLL0BoF7CVuaUO6WD5YluwoPbxY3dyVpFtJ1ITrn3B6BFMTXpxEipZnp 7Daw== MIME-Version: 1.0 X-Received: by 10.236.89.172 with SMTP id c32mr25542433yhf.180.1421885277211; Wed, 21 Jan 2015 16:07:57 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Wed, 21 Jan 2015 16:07:56 -0800 (PST) In-Reply-To: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> Date: Wed, 21 Jan 2015 16:07:56 -0800 X-Google-Sender-Auth: 1mSp0xxZeT3LeBdmW3KqM8Uch9o Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Thu, 22 Jan 2015 00:11:48 +0000 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:07:58 -0000 >> HPS: Your change failed to meet these guidelines. Some of us are upset >> because these guidelines are fairly fundamental for the on-going >> viability of FreeBSD. Due to linguistic / time zone / cultural >> differences these expectations have not been adequately communicated >> to you. You are not in the USB sandbox where others need for your >> support outweighs the inconvenience of random breakage. >> >> It sounds like you are making progress towards updating the concerns >> that have been voiced. If kib's observations are in fact comprehensive >> then adding a callout_init_cpu function and updating all clients so >> that their callouts continue to be scheduled on a CPU other than the >> BSP will suffice and we can all move on. > > Is there some reason that we can=E2=80=99t back things out, break things = down into > smaller pieces and have everything pass through phabric with a wide > ranging review? Given the fundamental nature of these changes, they > really need better review and doing it after the fact seems to be to be > too risky. I=E2=80=99m not debating that this =E2=80=9Cfixes=E2=80=9D som= e issues, but given the > performance regression, it sure seems like we may need a different > solution to be implemented and hashing that out in a branch might be > the best approach. Thank you. A more incremental approach would be appreciated by many of us. To avoid the bystander effect we can permit explicit timeouts for review-to-commit (72 hours?) so that we don't collectively end up sandbagging him. -K From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:10:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 957C85E3; Thu, 22 Jan 2015 00:10:45 +0000 (UTC) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4F0649; Thu, 22 Jan 2015 00:10:45 +0000 (UTC) Received: by mail-ig0-f182.google.com with SMTP id r10so3802002igi.3; Wed, 21 Jan 2015 16:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=K/kzEMreSDOBwM0WzGgFAfuFbVTfwTC8BJekt/tkpYc=; b=STNefD+hDhoOh8hvxcfBq1PycvKj9AkwkUCLwb3hkdGzNF7nD8JIiatw/GZ7iq5DSm sgKoYfH9aJLhrdSzKAgimAu7AGqV/rsurkwgl0PICdi+DQqBMzCFSRoMTbflz/a9CaTD gCV05d+ZZv2cAfh628eu/lEvR+awfKuMeP3BVSOs7Q1uLyriafG4zVekaXpb76u7j2cP sMwAJ5zRtuksPtg0389c9dNy61qWB/QksEyjN3mOjz8qU7fEiZycXTT4hRXkZG+xaQ/1 yggkeS+B53rhEsiePjpmZaBMqeZdR9ljfGRMVApB0+xqJNBp141O2Sce73dq42NsrU39 zssA== MIME-Version: 1.0 X-Received: by 10.50.93.70 with SMTP id cs6mr8352863igb.6.1421885444790; Wed, 21 Jan 2015 16:10:44 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Wed, 21 Jan 2015 16:10:44 -0800 (PST) In-Reply-To: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> Date: Wed, 21 Jan 2015 16:10:44 -0800 X-Google-Sender-Auth: 7huVFJe-f74X7tadH_R4yALEr8k Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Adrian Chadd To: "K. Macy" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Thu, 22 Jan 2015 00:21:28 +0000 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:10:45 -0000 On 21 January 2015 at 16:07, K. Macy wrote: >>> HPS: Your change failed to meet these guidelines. Some of us are upset >>> because these guidelines are fairly fundamental for the on-going >>> viability of FreeBSD. Due to linguistic / time zone / cultural >>> differences these expectations have not been adequately communicated >>> to you. You are not in the USB sandbox where others need for your >>> support outweighs the inconvenience of random breakage. >>> >>> It sounds like you are making progress towards updating the concerns >>> that have been voiced. If kib's observations are in fact comprehensive >>> then adding a callout_init_cpu function and updating all clients so >>> that their callouts continue to be scheduled on a CPU other than the >>> BSP will suffice and we can all move on. >> >> Is there some reason that we can=E2=80=99t back things out, break things= down into >> smaller pieces and have everything pass through phabric with a wide >> ranging review? Given the fundamental nature of these changes, they >> really need better review and doing it after the fact seems to be to be >> too risky. I=E2=80=99m not debating that this =E2=80=9Cfixes=E2=80=9D so= me issues, but given the >> performance regression, it sure seems like we may need a different >> solution to be implemented and hashing that out in a branch might be >> the best approach. > > Thank you. A more incremental approach would be appreciated by many of > us. To avoid the bystander effect we can permit explicit timeouts for > review-to-commit (72 hours?) so that we don't collectively end up > sandbagging him. I'm +1 for this. -a From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:35:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF94AD6; Thu, 22 Jan 2015 00:35:26 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 043D8894; Thu, 22 Jan 2015 00:35:26 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id f12so34825194qad.10; Wed, 21 Jan 2015 16:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MhT0VQiX6AD1Zg/8K2EiPaJg6r4yZOd0Gsb5sw3Ana8=; b=hBuyfWcqrNdI+8+XL69qTdYZgRmcFZeLD1kPx/CJsHRT8Xf0ySj6iGqXMDCOwjCgEY jxdCtzG0m7uamLlYunyPa4ks+cUzoCSLg7A8ddFJTzO6FLRG+3VTqlVJCpoixN29LUn0 pE8Nts8uReh6TsjOmJPZvhIYm1h1UCU0eqrehMh6Tl6OAMkTqi4P8w3aJzSsZC7Fr2Eg Cfck4hzeEBYkTwf1r7vy5Sq/0NthFWlXINyBJtnAumeSpdisYOJUcg07+3XdgTMyv/8K k7sziZKFuPsPzeVUlKAGdVwMIii126TL2AuxxqRQfWXE5oI0fxWX1mECj2iMHL0KpDFD Tang== X-Received: by 10.224.65.134 with SMTP id j6mr55807366qai.90.1421886925190; Wed, 21 Jan 2015 16:35:25 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.140.39.209 with HTTP; Wed, 21 Jan 2015 16:35:04 -0800 (PST) In-Reply-To: <1421876960.14601.390.camel@freebsd.org> References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> <1421871614.14601.387.camel@freebsd.org> <1421876960.14601.390.camel@freebsd.org> From: Ed Maste Date: Wed, 21 Jan 2015 19:35:04 -0500 X-Google-Sender-Auth: fSHKJYlV9Apg8E2slmNbQZkL6Ms Message-ID: Subject: Re: svn commit: r277497 - head To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:35:26 -0000 On 21 January 2015 at 16:49, Ian Lepore wrote: > On Wed, 2015-01-21 at 16:45 -0500, Ed Maste wrote: >> On 21 January 2015 at 15:20, Ian Lepore wrote: >> > I don't think >> > there's a single addr2line binary I can install that will work with >> > every object on the system. >> >> There is, in fact - ELF Tool Chain's addr2line will work regardless of >> the object's architecture. >> >> However, I'm happy enough to revert this change (and add a comment >> about non-build use cases) if you like. > > Do you mean the new one you're working on? Because that doesn't seem to > be true of the one installed on my 10-stable system right now. If it is > true of the new one, that's a much better solution, and I can get by > until it's ready for prime time, I think. Yes, the new one I've been working on. It's now the default in HEAD (along with nm, strings, size, etc.). Bringing this to stable/10 would be tricky because it depends on the new libdwarf in 11 that's not backwards compatible. For that reason perhaps I ought to just leave them in the cross-tools stage, until we can assume developers are generally cross building from an 11.x host. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:43:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65BD7E67 for ; Thu, 22 Jan 2015 00:43:34 +0000 (UTC) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338C8977 for ; Thu, 22 Jan 2015 00:43:33 +0000 (UTC) Received: by mail-pd0-f171.google.com with SMTP id fp1so31563405pdb.2 for ; Wed, 21 Jan 2015 16:43:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=bI0RwZXnBwP4gmat1mzhpDA7KxBSoogwVmkmMPyrvys=; b=QO7pIYBPeN87kYYYiXbqGsLubMtqaVeqXS3o/mM3J+LPwYevyU/SiA7StirH15sP0K OxLCJWY+iYMAOvhG+d2qS08zLsEPcIczpgwty8yj3+tPPseg4LuOrGPGnQlZNezbHfnY bSRV/6ZWfthm89h6PIGgnYgbgYxfapoz1OVGMQtIsdWuqsSRo2crCqqbtoV/JSAVwpV1 yCnqfKruQB5GW6OeLjZaKbr1wsEtUO1TJBafWfAvUyPrGYGm18WE+xKhnjKqaZCoXIy2 LUe+3Qnbh4blruqrak0vTpLxa6qKVfSxn7lci/0Usg7MxrkYU929oN5HL+48QTa4G6XM Sstw== X-Gm-Message-State: ALoCoQmpxE0Rmo4TNuvRHfAqRW0LoU8roT/igmFZ7tAh1PUVAT9SjcaxmrXzAncc32pf7Vl/wEz4 X-Received: by 10.67.10.227 with SMTP id ed3mr66398179pad.116.1421887413364; Wed, 21 Jan 2015 16:43:33 -0800 (PST) Received: from bsdimp.corp.netflix.com ([69.53.237.72]) by mx.google.com with ESMTPSA id ak5sm7369233pad.44.2015.01.21.16.43.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 16:43:32 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277497 - head From: Warner Losh In-Reply-To: Date: Wed, 21 Jan 2015 17:43:31 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3F018B96-1D7A-40BA-B592-C7DB4505F807@bsdimp.com> References: <201501211904.t0LJ4u3R070278@svn.freebsd.org> <1421871614.14601.387.camel@freebsd.org> <1421876960.14601.390.camel@freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.1993) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:43:34 -0000 > On Jan 21, 2015, at 5:35 PM, Ed Maste wrote: >=20 > On 21 January 2015 at 16:49, Ian Lepore wrote: >> On Wed, 2015-01-21 at 16:45 -0500, Ed Maste wrote: >>> On 21 January 2015 at 15:20, Ian Lepore wrote: >>>> I don't think >>>> there's a single addr2line binary I can install that will work with >>>> every object on the system. >>>=20 >>> There is, in fact - ELF Tool Chain's addr2line will work regardless = of >>> the object's architecture. >>>=20 >>> However, I'm happy enough to revert this change (and add a comment >>> about non-build use cases) if you like. >>=20 >> Do you mean the new one you're working on? Because that doesn't seem = to >> be true of the one installed on my 10-stable system right now. If it = is >> true of the new one, that's a much better solution, and I can get by >> until it's ready for prime time, I think. >=20 > Yes, the new one I've been working on. It's now the default in HEAD > (along with nm, strings, size, etc.). >=20 > Bringing this to stable/10 would be tricky because it depends on the > new libdwarf in 11 that's not backwards compatible. For that reason > perhaps I ought to just leave them in the cross-tools stage, until we > can assume developers are generally cross building from an 11.x host. There=E2=80=99s little harm in leaving it in, and some harm in taking it = out=E2=80=A6 The time to build this stuff is tiny... Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 00:52:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD5E625C; Thu, 22 Jan 2015 00:52:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98F26A65; Thu, 22 Jan 2015 00:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M0qZ7r040500; Thu, 22 Jan 2015 00:52:35 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M0qZMA040499; Thu, 22 Jan 2015 00:52:35 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501220052.t0M0qZMA040499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 22 Jan 2015 00:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277518 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 00:52:35 -0000 Author: will Date: Thu Jan 22 00:52:34 2015 New Revision: 277518 URL: https://svnweb.freebsd.org/changeset/base/277518 Log: Enable nanobsd.sh to be executed when pwd != NANO_SRC. While here, fix a bug in which NANO_PMAKE would not be appended at the appropriate time. Simply move both checks to after the call to set_defaults_and_export(). Tested by: lstewart Sponsored by: Spectra Logic Modified: head/tools/tools/nanobsd/nanobsd.sh (contents, props changed) Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Wed Jan 21 21:49:03 2015 (r277517) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Jan 22 00:52:34 2015 (r277518) @@ -121,6 +121,13 @@ if [ $# -gt 0 ] ; then usage fi +####################################################################### +# And then it is as simple as that... + +# File descriptor 3 is used for logging output, see pprint +exec 3>&1 +set_defaults_and_export + if [ ! -d "${NANO_TOOLS}" ]; then echo "NANO_TOOLS directory does not exist" 1>&2 exit 1 @@ -130,13 +137,6 @@ if ! $do_clean; then NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" fi -####################################################################### -# And then it is as simple as that... - -# File descriptor 3 is used for logging output, see pprint -exec 3>&1 -set_defaults_and_export - pprint 1 "NanoBSD image ${NANO_NAME} build starting" if $do_world ; then From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 01:05:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E82E473 for ; Thu, 22 Jan 2015 01:05:00 +0000 (UTC) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA1E6B6F for ; Thu, 22 Jan 2015 01:04:59 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id rp18so6210615iec.12 for ; Wed, 21 Jan 2015 17:04:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=OgkRidL8/wFmfsLreu2iaXGK4okeYK7KMA3lxEiKBhc=; b=BDHwrA4fWzRCZ3VPCw4NNumyNj7yUveDcy84aThQ4YKXpC6yL2aTAzlDEhAzphqCf1 RUwYhzleLOsrxY+NnkJgv0nUjXpTkILLSf5pIVFadfv9pIFX03f6VlpaFesQCjQV0Q/t tAAEYjgQMvvZP0IG04KAsta8d2XRA/bkaKTMcaPAJEyIyDWbyTQaNwT994AeExbJnVQM f8YVgMOToWGF0+mQZ8MU1VJ9piClkgUrJxJCHvsak317yWmiiF/zwLsZdvpcnRL8QlWO FoXOh4cknm/qPlbudYLAQ3XLZU5FmpgZrA/6QvWusV0S0ArxWyVcUlGThXXd10K8xhq6 X4/Q== X-Gm-Message-State: ALoCoQnk0z0xuyXjdn8Ho9RzEYsePR5QRcx13h5S/rtvIg2kwysJ1AQJLUd0egNCi0R4uzAUSkj0 X-Received: by 10.42.236.81 with SMTP id kj17mr3545657icb.60.1421888691848; Wed, 21 Jan 2015 17:04:51 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id ig15sm956819igb.10.2015.01.21.17.04.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 17:04:51 -0800 (PST) Date: Wed, 21 Jan 2015 18:04:49 -0700 From: Will Andrews To: Lawrence Stewart Subject: Re: svn commit: r275832 - head/tools/tools/nanobsd Message-ID: <20150122010448.GA40031@sol.firepipe.net> References: <201412161759.sBGHx6ZL016021@svn.freebsd.org> <54BF5A7B.2080601@freebsd.org> <20150121152352.GB38973@sol.firepipe.net> <54C02E0C.6060506@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <54C02E0C.6060506@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 01:05:00 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 22, 2015 at 09:54:04AM +1100, Lawrence Stewart wrote: > Yes, looks good to me and fixes the issue I reported. Please commit. Done in r277518. Thanks for the quick test. --=20 wca --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTATK8ACgkQF47idPgWcsVjGQCfUwrX4jmgOV97RXNDw2KnAGcl CLcAn1kv4KCK90aKYGObyzoNXOEfxHRf =JxYV -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 01:05:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA235478 for ; Thu, 22 Jan 2015 01:05:00 +0000 (UTC) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B21BB73 for ; Thu, 22 Jan 2015 01:05:00 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id eu11so22097728pac.13 for ; Wed, 21 Jan 2015 17:04:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=hwPEmUo/aCZCuNxemfa4vVsAHwT3NpS1ZR44jRXBNm4=; b=U6t6SUeDGUyy3r84dWZIFj2raAqMpB0FwjfF09S8eKTnK30AAKSVt4QHpj3bY6PqtW 3VI0mdjGVQNOE3mksoX541oycTEtFIA+G7VLTyymdgKY4Bb9RpKngT6Uzp0hdHoCB2Kc 5OsNDUd6NPABuLhNtSBL6IOuLmC127EQeF3/qdMMveze75uU3diVL3oclZtdc3FTGQz3 A87AmUOU+JN5x8TX6/VfP5JE1RPyBPw4O56Dp35AYtsZ0uU8ZOY9ymWwqJ4EO8KFCjWK Etwp1ROJX9ve5cxYfc+Kiu4ifizzwM65+1rfpoSCBUWvobSZHWS+7GpflnyaKhv+Ket+ 5nfw== X-Gm-Message-State: ALoCoQmLuwQZN5k6y3WRSTif4FDKaQsg5dvc4/o/fcSxNY/HwISHjYigQIO9Bfejb8KvfL1SOarm X-Received: by 10.66.163.228 with SMTP id yl4mr41048675pab.51.1421888699651; Wed, 21 Jan 2015 17:04:59 -0800 (PST) Received: from bsdimp.corp.netflix.com ([69.53.237.72]) by mx.google.com with ESMTPSA id kg12sm7086883pbb.44.2015.01.21.17.04.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 17:04:59 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc From: Warner Losh In-Reply-To: <20150121075410.GM42409@kib.kiev.ua> Date: Wed, 21 Jan 2015 18:04:57 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <81FEE3A9-C522-48A3-9292-893685C640AF@bsdimp.com> References: <201501201621.t0KGLx26096724@svn.freebsd.org> <20150120191438.GL42409@kib.kiev.ua> <54BF240C.2090107@freebsd.org> <20150121075410.GM42409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 01:05:00 -0000 > On Jan 21, 2015, at 12:54 AM, Konstantin Belousov = wrote: >=20 > On Tue, Jan 20, 2015 at 07:59:08PM -0800, Nathan Whitehorn wrote: >>=20 >> On 01/20/15 11:14, Konstantin Belousov wrote: >>> On Tue, Jan 20, 2015 at 04:21:59PM +0000, Nathan Whitehorn wrote: >>>> Author: nwhitehorn >>>> Date: Tue Jan 20 16:21:59 2015 >>>> New Revision: 277421 >>>> URL: https://svnweb.freebsd.org/changeset/base/277421 >>>>=20 >>>> Log: >>>> There does not seem to be any reason to acquire GIANT here. = Follow amd64 >>>> in removing it. >>>>=20 >>>> MFC after: 1 month >>>>=20 >>>> Modified: >>>> head/sys/powerpc/powerpc/mem.c >>>>=20 >>>> Modified: head/sys/powerpc/powerpc/mem.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 = (r277420) >>>> +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 = (r277421) >>>> @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, >>>> cnt =3D 0; >>>> error =3D 0; >>>>=20 >>>> - GIANT_REQUIRED; >>>> - >>> This is not an acquisition, to be pedantic. Really, it is cdevsw = which >>> has D_NEEDGIANT flag which acquires Giant. After architectures get >>> rid of GIANT_REQUIRED, flag can be removed. >>>=20 >> Just so I understand, you are not objecting to this commit, right? > Absolutely not, this is the right thing to do. >=20 >> Just=20 >> pointing out that (a) my commit message was wrong and that (b) once = all=20 >> architectures make this change (presumably more involved) we can get = rid=20 >> of the D_NEEDGIANT in /sys/dev/mem/memdev.c? > Exactly. There doesn=E2=80=99t seem to be a reason for i386 either. Was just = looking at the code today on the plane for unrelated reasons. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 01:23:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 004309F3; Thu, 22 Jan 2015 01:23:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF214D3E; Thu, 22 Jan 2015 01:23:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M1NIQO054680; Thu, 22 Jan 2015 01:23:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M1NHlC054673; Thu, 22 Jan 2015 01:23:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201501220123.t0M1NHlC054673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 22 Jan 2015 01:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277519 - in head/sys: net netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 01:23:19 -0000 Author: glebius Date: Thu Jan 22 01:23:16 2015 New Revision: 277519 URL: https://svnweb.freebsd.org/changeset/base/277519 Log: Back out r276841, r276756, r276747, r276746. The change in r276747 is very very questionable, since it makes vimages more dependent on each other. But the reason for the backout is that it screwed up shutting down the pf purge threads, and now kernel immedially panics on pf module unload. Although module unloading isn't an advertised feature of pf, it is very important for development process. I'd like to not backout r276746, since in general it is good. But since it has introduced numerous build breakages, that later were addressed in r276841, r276756, r276747, I need to back it out as well. Better replay it in clean fashion from scratch. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_if.c head/sys/netpfil/pf/pf_ioctl.c head/sys/netpfil/pf/pf_norm.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/net/pfvar.h Thu Jan 22 01:23:16 2015 (r277519) @@ -829,6 +829,7 @@ typedef int pflog_packet_t(struct pfi_ki struct pf_ruleset *, struct pf_pdesc *, int); extern pflog_packet_t *pflog_packet_ptr; +#define V_pf_end_threads VNET(pf_end_threads) #endif /* _KERNEL */ #define PFSYNC_FLAG_SRCNODE 0x04 @@ -1494,7 +1495,7 @@ VNET_DECLARE(struct pf_altqqueue *, pf_ VNET_DECLARE(struct pf_rulequeue, pf_unlinked_rules); #define V_pf_unlinked_rules VNET(pf_unlinked_rules) -void pf_vnet_initialize(void); +void pf_initialize(void); void pf_mtag_initialize(void); void pf_mtag_cleanup(void); void pf_cleanup(void); @@ -1586,7 +1587,7 @@ int pf_match_addr_range(struct pf_addr * struct pf_addr *, sa_family_t); int pf_match_port(u_int8_t, u_int16_t, u_int16_t, u_int16_t); -void pf_vnet_normalize_init(void); +void pf_normalize_init(void); void pf_normalize_cleanup(void); int pf_normalize_ip(struct mbuf **, int, struct pfi_kif *, u_short *, struct pf_pdesc *); @@ -1648,7 +1649,7 @@ MALLOC_DECLARE(PFI_MTYPE); VNET_DECLARE(struct pfi_kif *, pfi_all); #define V_pfi_all VNET(pfi_all) -void pfi_vnet_initialize(void); +void pfi_initialize(void); void pfi_cleanup(void); void pfi_kif_ref(struct pfi_kif *); void pfi_kif_unref(struct pfi_kif *); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/netpfil/pf/pf.c Thu Jan 22 01:23:16 2015 (r277519) @@ -151,7 +151,6 @@ static VNET_DEFINE(struct pf_send_head, #define V_pf_sendqueue VNET(pf_sendqueue) static struct mtx pf_sendqueue_mtx; -MTX_SYSINIT(pf_sendqueue_mtx, &pf_sendqueue_mtx, "pf send queue", MTX_DEF); #define PF_SENDQ_LOCK() mtx_lock(&pf_sendqueue_mtx) #define PF_SENDQ_UNLOCK() mtx_unlock(&pf_sendqueue_mtx) @@ -173,15 +172,11 @@ static VNET_DEFINE(struct task, pf_overl #define V_pf_overloadtask VNET(pf_overloadtask) static struct mtx pf_overloadqueue_mtx; -MTX_SYSINIT(pf_overloadqueue_mtx, &pf_overloadqueue_mtx, - "pf overload/flush queue", MTX_DEF); #define PF_OVERLOADQ_LOCK() mtx_lock(&pf_overloadqueue_mtx) #define PF_OVERLOADQ_UNLOCK() mtx_unlock(&pf_overloadqueue_mtx) VNET_DEFINE(struct pf_rulequeue, pf_unlinked_rules); struct mtx pf_unlnkdrules_mtx; -MTX_SYSINIT(pf_unlnkdrules_mtx, &pf_unlnkdrules_mtx, "pf unlinked rules", - MTX_DEF); static VNET_DEFINE(uma_zone_t, pf_sources_z); #define V_pf_sources_z VNET(pf_sources_z) @@ -295,6 +290,8 @@ static void pf_route6(struct mbuf **, int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len); +VNET_DECLARE(int, pf_end_threads); + VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); #define PACKET_LOOPED(pd) ((pd)->pf_mtag && \ @@ -731,7 +728,7 @@ pf_mtag_initialize() /* Per-vnet data storage structures initialization. */ void -pf_vnet_initialize() +pf_initialize() { struct pf_keyhash *kh; struct pf_idhash *ih; @@ -791,9 +788,13 @@ pf_vnet_initialize() STAILQ_INIT(&V_pf_sendqueue); SLIST_INIT(&V_pf_overloadqueue); TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, curvnet); + mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); + mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, + MTX_DEF); /* Unlinked, but may be referenced rules. */ TAILQ_INIT(&V_pf_unlinked_rules); + mtx_init(&pf_unlnkdrules_mtx, "pf unlinked rules", NULL, MTX_DEF); } void @@ -836,6 +837,10 @@ pf_cleanup() free(pfse, M_PFTEMP); } + mtx_destroy(&pf_sendqueue_mtx); + mtx_destroy(&pf_overloadqueue_mtx); + mtx_destroy(&pf_unlnkdrules_mtx); + uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); @@ -1381,37 +1386,71 @@ pf_intr(void *v) } void -pf_purge_thread(void *v __unused) +pf_purge_thread(void *v) { u_int idx = 0; - VNET_ITERATOR_DECL(vnet_iter); + + CURVNET_SET((struct vnet *)v); for (;;) { - tsleep(pf_purge_thread, PWAIT, "pftm", hz / 10); - VNET_LIST_RLOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - /* Process 1/interval fraction of the state table every run. */ - idx = pf_purge_expired_states(idx, pf_hashmask / - (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); + PF_RULES_RLOCK(); + rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftm", hz / 10); - /* Purge other expired types every PFTM_INTERVAL seconds. */ - if (idx == 0) { - /* - * Order is important: - * - states and src nodes reference rules - * - states and rules reference kifs - */ - pf_purge_expired_fragments(); - pf_purge_expired_src_nodes(); - pf_purge_unlinked_rules(); - pfi_kif_purge(); - } - CURVNET_RESTORE(); + if (V_pf_end_threads) { + /* + * To cleanse up all kifs and rules we need + * two runs: first one clears reference flags, + * then pf_purge_expired_states() doesn't + * raise them, and then second run frees. + */ + PF_RULES_RUNLOCK(); + pf_purge_unlinked_rules(); + pfi_kif_purge(); + + /* + * Now purge everything. + */ + pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_fragments(); + pf_purge_expired_src_nodes(); + + /* + * Now all kifs & rules should be unreferenced, + * thus should be successfully freed. + */ + pf_purge_unlinked_rules(); + pfi_kif_purge(); + + /* + * Announce success and exit. + */ + PF_RULES_RLOCK(); + V_pf_end_threads++; + PF_RULES_RUNLOCK(); + wakeup(pf_purge_thread); + kproc_exit(0); + } + PF_RULES_RUNLOCK(); + + /* Process 1/interval fraction of the state table every run. */ + idx = pf_purge_expired_states(idx, pf_hashmask / + (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); + + /* Purge other expired types every PFTM_INTERVAL seconds. */ + if (idx == 0) { + /* + * Order is important: + * - states and src nodes reference rules + * - states and rules reference kifs + */ + pf_purge_expired_fragments(); + pf_purge_expired_src_nodes(); + pf_purge_unlinked_rules(); + pfi_kif_purge(); } - VNET_LIST_RUNLOCK(); } /* not reached */ + CURVNET_RESTORE(); } u_int32_t Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/netpfil/pf/pf_if.c Thu Jan 22 01:23:16 2015 (r277519) @@ -102,13 +102,10 @@ MALLOC_DEFINE(PFI_MTYPE, "pf_ifnet", "pf LIST_HEAD(pfi_list, pfi_kif); static VNET_DEFINE(struct pfi_list, pfi_unlinked_kifs); #define V_pfi_unlinked_kifs VNET(pfi_unlinked_kifs) - static struct mtx pfi_unlnkdkifs_mtx; -MTX_SYSINIT(pfi_unlnkdkifs_mtx, &pfi_unlnkdkifs_mtx, "pf unlinked interfaces", - MTX_DEF); void -pfi_vnet_initialize(void) +pfi_initialize(void) { struct ifg_group *ifg; struct ifnet *ifp; @@ -117,6 +114,9 @@ pfi_vnet_initialize(void) V_pfi_buffer_max = 64; V_pfi_buffer = malloc(V_pfi_buffer_max * sizeof(*V_pfi_buffer), PFI_MTYPE, M_WAITOK); + + mtx_init(&pfi_unlnkdkifs_mtx, "pf unlinked interfaces", NULL, MTX_DEF); + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); PF_RULES_WLOCK(); V_pfi_all = pfi_kif_attach(kif, IFG_ALL); @@ -129,20 +129,18 @@ pfi_vnet_initialize(void) pfi_attach_ifnet(ifp); IFNET_RUNLOCK(); - if (IS_DEFAULT_VNET(curvnet)) { - pfi_attach_cookie = EVENTHANDLER_REGISTER(ifnet_arrival_event, - pfi_attach_ifnet_event, NULL, EVENTHANDLER_PRI_ANY); - pfi_detach_cookie = EVENTHANDLER_REGISTER(ifnet_departure_event, - pfi_detach_ifnet_event, NULL, EVENTHANDLER_PRI_ANY); - pfi_attach_group_cookie = EVENTHANDLER_REGISTER(group_attach_event, - pfi_attach_group_event, curvnet, EVENTHANDLER_PRI_ANY); - pfi_change_group_cookie = EVENTHANDLER_REGISTER(group_change_event, - pfi_change_group_event, curvnet, EVENTHANDLER_PRI_ANY); - pfi_detach_group_cookie = EVENTHANDLER_REGISTER(group_detach_event, - pfi_detach_group_event, curvnet, EVENTHANDLER_PRI_ANY); - pfi_ifaddr_event_cookie = EVENTHANDLER_REGISTER(ifaddr_event, - pfi_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); - } + pfi_attach_cookie = EVENTHANDLER_REGISTER(ifnet_arrival_event, + pfi_attach_ifnet_event, NULL, EVENTHANDLER_PRI_ANY); + pfi_detach_cookie = EVENTHANDLER_REGISTER(ifnet_departure_event, + pfi_detach_ifnet_event, NULL, EVENTHANDLER_PRI_ANY); + pfi_attach_group_cookie = EVENTHANDLER_REGISTER(group_attach_event, + pfi_attach_group_event, curvnet, EVENTHANDLER_PRI_ANY); + pfi_change_group_cookie = EVENTHANDLER_REGISTER(group_change_event, + pfi_change_group_event, curvnet, EVENTHANDLER_PRI_ANY); + pfi_detach_group_cookie = EVENTHANDLER_REGISTER(group_detach_event, + pfi_detach_group_event, curvnet, EVENTHANDLER_PRI_ANY); + pfi_ifaddr_event_cookie = EVENTHANDLER_REGISTER(ifaddr_event, + pfi_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); } void @@ -168,6 +166,8 @@ pfi_cleanup(void) free(p, PFI_MTYPE); } + mtx_destroy(&pfi_unlnkdkifs_mtx); + free(V_pfi_buffer, PFI_MTYPE); } Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Jan 22 01:23:16 2015 (r277519) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); #include #endif -static int pf_vnet_init(void); +static int pfattach(void); static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -189,6 +189,7 @@ static struct cdevsw pf_cdevsw = { static volatile VNET_DEFINE(int, pf_pfil_hooked); #define V_pf_pfil_hooked VNET(pf_pfil_hooked) +VNET_DEFINE(int, pf_end_threads); struct rwlock pf_rules_lock; struct sx pf_ioctl_lock; @@ -204,20 +205,17 @@ pfsync_defer_t *pfsync_defer_ptr = NUL pflog_packet_t *pflog_packet_ptr = NULL; static int -pf_vnet_init(void) +pfattach(void) { u_int32_t *my_timeout = V_pf_default_rule.timeout; int error; if (IS_DEFAULT_VNET(curvnet)) pf_mtag_initialize(); - TAILQ_INIT(&V_pf_tags); - TAILQ_INIT(&V_pf_qids); - - pf_vnet_initialize(); + pf_initialize(); pfr_initialize(); - pfi_vnet_initialize(); - pf_vnet_normalize_init(); + pfi_initialize(); + pf_normalize_init(); V_pf_limits[PF_LIMIT_STATES].limit = PFSTATE_HIWAT; V_pf_limits[PF_LIMIT_SRC_NODES].limit = PFSNODE_HIWAT; @@ -278,13 +276,10 @@ pf_vnet_init(void) for (int i = 0; i < SCNT_MAX; i++) V_pf_status.scounters[i] = counter_u64_alloc(M_WAITOK); - if (IS_DEFAULT_VNET(curvnet)) { - if ((error = kproc_create(pf_purge_thread, curvnet, NULL, 0, 0, - "pf purge")) != 0) { - /* XXXGL: leaked all above. */ - return (error); - } - } + if ((error = kproc_create(pf_purge_thread, curvnet, NULL, 0, 0, + "pf purge")) != 0) + /* XXXGL: leaked all above. */ + return (error); if ((error = swi_add(NULL, "pf send", pf_intr, curvnet, SWI_NET, INTR_MPSAFE, &V_pf_swi_cookie)) != 0) /* XXXGL: leaked all above. */ @@ -3720,11 +3715,27 @@ dehook_pf(void) static int pf_load(void) { + int error; + + VNET_ITERATOR_DECL(vnet_iter); + + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_pf_pfil_hooked = 0; + V_pf_end_threads = 0; + TAILQ_INIT(&V_pf_tags); + TAILQ_INIT(&V_pf_qids); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); rw_init(&pf_rules_lock, "pf rulesets"); sx_init(&pf_ioctl_lock, "pf ioctl"); pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); + if ((error = pfattach()) != 0) + return (error); return (0); } @@ -3748,6 +3759,11 @@ pf_unload(void) } PF_RULES_WLOCK(); shutdown_pf(); + V_pf_end_threads = 1; + while (V_pf_end_threads < 2) { + wakeup_one(pf_purge_thread); + rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftmo", 0); + } pf_normalize_cleanup(); pfi_cleanup(); pfr_cleanup(); @@ -3797,5 +3813,3 @@ static moduledata_t pf_mod = { DECLARE_MODULE(pf, pf_mod, SI_SUB_PSEUDO, SI_ORDER_FIRST); MODULE_VERSION(pf, PF_MODVER); -VNET_SYSINIT(pf_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255, - pf_vnet_init, NULL); Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/netpfil/pf/pf_norm.c Thu Jan 22 01:23:16 2015 (r277519) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_pf.h" #include -#include #include #include #include @@ -93,7 +92,6 @@ struct pf_fragment { }; static struct mtx pf_frag_mtx; -MTX_SYSINIT(pf_frag_mtx, &pf_frag_mtx, "pf fragments", MTX_DEF); #define PF_FRAG_LOCK() mtx_lock(&pf_frag_mtx) #define PF_FRAG_UNLOCK() mtx_unlock(&pf_frag_mtx) #define PF_FRAG_ASSERT() mtx_assert(&pf_frag_mtx, MA_OWNED) @@ -148,7 +146,7 @@ static void pf_scrub_ip6(struct mbuf * } while(0) void -pf_vnet_normalize_init(void) +pf_normalize_init(void) { V_pf_frag_z = uma_zcreate("pf frags", sizeof(struct pf_fragment), @@ -163,6 +161,9 @@ pf_vnet_normalize_init(void) V_pf_limits[PF_LIMIT_FRAGS].limit = PFFRAG_FRENT_HIWAT; uma_zone_set_max(V_pf_frent_z, PFFRAG_FRENT_HIWAT); uma_zone_set_warning(V_pf_frent_z, "PF frag entries limit reached"); + + mtx_init(&pf_frag_mtx, "pf fragments", NULL, MTX_DEF); + TAILQ_INIT(&V_pf_fragqueue); TAILQ_INIT(&V_pf_cachequeue); } @@ -174,6 +175,8 @@ pf_normalize_cleanup(void) uma_zdestroy(V_pf_state_scrub_z); uma_zdestroy(V_pf_frent_z); uma_zdestroy(V_pf_frag_z); + + mtx_destroy(&pf_frag_mtx); } static int Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Thu Jan 22 00:52:34 2015 (r277518) +++ head/sys/netpfil/pf/pf_table.c Thu Jan 22 01:23:16 2015 (r277519) @@ -184,13 +184,9 @@ static struct pfr_kentry static RB_PROTOTYPE(pfr_ktablehead, pfr_ktable, pfrkt_tree, pfr_ktable_compare); static RB_GENERATE(pfr_ktablehead, pfr_ktable, pfrkt_tree, pfr_ktable_compare); -VNET_DEFINE(struct pfr_ktablehead, pfr_ktables); -#define V_pfr_ktables VNET(pfr_ktables) - +struct pfr_ktablehead pfr_ktables; struct pfr_table pfr_nulltable; - -VNET_DEFINE(int, pfr_ktable_cnt); -#define V_pfr_ktable_cnt VNET(pfr_ktable_cnt) +int pfr_ktable_cnt; void pfr_initialize(void) @@ -1087,7 +1083,7 @@ pfr_clr_tables(struct pfr_table *filter, return (ENOENT); SLIST_INIT(&workq); - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (pfr_skip_table(filter, p, flags)) continue; if (!strcmp(p->pfrkt_anchor, PF_RESERVED_ANCHOR)) @@ -1122,7 +1118,7 @@ pfr_add_tables(struct pfr_table *tbl, in flags & PFR_FLAG_USERIOCTL)) senderr(EINVAL); key.pfrkt_flags |= PFR_TFLAG_ACTIVE; - p = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + p = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (p == NULL) { p = pfr_create_ktable(&key.pfrkt_t, tzero, 1); if (p == NULL) @@ -1138,7 +1134,7 @@ pfr_add_tables(struct pfr_table *tbl, in /* find or create root table */ bzero(key.pfrkt_anchor, sizeof(key.pfrkt_anchor)); - r = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + r = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (r != NULL) { p->pfrkt_root = r; goto _skip; @@ -1194,7 +1190,7 @@ pfr_del_tables(struct pfr_table *tbl, in if (pfr_validate_table(&key.pfrkt_t, 0, flags & PFR_FLAG_USERIOCTL)) return (EINVAL); - p = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + p = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (p != NULL && (p->pfrkt_flags & PFR_TFLAG_ACTIVE)) { SLIST_FOREACH(q, &workq, pfrkt_workq) if (!pfr_ktable_compare(p, q)) @@ -1233,7 +1229,7 @@ pfr_get_tables(struct pfr_table *filter, *size = n; return (0); } - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (pfr_skip_table(filter, p, flags)) continue; if (n-- <= 0) @@ -1268,7 +1264,7 @@ pfr_get_tstats(struct pfr_table *filter, return (0); } SLIST_INIT(&workq); - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (pfr_skip_table(filter, p, flags)) continue; if (n-- <= 0) @@ -1300,7 +1296,7 @@ pfr_clr_tstats(struct pfr_table *tbl, in bcopy(tbl + i, &key.pfrkt_t, sizeof(key.pfrkt_t)); if (pfr_validate_table(&key.pfrkt_t, 0, 0)) return (EINVAL); - p = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + p = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (p != NULL) { SLIST_INSERT_HEAD(&workq, p, pfrkt_workq); xzero++; @@ -1332,7 +1328,7 @@ pfr_set_tflags(struct pfr_table *tbl, in if (pfr_validate_table(&key.pfrkt_t, 0, flags & PFR_FLAG_USERIOCTL)) return (EINVAL); - p = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + p = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (p != NULL && (p->pfrkt_flags & PFR_TFLAG_ACTIVE)) { p->pfrkt_nflags = (p->pfrkt_flags | setflag) & ~clrflag; @@ -1374,7 +1370,7 @@ pfr_ina_begin(struct pfr_table *trs, u_i if (rs == NULL) return (ENOMEM); SLIST_INIT(&workq); - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (!(p->pfrkt_flags & PFR_TFLAG_INACTIVE) || pfr_skip_table(trs, p, 0)) continue; @@ -1419,7 +1415,7 @@ pfr_ina_define(struct pfr_table *tbl, st return (EBUSY); tbl->pfrt_flags |= PFR_TFLAG_INACTIVE; SLIST_INIT(&tableq); - kt = RB_FIND(pfr_ktablehead, &V_pfr_ktables, (struct pfr_ktable *)tbl); + kt = RB_FIND(pfr_ktablehead, &pfr_ktables, (struct pfr_ktable *)tbl); if (kt == NULL) { kt = pfr_create_ktable(tbl, 0, 1); if (kt == NULL) @@ -1432,7 +1428,7 @@ pfr_ina_define(struct pfr_table *tbl, st /* find or create root table */ bzero(&key, sizeof(key)); strlcpy(key.pfrkt_name, tbl->pfrt_name, sizeof(key.pfrkt_name)); - rt = RB_FIND(pfr_ktablehead, &V_pfr_ktables, &key); + rt = RB_FIND(pfr_ktablehead, &pfr_ktables, &key); if (rt != NULL) { kt->pfrkt_root = rt; goto _skip; @@ -1509,7 +1505,7 @@ pfr_ina_rollback(struct pfr_table *trs, if (rs == NULL || !rs->topen || ticket != rs->tticket) return (0); SLIST_INIT(&workq); - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (!(p->pfrkt_flags & PFR_TFLAG_INACTIVE) || pfr_skip_table(trs, p, 0)) continue; @@ -1545,7 +1541,7 @@ pfr_ina_commit(struct pfr_table *trs, u_ return (EBUSY); SLIST_INIT(&workq); - RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { + RB_FOREACH(p, pfr_ktablehead, &pfr_ktables) { if (!(p->pfrkt_flags & PFR_TFLAG_INACTIVE) || pfr_skip_table(trs, p, 0)) continue; @@ -1691,7 +1687,7 @@ pfr_table_count(struct pfr_table *filter PF_RULES_ASSERT(); if (flags & PFR_FLAG_ALLRSETS) - return (V_pfr_ktable_cnt); + return (pfr_ktable_cnt); if (filter->pfrt_anchor[0]) { rs = pf_find_ruleset(filter->pfrt_anchor); return ((rs != NULL) ? rs->tables : -1); @@ -1724,8 +1720,8 @@ pfr_insert_ktable(struct pfr_ktable *kt) PF_RULES_WASSERT(); - RB_INSERT(pfr_ktablehead, &V_pfr_ktables, kt); - V_pfr_ktable_cnt++; + RB_INSERT(pfr_ktablehead, &pfr_ktables, kt); + pfr_ktable_cnt++; if (kt->pfrkt_root != NULL) if (!kt->pfrkt_root->pfrkt_refcnt[PFR_REFCNT_ANCHOR]++) pfr_setflags_ktable(kt->pfrkt_root, @@ -1756,14 +1752,14 @@ pfr_setflags_ktable(struct pfr_ktable *k if (!(newf & PFR_TFLAG_ACTIVE)) newf &= ~PFR_TFLAG_USRMASK; if (!(newf & PFR_TFLAG_SETMASK)) { - RB_REMOVE(pfr_ktablehead, &V_pfr_ktables, kt); + RB_REMOVE(pfr_ktablehead, &pfr_ktables, kt); if (kt->pfrkt_root != NULL) if (!--kt->pfrkt_root->pfrkt_refcnt[PFR_REFCNT_ANCHOR]) pfr_setflags_ktable(kt->pfrkt_root, kt->pfrkt_root->pfrkt_flags & ~PFR_TFLAG_REFDANCHOR); pfr_destroy_ktable(kt, 1); - V_pfr_ktable_cnt--; + pfr_ktable_cnt--; return; } if (!(newf & PFR_TFLAG_ACTIVE) && kt->pfrkt_cnt) { @@ -1884,7 +1880,7 @@ static struct pfr_ktable * pfr_lookup_table(struct pfr_table *tbl) { /* struct pfr_ktable start like a struct pfr_table */ - return (RB_FIND(pfr_ktablehead, &V_pfr_ktables, + return (RB_FIND(pfr_ktablehead, &pfr_ktables, (struct pfr_ktable *)tbl)); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 01:27:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56A14BF8; Thu, 22 Jan 2015 01:27:13 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D054ED6D; Thu, 22 Jan 2015 01:27:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0M1R9VG083373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Jan 2015 04:27:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0M1R9jp083372; Thu, 22 Jan 2015 04:27:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 22 Jan 2015 04:27:09 +0300 From: Gleb Smirnoff To: Craig Rodrigues , Nikos Vassiliadis Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150122012709.GM15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501060903.t06934qp081875@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 01:27:13 -0000 On Tue, Jan 06, 2015 at 09:03:04AM +0000, Craig Rodrigues wrote: C> Author: rodrigc C> Date: Tue Jan 6 09:03:03 2015 C> New Revision: 276747 C> URL: https://svnweb.freebsd.org/changeset/base/276747 C> C> Log: C> Instead of creating a purge thread for every vnet, create C> a single purge thread and clean up all vnets from this thread. C> C> PR: 194515 C> Differential Revision: D1315 C> Submitted by: Nikos Vassiliadis Sorry guys, I backed this out due to broken kldunload of pf module, which is critical when you are working with pf bugs. I had to backout r276746 as well, since it has numerous build breakages, that are addressed by later revisions. That's my fault that I don't review in time, and I will try to improve the situation. Can you please replay r276746 again, addressing all the build problems and send the patch to me? You can user reviews.freebsd.org if you want. I'd like to get this in, but in a better quality. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 01:54:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53D3CD6 for ; Thu, 22 Jan 2015 01:54:30 +0000 (UTC) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2109FEE for ; Thu, 22 Jan 2015 01:54:29 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id z11so42518020lbi.10 for ; Wed, 21 Jan 2015 17:54:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=27RmEEgkayiGQc8dykNZpQLn2nXhZwd4+wlNClVCfMQ=; b=bV/A+d1bD86t2n4xJcMb6CbNQrF6+o8pfu3g0jFbo37vrFIdrr69BA434nASLGl03r Hgvc3T+PbZzz238ROX6gZ7IdD5Z8YpjepJ+K07MdgD/L67zgQaMAiuoDgnQmqU8zHndG Q1tWAO+AaKvLaEeI/ek3PHkMJm0IYPpOlSvrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=27RmEEgkayiGQc8dykNZpQLn2nXhZwd4+wlNClVCfMQ=; b=jfKfSEShngJ+AAUFRaV3hRhNJ77mBECF4OnUaMFKxRJTDCBYX9dcCaKOzXcu81OPDd J/whECctqCwIIBJ7EKGTSM24HEdOtOX23clJ17k60Ic7EYgVnzTePUZiEAIGjIlq3Tur 1axbj80H4VshbrmFH6emI+bCX1JJHOFEqtQSOOF36exrLuSTMv50HOPVslFVoiKyLoZD YfyqE2hVAcsCZqghEx3yCMpUBZXUapmGvdlhcoUeZQgqRMHyjmZkv4B3fnuaqel1k0jW dd74AkIAn2i4b+U4knYpyHJM62HaJc02UsP9LU/T3C8a0+kn9EbSJSufdrhgRWSkcqoI xT7A== X-Gm-Message-State: ALoCoQlC/lBe2csqFQuKTOfuEKsvTV16/it15bvhZ+8FZMwWfhjnnfNpaPsdyZpY/IaFsvlfiCg+ X-Received: by 10.153.6.6 with SMTP id cq6mr47664728lad.23.1421891667750; Wed, 21 Jan 2015 17:54:27 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.92.131 with HTTP; Wed, 21 Jan 2015 17:54:07 -0800 (PST) In-Reply-To: <201501212149.t0LLn3CF049759@svn.freebsd.org> References: <201501212149.t0LLn3CF049759@svn.freebsd.org> From: Juli Mallett Date: Wed, 21 Jan 2015 17:54:07 -0800 X-Google-Sender-Auth: 82VzgwcoLKKSFlvJFmNk0tFxNt4 Message-ID: Subject: Re: svn commit: r277517 - head To: Ed Maste Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 01:54:30 -0000 On Wed, Jan 21, 2015 at 1:49 PM, Ed Maste wrote: > Author: emaste > Date: Wed Jan 21 21:49:03 2015 > New Revision: 277517 > URL: https://svnweb.freebsd.org/changeset/base/277517 > > Log: > Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL > > ELF Tool Chain tools need libelf and libdwarf. Thanks very much! From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 03:32:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F1F3568; Thu, 22 Jan 2015 03:32:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B686CFC; Thu, 22 Jan 2015 03:32:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M3W5Aw016278; Thu, 22 Jan 2015 03:32:05 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M3W5Ck016277; Thu, 22 Jan 2015 03:32:05 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501220332.t0M3W5Ck016277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 22 Jan 2015 03:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277522 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 03:32:05 -0000 Author: gonzo Date: Thu Jan 22 03:32:04 2015 New Revision: 277522 URL: https://svnweb.freebsd.org/changeset/base/277522 Log: Write ACK for all kinds of LCDC interrupts Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jan 22 02:24:42 2015 (r277521) +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jan 22 03:32:04 2015 (r277522) @@ -365,7 +365,7 @@ am335x_lcd_intr(void *arg) reg = LCD_READ4(sc, LCD_RASTER_CTRL); reg |= RASTER_CTRL_LCDEN; LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); - return; + goto done; } if (reg & IRQ_PL) { @@ -376,7 +376,7 @@ am335x_lcd_intr(void *arg) reg = LCD_READ4(sc, LCD_RASTER_CTRL); reg |= RASTER_CTRL_LCDEN; LCD_WRITE4(sc, LCD_RASTER_CTRL, reg); - return; + goto done; } if (reg & IRQ_EOF0) { @@ -399,6 +399,7 @@ am335x_lcd_intr(void *arg) /* TODO: Handle ACB */ } +done: LCD_WRITE4(sc, LCD_END_OF_INT_IND, 0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 03:33:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF2216BF; Thu, 22 Jan 2015 03:33:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC54AD0E; Thu, 22 Jan 2015 03:33:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M3XqLe016548; Thu, 22 Jan 2015 03:33:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M3Xqja016547; Thu, 22 Jan 2015 03:33:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501220333.t0M3Xqja016547@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 22 Jan 2015 03:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277523 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 03:33:53 -0000 Author: gonzo Date: Thu Jan 22 03:33:51 2015 New Revision: 277523 URL: https://svnweb.freebsd.org/changeset/base/277523 Log: Add last_fault_code used in pmap-v6.c if kernel is compiled with "option DEBUG" Modified: head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Thu Jan 22 03:32:04 2015 (r277522) +++ head/sys/arm/arm/trap-v6.c Thu Jan 22 03:33:51 2015 (r277523) @@ -67,6 +67,10 @@ __FBSDID("$FreeBSD$"); extern char fusubailout[]; +#ifdef DEBUG +int last_fault_code; /* For the benefit of pmap_fault_fixup() */ +#endif + struct ksig { int sig; u_long code; @@ -457,6 +461,10 @@ abort_handler(struct trapframe *tf, int if (prefetch) ftype |= VM_PROT_EXECUTE; +#ifdef DEBUG + last_fault_code = fsr; +#endif + #ifndef ARM_NEW_PMAP if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype, usermode)) { From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 03:56:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 522279A0; Thu, 22 Jan 2015 03:56:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D75EEB4; Thu, 22 Jan 2015 03:56:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M3uPmW026209; Thu, 22 Jan 2015 03:56:25 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M3uONl026205; Thu, 22 Jan 2015 03:56:24 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201501220356.t0M3uONl026205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 22 Jan 2015 03:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277524 - in head/sys: dev/hwpmc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 03:56:25 -0000 Author: rstone Date: Thu Jan 22 03:56:23 2015 New Revision: 277524 URL: https://svnweb.freebsd.org/changeset/base/277524 Log: style(9) cleanup Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Jan 22 03:33:51 2015 (r277523) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Jan 22 03:56:23 2015 (r277524) @@ -680,7 +680,8 @@ static struct iap_event_descr iap_events IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | + IAP_F_HWX), IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_60H, 0x08, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), @@ -710,9 +711,12 @@ static struct iap_event_descr iap_events IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(0FH_01H, 0x0F, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(0FH_02H, 0x0F, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -826,7 +830,8 @@ static struct iap_event_descr iap_events IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX), - IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | + IAP_F_HWX), IAPDESCR(25H, 0x25, IAP_M_CORE, IAP_F_ALLCPUSCORE2), @@ -967,7 +972,8 @@ static struct iap_event_descr iap_events IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), - IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW | + IAP_F_HWX), IAPDESCR(4BH_00H, 0x4B, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(4BH_01H, 0x4B, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7O), @@ -1008,10 +1014,14 @@ static struct iap_event_descr iap_events IAPDESCR(53H_01H, 0x53, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(58H_04H, 0x58, 0x04, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(58H_04H, 0x58, 0x04, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(59H_20H, 0x59, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(59H_40H, 0x59, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), @@ -1114,8 +1124,8 @@ static struct iap_event_descr iap_events IAPDESCR(79H_30H, 0x79, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - - IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(7AH, 0x7A, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1367,7 +1377,8 @@ static struct iap_event_descr iap_events IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_CAS), IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_CAS), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | + IAP_F_HWX), IAPDESCR(B7H_02H, 0xB7, 0x02, IAP_F_CAS), IAPDESCR(B8H_01H, 0xB8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Thu Jan 22 03:33:51 2015 (r277523) +++ head/sys/dev/hwpmc/pmc_events.h Thu Jan 22 03:56:23 2015 (r277524) @@ -2734,7 +2734,7 @@ __PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_M __PMC_EV_ALIAS("TLB_FLUSH.DTLB_THREAD", IAP_EVENT_BDH_01H) \ __PMC_EV_ALIAS("TLB_FLUSH.STLB_ANY", IAP_EVENT_BDH_20H) \ __PMC_EV_ALIAS("INST_RETIRED.ANY_P", IAP_EVENT_C0H_00H) \ -__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \ +__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.AVX_TO_SSE", IAP_EVENT_C1H_08H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.SSE_TO_AVX", IAP_EVENT_C1H_10H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.ANY_WB_ASSIST", IAP_EVENT_C1H_40H) \ @@ -2963,7 +2963,7 @@ __PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_M __PMC_EV_ALIAS("TLB_FLUSH.DTLB_THREAD", IAP_EVENT_BDH_01H) \ __PMC_EV_ALIAS("TLB_FLUSH.STLB_ANY", IAP_EVENT_BDH_20H) \ __PMC_EV_ALIAS("INST_RETIRED.ANY_P", IAP_EVENT_C0H_00H) \ -__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \ +__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.AVX_TO_SSE", IAP_EVENT_C1H_08H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.SSE_TO_AVX", IAP_EVENT_C1H_10H) \ __PMC_EV_ALIAS("OTHER_ASSISTS.ANY_WB_ASSIST", IAP_EVENT_C1H_40H) \ Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Thu Jan 22 03:33:51 2015 (r277523) +++ head/sys/sys/pmc.h Thu Jan 22 03:56:23 2015 (r277524) @@ -94,7 +94,7 @@ __PMC_CPU(INTEL_ATOM_SILVERMONT, 0x92, "Intel Atom Silvermont") \ __PMC_CPU(INTEL_NEHALEM_EX, 0x93, "Intel Nehalem Xeon 7500") \ __PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \ - __PMC_CPU(INTEL_HASWELL_XEON, 0x95, "Intel Haswell Xeon E5 v3") \ + __PMC_CPU(INTEL_HASWELL_XEON, 0x95, "Intel Haswell Xeon E5 v3") \ __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 05:21:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E18D70D for ; Thu, 22 Jan 2015 05:21:06 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEAF78F2 for ; Thu, 22 Jan 2015 05:21:05 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id h136so19342792oig.11 for ; Wed, 21 Jan 2015 21:21:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=1omhlkBVCJNTsDzPh+6hXMmwcOYHnQpTXCs8tTJKoEQ=; b=hm7mPKB2Gta7j+hKC55Z1Nd8eBT9iFQPAb9ixsOWYwlRQ8WJhEMBJMK7f3UBHZZ60L SuSsAsGW553xH43LJMLoBsOecLmJ+6ZrfiIt989rieREmZ/xuOFaElbkXaVfW2MYWxcq iHJ/EcYuUEG3cqsuPx6qfYDmAsf1os+pvvdxewBtqcZpJWo5pEw7vSek3WncKNBgGC3w T9JQurGnAEq7Kd9/eYM7WyXZ4ngKTATUpkwW7PSopxfPDj6lxXTZEbekFahDfBkvG1c6 ofpCasTVDe64xb4ccAFnDwA5bN6JRpNUCR0kQuCfUPDSLYqd4fcXxjG2oasIPzWJky8O wbuQ== X-Gm-Message-State: ALoCoQkzF4StFlItGF8ejlbh9iwI3Z0C58wSOpCPkMSnRMxcN0k2sGd6k2FFOP7k/3exHPDZbBKZ X-Received: by 10.182.148.98 with SMTP id tr2mr27417291obb.28.1421904064608; Wed, 21 Jan 2015 21:21:04 -0800 (PST) Received: from [192.168.43.169] ([172.56.8.11]) by mx.google.com with ESMTPSA id r9sm9021703obi.29.2015.01.21.21.21.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 21:21:04 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Warner Losh In-Reply-To: <54BE0528.2050503@selasky.org> Date: Wed, 21 Jan 2015 22:21:02 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <19408675-1E2B-4F38-8C9A-66975B6C01DF@bsdimp.com> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <54BDE58F.3070909@selasky.org> <54BE0528.2050503@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 05:21:06 -0000 > On Jan 20, 2015, at 12:35 AM, Hans Petter Selasky = wrote: >=20 > On 01/20/15 06:22, Adrian Chadd wrote: >> Sweet, thanks. I'l test it, but anything that changes the locking to >> TCP is going to need a more thorough review. The "there be dragons" >> disclaimer is appropriate.:) >=20 > No changes in locking - simply some minor code reordering. This isn=E2=80=99t entirely true. You changed the INFO_WLOCK protocol, = and also drop the WLOCK to acquire the INFO_WLOCK in places, and it = isn=E2=80=99t clear to me at all why this is safe to do. Please document = the analysis you did to show that was safe. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 05:26:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA83D957 for ; Thu, 22 Jan 2015 05:26:37 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5CC9BB for ; Thu, 22 Jan 2015 05:26:37 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id va8so20064394obc.0 for ; Wed, 21 Jan 2015 21:26:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=2RCmvLyW7SEixhwB/8BhFfcLXIySteIgbdvYcMZ2N98=; b=F8lw/n6UpmGlVm14jpNScAmPS5oBhfXyIiY/z53IhgTqbYziG67ahYghc1R4BpJRX9 MVqYUQQ0afDQv4SiOx+9v8H3j7s1rh/uJX2H1lf2/Q6W8GMQOpSt0HGzM1RjORuaiY2R 6Es+DAhUmoIKHHNC5c2tKcou/uSR7NTSe6aUn+U+WZuVKi1+EcX4PY/VeP7FmFO8sNE+ eidFOUKvxGFysPEAKn0vpMl9oiNm1KxLEonoSIdD3ZlXGMz+LqtbYDoAHom0xiMlSsRn QzMG8sWrDKbNfApZodDro6Z7YTClYkpSWpSeGnWG9rWQ8jIriHDMIlrLpizOoqb4AXdv hUNA== X-Gm-Message-State: ALoCoQlSoCkpzWpcyXKoX4bgQrKMsYszic6YsFE5PRASzfofkudh+2d05fDTVcTXfYDBoSHDq7bK X-Received: by 10.60.133.141 with SMTP id pc13mr27616787oeb.68.1421904396587; Wed, 21 Jan 2015 21:26:36 -0800 (PST) Received: from [192.168.43.169] ([172.56.8.11]) by mx.google.com with ESMTPSA id d198sm4759185oih.12.2015.01.21.21.26.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 21:26:36 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Warner Losh In-Reply-To: <54BE21F0.6010602@selasky.org> Date: Wed, 21 Jan 2015 22:26:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 05:26:37 -0000 > On Jan 20, 2015, at 2:37 AM, Hans Petter Selasky = wrote: >=20 > On 01/20/15 10:00, Konstantin Belousov wrote: >> On Tue, Jan 20, 2015 at 08:58:34AM +0100, Hans Petter Selasky wrote: >>> On 01/20/15 08:51, Konstantin Belousov wrote: >>>> On Tue, Jan 20, 2015 at 05:30:25AM +0100, Hans Petter Selasky = wrote: >>>>> On 01/19/15 22:59, Adrian Chadd wrote: >>>>>> Hi, >>>>>>=20 >>>>>> Would you please check what the results of this are with CPU = specific >>>>>> callwheels? >>>>>>=20 >>>>>> I'm doing some 10+ gig traffic testing on -HEAD with RSS enabled = (on >>>>>> ixgbe) and with this setup, the per-CPU TCP callwheel stuff is >>>>>> enabled. But all the callwheels are now back on clock(0) and so = is the >>>>>> lock contention. :( >>>>>>=20 >>>>>> Thanks, >>>>>>=20 >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> Like stated in the manual page, callout_reset_curcpu/on() does not = work >>>>> with MPSAFE callouts any more! >>>> I.e. you 'fixed' some undeterminate bugs in callout migration by = not >>>> doing migration at all anymore. >>>>=20 >>>>>=20 >>>>> You need to use callout_init_{mtx,rm,rw} and remove the custom = locking >>>>> inside the callback in the TCP stack to get it working like = before! >>>>=20 >>>> No, you need to do this, if you think that whole callout KPI must = be >>>> rototiled. It is up to the person who modifies the KPI, to ensure = that >>>> existing code is not broken. >=20 > Hi, >=20 > It is not very hard to update existing callout clients and you can do = it too, if you need the extra bits of performance. >=20 > Are there more API's than the TCP stack which you think needs an = update and are performance critical? >=20 >>>>=20 >>>> As I understand, currently we are back to the one-cpu callouts. >>>> Do other people consider this situation acceptable ? >=20 > For the TCP stack - yes, but not for other clients like cv_timedwait() = and such. >=20 > If you think you have a better way to solve the callout problems, = please tell me! In order for a callout to change its CPU you need a lock = to protect which CPU the callout is on. Instead of introducing a third = lock in the callout path, which will be a congestion point, to protect = against changing the CPU number, I decided that we will use the client's = mutex and the MPSAFE implies the client doesn't have any mutex. So it = won't work with callout clients which use the CALLOUT_MPSAFE flag. = Honestly CALLOUT_MPSAFE should not be used, because it leads to extra = complexity in the clients catching the race when tearing down the = callouts and any pending callbacks. Then it is incumbent on you to fix them. You can=92t just fix one = instance and wash your hands of the problem. Maybe this is a real and legitimate bug. However, until you=92ve = followed your solution through by actually fixing the abusers of it, my = confidence that another issue won=92t present itself is quite low. The = code seems half baked to me. And from reading this thread, it seems like = perhaps I=92m not the only one. >>> Please read the callout 9 manual page first. >>=20 >> Assume I read it. How this changes any of my points above ? >> """ >> A change in the CPU selection cannot happen if this function is >> re-scheduled inside a callout function. Else the callback function = given >> by the func argument will be executed on the same CPU like previously >> done. >> """ >> You cannot do this without fixing consumers. >>=20 >=20 > The code simply needs an update. It is not broken in any ways - right? = If it is not broken, fixing it is not that urgent. Radically changing the performance characteristics is breaking the code. = Performance regression in the TCP stack is urgent to fix. Not being able = to enumerate what all the consumers are that use this and provide an = analysis about why they aren=92t important to fix is a bug in your = process, and in your interaction with the project. We simply do not = operate that way. Warner= From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 05:28:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1A1FAE9 for ; Thu, 22 Jan 2015 05:28:17 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97FE69CD for ; Thu, 22 Jan 2015 05:28:17 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id wp4so22934310obc.6 for ; Wed, 21 Jan 2015 21:28:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=gCc/2CEv/q4N78L4DdLIdtw26G4K2P060oqnLK/KYiQ=; b=Be69ZyhV+yynP9Fu/IsyEttEOJ+VqhFNVuhfz3HW4kcggp7lAysWkTpmeOMUocHbdP HH0jfKU6EMd0Pjg+aLbxvXNjMciHH7MBAyRQSgczyex6zIWy2i+oI59s/l+JRbrKzz4y yTufnZVq66i73dUfrI0Yur+csamZ8L0r7jzZtQY8qCsOQShErjV2yda9yAW11blEdqCG ltq2d0ovvnhN3EqAhch/nXyXjxy0iAeIu6iUg8uO0rRzCVcP7y/zafe0WkOOxNcSQbvn reefln4Cnr3lMgYnekusIgc0iOp60HnuX5z6KgfEK0qjuIDPRp95vfrHoX17vNiC5vSc r6Ww== X-Gm-Message-State: ALoCoQmBYv1KMC0YwSS3AjrGBj2hgTJHQN91vXbi1gaWwqSjqwNEqJ4IspoIDGIIdNRFLpUsA5Gs X-Received: by 10.202.89.213 with SMTP id n204mr25673842oib.77.1421904114515; Wed, 21 Jan 2015 21:21:54 -0800 (PST) Received: from [192.168.43.169] ([172.56.8.11]) by mx.google.com with ESMTPSA id r9sm9021703obi.29.2015.01.21.21.21.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 21:21:53 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Warner Losh In-Reply-To: <20150120075126.GA42409@kib.kiev.ua> Date: Wed, 21 Jan 2015 22:21:52 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <5D0577C3-FBDC-49D1-81AA-F19D56EEE2DC@bsdimp.com> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1993) Cc: Hans Petter Selasky , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 05:28:17 -0000 > On Jan 20, 2015, at 12:51 AM, Konstantin Belousov = wrote: > Do other people consider this situation acceptable ? Not even a little. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 07:13:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21CE7836; Thu, 22 Jan 2015 07:13:39 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1563C4; Thu, 22 Jan 2015 07:13:38 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 364AA1FE023; Thu, 22 Jan 2015 08:13:36 +0100 (CET) Message-ID: <54C0A352.8090701@selasky.org> Date: Thu, 22 Jan 2015 08:14:26 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> In-Reply-To: <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 07:13:39 -0000 On 01/22/15 06:26, Warner Losh wrote: > >> The code simply needs an update. It is not broken in any ways - right? If it is not broken, fixing it is not that urgent. > > Radically changing the performance characteristics is breaking the code. Performance regression in the TCP stack is urgent to fix. Not being able to enumerate what all the consumers are that use this and provide an analysis about why they aren’t important to fix is a bug in your process, and in your interaction with the project. We simply do not operate that way. Hi, My plan is to work out a patch for the TCP stack today, which only change the callout_init() call or its function. This should not need any particular review. I'll let adrian test and review, because I think he is closer to me timezone wise and you're standing on my head saying its urgent. If he is still not happy, I can back my change out. Else it remains in -current AS-IS. MFC to 10-stable I can delay for sure until all issues you report to me are fixed. Thank you for your patience! --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 08:10:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C008EC9; Thu, 22 Jan 2015 08:10:32 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5472AC1; Thu, 22 Jan 2015 08:10:31 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0M8AOC6056515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2015 10:10:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0M8AOC6056515 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0M8ANmT056512; Thu, 22 Jan 2015 10:10:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Jan 2015 10:10:23 +0200 From: Konstantin Belousov To: Hans Petter Selasky Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Message-ID: <20150122081023.GT42409@kib.kiev.ua> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54C0A352.8090701@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 08:10:32 -0000 On Thu, Jan 22, 2015 at 08:14:26AM +0100, Hans Petter Selasky wrote: > On 01/22/15 06:26, Warner Losh wrote: > > > >> The code simply needs an update. It is not broken in any ways - right? If it is not broken, fixing it is not that urgent. > > > > Radically changing the performance characteristics is breaking the code. Performance regression in the TCP stack is urgent to fix. > Not being able to enumerate what all the consumers are that use this and > provide an analysis about why they aren?t important to fix is a bug in > your process, and in your interaction with the project. We simply do not > operate that way. Right, I completely agree with this statement. > Hi, > > My plan is to work out a patch for the TCP stack today, which only > change the callout_init() call or its function. This should not need any > particular review. I'll let adrian test and review, because I think he > is closer to me timezone wise and you're standing on my head saying its > urgent. If he is still not happy, I can back my change out. Else it > remains in -current AS-IS. TCP regresssion was noted, so it is brought in front. There is nothing else which makes TCP issue different from other (hidden) issues. =========================== > MFC to 10-stable I can delay for sure until > all issues you report to me are fixed. =========================== Sigh, you still do not understand. It is your duty to identify all pieces which break after your change. After that, we can argue whether each of them is critical or not to allow the migration. But this must have been done before the KPI change hit the tree. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 08:18:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C650120C for ; Thu, 22 Jan 2015 08:18:46 +0000 (UTC) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5938EBA1 for ; Thu, 22 Jan 2015 08:18:46 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id l15so31729741wiw.4 for ; Thu, 22 Jan 2015 00:18:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Hsjk2mZMd3zNZYw7YLLdMpZkBdnQHpiIhcKWoW6qLzs=; b=JliJp4KUMCkJH8q4Gs/rUsF9Q0pp3oDgNiFibC/+jj1S8oToZ4TWuR2zqwPXzO8GMl q8I6SoVBPitWHDQ6eS+Mj2WQO+9/Ht1GjLuCzKS7AzV8iC8pk8fFaMy8GuBO07um9FnW IS75G6uuvsqmc43/5KQLV+2grT8EG83KreJ4eDY4LwBL33NuuWDz+3DzkcaKzhxIbLkD bTPo3YA9+eze51p1JqZnoJ3Wb82Ia7joJ6LEf8krJEJX0Ct3CGzEKQwax8ZIo3kkEJJG RabFYo/xhLhe/S9dJompn4ICbG+LB7sLFieIoYG/X0SGIlWJFA7jPyllmNyWgEXlM4RS 5ZMw== X-Gm-Message-State: ALoCoQnK8UqaNDuK1H8TJj7xOAIyWANbA60FAamfwjlojQO8amOwiD83rvAZLwr1XOolRvts0Ntb MIME-Version: 1.0 X-Received: by 10.180.160.144 with SMTP id xk16mr66011195wib.12.1421914717432; Thu, 22 Jan 2015 00:18:37 -0800 (PST) Received: by 10.27.205.86 with HTTP; Thu, 22 Jan 2015 00:18:37 -0800 (PST) X-Originating-IP: [178.172.239.242] In-Reply-To: <201501211610.t0LGAcMg085437@svn.freebsd.org> References: <201501211610.t0LGAcMg085437@svn.freebsd.org> Date: Thu, 22 Jan 2015 11:18:37 +0300 Message-ID: Subject: Re: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms From: "Max N. Boyarov" To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 08:18:46 -0000 On Wed, Jan 21, 2015 at 7:10 PM, Konstantin Belousov wrote: > Author: kib > Date: Wed Jan 21 16:10:37 2015 > New Revision: 277487 > URL: https://svnweb.freebsd.org/changeset/base/277487 > > Log: > An update for the i915 GPU driver, which brings the code up to Linux > commit 4d93914ae3db4a897ead4b. Some related drm infrastructure > changes are imported as needed. > > Biggest update is the rewrite of the i915 gem io to more closely > follow Linux model, althought the mechanism used by FreeBSD port is > different. > > Sponsored by: The FreeBSD Foundation > MFC after: 2 month Hi, after this commit i have many error messages like: error: [drm:pid1121:gen6_sanitize_pm] *ERROR* Power management discrepancy: GEN6_RP_INTERRUPT_LIMITS expected 18070000, was 18000000 On my thinkpad t530 info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). info: [drm] Driver supports precise vblank timestamp query. drmn1: taking over the fictitious range 0xe0000000-0xf0000000 info: [drm] Enabling RC6 states: RC6 off, RC6p off, RC6pp off info: [drm] Connector LVDS-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.LVDS-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector VGA-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.VGA-1 info: [drm] - kern.vt.fb.default_mode fbd1 on drmn1 -- Max N. Boyarov From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 08:39:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDDBF609; Thu, 22 Jan 2015 08:39:07 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87899D8B; Thu, 22 Jan 2015 08:39:07 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DACE51FE023; Thu, 22 Jan 2015 09:39:04 +0100 (CET) Message-ID: <54C0B75B.9070305@selasky.org> Date: Thu, 22 Jan 2015 09:39:55 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> In-Reply-To: <20150122081023.GT42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 08:39:07 -0000 On 01/22/15 09:10, Konstantin Belousov wrote: > On Thu, Jan 22, 2015 at 08:14:26AM +0100, Hans Petter Selasky wrote: >> On 01/22/15 06:26, Warner Losh wrote: >> > >>>> The code simply needs an update. It is not broken in any ways - right? If it is not broken, fixing it is not that urgent. >>> >>> Radically changing the performance characteristics is breaking the code. Performance regression in the TCP stack is urgent to fix. > >> Not being able to enumerate what all the consumers are that use this and >> provide an analysis about why they aren?t important to fix is a bug in >> your process, and in your interaction with the project. We simply do not >> operate that way. > Right, I completely agree with this statement. > > >> Hi, >> >> My plan is to work out a patch for the TCP stack today, which only >> change the callout_init() call or its function. This should not need any >> particular review. I'll let adrian test and review, because I think he >> is closer to me timezone wise and you're standing on my head saying its >> urgent. If he is still not happy, I can back my change out. Else it >> remains in -current AS-IS. > TCP regresssion was noted, so it is brought in front. There is nothing > else which makes TCP issue different from other (hidden) issues. > > =========================== >> MFC to 10-stable I can delay for sure until >> all issues you report to me are fixed. > =========================== > > Sigh, you still do not understand. It is your duty to identify all pieces > which break after your change. After that, we can argue whether each of > them is critical or not to allow the migration. But this must have been > done before the KPI change hit the tree. > Hi, Are you saying that pieces of code that runs completely unlocked using "volatile" as only synchronization mechanism is better than what I would call a temporary and hopefully short TCP stack performance loss? I don't understand? How frequently do you reboot your boxes? Maybe one every day? And you don't care? --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:12:17 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 116A54D8; Thu, 22 Jan 2015 09:12:17 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C03E214; Thu, 22 Jan 2015 09:12:16 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0M9CAfv070722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2015 11:12:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0M9CAfv070722 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0M9CAjh070721; Thu, 22 Jan 2015 11:12:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Jan 2015 11:12:10 +0200 From: Konstantin Belousov To: Warner Losh Subject: Re: svn commit: r277421 - head/sys/powerpc/powerpc Message-ID: <20150122091210.GV42409@kib.kiev.ua> References: <201501201621.t0KGLx26096724@svn.freebsd.org> <20150120191438.GL42409@kib.kiev.ua> <54BF240C.2090107@freebsd.org> <20150121075410.GM42409@kib.kiev.ua> <81FEE3A9-C522-48A3-9292-893685C640AF@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81FEE3A9-C522-48A3-9292-893685C640AF@bsdimp.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: src-committers@FreeBSD.org, mips@freebsd.org, svn-src-all@FreeBSD.org, arm@freebsd.org, Nathan Whitehorn , sparc64@freebsd.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:12:17 -0000 On Wed, Jan 21, 2015 at 06:04:57PM -0700, Warner Losh wrote: > > > On Jan 21, 2015, at 12:54 AM, Konstantin Belousov wrote: > > > > On Tue, Jan 20, 2015 at 07:59:08PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/20/15 11:14, Konstantin Belousov wrote: > >>> On Tue, Jan 20, 2015 at 04:21:59PM +0000, Nathan Whitehorn wrote: > >>>> Author: nwhitehorn > >>>> Date: Tue Jan 20 16:21:59 2015 > >>>> New Revision: 277421 > >>>> URL: https://svnweb.freebsd.org/changeset/base/277421 > >>>> > >>>> Log: > >>>> There does not seem to be any reason to acquire GIANT here. Follow amd64 > >>>> in removing it. > >>>> > >>>> MFC after: 1 month > >>>> > >>>> Modified: > >>>> head/sys/powerpc/powerpc/mem.c > >>>> > >>>> Modified: head/sys/powerpc/powerpc/mem.c > >>>> ============================================================================== > >>>> --- head/sys/powerpc/powerpc/mem.c Tue Jan 20 15:45:09 2015 (r277420) > >>>> +++ head/sys/powerpc/powerpc/mem.c Tue Jan 20 16:21:59 2015 (r277421) > >>>> @@ -100,8 +100,6 @@ memrw(struct cdev *dev, struct uio *uio, > >>>> cnt = 0; > >>>> error = 0; > >>>> > >>>> - GIANT_REQUIRED; > >>>> - > >>> This is not an acquisition, to be pedantic. Really, it is cdevsw which > >>> has D_NEEDGIANT flag which acquires Giant. After architectures get > >>> rid of GIANT_REQUIRED, flag can be removed. > >>> > >> Just so I understand, you are not objecting to this commit, right? > > Absolutely not, this is the right thing to do. > > > >> Just > >> pointing out that (a) my commit message was wrong and that (b) once all > >> architectures make this change (presumably more involved) we can get rid > >> of the D_NEEDGIANT in /sys/dev/mem/memdev.c? > > Exactly. > > There doesn???t seem to be a reason for i386 either. Was just looking > at the code today on the plane for unrelated reasons. > I agree. For i386, there is definitely no reason to require Giant. I looked over arm+mips+sparc64, and I do not see a reason. Note that I do not know/understand their pmap implementations, but I expect that Giant is not needed due to properties of the used (pmap) functions. Below is the trivial patch. Would be nice to get at least a nod from some arch maintainers. diff --git a/sys/arm/arm/mem.c b/sys/arm/arm/mem.c index 460a004..30d4b1d 100644 --- a/sys/arm/arm/mem.c +++ b/sys/arm/arm/mem.c @@ -82,8 +82,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags) int error = 0; vm_offset_t addr, eaddr; - GIANT_REQUIRED; - while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { diff --git a/sys/dev/mem/memdev.c b/sys/dev/mem/memdev.c index 37bad15..c3d1af1 100644 --- a/sys/dev/mem/memdev.c +++ b/sys/dev/mem/memdev.c @@ -52,7 +52,7 @@ static struct cdev *memdev, *kmemdev; static struct cdevsw mem_cdevsw = { .d_version = D_VERSION, - .d_flags = D_MEM|D_NEEDGIANT, + .d_flags = D_MEM, .d_open = memopen, .d_read = memrw, .d_write = memrw, diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index 9c83f47..b036bd3 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -86,10 +86,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags) int error = 0; vm_offset_t addr; - /* XXX UPS Why ? */ - GIANT_REQUIRED; - - if (dev2unit(dev) != CDEV_MINOR_MEM && dev2unit(dev) != CDEV_MINOR_KMEM) return EIO; diff --git a/sys/mips/mips/mem.c b/sys/mips/mips/mem.c index d40c424..08bb6b0 100644 --- a/sys/mips/mips/mem.c +++ b/sys/mips/mips/mem.c @@ -85,8 +85,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags) cnt = 0; error = 0; - GIANT_REQUIRED; - pmap_page_init(&m); while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; diff --git a/sys/sparc64/sparc64/mem.c b/sys/sparc64/sparc64/mem.c index d09f6b8..6bd5225 100644 --- a/sys/sparc64/sparc64/mem.c +++ b/sys/sparc64/sparc64/mem.c @@ -99,8 +99,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags) error = 0; ova = 0; - GIANT_REQUIRED; - while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:14:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 761586DB; Thu, 22 Jan 2015 09:14:45 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB48823E; Thu, 22 Jan 2015 09:14:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0M9Edk2070791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2015 11:14:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0M9Edk2070791 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0M9Edsh070790; Thu, 22 Jan 2015 11:14:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Jan 2015 11:14:39 +0200 From: Konstantin Belousov To: Shawn Webb Subject: Re: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms Message-ID: <20150122091439.GW42409@kib.kiev.ua> References: <201501211610.t0LGAcMg085437@svn.freebsd.org> <1421865947.6315.1.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1421865947.6315.1.camel@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:14:45 -0000 On Wed, Jan 21, 2015 at 01:45:47PM -0500, Shawn Webb wrote: > On Wed, 2015-01-21 at 16:10 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jan 21 16:10:37 2015 > > New Revision: 277487 > > URL: https://svnweb.freebsd.org/changeset/base/277487 > > > > Log: > > An update for the i915 GPU driver, which brings the code up to Linux > > commit 4d93914ae3db4a897ead4b. Some related drm infrastructure > > changes are imported as needed. > > > > Biggest update is the rewrite of the i915 gem io to more closely > > follow Linux model, althought the mechanism used by FreeBSD port is > > different. > > Hey Kostik, > > This causes my Haswell laptop to just display a blank screen on bootup. > Is there something I should be doing? I just have i915kms_load="YES" > in /boot/loader.conf. Yes, remove the i915kms_load from your loader.conf. Haswell is not supported. > > Thanks, > > Shawn From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:16:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB88C844; Thu, 22 Jan 2015 09:16:25 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579D4262; Thu, 22 Jan 2015 09:16:25 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0M9GKwp071888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2015 11:16:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0M9GKwp071888 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0M9GKmF071887; Thu, 22 Jan 2015 11:16:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Jan 2015 11:16:20 +0200 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r277489 - head/sys/kern Message-ID: <20150122091620.GX42409@kib.kiev.ua> References: <201501211632.t0LGWtOR098070@svn.freebsd.org> <20150121182444.GG15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150121182444.GG15484@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:16:25 -0000 On Wed, Jan 21, 2015 at 09:24:44PM +0300, Gleb Smirnoff wrote: > On Wed, Jan 21, 2015 at 04:32:55PM +0000, Konstantin Belousov wrote: > K> Author: kib > K> Date: Wed Jan 21 16:32:54 2015 > K> New Revision: 277489 > K> URL: https://svnweb.freebsd.org/changeset/base/277489 > K> > K> Log: > K> Do not assert that the new pipepair mutex is not initialized. The > K> backing memory contains garbage and might trigger the assertion. > > I have touched dozen of places in kernel where I do explicit M_ZERO on > allocation just to satisfy later assertion in the mtx_init. Is the > correct fix to use MTX_NEW? I think MTX_NEW is better. Note that this flag is just a month old, it was added by dchagin in r275751. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:17:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0479B9B1; Thu, 22 Jan 2015 09:17:30 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE10F275; Thu, 22 Jan 2015 09:17:29 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id bj1so608373pad.9; Thu, 22 Jan 2015 01:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=CyfZ64T99t3fOsWzkFjN6ti92maBnENABxYmeYIUvag=; b=mTtWjo3JDUEIv97fYLpq/nmgI3s95Mlp2/i8wpLV58NIiBoV2MnMXaBp9lVmu4U+NF LC148dR4UhJ2EEY8O0kZaak9Ufs3JwDK7fmBJGeospTHb20BQzKHPPch1DNHOkP+RRPD +/N1FYFiwQ+kcVOR2hT/NBfEBsT+yzMood2QDfhnCyxWzNTVMVU9izFVP0eECk6J0Xuf HbdZ6M+X4mO4kPavN4M9qdb/g1vynnnSZEKAJ3PRrteZVcth+7M+zw0FPu49YWiCfU1h 9AmfQqLVyFZbk5XHveKGFz6T/a8X5nIKyjGKqhH6B1ZhDxGWQE8YI5Fqg0EMHFmltAGD Zn8A== X-Received: by 10.70.38.239 with SMTP id j15mr366542pdk.115.1421918249323; Thu, 22 Jan 2015 01:17:29 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:d121:5f34:3218:d268? ([2601:8:ab80:7d6:d121:5f34:3218:d268]) by mx.google.com with ESMTPSA id bk8sm8599154pad.28.2015.01.22.01.17.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Jan 2015 01:17:28 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_BFBE73B5-8C12-4703-841F-12D0C005BFC3"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms From: Garrett Cooper In-Reply-To: <20150122091439.GW42409@kib.kiev.ua> Date: Thu, 22 Jan 2015 01:17:28 -0800 Message-Id: <3DCFA90E-6BF2-48E5-885E-A7D4D2C3C5C9@gmail.com> References: <201501211610.t0LGAcMg085437@svn.freebsd.org> <1421865947.6315.1.camel@gmail.com> <20150122091439.GW42409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Shawn Webb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:17:30 -0000 --Apple-Mail=_BFBE73B5-8C12-4703-841F-12D0C005BFC3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jan 22, 2015, at 1:14, Konstantin Belousov = wrote: > On Wed, Jan 21, 2015 at 01:45:47PM -0500, Shawn Webb wrote: >> On Wed, 2015-01-21 at 16:10 +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Wed Jan 21 16:10:37 2015 >>> New Revision: 277487 >>> URL: https://svnweb.freebsd.org/changeset/base/277487 >>>=20 >>> Log: >>> An update for the i915 GPU driver, which brings the code up to = Linux >>> commit 4d93914ae3db4a897ead4b. Some related drm infrastructure >>> changes are imported as needed. >>>=20 >>> Biggest update is the rewrite of the i915 gem io to more closely >>> follow Linux model, althought the mechanism used by FreeBSD port is >>> different. >>=20 >> Hey Kostik, >>=20 >> This causes my Haswell laptop to just display a blank screen on = bootup. >> Is there something I should be doing? I just have i915kms_load=3D"YES" >> in /boot/loader.conf. > Yes, remove the i915kms_load from your loader.conf. >=20 > Haswell is not supported. Hi kib@, Wouldn=92t it be better to check for supported PCI/vendor/etc IDs and = filter out the supported ones, just to avoid people running into issues = like this when first booting i915kms on Haswell, Broadwell, etc = hardware? Thanks! --Apple-Mail=_BFBE73B5-8C12-4703-841F-12D0C005BFC3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUwMAoAAoJEMZr5QU6S73eqcgH/2wPuwVyv/YLJpN4+6qcgDY5 6r16o1czRfta90XoywQhu+qqMYE96rWgSPC9TnBiZd1G/2Xsq5qS1UBfutGJjkNI QJCeLDTDmV7Jt04G8kvNtWTA6LgzXRwRApZ6YWpPfPHxBubI3LJNt3VxBWDerWJn nYD+YZIWo3l7+LPxHFgrb2l4ZChEa8BEcAK9NELA8NsQA73iUO42ew9DMXzUpD3F 7IbhSsdj0e7utqMmmRboEn+0kqc0UVnAsAO8L4Ktvhk/xTMONZ6efGe0pKMWOhAH mZl3BK8RkvRlJ3tyyamBXLC5ENe/shb89vZhBosW5be2zDAaCxCnrawubjs72/8= =Mbxh -----END PGP SIGNATURE----- --Apple-Mail=_BFBE73B5-8C12-4703-841F-12D0C005BFC3-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:23:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73D66B4B for ; Thu, 22 Jan 2015 09:23:03 +0000 (UTC) Received: from mailrelay10.public.one.com (mailrelay10.public.one.com [195.47.247.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3C4B35C for ; Thu, 22 Jan 2015 09:23:01 +0000 (UTC) X-HalOne-Cookie: 9f6213b6b59468badff61996346a9a1a4a30b6f8 X-HalOne-ID: 18b6d401-a218-11e4-9705-b82a72d06996 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cederstrand.dk; s=20140924; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to: references; bh=O3M0lAgommefxFPD/U0U/ZccpUy/AwJnKIlJb1V+bSA=; b=nu5lq11VemVT2Lk+dQ96OMUlCPkjpQV9z1LDpkboABS30y986RIualNF3za3YS1la+NvnXuh1NUtj vDWbSAdUoYHoYxuKBJBEKWCR72DYp0C16IEnNtvAFeHNlAU2XP/A/JyKvwBImsr/zHPbR5RCqSmjSG kFm19XqvBXIxwaXU= Received: from [192.168.1.58] (unknown [217.157.7.221]) by smtpfilter3.public.one.com (Halon Mail Gateway) with ESMTPSA; Thu, 22 Jan 2015 09:21:50 +0000 (GMT) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5559BE3C-DD53-4BCD-B541-DEBD07465DA9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b4 From: Erik Cederstrand In-Reply-To: <54C0B75B.9070305@selasky.org> Date: Thu, 22 Jan 2015 10:21:50 +0100 Message-Id: References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1993) Cc: Kostik Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:23:03 -0000 --Apple-Mail=_5559BE3C-DD53-4BCD-B541-DEBD07465DA9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Den 22/01/2015 kl. 09.39 skrev Hans Petter Selasky : >=20 > Are you saying that pieces of code that runs completely unlocked using = "volatile" as only synchronization mechanism is better than what I would = call a temporary and hopefully short TCP stack performance loss? >=20 > I don't understand? How frequently do you reboot your boxes? Maybe one = every day? And you don't care? Hans, I'm just a spectator here, but please do yourself and the project = a favor and back out your change, go back to the Phabricator review once = more and let the review process roll until everyone is satisfied. Although it's not very evident in this thread, I'm sure everyone = actually appreciates your work. I also acknowledge that it's frustrating = to back out a commit that you have spent a lot of effort on, and which = fixes actual bugs. It's also frustrating to get insufficient feedback on a code review, but = you certainly got people's attention now. Now you need to trust that the = people voicing concerns will step up and provide constructive feedback = in Phabricator, so this can be committed in a timely manner, in a = quality that we expect from FreeBSD. Kind regards, Erik --Apple-Mail=_5559BE3C-DD53-4BCD-B541-DEBD07465DA9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUwMEvAAoJEFWwJk18WUOGNhoP/24vIV3iwuoK0+rxRI4XgI/W 5UrPI9CrUPKihaYu9TGnd1uyfXFNnMjW1d/p/8KGET8jowLG+8Q/WYnxKZfB1lQ2 yW0PRFNwH9xNYdPiW5tMQOW8S1mBaxW6rl+BjZB8VxM3h2BM9I+eM4HENbSzC1Un nvW8P8q6jUjpDiWVJSiUGuwXP//fnVAQmL/MeecFqeJvUqVgxTWixcucBEnzBYnn cButKWRBTK8B87y7eFMSCmbEhxe0bLmn1mBKpbkzEVQCFZsLZekPqoCT2GyDOA8k B/i1qlGuMZeOWLnSg2gshCCRYYOpgwVSzqegYurz4jVvR4QGufd7c1kgc+3DxX45 jnWEMprh6XlLajgrJIUcV4unWtNAlFB8WlE3o8UR+ufHqsFu6Fmy/GPqMzy3tTfJ sRk6k+5SkVHnx+8UBEncNzYIrbHZj7f0Z0tWfg3wiLNLop2BVLBCAs6+yJnGL2Ef y17J/Kidvj9+P51Grx89KzHKt1UFi4F/1uFeYHNFA27d+1qe5LQMDI/8RfV/xiYL 7gvfBCURGPNJMTSqZbj7NTdYiQ7JoCITRtKxXHN/9XMj4+NqmWnR3O97C1Lrbu4S B5vHdQNGluS6buyfBTK3pba5oUvBxqfsK39sOmTU7YVZ9YZuTOcMhg0QPKMrd6l0 R5ucUgtZ39gk09O6bqEA =j32Y -----END PGP SIGNATURE----- --Apple-Mail=_5559BE3C-DD53-4BCD-B541-DEBD07465DA9-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:25:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8E80CBF; Thu, 22 Jan 2015 09:25:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4A2737C; Thu, 22 Jan 2015 09:25:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0M9PWQ8077437; Thu, 22 Jan 2015 09:25:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0M9PWpf077436; Thu, 22 Jan 2015 09:25:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501220925.t0M9PWpf077436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 22 Jan 2015 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277527 - head/tools/regression/file/flock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:25:32 -0000 Author: ngie Date: Thu Jan 22 09:25:31 2015 New Revision: 277527 URL: https://svnweb.freebsd.org/changeset/base/277527 Log: Make this compile with WARNS=6 and clang/gcc MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/file/flock/flock.c Modified: head/tools/regression/file/flock/flock.c ============================================================================== --- head/tools/regression/file/flock/flock.c Thu Jan 22 09:07:02 2015 (r277526) +++ head/tools/regression/file/flock/flock.c Thu Jan 22 09:25:31 2015 (r277527) @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#include #include #include #ifdef __FreeBSD__ @@ -52,6 +53,10 @@ #endif #include #else +#ifndef nitems +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) +#endif + #ifndef __unused #ifdef __GNUC__ #define __unused __attribute__((__unused__)) @@ -61,7 +66,7 @@ #endif #endif -int verbose = 0; +static int verbose = 0; static int make_file(const char *pathname, off_t sz) @@ -1519,7 +1524,7 @@ struct test { int intr; /* non-zero if the test interrupts a lock */ }; -struct test tests[] = { +static struct test tests[] = { { test1, 1, 0 }, { test2, 2, 0 }, { test3, 3, 1 }, @@ -1537,7 +1542,6 @@ struct test tests[] = { { test15, 15, 1 }, { test16, 16, 1 }, }; -int test_count = sizeof(tests) / sizeof(tests[0]); int main(int argc, const char *argv[]) @@ -1545,7 +1549,7 @@ main(int argc, const char *argv[]) int testnum; int fd; int nointr; - int i; + unsigned i; struct sigaction sa; int test_argc; const char **test_argv; @@ -1583,7 +1587,7 @@ main(int argc, const char *argv[]) } #endif - for (i = 0; i < test_count; i++) { + for (i = 0; i < nitems(tests); i++) { if (tests[i].intr && nointr) continue; if (!testnum || tests[i].num == testnum) From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:49:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E363398; Thu, 22 Jan 2015 09:49:23 +0000 (UTC) Received: from mail-yk0-x22d.google.com (mail-yk0-x22d.google.com [IPv6:2607:f8b0:4002:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D19357F0; Thu, 22 Jan 2015 09:49:22 +0000 (UTC) Received: by mail-yk0-f173.google.com with SMTP id 142so249047ykq.4; Thu, 22 Jan 2015 01:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=XuppOt+MvXZLfBycHGIcxILmL8Mj6/bFmzIanlcg1k4=; b=DIIrSY2Z9szGPS2AAPJdMrycrAs6ZgQXckjWEeNmb1EkWOeYA5trjXO6LRF9ObCWAz y5iMl3M+m+94O60GrRFWVCFU+ZvbNJLb2wL4yqYzwA5ZEveEBSiPEKmNpfy0yQKLAiwU oKPGlf/jaTCzcTHKwY/8dBwpdCCBxqEebXl1Vwo9PP6L4od/B7OQVgYKJsTJughlu1Lb b0tByo8ScnSyH98Dp8S/8rBtw70yDxF6cGFX5SCzUQvjT7GEkBdSO6WcadlqcwkR5EAq vE3q+cv34MhdKr782xgvrrrah1Xs/9/Q2c5Jh5R3y3F/bx91GaSsUN+hBK3YiT5L18lf cOIw== MIME-Version: 1.0 X-Received: by 10.236.40.116 with SMTP id e80mr213054yhb.186.1421920161829; Thu, 22 Jan 2015 01:49:21 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.70.132 with HTTP; Thu, 22 Jan 2015 01:49:21 -0800 (PST) In-Reply-To: <54C0B75B.9070305@selasky.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> Date: Thu, 22 Jan 2015 01:49:21 -0800 X-Google-Sender-Auth: 2MC7MWlTQOqEyhpeI1znneXyvGk Message-ID: Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: "K. Macy" To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 09:49:23 -0000 >> Sigh, you still do not understand. It is your duty to identify all pieces >> which break after your change. After that, we can argue whether each of >> them is critical or not to allow the migration. But this must have been >> done before the KPI change hit the tree. >> > > Hi, > > Are you saying that pieces of code that runs completely unlocked using > "volatile" as only synchronization mechanism is better than what I would > call a temporary and hopefully short TCP stack performance loss? > Hans - The project has long standing expectations about how changes are made to core subsystems. When you hear "understand" your ego intercedes - put that aside. I told you this first this afternoon and others have repeated it several times. When you change a KPI, consumers are updated at the same time - _period_. This protocol is not up for debate. I'm glad that others have the presence of mind and fortitude to insist on this. Your work is appreciated, but whether or not you agree about this is not relevant. We're all sorry if this upsets you but this is only a temporary setback. Channelling this work through phabricator will go a long way towards smoothing over the current friction. Think about the greater goal here, not whether this is "done" now or in a week. -K From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 10:06:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 719F86EA; Thu, 22 Jan 2015 10:06:27 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F6E9BF; Thu, 22 Jan 2015 10:06:26 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D40011FE023; Thu, 22 Jan 2015 11:06:23 +0100 (CET) Message-ID: <54C0CBD2.9020206@selasky.org> Date: Thu, 22 Jan 2015 11:07:14 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 10:06:27 -0000 On 01/22/15 10:49, K. Macy wrote: >>> Sigh, you still do not understand. It is your duty to identify all pieces >>> which break after your change. After that, we can argue whether each of >>> them is critical or not to allow the migration. But this must have been >>> done before the KPI change hit the tree. >>> >> >> Hi, >> >> Are you saying that pieces of code that runs completely unlocked using >> "volatile" as only synchronization mechanism is better than what I would >> call a temporary and hopefully short TCP stack performance loss? >> > > > Hans - The project has long standing expectations about how changes > are made to core subsystems. When you hear "understand" your ego > intercedes - put that aside. I told you this first this afternoon and > others have repeated it several times. When you change a KPI, > consumers are updated at the same time - _period_. This protocol is > not up for debate. I'm glad that others have the presence of mind and > fortitude to insist on this. Your work is appreciated, but whether or > not you agree about this is not relevant. > > We're all sorry if this upsets you but this is only a temporary > setback. Channelling this work through phabricator will go a long way > towards smoothing over the current friction. Think about the greater > goal here, not whether this is "done" now or in a week. > Hi Kip, That is fine by me. I didn't know about the "protocol" you refer to until now. I will revert my callout patch and hopefully without causing any build issues and then we can have another round in the Phabricator to iron out the TCP stack issues and possibly others. Sounds good. Please give me some hours to ensure that the pullout doesn't cause any build breakages. Thank you! --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 10:10:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97BB4895; Thu, 22 Jan 2015 10:10:49 +0000 (UTC) Received: from mail-yk0-x238.google.com (mail-yk0-x238.google.com [IPv6:2607:f8b0:4002:c07::238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51190A15; Thu, 22 Jan 2015 10:10:49 +0000 (UTC) Received: by mail-yk0-f184.google.com with SMTP id 20so122046yks.1; Thu, 22 Jan 2015 02:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=hFfFxaHbl34gw1YFkWYVudSrqFx4qwqPYkvL6C39B0o=; b=Hg0li6dZ4he+CegsWnwYrJ1bUe1jAAvRaFhKJ8wNwIDqEPM+Is24wdpHdCcnUmnDm5 53z7zpQj7VT8wWJu6YeDoBxKwsrFSliaIf/qVFNx8lFepbr99it2gCIv9PFiSs03ISXg eEkAGHVOZtuJhExWrHNyKF0MkLbz8t+F/AAaKxCPNFB48kvImHL32D5NR7rH4b2Q0a2E 9OdMs2b+NHlQUOWlICmLNTWBeJJ5ijJN4WaRE5pPMFfiMcmYcwo3hbaW+rvSgvxmn/Wa hoXa/+8yK+PNHJOHtdeF1nNSEPvArnK3PvUawzHc99Wget+wBRHgkB5FZrZOLP+eOGsi NF+g== X-Received: by 10.50.142.71 with SMTP id ru7mr165143igb.0.1421921448591; Thu, 22 Jan 2015 02:10:48 -0800 (PST) X-Google-Doc-Id: 6b879da8396577f2 X-Google-Web-Client: true Date: Thu, 22 Jan 2015 02:10:47 -0800 (PST) From: roseknr1 To: bsdmailinglist@googlegroups.com Message-Id: <6e8555f0-2b8e-4f37-b33a-472c65f0c2d4@googlegroups.com> In-Reply-To: <201501151532.t0FFWV2Y037455@svn.freebsd.org> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys MIME-Version: 1.0 X-Google-IP: 117.248.6.188 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, hselasky@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 10:10:49 -0000 http://www.mrs-realestate.blogspot.in/ 2400sq.ft 2400*200=480000 only near (sez-3) tamilnadu 6km only sez-3 after 10 year land valu woooooooooooo contact:7373730713(sms only) From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 10:38:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 940A8104; Thu, 22 Jan 2015 10:38:24 +0000 (UTC) Received: from frv25.fwdcdn.com (frv25.fwdcdn.com [212.42.77.25]) by mx1.freebsd.org (Postfix) with ESMTP id 507C7CFA; Thu, 22 Jan 2015 10:38:24 +0000 (UTC) Received: from [10.10.14.27] (helo=frv27.fwdcdn.com) by frv25.fwdcdn.com QID:1YEEnx-000JOR-6F/RC:4; Thu, 22 Jan 2015 12:16:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=GWnMaQ00/7UAWeHXAoZVx8hsq792WHI4TleQK1GvDLo=; b=NlBDqMT2c9m6xtEVdA+5wgClRhaJ6BX0zPTTWg6QM2gJW1uivZ1AAFqQAV7TbQyENbStfqgpm5tCcYjjx63FU6EPTvHxKhv9hlOQ/lltCLYirw/ib8T0puJbIDS9zXlBO5DO4WeFKPa3LSgKBPKAc0mS9qDd04R7NqRlW2REp2w=; Received: from [178.137.225.164] (helo=nonamehost.local) by frv27.fwdcdn.com with esmtpsa ID 1YEEno-0001ET-DQ ; Thu, 22 Jan 2015 12:15:52 +0200 Date: Thu, 22 Jan 2015 12:15:51 +0200 From: Ivan Klymenko To: "Max N. Boyarov" Subject: Re: svn commit: r277487 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms Message-ID: <20150122121551.77a7a9fb@nonamehost.local> In-Reply-To: References: <201501211610.t0LGAcMg085437@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=178.137.225.164; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-Ukrnet-Yellow: 0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 10:38:24 -0000 =D0=92 Thu, 22 Jan 2015 11:18:37 +0300 "Max N. Boyarov" =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Wed, Jan 21, 2015 at 7:10 PM, Konstantin Belousov > wrote: > > Author: kib > > Date: Wed Jan 21 16:10:37 2015 > > New Revision: 277487 > > URL: https://svnweb.freebsd.org/changeset/base/277487 > > > > Log: > > An update for the i915 GPU driver, which brings the code up to > > Linux commit 4d93914ae3db4a897ead4b. Some related drm > > infrastructure changes are imported as needed. > > > > Biggest update is the rewrite of the i915 gem io to more closely > > follow Linux model, althought the mechanism used by FreeBSD port > > is different. > > > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 month >=20 > Hi, after this commit i have many error messages like: >=20 > error: [drm:pid1121:gen6_sanitize_pm] *ERROR* Power management > discrepancy: GEN6_RP_INTERRUPT_LIMITS expected 18070000, was 18000000 >=20 >=20 > On my thinkpad t530 > info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). > info: [drm] Driver supports precise vblank timestamp query. > drmn1: taking over the fictitious range 0xe0000000-0xf0000000 > info: [drm] Enabling RC6 states: RC6 off, RC6p off, RC6pp off > info: [drm] Connector LVDS-1: get mode from tunables: > info: [drm] - kern.vt.fb.modes.LVDS-1 > info: [drm] - kern.vt.fb.default_mode > info: [drm] Connector VGA-1: get mode from tunables: > info: [drm] - kern.vt.fb.modes.VGA-1 > info: [drm] - kern.vt.fb.default_mode > fbd1 on drmn1 >=20 >=20 >=20 Hi. I have similar error messages like: info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). info: [drm] Driver supports precise vblank timestamp query. info: [drm] Enabling RC6 states: RC6 on, RC6p on, RC6pp on drmn0: taking over the fictitious range 0xc0000000-0xd0000000 info: [drm] Connector LVDS-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.LVDS-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector VGA-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.VGA-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector HDMI-A-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.HDMI-A-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector DP-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.DP-1 info: [drm] - kern.vt.fb.default_mode info: [drm] GMBUS timed out, falling back to bit banging on pin 7 [gmbus bu= s dpd] fbd0 on drmn0 VT: Replacing driver "vga" with new "fb". info: [drm] Initialized i915 1.6.0 20080730 error: [drm:pid12:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed= ... blt ring idle [waiting on 1104125, at 1104125], missed IRQ? ... error: [drm:pid9861:gen6_sanitize_pm] *ERROR* Power management discrepancy:= GEN6_RP_INTERRUPT_LIMITS expected 18000000, was 12060000 ... error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... G= PU hung info: [drm] capturing error event; look for more information in sysctl hw.d= ri.0.info.i915_error_state info: [drm] Enabling RC6 states: RC6 on, RC6p on, RC6pp on error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... G= PU hung info: [drm] Enabling RC6 states: RC6 on, RC6p on, RC6pp on error: [drm:pid1374:gen6_sanitize_pm] *ERROR* Power management discrepancy:= GEN6_RP_INTERRUPT_LIMITS expected 18000000, was 12060000 error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... G= PU hung info: [drm] Enabling RC6 states: RC6 on, RC6p on, RC6pp on error: [drm:pid9861:gen6_sanitize_pm] *ERROR* Power management discrepancy:= GEN6_RP_INTERRUPT_LIMITS expected 18000000, was 12060000 pid 1374 (Xorg), uid 0: exited on signal 6 error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer error: [drm:pid7:i915_gem_object_unbind] *ERROR* Attempting to unbind pinne= d buffer ... My hardware described in this report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D194766 Thanks. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:12:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B456B76; Thu, 22 Jan 2015 11:12:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43FA21A2; Thu, 22 Jan 2015 11:12:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MBChBX027397; Thu, 22 Jan 2015 11:12:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MBCg57027392; Thu, 22 Jan 2015 11:12:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501221112.t0MBCg57027392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Jan 2015 11:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277528 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:12:43 -0000 Author: hselasky Date: Thu Jan 22 11:12:42 2015 New Revision: 277528 URL: https://svnweb.freebsd.org/changeset/base/277528 Log: Revert for r277213: FreeBSD developers need more time to review patches in the surrounding areas like the TCP stack which are using MPSAFE callouts to restore distribution of callouts on multiple CPUs. Bump the __FreeBSD_version instead of reverting it. Suggested by: kmacy, adrian, glebius and kib Differential Revision: https://reviews.freebsd.org/D1438 Modified: head/share/man/man9/Makefile head/share/man/man9/timeout.9 head/sys/kern/init_main.c head/sys/kern/kern_condvar.c head/sys/kern/kern_lock.c head/sys/kern/kern_switch.c head/sys/kern/kern_synch.c head/sys/kern/kern_thread.c head/sys/kern/kern_timeout.c head/sys/kern/subr_sleepqueue.c head/sys/ofed/include/linux/completion.h head/sys/sys/_callout.h head/sys/sys/callout.h head/sys/sys/param.h head/sys/sys/proc.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jan 22 09:25:31 2015 (r277527) +++ head/share/man/man9/Makefile Thu Jan 22 11:12:42 2015 (r277528) @@ -1570,7 +1570,6 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_active.9 \ timeout.9 callout_deactivate.9 \ timeout.9 callout_drain.9 \ - timeout.9 callout_drain_async.9 \ timeout.9 callout_handle_init.9 \ timeout.9 callout_init.9 \ timeout.9 callout_init_mtx.9 \ Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Thu Jan 22 09:25:31 2015 (r277527) +++ head/share/man/man9/timeout.9 Thu Jan 22 11:12:42 2015 (r277528) @@ -29,14 +29,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2015 +.Dd October 8, 2014 .Dt TIMEOUT 9 .Os .Sh NAME .Nm callout_active , .Nm callout_deactivate , .Nm callout_drain , -.Nm callout_drain_async , .Nm callout_handle_init , .Nm callout_init , .Nm callout_init_mtx , @@ -64,232 +63,279 @@ .In sys/systm.h .Bd -literal typedef void timeout_t (void *); -typedef void callout_func_t (void *); .Ed +.Ft int +.Fn callout_active "struct callout *c" +.Ft void +.Fn callout_deactivate "struct callout *c" +.Ft int +.Fn callout_drain "struct callout *c" +.Ft void +.Fn callout_handle_init "struct callout_handle *handle" +.Bd -literal +struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); +.Ed +.Ft void +.Fn callout_init "struct callout *c" "int mpsafe" +.Ft void +.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" +.Ft void +.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" +.Ft void +.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" +.Ft int +.Fn callout_pending "struct callout *c" +.Ft int +.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" +.Ft int +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ +"void *arg" +.Ft int +.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ +"void *arg" "int cpu" +.Ft int +.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" +.Ft int +.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int flags" +.Ft int +.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" +.Ft int +.Fn callout_schedule "struct callout *c" "int ticks" +.Ft int +.Fn callout_schedule_curcpu "struct callout *c" "int ticks" +.Ft int +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" +.Ft int +.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "int flags" +.Ft int +.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "int flags" +.Ft int +.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "int cpu" "int flags" +.Ft int +.Fn callout_stop "struct callout *c" +.Ft struct callout_handle +.Fn timeout "timeout_t *func" "void *arg" "int ticks" +.Ft void +.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" .Sh DESCRIPTION The .Nm callout API is used to schedule a call to an arbitrary function at a specific -time in the future in a single-shot fashion. -Consumers of this API are required to allocate a -.Pq struct callout -structure for each pending function invocation. -The +time in the future. +Consumers of this API are required to allocate a callout structure .Pq struct callout -structure stores the full state about any pending function call and -should be drained by a call to -.Fn callout_drain -or -.Fn callout_drain_async -before freeing. -.Sh INITIALISATION -.Ft void -.Fn callout_handle_init "struct callout_handle *handle" -This function is deprecated and is used to prepare a -.Pq struct callout_handle -structure before it can be used the first time. -If this function is called on a pending timeout, the pending timeout -cannot be cancelled and the -.Fn untimeout -function will return as if there was no timeout pending. +for each pending function invocation. +This structure stores state about the pending function invocation including +the function to be called and the time at which the function should be invoked. +Pending function calls can be cancelled or rescheduled to a different time. +In addition, +a callout structure may be reused to schedule a new function call after a +scheduled call is completed. +.Pp +Callouts only provide a single-shot mode. +If a consumer requires a periodic timer, +it must explicitly reschedule each function call. +This is normally done by rescheduling the subsequent call within the called +function. .Pp -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" -This macro is deprecated and can be used instead of -.Fn callout_handle_init -to assign the default state to the -.Pq struct callout_handle -structure when declaring static timeouts. +Callout functions must not sleep. +They may not acquire sleepable locks, +wait on condition variables, +perform blocking allocation requests, +or invoke any other action that might sleep. .Pp -.Ft void -.Fn callout_init "struct callout *c" "int mpsafe" -This function prepares a -.Pq struct callout -structure before it can be used. -This function should not be used when the callout is pending a timeout. +Each callout structure must be initialized by +.Fn callout_init , +.Fn callout_init_mtx , +.Fn callout_init_rm , +or +.Fn callout_init_rw +before it is passed to any of the other callout functions. +The +.Fn callout_init +function initializes a callout structure in +.Fa c +that is not associated with a specific lock. If the .Fa mpsafe -argument is non-zero, the callback function will be running unlocked. -Else the Giant mutex will be locked before calling the callback function. +argument is zero, +the callout structure is not considered to be +.Dq multi-processor safe ; +and the Giant lock will be acquired before calling the callout function +and released when the callout function returns. .Pp -.Ft void -.Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" -This function prepares a -.Pq struct callout -structure before it can be used. -This function should not be used when the callout is pending a timeout. The -.Fa mtx -argument should be non-zero and should specify a pointer to a valid -spinlock type of mutex or a valid regular non-sleepable mutex which -the callback subsystem should lock before calling the callback -function. -Valid +.Fn callout_init_mtx , +.Fn callout_init_rm , +and +.Fn callout_init_rw +functions initialize a callout structure in +.Fa c +that is associated with a specific lock. +The lock is specified by the +.Fa mtx , +.Fa rm , +or +.Fa rw +parameter. +The associated lock must be held while stopping or rescheduling the +callout. +The callout subsystem acquires the associated lock before calling the +callout function and releases it after the function returns. +If the callout was cancelled while the callout subsystem waited for the +associated lock, +the callout function is not called, +and the associated lock is released. +This ensures that stopping or rescheduling the callout will abort any +previously scheduled invocation. +.Pp +Only regular mutexes may be used with +.Fn callout_init_mtx ; +spin mutexes are not supported. +A sleepable read-mostly lock +.Po +one initialized with the +.Dv RM_SLEEPABLE +flag +.Pc +may not be used with +.Fn callout_init_rm . +Similarly, other sleepable lock types such as +.Xr sx 9 +and +.Xr lockmgr 9 +cannot be used with callouts because sleeping is not permitted in +the callout subsystem. +.Pp +These .Fa flags -are: +may be specified for +.Fn callout_init_mtx , +.Fn callout_init_rm , +or +.Fn callout_init_rw : .Bl -tag -width ".Dv CALLOUT_RETURNUNLOCKED" .It Dv CALLOUT_RETURNUNLOCKED -It is assumed that the callout function has released the specified -mutex before returning. -Else the callout subsystem will release the specified mutex after the -callout function has returned. +The callout function will release the associated lock itself, +so the callout subsystem should not attempt to unlock it +after the callout function returns. +.It Dv CALLOUT_SHAREDLOCK +The lock is only acquired in read mode when running the callout handler. +This flag is ignored by +.Fn callout_init_mtx . .El .Pp -.Ft void -.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" -This function is the same like the -.Fn callout_init_mtx -function except it accepts a read-mostly type of lock. -The read-mostly lock must not be initialised with the -.Dv RM_SLEEPABLE -flag. +The function +.Fn callout_stop +cancels a callout +.Fa c +if it is currently pending. +If the callout is pending, then +.Fn callout_stop +returns a non-zero value. +If the callout is not set, +has already been serviced, +or is currently being serviced, +then zero will be returned. +If the callout has an associated lock, +then that lock must be held when this function is called. .Pp -.Ft void -.Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" -This function is the same like the -.Fn callout_init_mtx -function except it accepts a reader-writer type of lock. -.Sh SCHEDULING CALLOUTS -.Ft struct callout_handle -.Fn timeout "timeout_t *func" "void *arg" "int ticks" -This function is deprecated and schedules a call to the function given by the argument -.Fa func -to take place after +The function +.Fn callout_drain +is identical to +.Fn callout_stop +except that it will wait for the callout +.Fa c +to complete if it is already in progress. +This function MUST NOT be called while holding any +locks on which the callout might block, or deadlock will result. +Note that if the callout subsystem has already begun processing this +callout, then the callout function may be invoked before +.Fn callout_drain +returns. +However, the callout subsystem does guarantee that the callout will be +fully stopped before +.Fn callout_drain +returns. +.Pp +The +.Fn callout_reset +and +.Fn callout_schedule +function families schedule a future function invocation for callout +.Fa c . +If +.Fa c +already has a pending callout, +it is cancelled before the new invocation is scheduled. +These functions return a non-zero value if a pending callout was cancelled +and zero if there was no pending callout. +If the callout has an associated lock, +then that lock must be held when any of these functions are called. +.Pp +The time at which the callout function will be invoked is determined by +either the +.Fa ticks +argument or the +.Fa sbt , +.Fa pr , +and +.Fa flags +arguments. +When +.Fa ticks +is used, +the callout is scheduled to execute after .Fa ticks Ns No /hz seconds. Non-positive values of .Fa ticks are silently converted to the value .Sq 1 . -The -.Fa func -argument should be a valid pointer to a function that takes a single -.Fa void * -argument. -Upon invocation, the -.Fa func -function will receive -.Fa arg -as its only argument. -The Giant lock is locked when the -.Fa arg -function is invoked and should not be unlocked by this function. -The returned value from -.Fn timeout -is a -.Ft struct callout_handle -structure which can be used in conjunction with the -.Fn untimeout -function to request that a scheduled timeout be cancelled. -As handles are recycled by the system, it is possible, although unlikely, -that a handle from one invocation of -.Fn timeout -may match the handle of another invocation of -.Fn timeout -if both calls used the same function pointer and argument, and the first -timeout is expired or canceled before the second call. -Please ensure that the function and argument pointers are unique when using this function. .Pp -.Ft int -.Fn callout_reset "struct callout *c" "int ticks" "callout_func_t *func" "void *arg" -This function is used to schedule or re-schedule a callout. -This function at first stops the callout given by the -.Fa c -argument, if any. -Then it will start the callout given by the -.Fa c -argument. -The relative time until the timeout callback happens is given by the -.Fa ticks -argument. -The number of ticks in a second is defined by -.Dv hz -and can vary from system to system. -This function returns a non-zero value if the given callout was pending and -the callback function was prevented from being called. -Else a value of zero is returned. -If a lock is associated with the callout given by the -.Fa c -argument and it is exclusivly locked when this function is called this -function will always ensure that previous callback function, if any, -is never reached. -In other words the callout will be atomically restarted. -Else there is no such guarantee. -The callback function is given by the -.Fa func -argument and its function argument is given by the -.Fa arg -argument. -.Pp -.Ft int -.Fn callout_reset_curcpu "struct callout *c" "int ticks" "callout_func_t *func" \ -"void *arg" -This function works the same like the -.Fn callout_reset -function except the callback function given by the -.Fa func -argument will be executed on the same CPU which called this function. -A change in the CPU selection can happen if the callout has a lock -associated with it and is locked when this function is called. -A change in the CPU selection cannot happen if this function is -re-scheduled inside a callout function. -Else the callback function given by the -.Fa func -argument will be executed on the same CPU like previously done. -.Pp -.Ft int -.Fn callout_reset_on "struct callout *c" "int ticks" "callout_func_t *func" \ -"void *arg" "int cpu" -This function works the same like the -.Fn callout_reset -function except the callback function given by the -.Fa func -argument will be executed on the CPU given by the -.Fa cpu -argument. -A change in the CPU selection can happen if the callout has a lock -associated with it and is locked when this function is called. -A change in the CPU selection cannot happen if this function is -re-scheduled inside a callout function. -Else the callback function given by the -.Fa func -argument will be executed on the same CPU like previously done. -.Pp -.Ft int -.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" -This function works the same like the -.Fn callout_reset -function except the relative or absolute time after which the timeout -callback should happen is given by the +The +.Fa sbt , +.Fa pr , +and +.Fa flags +arguments provide more control over the scheduled time including +support for higher resolution times, +specifying the precision of the scheduled time, +and setting an absolute deadline instead of a relative timeout. +The callout is scheduled to execute in a time window which begins at +the time specified in .Fa sbt -argument and extends for the amount of time specified in the -.Fa pr -argument. -This function is used when you need high precision timeouts. -If the +and extends for the amount of time specified in +.Fa pr . +If .Fa sbt -argument specifies a time in the past, +specifies a time in the past, the window is adjusted to start at the current time. A non-zero value for .Fa pr allows the callout subsystem to coalesce callouts scheduled close to each other into fewer timer interrupts, reducing processing overhead and power consumption. -The +These .Fa flags -argument may be non-zero to adjust the interpretation of the +may be specified to adjust the interpretation of .Fa sbt -and the -.Fa pr -arguments: +and +.Fa pr : .Bl -tag -width ".Dv C_DIRECT_EXEC" .It Dv C_ABSOLUTE Handle the .Fa sbt argument as an absolute time since boot. -By default, the +By default, .Fa sbt -argument is treated like a relative amount of time, +is treated as a relative amount of time, similar to .Fa ticks . .It Dv C_DIRECT_EXEC @@ -301,7 +347,7 @@ Callout functions run in this context ma and should be as small as possible because they run with absolute priority. .It Fn C_PREL Specifies relative event time precision as binary logarithm of time interval -divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4 and so on. +divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. Note that the larger of .Fa pr or this value is used as the length of the time window. @@ -314,215 +360,65 @@ Align the timeouts to calls if possible. .El .Pp -.Ft int -.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "callout_func_t *func" "void *arg" "int flags" -This function works the same like the -.Fn callout_reset_sbt -function except the callback function given by the -.Fa func -argument will be executed on the same CPU which called this function. -A change in the CPU selection can happen if the callout has a lock -associated with it and is locked when this function is called. -A change in the CPU selection cannot happen if this function is -re-scheduled inside a callout function. -Else the callback function given by the -.Fa func -argument will be executed on the same CPU like previously done. -.Pp -.Ft int -.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "callout_func_t *func" "void *arg" "int cpu" "int flags" -This function works the same like the -.Fn callout_reset_sbt -function except the callback function given by the +The +.Fn callout_reset +functions accept a .Fa func -argument will be executed on the CPU given by the -.Fa cpu +argument which identifies the function to be called when the time expires. +It must be a pointer to a function that takes a single +.Fa void * argument. -A change in the CPU selection can happen if the callout has a lock -associated with it and is locked when this function is called. -A change in the CPU selection cannot happen if this function is -re-scheduled inside a callout function. -Else the callback function given by the +Upon invocation, .Fa func -argument will be executed on the same CPU like previously done. -.Pp -.Ft int -.Fn callout_schedule "struct callout *c" "int ticks" -This function works the same like the -.Fn callout_reset -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Pp -.Ft int -.Fn callout_schedule_curcpu "struct callout *c" "int ticks" -This function works the same like the -.Fn callout_reset_curcpu -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Pp -.Ft int -.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" -This function works the same like the -.Fn callout_reset_on -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Pp -.Ft int -.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int flags" -This function works the same like the -.Fn callout_reset_sbt -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Pp -.Ft int -.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int flags" -This function works the same like the -.Fn callout_reset_sbt_curcpu -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Pp -.Ft int -.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \ -"sbintime_t pr" "int cpu" "int flags" -This function works the same like the -.Fn callout_reset_sbt_on -function except it re-uses the callback function and the callback argument -already stored in the -.Pq struct callout -structure. -.Sh CHECKING THE STATE OF CALLOUTS -.Ft int -.Fn callout_pending "struct callout *c" -This function returns non-zero if the callout pointed to by the -.Fa c -argument is pending for callback. -Else this function returns zero. -This function returns zero when inside the callout function if the -callout is not re-scheduled. -.Pp -.Ft int -.Fn callout_active "struct callout *c" -This function is deprecated and returns non-zero if the callout -pointed to by the -.Fa c -argument was scheduled in the past. -Else this function returns zero. -This function also returns zero after the -.Fn callout_deactivate -or the -.Fn callout_stop -or the -.Fn callout_drain -or the -.Fn callout_drain_async -function is called on the same callout as given by the -.Fa c -argument. -.Pp -.Ft void -.Fn callout_deactivate "struct callout *c" -This function is deprecated and ensures that subsequent calls to the -.Fn callout_activate -function returns zero until the callout is scheduled again. -.Sh STOPPING CALLOUTS -.Ft void -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" -This function is deprecated and cancels the timeout associated with the -.Fa handle -argument using the function pointed to by the +will receive +.Fa arg +as its only argument. +The +.Fn callout_schedule +functions reuse the .Fa func -argument and having the +and .Fa arg -arguments to validate the handle. -If the handle does not correspond to a timeout with -the function +arguments from the previous callout. +Note that one of the +.Fn callout_reset +functions must always be called to initialize .Fa func -taking the argument +and .Fa arg -no action is taken. The -.Fa handle -must be initialised by a previous call to -.Fn timeout , -.Fn callout_handle_init -or assigned the value of -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" -before being passed to -.Fn untimeout . -The behavior of calling -.Fn untimeout -with an uninitialised handle -is undefined. +before one of the +.Fn callout_schedule +functions can be used. .Pp -.Ft int -.Fn callout_stop "struct callout *c" -This function is used to stop a timeout function invocation associated with the callout pointed to by the -.Fa c -argument, in a non-blocking fashion. -This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialised. -This function returns a non-zero value if the given callout was pending and -the callback function was prevented from being called. -Else a value of zero is returned. -If a lock is associated with the callout given by the -.Fa c -argument and it is exclusivly locked when this function is called, the -.Fn callout_stop -function will always ensure that the callback function is never reached. -In other words the callout will be atomically stopped. -Else there is no such guarantee. -.Sh DRAINING CALLOUTS -.Ft int -.Fn callout_drain "struct callout *c" -This function works the same like the -.Fn callout_stop -function except it ensures that all callback functions have returned and there are no more references to the callout pointed to by the -.Fa c -argument inside the callout subsystem before it returns. -Also this function ensures that the lock, if any, associated with the -callout is no longer being used. -When this function returns, it is safe to free the callout structure pointed to by the -.Fa c -argument. +The callout subsystem provides a softclock thread for each CPU in the system. +Callouts are assigned to a single CPU and are executed by the softclock thread +for that CPU. +Initially, +callouts are assigned to CPU 0. +The +.Fn callout_reset_on , +.Fn callout_reset_sbt_on , +.Fn callout_schedule_on +and +.Fn callout_schedule_sbt_on +functions assign the callout to CPU +.Fa cpu . +The +.Fn callout_reset_curcpu , +.Fn callout_reset_sbt_curpu , +.Fn callout_schedule_curcpu +and +.Fn callout_schedule_sbt_curcpu +functions assign the callout to the current CPU. +The +.Fn callout_reset , +.Fn callout_reset_sbt , +.Fn callout_schedule +and +.Fn callout_schedule_sbt +functions schedule the callout to execute in the softclock thread of the CPU +to which it is currently assigned. .Pp -.Ft int -.Fn callout_drain_async "struct callout *c" "callout_func_t *fn" "void *arg" -This function is non-blocking and works the same like the -.Fn callout_stop -function except if it returns non-zero it means the callback function pointed to by the -.Fa fn -argument will be called back with the -.Fa arg -argument when all references to the callout pointed to by the -.Fa c -argument are gone. -If this function returns zero, it is safe to free the callout structure pointed to by the -.Fa c -argument right away. -.Sh CALLOUT FUNCTION RESTRICTIONS -Callout functions must not sleep. -They may not acquire sleepable locks, wait on condition variables, -perform blocking allocation requests, or invoke any other action that -might sleep. -.Sh CALLOUT SUBSYSTEM INTERNALS -The callout subsystem has its own set of spinlocks to protect its internal state. -The callout subsystem provides a softclock thread for each CPU in the -system. -Callouts are assigned to a single CPU and are executed by the -softclock thread for that CPU. -Initially, callouts are assigned to CPU 0. Softclock threads are not pinned to their respective CPUs by default. The softclock thread for CPU 0 can be pinned to CPU 0 by setting the .Va kern.pin_default_swi @@ -531,7 +427,50 @@ Softclock threads for CPUs other than ze respective CPUs by setting the .Va kern.pin_pcpu_swi loader tunable to a non-zero value. -.Sh "AVOIDING RACE CONDITIONS" +.Pp +The macros +.Fn callout_pending , +.Fn callout_active +and +.Fn callout_deactivate +provide access to the current state of the callout. +The +.Fn callout_pending +macro checks whether a callout is +.Em pending ; +a callout is considered +.Em pending +when a timeout has been set but the time has not yet arrived. +Note that once the timeout time arrives and the callout subsystem +starts to process this callout, +.Fn callout_pending +will return +.Dv FALSE +even though the callout function may not have finished +.Pq or even begun +executing. +The +.Fn callout_active +macro checks whether a callout is marked as +.Em active , +and the +.Fn callout_deactivate +macro clears the callout's +.Em active +flag. +The callout subsystem marks a callout as +.Em active +when a timeout is set and it clears the +.Em active +flag in +.Fn callout_stop +and +.Fn callout_drain , +but it +.Em does not +clear it when a callout expires normally via the execution of the +callout function. +.Ss "Avoiding Race Conditions" The callout subsystem invokes callout functions from its own thread context. Without some kind of synchronization, @@ -548,7 +487,7 @@ synchronization concerns. The first approach is preferred as it is the simplest: .Bl -enum -offset indent .It -Callouts can be associated with a specific lock when they are initialised +Callouts can be associated with a specific lock when they are initialized by .Fn callout_init_mtx , .Fn callout_init_rm , @@ -569,7 +508,7 @@ or .Fn callout_schedule functions to provide this safety. .Pp -A callout initialised via +A callout initialized via .Fn callout_init with .Fa mpsafe @@ -592,8 +531,9 @@ function families .Pc indicates whether or not the callout was removed. If it is known that the callout was set and the callout function has -not yet executed, then a return value of zero indicates that the -callout function is about to be called. +not yet executed, then a return value of +.Dv FALSE +indicates that the callout function is about to be called. For example: .Bd -literal -offset indent if (sc->sc_flags & SCFLG_CALLOUT_RUNNING) { @@ -649,14 +589,16 @@ The callout function should first check .Em pending flag and return without action if .Fn callout_pending -returns non-zero. +returns +.Dv TRUE . This indicates that the callout was rescheduled using .Fn callout_reset just before the callout function was invoked. If .Fn callout_active -returns zero then the callout function should also return without -action. +returns +.Dv FALSE +then the callout function should also return without action. This indicates that the callout has been stopped. Finally, the callout function should call .Fn callout_deactivate @@ -726,13 +668,129 @@ a callout should always be drained prior or releasing the storage for the callout structure. .Sh LEGACY API .Bf Sy -The +The functions below are a legacy API that will be removed in a future release. +New code should not use these routines. +.Ef +.Pp +The function +.Fn timeout +schedules a call to the function given by the argument +.Fa func +to take place after +.Fa ticks Ns No /hz +seconds. +Non-positive values of +.Fa ticks +are silently converted to the value +.Sq 1 . +.Fa func +should be a pointer to a function that takes a +.Fa void * +argument. +Upon invocation, +.Fa func +will receive +.Fa arg +as its only argument. +The return value from .Fn timeout +is a +.Ft struct callout_handle +which can be used in conjunction with the +.Fn untimeout +function to request that a scheduled timeout be canceled. +.Pp +The function +.Fn callout_handle_init +can be used to initialize a handle to a state which will cause +any calls to +.Fn untimeout +with that handle to return with no side +effects. +.Pp +Assigning a callout handle the value of +.Fn CALLOUT_HANDLE_INITIALIZER +performs the same function as +.Fn callout_handle_init +and is provided for use on statically declared or global callout handles. +.Pp +The function +.Fn untimeout +cancels the timeout associated with +.Fa handle +using the +.Fa func and +.Fa arg +arguments to validate the handle. +If the handle does not correspond to a timeout with +the function +.Fa func +taking the argument +.Fa arg +no action is taken. +.Fa handle +must be initialized by a previous call to +.Fn timeout , +.Fn callout_handle_init , +or assigned the value of +.Fn CALLOUT_HANDLE_INITIALIZER "&handle" +before being passed to +.Fn untimeout . +The behavior of calling .Fn untimeout -functions are a legacy API that will be removed in a future release. -New code should not use these routines. -.Ef +with an uninitialized handle +is undefined. +.Pp +As handles are recycled by the system, it is possible (although unlikely) +that a handle from one invocation of +.Fn timeout +may match the handle of another invocation of +.Fn timeout +if both calls used the same function pointer and argument, and the first +timeout is expired or canceled before the second call. +The timeout facility offers O(1) running time for +.Fn timeout +and +.Fn untimeout . +Timeouts are executed from +.Fn softclock +with the +.Va Giant +lock held. +Thus they are protected from re-entrancy. +.Sh RETURN VALUES +The +.Fn callout_active +macro returns the state of a callout's +.Em active +flag. +.Pp +The +.Fn callout_pending +macro returns the state of a callout's +.Em pending +flag. +.Pp +The +.Fn callout_reset +and +.Fn callout_schedule +function families return non-zero if the callout was pending before the new +function invocation was scheduled. +.Pp +The +.Fn callout_stop +and +.Fn callout_drain +functions return non-zero if the callout was still pending when it was +called or zero otherwise. +The +.Fn timeout +function returns a +.Ft struct callout_handle +that can be passed to *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:17:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 593C1D2E; Thu, 22 Jan 2015 11:17:22 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE551D3; Thu, 22 Jan 2015 11:17:21 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EE14A1FE023; Thu, 22 Jan 2015 12:17:18 +0100 (CET) Message-ID: <54C0DC71.6080106@selasky.org> Date: Thu, 22 Jan 2015 12:18:09 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "K. Macy" Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> <54C0CBD2.9020206@selasky.org> In-Reply-To: <54C0CBD2.9020206@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:17:22 -0000 Hi, Please move any further comments on this thread to: https://reviews.freebsd.org/D1438 See "r277528". Discussion ends here. --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:27:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 686E73A7 for ; Thu, 22 Jan 2015 11:27:03 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE506340 for ; Thu, 22 Jan 2015 11:27:02 +0000 (UTC) Received: from [192.168.1.134] (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t0MBQ0VH093440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Jan 2015 06:26:01 -0500 (EST) (envelope-from randall@lakerest.net) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.1\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Randy Stewart In-Reply-To: <54C0B75B.9070305@selasky.org> Date: Thu, 22 Jan 2015 06:26:53 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <04866FE0-43BF-4569-9B67-7ED5F6F4F736@lakerest.net> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.2070.1) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:27:03 -0000 Hans: We (netflix) run in production 35% of the internet with these very = things you identify no lock an all. We *do* have some issue we are looking at = but so far I have *never* connected the dots the way you were claiming that would cause a crash. I can see where TCP would do incorrect retransmissions = but I did *not* see a crash. Now granted my look was quick at this, but that was due to time constraints and the holidays. I am going to put myself = full-time on this to see if I can understand both how you got at =93there is a = panic in tcp=94 and it must fully be the callout-subsystem thus we need to re-write large = parts of it. You *may* be correct in a re-write is needed, you *may* be completely = incorrect. In either case I plan to dig into this and find out. R > On Jan 22, 2015, at 3:39 AM, Hans Petter Selasky = wrote: >=20 > On 01/22/15 09:10, Konstantin Belousov wrote: >> On Thu, Jan 22, 2015 at 08:14:26AM +0100, Hans Petter Selasky wrote: >>> On 01/22/15 06:26, Warner Losh wrote: >>> > >>>>> The code simply needs an update. It is not broken in any ways - = right? If it is not broken, fixing it is not that urgent. >>>>=20 >>>> Radically changing the performance characteristics is breaking the = code. Performance regression in the TCP stack is urgent to fix. >>=20 >>> Not being able to enumerate what all the consumers are that use this = and >>> provide an analysis about why they aren?t important to fix is a bug = in >>> your process, and in your interaction with the project. We simply do = not >>> operate that way. >> Right, I completely agree with this statement. >>=20 >>=20 >>> Hi, >>>=20 >>> My plan is to work out a patch for the TCP stack today, which only >>> change the callout_init() call or its function. This should not need = any >>> particular review. I'll let adrian test and review, because I think = he >>> is closer to me timezone wise and you're standing on my head saying = its >>> urgent. If he is still not happy, I can back my change out. Else it >>> remains in -current AS-IS. >> TCP regresssion was noted, so it is brought in front. There is = nothing >> else which makes TCP issue different from other (hidden) issues. >>=20 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> MFC to 10-stable I can delay for sure until >>> all issues you report to me are fixed. >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>=20 >> Sigh, you still do not understand. It is your duty to identify all = pieces >> which break after your change. After that, we can argue whether each = of >> them is critical or not to allow the migration. But this must have = been >> done before the KPI change hit the tree. >>=20 >=20 > Hi, >=20 > Are you saying that pieces of code that runs completely unlocked using = "volatile" as only synchronization mechanism is better than what I would = call a temporary and hopefully short TCP stack performance loss? >=20 > I don't understand? How frequently do you reboot your boxes? Maybe one = every day? And you don't care? >=20 > --HPS >=20 >=20 >=20 ----- Randall Stewart randall@lakerest.net From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:29:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4D656D for ; Thu, 22 Jan 2015 11:29:56 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1171235D for ; Thu, 22 Jan 2015 11:29:55 +0000 (UTC) Received: from [192.168.1.134] (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t0MBSrUU093483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Jan 2015 06:28:55 -0500 (EST) (envelope-from rrs@lakerest.net) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.1\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Randall Stewart In-Reply-To: <54C0B75B.9070305@selasky.org> Date: Thu, 22 Jan 2015 06:29:46 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <88A39F5F-A9F4-432F-8BAB-9393DAA8F36A@lakerest.net> References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.2070.1) Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:29:56 -0000 Hans Thats great, could you please open a project branch that we can look at it in too? I would very much appreciate that. Sometimes I like to look at the whole code with it all in place (not just patches) and a project branch really helps with that. R > On Jan 22, 2015, at 3:39 AM, Hans Petter Selasky = wrote: >=20 > On 01/22/15 09:10, Konstantin Belousov wrote: >> On Thu, Jan 22, 2015 at 08:14:26AM +0100, Hans Petter Selasky wrote: >>> On 01/22/15 06:26, Warner Losh wrote: >>> > >>>>> The code simply needs an update. It is not broken in any ways - = right? If it is not broken, fixing it is not that urgent. >>>>=20 >>>> Radically changing the performance characteristics is breaking the = code. Performance regression in the TCP stack is urgent to fix. >>=20 >>> Not being able to enumerate what all the consumers are that use this = and >>> provide an analysis about why they aren?t important to fix is a bug = in >>> your process, and in your interaction with the project. We simply do = not >>> operate that way. >> Right, I completely agree with this statement. >>=20 >>=20 >>> Hi, >>>=20 >>> My plan is to work out a patch for the TCP stack today, which only >>> change the callout_init() call or its function. This should not need = any >>> particular review. I'll let adrian test and review, because I think = he >>> is closer to me timezone wise and you're standing on my head saying = its >>> urgent. If he is still not happy, I can back my change out. Else it >>> remains in -current AS-IS. >> TCP regresssion was noted, so it is brought in front. There is = nothing >> else which makes TCP issue different from other (hidden) issues. >>=20 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> MFC to 10-stable I can delay for sure until >>> all issues you report to me are fixed. >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>=20 >> Sigh, you still do not understand. It is your duty to identify all = pieces >> which break after your change. After that, we can argue whether each = of >> them is critical or not to allow the migration. But this must have = been >> done before the KPI change hit the tree. >>=20 >=20 > Hi, >=20 > Are you saying that pieces of code that runs completely unlocked using = "volatile" as only synchronization mechanism is better than what I would = call a temporary and hopefully short TCP stack performance loss? >=20 > I don't understand? How frequently do you reboot your boxes? Maybe one = every day? And you don't care? >=20 > --HPS >=20 >=20 >=20 ------------------------------ Randall Stewart 803-317-4952 (cell) From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:49:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED1719F6; Thu, 22 Jan 2015 11:49:27 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A32B67D9; Thu, 22 Jan 2015 11:49:27 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3709B1FE023; Thu, 22 Jan 2015 12:49:25 +0100 (CET) Message-ID: <54C0E3F7.9080403@selasky.org> Date: Thu, 22 Jan 2015 12:50:15 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Randy Stewart Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys References: <201501151532.t0FFWV2Y037455@svn.freebsd.org> <54BDD9E1.6090505@selasky.org> <20150120075126.GA42409@kib.kiev.ua> <54BE0AAA.4050104@selasky.org> <20150120090057.GD42409@kib.kiev.ua> <54BE21F0.6010602@selasky.org> <7C692107-51CF-4DFA-BD6C-623D56893150@bsdimp.com> <54C0A352.8090701@selasky.org> <20150122081023.GT42409@kib.kiev.ua> <54C0B75B.9070305@selasky.org> <04866FE0-43BF-4569-9B67-7ED5F6F4F736@lakerest.net> In-Reply-To: <04866FE0-43BF-4569-9B67-7ED5F6F4F736@lakerest.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:49:28 -0000 On 01/22/15 12:26, Randy Stewart wrote: > Hans: > > We (netflix) run in production 35% of the internet with these very things > you identify no lock an all. We *do* have some issue we are looking at but so far > I have *never* connected the dots the way you were claiming that would > cause a crash. I can see where TCP would do incorrect retransmissions but > I did *not* see a crash. Now granted my look was quick at this, but that > was due to time constraints and the holidays. I am going to put myself full-time > on this to see if I can understand both how you got at “there is a panic in tcp” and > it must fully be the callout-subsystem thus we need to re-write large parts of it. > > You *may* be correct in a re-write is needed, you *may* be completely incorrect. > In either case I plan to dig into this and find out. > Hi, There are multiple issues in the bag here ... --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 05:19:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C237620; Thu, 22 Jan 2015 05:19:33 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CCC4C8E6; Thu, 22 Jan 2015 05:19:32 +0000 (UTC) Received: from [192.168.1.134] (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t0M5IO0L086239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Jan 2015 00:18:25 -0500 (EST) (envelope-from randall@lakerest.net) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.1\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Randy Stewart In-Reply-To: Date: Thu, 22 Jan 2015 00:19:18 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.2070.1) X-Mailman-Approved-At: Thu, 22 Jan 2015 12:30:50 +0000 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , Kip Macy , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 05:19:33 -0000 All: I have finally pulled my head out of the sands of TLS and=20 had some time to look at this interesting long thread. I agree with Warner and Adrian on this.. Lets back it out and then in a branch chew this over piece by piece.. R > On Jan 21, 2015, at 7:10 PM, Adrian Chadd wrote: >=20 > On 21 January 2015 at 16:07, K. Macy wrote: >>>> HPS: Your change failed to meet these guidelines. Some of us are = upset >>>> because these guidelines are fairly fundamental for the on-going >>>> viability of FreeBSD. Due to linguistic / time zone / cultural >>>> differences these expectations have not been adequately = communicated >>>> to you. You are not in the USB sandbox where others need for your >>>> support outweighs the inconvenience of random breakage. >>>>=20 >>>> It sounds like you are making progress towards updating the = concerns >>>> that have been voiced. If kib's observations are in fact = comprehensive >>>> then adding a callout_init_cpu function and updating all clients so >>>> that their callouts continue to be scheduled on a CPU other than = the >>>> BSP will suffice and we can all move on. >>>=20 >>> Is there some reason that we can=E2=80=99t back things out, break = things down into >>> smaller pieces and have everything pass through phabric with a wide >>> ranging review? Given the fundamental nature of these changes, they >>> really need better review and doing it after the fact seems to be to = be >>> too risky. I=E2=80=99m not debating that this =E2=80=9Cfixes=E2=80=9D = some issues, but given the >>> performance regression, it sure seems like we may need a different >>> solution to be implemented and hashing that out in a branch might be >>> the best approach. >>=20 >> Thank you. A more incremental approach would be appreciated by many = of >> us. To avoid the bystander effect we can permit explicit timeouts for >> review-to-commit (72 hours?) so that we don't collectively end up >> sandbagging him. >=20 > I'm +1 for this. >=20 >=20 >=20 > -a >=20 >=20 ----- Randall Stewart randall@lakerest.net From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:19:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAB7DEBF; Thu, 22 Jan 2015 11:19:02 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 778AD1F2; Thu, 22 Jan 2015 11:19:02 +0000 (UTC) Received: from [192.168.1.134] (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t0MBHvF0093229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Jan 2015 06:17:57 -0500 (EST) (envelope-from rrs@lakerest.net) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.1\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Randall Stewart In-Reply-To: Date: Thu, 22 Jan 2015 06:18:49 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.2070.1) X-Mailman-Approved-At: Thu, 22 Jan 2015 12:51:01 +0000 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , Kip Macy , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:19:03 -0000 Let me re-send my email.. my silly mac sent my first try from the wrong = address.. sigh (sorry moderator where ever you are ;-o) All: I have finally pulled my head out of the sands of TLS and=20 had some time to look at this interesting long thread. I agree with Warner and Adrian on this.. Lets back it out and then in a branch chew this over piece by piece.. R As an addition I have decided to get my head back into this, I was one of the ones on Hann=E2=80=99s original email and I had asked him to wait until *after* the Holiday=E2=80=99s to do anything (thinking on continuing the discussion) I did *not* realize he planned on roto-tilling the callout system.. sigh =20 > On Jan 21, 2015, at 7:10 PM, Adrian Chadd wrote: >=20 > On 21 January 2015 at 16:07, K. Macy wrote: >>>> HPS: Your change failed to meet these guidelines. Some of us are = upset >>>> because these guidelines are fairly fundamental for the on-going >>>> viability of FreeBSD. Due to linguistic / time zone / cultural >>>> differences these expectations have not been adequately = communicated >>>> to you. You are not in the USB sandbox where others need for your >>>> support outweighs the inconvenience of random breakage. >>>>=20 >>>> It sounds like you are making progress towards updating the = concerns >>>> that have been voiced. If kib's observations are in fact = comprehensive >>>> then adding a callout_init_cpu function and updating all clients so >>>> that their callouts continue to be scheduled on a CPU other than = the >>>> BSP will suffice and we can all move on. >>>=20 >>> Is there some reason that we can=E2=80=99t back things out, break = things down into >>> smaller pieces and have everything pass through phabric with a wide >>> ranging review? Given the fundamental nature of these changes, they >>> really need better review and doing it after the fact seems to be to = be >>> too risky. I=E2=80=99m not debating that this =E2=80=9Cfixes=E2=80=9D = some issues, but given the >>> performance regression, it sure seems like we may need a different >>> solution to be implemented and hashing that out in a branch might be >>> the best approach. >>=20 >> Thank you. A more incremental approach would be appreciated by many = of >> us. To avoid the bystander effect we can permit explicit timeouts for >> review-to-commit (72 hours?) so that we don't collectively end up >> sandbagging him. >=20 > I'm +1 for this. >=20 >=20 >=20 > -a ------------------------------ Randall Stewart 803-317-4952 (cell) From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:22:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A651EB; Thu, 22 Jan 2015 11:22:25 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B9C3D2F3; Thu, 22 Jan 2015 11:22:24 +0000 (UTC) Received: from [192.168.1.134] (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t0MBLKH4093292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Jan 2015 06:21:21 -0500 (EST) (envelope-from randall@lakerest.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.1\)) Subject: Re: svn commit: r277213 - in head: share/man/man9 sys/kern sys/ofed/include/linux sys/sys From: Randy Stewart In-Reply-To: Date: Thu, 22 Jan 2015 06:22:13 -0500 Content-Transfer-Encoding: 7bit Message-Id: <4E451459-6993-49E8-BB33-502DC0D82C19@lakerest.net> References: <20150120075126.GA42409@kib.kiev.ua> <20150120211137.GY15484@FreeBSD.org> <54BED6FB.8060401@selasky.org> <54BEE62D.2060703@ignoranthack.me> <54BEE8E6.3080009@ignoranthack.me> <54BEEA7F.1070301@ignoranthack.me> <54BEF154.3030606@ignoranthack.me> <20150121181512.GE15484@FreeBSD.org> To: Randall Ray Stewart X-Mailer: Apple Mail (2.2070.1) X-Mailman-Approved-At: Thu, 22 Jan 2015 12:51:20 +0000 Cc: Hans Petter Selasky , Adrian Chadd , "src-committers@freebsd.org" , Kip Macy , Jason Wolfe , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sean Bruno , Gleb Smirnoff , Konstantin Belousov , "M. Warner Losh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:22:25 -0000 Hans: I think this is the wrong approach. You should: a) Back out the commit you did to head b) create a project branch and put your changes in there c) fix *everything* you break in these subtle ways d) Discuss through a review process if your changes are correct e) When consensus is reached then and only then put it into head with all the fixes. If you are not willing to do the above, then we need this taken up to core and have them act on it. I think enough folks have voiced concern that you should be willing to do the above steps. R > On Jan 22, 2015, at 12:19 AM, Randy Stewart wrote: > > All: > > I have finally pulled my head out of the sands of TLS and > had some time to look at this interesting long thread. I agree > with Warner and Adrian on this.. Lets back it out > and then in a branch chew this over piece by piece.. > > R ----- Randall Stewart randall@lakerest.net From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 14:49:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 802F231C; Thu, 22 Jan 2015 14:49:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BEDCE06; Thu, 22 Jan 2015 14:49:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MEnbeq026762; Thu, 22 Jan 2015 14:49:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MEnbJm026761; Thu, 22 Jan 2015 14:49:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501221449.t0MEnbJm026761@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Jan 2015 14:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277529 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 14:49:37 -0000 Author: mav Date: Thu Jan 22 14:49:36 2015 New Revision: 277529 URL: https://svnweb.freebsd.org/changeset/base/277529 Log: Don't count requests with status sent as overlapping. While those requests are still in target OOA queue, for initiator they are already completed, so tags can be reused. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jan 22 11:12:42 2015 (r277528) +++ head/sys/cam/ctl/ctl.c Thu Jan 22 14:49:36 2015 (r277529) @@ -10826,7 +10826,8 @@ ctl_check_for_blockage(struct ctl_lun *l ooa_io->io_hdr.nexus.targ_port) && (pending_io->io_hdr.nexus.initid.id == ooa_io->io_hdr.nexus.initid.id)) - && ((ooa_io->io_hdr.flags & CTL_FLAG_ABORT) == 0)) + && ((ooa_io->io_hdr.flags & (CTL_FLAG_ABORT | + CTL_FLAG_STATUS_SENT)) == 0)) return (CTL_ACTION_OVERLAP); /* @@ -10847,7 +10848,8 @@ ctl_check_for_blockage(struct ctl_lun *l ooa_io->io_hdr.nexus.targ_port) && (pending_io->io_hdr.nexus.initid.id == ooa_io->io_hdr.nexus.initid.id)) - && ((ooa_io->io_hdr.flags & CTL_FLAG_ABORT) == 0)) + && ((ooa_io->io_hdr.flags & (CTL_FLAG_ABORT | + CTL_FLAG_STATUS_SENT)) == 0)) return (CTL_ACTION_OVERLAP_TAG); /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 16:27:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0C4DCBB; Thu, 22 Jan 2015 16:27:26 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 57E58C6F; Thu, 22 Jan 2015 16:27:26 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2A6AA25D3815; Thu, 22 Jan 2015 16:27:13 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D724FC7700C; Thu, 22 Jan 2015 16:27:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Cvh6QVbohJBu; Thu, 22 Jan 2015 16:27:01 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D3509C76FFA; Thu, 22 Jan 2015 16:27:00 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277511 - head/sys/dev/firewire From: "Bjoern A. Zeeb" In-Reply-To: <201501212008.t0LK8PhR001309@svn.freebsd.org> Date: Thu, 22 Jan 2015 16:26:58 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201501212008.t0LK8PhR001309@svn.freebsd.org> To: Will Andrews , gibbs@FreeBSD.org X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 16:27:26 -0000 > On 21 Jan 2015, at 20:08 , Will Andrews wrote: >=20 > Author: will > Date: Wed Jan 21 20:08:24 2015 > New Revision: 277511 > URL: https://svnweb.freebsd.org/changeset/base/277511 >=20 > Log: > Fix remote DMA based firewire debugging when targeting > systems with more than 4GB of physical memory. >=20 > To remotely debug the system 'stealthy' which has a kernel > with this change installed and firewire properly configured: >=20 > % fwcontrol -m stealthy (or stealthy's firewire EUI64) > % kgdb kernel /dev/fwmem0.0 >=20 > sys/dev/firewire/fwohci.c: > Rather than hard code the upper limit for hw based > automatic responses to remote DMA requests at 4GB, > program the hardware using Maxmem, the page number > one higher than the highest physical page detected > in the system. >=20 > While here, garbage collect more useless splfw() > calls. >=20 > Submitted by: gibbs > MFC after: 1 week > Sponsored by: Spectra Logic > MFSpectraBSD: 1110994 on 2015/01/06 arm doesn=E2=80=99t define a Maxmem; the kernel builds are thus = currently broken. converting beaglebone.dts -> = /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/sys/BEAGLEBONE/beagleb= one.dtb = /scratch/tmp/bz/head.svn/sys/modules/firewire/firewire/../../../dev/firewi= re/fwohci.c:1856:28: error: use of undeclared identifier 'Maxmem' prequpper =3D ((uintmax_t)Maxmem << PAGE_SHIFT) = >> 16; ^ = /scratch/tmp/bz/head.svn/sys/modules/firewire/firewire/../../../dev/firewi= re/fwohci.c:1862:20: error: use of undeclared identifier 'Maxmem' (uintmax_t)Maxmem << PAGE_SHIFT, ^ 2 errors generated. =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 16:49:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40A83434; Thu, 22 Jan 2015 16:49:18 +0000 (UTC) Received: from smtp6.ore.mailhop.org (smtp6.ore.mailhop.org [54.149.35.133]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFAEEAC; Thu, 22 Jan 2015 16:49:17 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp6.ore.mailhop.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YEKwX-00054F-5b; Thu, 22 Jan 2015 16:49:17 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0MGnDuI004093; Thu, 22 Jan 2015 09:49:14 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+Fuh8lLdULr5lfkMYFElGA Message-ID: <1421945353.14601.402.camel@freebsd.org> Subject: Re: svn commit: r277511 - head/sys/dev/firewire From: Ian Lepore To: "Bjoern A. Zeeb" Date: Thu, 22 Jan 2015 09:49:13 -0700 In-Reply-To: References: <201501212008.t0LK8PhR001309@svn.freebsd.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, gibbs@FreeBSD.org, src-committers , Will Andrews X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 16:49:18 -0000 On Thu, 2015-01-22 at 16:26 +0000, Bjoern A. Zeeb wrote: > > On 21 Jan 2015, at 20:08 , Will Andrews wrote: > > > > Author: will > > Date: Wed Jan 21 20:08:24 2015 > > New Revision: 277511 > > URL: https://svnweb.freebsd.org/changeset/base/277511 > > > > Log: > > Fix remote DMA based firewire debugging when targeting > > systems with more than 4GB of physical memory. > > > > To remotely debug the system 'stealthy' which has a kernel > > with this change installed and firewire properly configured: > > > > % fwcontrol -m stealthy (or stealthy's firewire EUI64) > > % kgdb kernel /dev/fwmem0.0 > > > > sys/dev/firewire/fwohci.c: > > Rather than hard code the upper limit for hw based > > automatic responses to remote DMA requests at 4GB, > > program the hardware using Maxmem, the page number > > one higher than the highest physical page detected > > in the system. > > > > While here, garbage collect more useless splfw() > > calls. > > > > Submitted by: gibbs > > MFC after: 1 week > > Sponsored by: Spectra Logic > > MFSpectraBSD: 1110994 on 2015/01/06 > > arm doesn¢t define a Maxmem; the kernel builds are thus currently broken. > > converting beaglebone.dts -> /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/sys/BEAGLEBONE/beaglebone.dtb > /scratch/tmp/bz/head.svn/sys/modules/firewire/firewire/../../../dev/firewire/fwohci.c:1856:28: error: use of undeclared identifier 'Maxmem' > prequpper = ((uintmax_t)Maxmem << PAGE_SHIFT) >> 16; > ^ > /scratch/tmp/bz/head.svn/sys/modules/firewire/firewire/../../../dev/firewire/fwohci.c:1862:20: error: use of undeclared identifier 'Maxmem' > (uintmax_t)Maxmem << PAGE_SHIFT, > ^ > 2 errors generated. This is the first I've heard of Maxmem. I think I can get it added to arm pretty quickly. -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 17:09:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E247FB; Thu, 22 Jan 2015 17:09:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2A8B640; Thu, 22 Jan 2015 17:09:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MH9sDa093006; Thu, 22 Jan 2015 17:09:54 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MH9svg093005; Thu, 22 Jan 2015 17:09:54 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501221709.t0MH9svg093005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 22 Jan 2015 17:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277530 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 17:09:55 -0000 Author: will Date: Thu Jan 22 17:09:54 2015 New Revision: 277530 URL: https://svnweb.freebsd.org/changeset/base/277530 Log: Improve CARP logging so that all state transitions are logged. sys/netinet/ip_carp.c: Add a "reason" string parameter to carp_set_state() and carp_master_down_locked() allowing more specific logging information to be passed into these apis. Refactor existing state transition logging into a single log call in carp_set_state(). Update all calls to carp_set_state() and carp_master_down_locked() to pass an appropriate reason string. For state transitions that were previously logged, the output should be unchanged. Submitted by: gibbs (original), asomers (updated) MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1039697 on 2014/02/11 (original) 1049992 on 2014/03/21 (updated) Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Jan 22 14:49:36 2015 (r277529) +++ head/sys/netinet/ip_carp.c Thu Jan 22 17:09:54 2015 (r277530) @@ -304,11 +304,12 @@ static void carp_destroy(struct carp_sof static struct carp_if *carp_alloc_if(struct ifnet *); static void carp_free_if(struct carp_if *); -static void carp_set_state(struct carp_softc *, int); +static void carp_set_state(struct carp_softc *, int, const char* reason); static void carp_sc_state(struct carp_softc *); static void carp_setrun(struct carp_softc *, sa_family_t); static void carp_master_down(void *); -static void carp_master_down_locked(struct carp_softc *); +static void carp_master_down_locked(struct carp_softc *, + const char* reason); static void carp_send_ad(void *); static void carp_send_ad_locked(struct carp_softc *); static void carp_addroute(struct carp_softc *); @@ -654,11 +655,8 @@ carp_input_c(struct mbuf *m, struct carp if (timevalcmp(&sc_tv, &ch_tv, >) || timevalcmp(&sc_tv, &ch_tv, ==)) { callout_stop(&sc->sc_ad_tmo); - CARP_LOG("VHID %u@%s: MASTER -> BACKUP " - "(more frequent advertisement received)\n", - sc->sc_vhid, - sc->sc_carpdev->if_xname); - carp_set_state(sc, BACKUP); + carp_set_state(sc, BACKUP, + "more frequent advertisement received"); carp_setrun(sc, 0); carp_delroute(sc); } @@ -669,11 +667,8 @@ carp_input_c(struct mbuf *m, struct carp * and this one claims to be slower, treat him as down. */ if (V_carp_preempt && timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_LOG("VHID %u@%s: BACKUP -> MASTER " - "(preempting a slower master)\n", - sc->sc_vhid, - sc->sc_carpdev->if_xname); - carp_master_down_locked(sc); + carp_master_down_locked(sc, + "preempting a slower master"); break; } @@ -684,11 +679,7 @@ carp_input_c(struct mbuf *m, struct carp */ sc_tv.tv_sec = sc->sc_advbase * 3; if (timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_LOG("VHID %u@%s: BACKUP -> MASTER " - "(master timed out)\n", - sc->sc_vhid, - sc->sc_carpdev->if_xname); - carp_master_down_locked(sc); + carp_master_down_locked(sc, "master will time out"); break; } @@ -1153,10 +1144,7 @@ carp_master_down(void *v) CURVNET_SET(sc->sc_carpdev->if_vnet); if (sc->sc_state == BACKUP) { - CARP_LOG("VHID %u@%s: BACKUP -> MASTER (master down)\n", - sc->sc_vhid, - sc->sc_carpdev->if_xname); - carp_master_down_locked(sc); + carp_master_down_locked(sc, "master timed out"); } CURVNET_RESTORE(); @@ -1164,14 +1152,14 @@ carp_master_down(void *v) } static void -carp_master_down_locked(struct carp_softc *sc) +carp_master_down_locked(struct carp_softc *sc, const char *reason) { CARP_LOCK_ASSERT(sc); switch (sc->sc_state) { case BACKUP: - carp_set_state(sc, MASTER); + carp_set_state(sc, MASTER, reason); carp_send_ad_locked(sc); #ifdef INET carp_send_arp(sc); @@ -1212,10 +1200,7 @@ carp_setrun(struct carp_softc *sc, sa_fa switch (sc->sc_state) { case INIT: - CARP_LOG("VHID %u@%s: INIT -> BACKUP\n", - sc->sc_vhid, - sc->sc_carpdev->if_xname); - carp_set_state(sc, BACKUP); + carp_set_state(sc, BACKUP, "initialization complete"); carp_setrun(sc, 0); break; case BACKUP: @@ -1717,12 +1702,12 @@ carp_ioctl(struct ifreq *ifr, u_long cmd switch (carpr.carpr_state) { case BACKUP: callout_stop(&sc->sc_ad_tmo); - carp_set_state(sc, BACKUP); + carp_set_state(sc, BACKUP, "SIOCSVH"); carp_setrun(sc, 0); carp_delroute(sc); break; case MASTER: - carp_master_down_locked(sc); + carp_master_down_locked(sc, "SIOCSVH"); break; default: break; @@ -1964,7 +1949,7 @@ carp_detach_locked(struct ifaddr *ifa) } static void -carp_set_state(struct carp_softc *sc, int state) +carp_set_state(struct carp_softc *sc, int state, const char *reason) { CARP_LOCK_ASSERT(sc); @@ -1973,10 +1958,14 @@ carp_set_state(struct carp_softc *sc, in const char *carp_states[] = { CARP_STATES }; char subsys[IFNAMSIZ+5]; - sc->sc_state = state; - snprintf(subsys, IFNAMSIZ+5, "%u@%s", sc->sc_vhid, sc->sc_carpdev->if_xname); + + CARP_LOG("%s: %s -> %s (%s)\n", subsys, + carp_states[sc->sc_state], carp_states[state], reason); + + sc->sc_state = state; + devctl_notify("CARP", subsys, carp_states[state], NULL); } } @@ -2010,13 +1999,13 @@ carp_sc_state(struct carp_softc *sc) #ifdef INET6 callout_stop(&sc->sc_md6_tmo); #endif - carp_set_state(sc, INIT); + carp_set_state(sc, INIT, "hw interface down"); carp_setrun(sc, 0); if (!sc->sc_suppress) carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; } else { - carp_set_state(sc, INIT); + carp_set_state(sc, INIT, "hw interface up"); carp_setrun(sc, 0); if (sc->sc_suppress) carp_demote_adj(-V_carp_ifdown_adj, "interface up"); From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 17:13:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 537F5370; Thu, 22 Jan 2015 17:13:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD98767; Thu, 22 Jan 2015 17:13:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MHDi5c097092; Thu, 22 Jan 2015 17:13:44 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MHDigO097091; Thu, 22 Jan 2015 17:13:44 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201501221713.t0MHDigO097091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 22 Jan 2015 17:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277531 - head/bin/freebsd-version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 17:13:44 -0000 Author: ume Date: Thu Jan 22 17:13:43 2015 New Revision: 277531 URL: https://svnweb.freebsd.org/changeset/base/277531 Log: Don't include newvers.sh into freebsd-version. Modified: head/bin/freebsd-version/Makefile Modified: head/bin/freebsd-version/Makefile ============================================================================== --- head/bin/freebsd-version/Makefile Thu Jan 22 17:09:54 2015 (r277530) +++ head/bin/freebsd-version/Makefile Thu Jan 22 17:13:43 2015 (r277531) @@ -11,7 +11,7 @@ freebsd-version.sh: ${.CURDIR}/freebsd-v s/@@TYPE@@/$${TYPE}/g; \ s/@@REVISION@@/$${REVISION}/g; \ s/@@BRANCH@@/$${BRANCH}/g; \ - " ${.ALLSRC} >${.TARGET} ; then \ + " ${.CURDIR}/freebsd-version.sh.in >${.TARGET} ; then \ rm -f ${.TARGET} ; \ exit 1 ; \ fi From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 17:42:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FBA9D4D; Thu, 22 Jan 2015 17:42:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 335DCA81; Thu, 22 Jan 2015 17:42:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MHgVQb011519; Thu, 22 Jan 2015 17:42:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MHgV1t011518; Thu, 22 Jan 2015 17:42:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501221742.t0MHgV1t011518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 22 Jan 2015 17:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277532 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 17:42:31 -0000 Author: ian Date: Thu Jan 22 17:42:30 2015 New Revision: 277532 URL: https://svnweb.freebsd.org/changeset/base/277532 Log: Add the Maxmem global and set it to the highest physical page number plus 1. Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Thu Jan 22 17:13:43 2015 (r277531) +++ head/sys/arm/arm/physmem.c Thu Jan 22 17:42:30 2015 (r277532) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -86,8 +87,12 @@ static size_t excnt; vm_paddr_t phys_avail[MAX_AVAIL_ENTRIES + 2]; /* +2 to allow for a pair */ vm_paddr_t dump_avail[MAX_AVAIL_ENTRIES + 2]; /* of zeroes to terminate. */ -/* This is the total number of hardware pages, excluded or not. */ +/* + * realmem is the total number of hardware pages, excluded or not. + * Maxmem is one greater than the last physical page number. + */ long realmem; +long Maxmem; /* The address at which the kernel was loaded. Set early in initarm(). */ vm_paddr_t arm_physmem_kernaddr; @@ -152,8 +157,8 @@ arm_physmem_print_tables() * * Returns the number of pages of non-excluded memory added to the avail list. */ -static long -regions_to_avail(vm_paddr_t *avail, uint32_t exflags) +static size_t +regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail) { size_t acnt, exi, hwi; vm_paddr_t end, start, xend, xstart; @@ -236,7 +241,9 @@ regions_to_avail(vm_paddr_t *avail, uint panic("Not enough space in the dump/phys_avail arrays"); } - return (availmem); + if (pavail) + *pavail = availmem; + return (acnt); } /* @@ -311,13 +318,23 @@ void arm_physmem_exclude_region(vm_paddr /* * Process all the regions added earlier into the global avail lists. + * + * Updates the kernel global 'physmem' with the number of physical pages + * available for use (all pages not in any exclusion region). + * + * Updates the kernel global 'Maxmem' with the page number one greater then the + * last page of physical memory in the system. */ void arm_physmem_init_kernel_globals(void) { + size_t nextidx; - regions_to_avail(dump_avail, EXFLAG_NODUMP); - physmem = regions_to_avail(phys_avail, EXFLAG_NOALLOC); + regions_to_avail(dump_avail, EXFLAG_NODUMP, NULL); + nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC, &physmem); + if (nextidx == 0) + panic("No memory entries in phys_avail"); + Maxmem = atop(phys_avail[nextidx - 1]); } #ifdef DDB From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 17:46:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D002A89; Thu, 22 Jan 2015 17:46:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED0C5AE7; Thu, 22 Jan 2015 17:46:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MHk66t013665; Thu, 22 Jan 2015 17:46:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MHk6Ru013664; Thu, 22 Jan 2015 17:46:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501221746.t0MHk6Ru013664@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 22 Jan 2015 17:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277533 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 17:46:07 -0000 Author: ian Date: Thu Jan 22 17:46:05 2015 New Revision: 277533 URL: https://svnweb.freebsd.org/changeset/base/277533 Log: Declare Maxmem on arm. This should have been part of r277532. Modified: head/sys/arm/include/md_var.h Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Thu Jan 22 17:42:30 2015 (r277532) +++ head/sys/arm/include/md_var.h Thu Jan 22 17:46:05 2015 (r277533) @@ -33,6 +33,7 @@ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ +extern long Maxmem; extern char sigcode[]; extern int szsigcode; extern uint32_t *vm_page_dump; From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 17:53:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCB13E0; Thu, 22 Jan 2015 17:53:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A890AC1A; Thu, 22 Jan 2015 17:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MHrV5K018168; Thu, 22 Jan 2015 17:53:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MHrVWQ018167; Thu, 22 Jan 2015 17:53:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501221753.t0MHrVWQ018167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Jan 2015 17:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277534 - head/lib/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 17:53:31 -0000 Author: emaste Date: Thu Jan 22 17:53:30 2015 New Revision: 277534 URL: https://svnweb.freebsd.org/changeset/base/277534 Log: Update reported elftoolchain version The last elftoolchain update is upstream rev 3136. Update our reported version and add M (Modified) suffix as our elftoolchain contains additional fixes not yet committed upstream. Sponsored by: The FreeBSD Foundation Modified: head/lib/libelftc/elftc_version.c Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Thu Jan 22 17:46:05 2015 (r277533) +++ head/lib/libelftc/elftc_version.c Thu Jan 22 17:53:30 2015 (r277534) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "libelftc r3130"; + return "elftoolchain r3136M"; } From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 18:24:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 120F1A56 for ; Thu, 22 Jan 2015 18:24:37 +0000 (UTC) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEDB5FA5 for ; Thu, 22 Jan 2015 18:24:36 +0000 (UTC) Received: by mail-ig0-f178.google.com with SMTP id hl2so3770774igb.5 for ; Thu, 22 Jan 2015 10:24:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=eAHXyqWAy4COCnrHVlVGCZnjyBVZxychxEF7SjAkyHM=; b=dCJEnJbh2gj8AqVow3WwKSufcYyFSA6NaS9YX/pPEBPUBGCmTPitPDp43RZLeXZhgb UtlO2KYL9u2f2pXcYk2wIIbnR02v6JKyvI3vOwOEBx8gXVBZFLeUcGfwnklviL754VZU qBFSVam4hOQJRIMmq+NHFDdkA1RBxHE9FjeMi+A/rN/8CrYCK2i6CQLlxOxyLi9Vb1jQ RoT7hrwahQr97JsinktCixM5SXu1lCOztQuYsG4gwkZnlGizPyY5tQ1F5z/ySYwu1iPW OVjk/Sj6FYmVbFJ5xySRWvYds4SjahTYmv1JzNoB0yTaklhmEcWVwrB9Ud8PIyMemAyl m5aQ== X-Gm-Message-State: ALoCoQlRS9xN0DACAkt3FsDp7YzgA14RoERuA2MlrHHtwRQ0EJKwJHTRgJVbl4RmRgE3BBN27eUt X-Received: by 10.50.55.98 with SMTP id r2mr5744103igp.6.1421950701928; Thu, 22 Jan 2015 10:18:21 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id f1sm3364341igt.14.2015.01.22.10.18.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 10:18:21 -0800 (PST) Date: Thu, 22 Jan 2015 11:18:19 -0700 From: Will Andrews To: Ian Lepore Subject: Re: svn commit: r277532 - head/sys/arm/arm Message-ID: <20150122181818.GA49380@sol.firepipe.net> References: <201501221742.t0MHgV1t011518@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <201501221742.t0MHgV1t011518@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 18:24:37 -0000 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 22, 2015 at 05:42:31PM +0000, Ian Lepore wrote: > Log: > Add the Maxmem global and set it to the highest physical page number pl= us 1. Thanks! --=20 wca --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTBPuoACgkQF47idPgWcsXmlgCeORv7pzwjmooLib2hgZTuXdwY QGYAoIaJlSWMPqbKR3rTZP3rr+zx5pmX =4GU4 -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 19:43:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3188996; Thu, 22 Jan 2015 19:43:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 841CBAB1; Thu, 22 Jan 2015 19:43:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MJh6at072520; Thu, 22 Jan 2015 19:43:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MJh6HK072518; Thu, 22 Jan 2015 19:43:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501221943.t0MJh6HK072518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 22 Jan 2015 19:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277536 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 19:43:06 -0000 Author: gjb Date: Thu Jan 22 19:43:05 2015 New Revision: 277536 URL: https://svnweb.freebsd.org/changeset/base/277536 Log: Rename the 'release' target to 'real-release', and add two targets, 'vm-release' and 'cloudware-release', that are invoked if WITH_VMIMAGES and WITH_CLOUDWARE are not empty. This fixes an issue where 'make release' would not build the cloud provider targets because CLOUDWARE was not yet set. [1] Move the WITH_VMIMAGES and WITH_CLOUDWARE targets to Makefile.vm. Note: There is no 'cloudware-install' target yet, since some of the disk image names may need to be specific to the provider, so this is probably best handled by the build scripts. Reported by: cperciva [1] MFC after: 1 month X-MFC-with: r277458 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/release/Makefile.vm Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Jan 22 19:03:43 2015 (r277535) +++ head/release/Makefile Thu Jan 22 19:43:05 2015 (r277536) @@ -8,7 +8,10 @@ # memstick: Builds memory stick image (memstick.img) # mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) -# release: Build all media and FTP distribution area +# release: Invokes real-release, vm-release, and cloudware-release targets +# real-release: Build all media and FTP distribution area +# vm-release: Build all virtual machine image targets +# cloudware-release: Build all cloud hosting provider targets # install: Invokes the release-install and vm-install targets # release-install: Copies all release installation media into ${DESTDIR} # vm-install: Copies all virtual machine images into ${DESTDIR} @@ -275,15 +278,11 @@ ftp: packagesystem mkdir -p ftp cp *.txz MANIFEST ftp -release: +release: real-release vm-release cloudware-release + +real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} -.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} -.endif -.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} -.endif install: release-install vm-install Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Thu Jan 22 19:03:43 2015 (r277535) +++ head/release/Makefile.vm Thu Jan 22 19:43:05 2015 (r277536) @@ -109,3 +109,13 @@ vm-install: cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ ${DESTDIR}/vmimages/CHECKSUM.MD5 .endif + +vm-release: +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} +.endif + +cloudware-release: +.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} +.endif From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 21:09:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2B1DC20; Thu, 22 Jan 2015 21:09:52 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79A0D610; Thu, 22 Jan 2015 21:09:52 +0000 (UTC) Received: from moby.local ([91.89.177.101]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M2ts6-1XPJpF1uze-00sb7B; Thu, 22 Jan 2015 22:09:47 +0100 Message-ID: <54C16715.6060701@gmx.com> Date: Thu, 22 Jan 2015 22:09:41 +0100 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Gleb Smirnoff , Craig Rodrigues Subject: Re: svn commit: r276747 - head/sys/netpfil/pf References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> In-Reply-To: <20150122012709.GM15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:UiwhKkbDCweNofu3FvHAFs6cQti7PbSP5bweQMnDr2uPkaLW0Vf pia8RYpDbfzh3KrvGKG1qrDZ11mU+qWAxbt0AtZ7jVa7247l3ozidFRBpZI99zSeCwqZVjf pSfjBzHn76ea8kADyJTwePTxnc85GDwTQ89GdmSBvy/33Ozit4h5gbK1tpAjBJIZEVvteGj l2FAp92bDTk0Nqyb/7wxQ== X-UI-Out-Filterresults: notjunk:1; Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 21:09:53 -0000 On 01/22/15 02:27, Gleb Smirnoff wrote: > On Tue, Jan 06, 2015 at 09:03:04AM +0000, Craig Rodrigues wrote: > C> Author: rodrigc > C> Date: Tue Jan 6 09:03:03 2015 > C> New Revision: 276747 > C> URL: https://svnweb.freebsd.org/changeset/base/276747 > C> > C> Log: > C> Instead of creating a purge thread for every vnet, create > C> a single purge thread and clean up all vnets from this thread. > C> > C> PR: 194515 > C> Differential Revision: D1315 > C> Submitted by: Nikos Vassiliadis > > Sorry guys, I backed this out due to broken kldunload of pf module, which > is critical when you are working with pf bugs. For sure. 100% understood. > I had to backout r276746 as well, since it has numerous build breakages, > that are addressed by later revisions. > > That's my fault that I don't review in time, and I will try to improve > the situation. > > Can you please replay r276746 again, addressing all the build problems > and send the patch to me? You can user reviews.freebsd.org if you want. > > I'd like to get this in, but in a better quality. I'd like to get involved again and help you fixing pf. Craig could you replay 276746? I can try fixing the pf purge thread. Thanks, Nikos From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 22:04:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29C7CBB9; Thu, 22 Jan 2015 22:04:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0678C1D; Thu, 22 Jan 2015 22:04:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MM4hOm038875; Thu, 22 Jan 2015 22:04:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MM4hBx038874; Thu, 22 Jan 2015 22:04:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501222204.t0MM4hBx038874@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 22 Jan 2015 22:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277539 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 22:04:44 -0000 Author: nwhitehorn Date: Thu Jan 22 22:04:43 2015 New Revision: 277539 URL: https://svnweb.freebsd.org/changeset/base/277539 Log: Allow use of a pre-instantiated RTAS as well as a self-instantiated one. This lets the kernel boot on RTAS-based systems by being kexec'ed from Linux. Modified: head/sys/powerpc/ofw/rtas.c Modified: head/sys/powerpc/ofw/rtas.c ============================================================================== --- head/sys/powerpc/ofw/rtas.c Thu Jan 22 21:41:41 2015 (r277538) +++ head/sys/powerpc/ofw/rtas.c Thu Jan 22 22:04:43 2015 (r277539) @@ -86,12 +86,6 @@ rtas_setup(void *junk) return; } OF_package_to_path(rtas, path, sizeof(path)); - rtasi = OF_open(path); - if (rtasi == 0) { - rtas = 0; - printf("Error initializing RTAS: could not open node\n"); - return; - } mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN); @@ -110,7 +104,7 @@ rtas_setup(void *junk) * It must be 4KB-aligned and not cross a 256 MB boundary. */ - OF_getprop(rtas, "rtas-size", &rtas_size, sizeof(rtas_size)); + OF_getencprop(rtas, "rtas-size", &rtas_size, sizeof(rtas_size)); rtas_size = round_page(rtas_size); rtas_bounce_virt = contigmalloc(rtas_size + PAGE_SIZE, M_RTAS, 0, 0, ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), @@ -125,15 +119,32 @@ rtas_setup(void *junk) * Instantiate RTAS. We always use the 32-bit version. */ - result = OF_call_method("instantiate-rtas", rtasi, 1, 1, - (cell_t)rtas_private_data, &rtas_ptr); - OF_close(rtasi); - - if (result != 0) { - rtas = 0; - rtas_ptr = 0; - printf("Error initializing RTAS (%d)\n", result); - return; + if (OF_hasprop(rtas, "linux,rtas-entry") && + OF_hasprop(rtas, "linux,rtas-base")) { + OF_getencprop(rtas, "linux,rtas-base", &rtas_ptr, + sizeof(rtas_ptr)); + rtas_private_data = rtas_ptr; + OF_getencprop(rtas, "linux,rtas-entry", &rtas_ptr, + sizeof(rtas_ptr)); + } else { + rtasi = OF_open(path); + if (rtasi == 0) { + rtas = 0; + printf("Error initializing RTAS: could not open " + "node\n"); + return; + } + + result = OF_call_method("instantiate-rtas", rtasi, 1, 1, + (cell_t)rtas_private_data, &rtas_ptr); + OF_close(rtasi); + + if (result != 0) { + rtas = 0; + rtas_ptr = 0; + printf("Error initializing RTAS (%d)\n", result); + return; + } } rtas_entry = (uintptr_t)(rtas_ptr); @@ -252,7 +263,7 @@ rtas_token_lookup(const char *method) if (!rtas_exists()) return (-1); - if (OF_getprop(rtas, method, &token, sizeof(token)) == -1) + if (OF_getencprop(rtas, method, &token, sizeof(token)) == -1) return (-1); return (token); From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 22:23:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1953923A; Thu, 22 Jan 2015 22:23:17 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 98C8AE0C; Thu, 22 Jan 2015 22:23:15 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0MMNE73087830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 Jan 2015 01:23:14 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0MMNEXK087829; Fri, 23 Jan 2015 01:23:14 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 23 Jan 2015 01:23:14 +0300 From: Gleb Smirnoff To: Nikos Vassiliadis Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150122222314.GO15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54C16715.6060701@gmx.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Craig Rodrigues , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 22:23:17 -0000 On Thu, Jan 22, 2015 at 10:09:41PM +0100, Nikos Vassiliadis wrote: N> > Sorry guys, I backed this out due to broken kldunload of pf module, which N> > is critical when you are working with pf bugs. N> N> For sure. 100% understood. N> N> > I had to backout r276746 as well, since it has numerous build breakages, N> > that are addressed by later revisions. N> > N> > That's my fault that I don't review in time, and I will try to improve N> > the situation. N> > N> > Can you please replay r276746 again, addressing all the build problems N> > and send the patch to me? You can user reviews.freebsd.org if you want. N> > N> > I'd like to get this in, but in a better quality. N> N> I'd like to get involved again and help you fixing pf. Craig could you N> replay 276746? Erm, I didn't mean replaying 276746 as svn commit. I meant: checkout head, reapply r276746, fix all build breakages, and submit the patch to me. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 23:03:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE4C8F3D; Thu, 22 Jan 2015 23:03:56 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 654AE299; Thu, 22 Jan 2015 23:03:55 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t0MN3rtx087989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 Jan 2015 02:03:53 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t0MN3r5R087988; Fri, 23 Jan 2015 02:03:53 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 23 Jan 2015 02:03:53 +0300 From: Gleb Smirnoff To: Will Andrews Subject: Re: svn commit: r277530 - head/sys/netinet Message-ID: <20150122230353.GQ15484@FreeBSD.org> References: <201501221709.t0MH9svg093005@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501221709.t0MH9svg093005@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 23:03:57 -0000 On Thu, Jan 22, 2015 at 05:09:54PM +0000, Will Andrews wrote: W> Author: will W> Date: Thu Jan 22 17:09:54 2015 W> New Revision: 277530 W> URL: https://svnweb.freebsd.org/changeset/base/277530 W> W> Log: W> Improve CARP logging so that all state transitions are logged. W> W> sys/netinet/ip_carp.c: W> Add a "reason" string parameter to carp_set_state() and W> carp_master_down_locked() allowing more specific logging W> information to be passed into these apis. W> W> Refactor existing state transition logging into a single W> log call in carp_set_state(). W> W> Update all calls to carp_set_state() and W> carp_master_down_locked() to pass an appropriate reason W> string. For state transitions that were previously logged, W> the output should be unchanged. W> W> Submitted by: gibbs (original), asomers (updated) W> MFC after: 1 week W> Sponsored by: Spectra Logic W> MFSpectraBSD: 1039697 on 2014/02/11 (original) W> 1049992 on 2014/03/21 (updated) Very nice, thanks! The only thing I'd suggest to change is "SIOCSVH". You and me, we understand this enchantment word, but average user Joe doesn't. :) May be a text like "user requested" or something else. I don't insist on anything, as I am not native speaker, but anything except of SIOCSVH :) P.S. Abbreviation "hw" might also be improved. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 23:50:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C6C29F8; Thu, 22 Jan 2015 23:50:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 684B396A; Thu, 22 Jan 2015 23:50:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0MNonFl091655; Thu, 22 Jan 2015 23:50:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0MNomwm091649; Thu, 22 Jan 2015 23:50:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501222350.t0MNomwm091649@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 22 Jan 2015 23:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277541 - in head/etc: . newsyslog.conf.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 23:50:49 -0000 Author: ngie Date: Thu Jan 22 23:50:47 2015 New Revision: 277541 URL: https://svnweb.freebsd.org/changeset/base/277541 Log: Add sample log rotation support for opensm Up to 7 archives of the log will be kept (just for consistency with the other log rotation rules) PR: 196788 MFC after: 1 week Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Added: head/etc/newsyslog.conf.d/ head/etc/newsyslog.conf.d/Makefile (contents, props changed) head/etc/newsyslog.conf.d/opensm.conf (contents, props changed) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Jan 22 23:45:38 2015 (r277540) +++ head/etc/Makefile Thu Jan 22 23:50:47 2015 (r277541) @@ -3,8 +3,11 @@ .include +SUBDIR= \ + newsyslog.conf.d + .if ${MK_SENDMAIL} != "no" -SUBDIR= sendmail +SUBDIR+=sendmail .endif .if ${MK_TESTS} != "no" Added: head/etc/newsyslog.conf.d/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/newsyslog.conf.d/Makefile Thu Jan 22 23:50:47 2015 (r277541) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +BINDIR= /etc/newsyslog.conf.d + +FILES= + +.if ${MK_OFED} != "no" +FILES+= opensm.conf +.endif + +.include Added: head/etc/newsyslog.conf.d/opensm.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/newsyslog.conf.d/opensm.conf Thu Jan 22 23:50:47 2015 (r277541) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +/var/log/opensm.log 600 7 * * Z /var/run/opensm.pid 30 From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 00:06:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CCF2101; Fri, 23 Jan 2015 00:06:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D343AC5; Fri, 23 Jan 2015 00:06:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0N06aAl000572; Fri, 23 Jan 2015 00:06:36 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0N06a2E000567; Fri, 23 Jan 2015 00:06:36 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501230006.t0N06a2E000567@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 00:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277544 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 00:06:36 -0000 Author: will Date: Fri Jan 23 00:06:35 2015 New Revision: 277544 URL: https://svnweb.freebsd.org/changeset/base/277544 Log: Improve the distribution of LAGG port traffic. I edited the original change to retain the use of arc4random() as a seed for the hashing as a very basic defense against intentional lagg port selection. The author's original commit message (edited slightly): sys/net/ieee8023ad_lacp.c sys/net/if_lagg.c In lagg_hashmbuf, use the FNV hash instead of the old hash32_buf. The hash32 family of functions operate one octet at a time, and when run on a string s of length n, their output is equivalent to : ----- i=n-1 \ n \ (n-i-1) 32 ( seed^ + / 33^ * s[i] ) % 2^ / ----- i=0 The problem is that the last five bytes of input don't get multiplied by sufficiently many powers of 33 to rollover 2^32. That means that changing the last few bytes (but obviously not the very last) of input will always change the value of the hash by a multiple of 33. In the case of lagg_hashmbuf() with ipv4 input, the last four bytes are the TCP or UDP port numbers. Since the output of lagg_hashmbuf is always taken modulo the port count, and 3 is a common port count for a lagg, that's bad. It means that the UDP or TCP source port will never affect which lagg member is selected on a 3-port lagg. At 10Gbps, I was not able to measure any difference in CPU consumption between the old and new hash. Submitted by: asomers (original commit) Reviewed by: emaste, glebius MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1001723 on 2013/08/28 (original) 1114258 on 2015/01/22 (edit) Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Jan 23 00:02:26 2015 (r277543) +++ head/sys/net/ieee8023ad_lacp.c Fri Jan 23 00:06:35 2015 (r277544) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include /* hz */ #include /* for net/if.h */ @@ -757,13 +758,16 @@ void lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; + uint32_t seed; lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_psc = lsc; lsc->lsc_softc = sc; - lsc->lsc_hashkey = arc4random(); + seed = arc4random(); + lsc->lsc_hashkey = FNV1_32_INIT; + lsc->lsc_hashkey = fnv_32_buf(&seed, sizeof(seed), lsc->lsc_hashkey); lsc->lsc_active_aggregator = NULL; lsc->lsc_strict_mode = 1; LACP_LOCK_INIT(lsc); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Jan 23 00:02:26 2015 (r277543) +++ head/sys/net/if_lagg.c Fri Jan 23 00:06:35 2015 (r277544) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -1853,13 +1853,13 @@ lagg_hashmbuf(struct lagg_softc *sc, str eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); if (sc->sc_flags & LAGG_F_HASHL2) { - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + p = fnv_32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = fnv_32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); } /* Special handling for encapsulating VLAN frames */ if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { - p = hash32_buf(&m->m_pkthdr.ether_vtag, + p = fnv_32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); @@ -1867,7 +1867,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str goto out; if (sc->sc_flags & LAGG_F_HASHL2) - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + p = fnv_32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1880,8 +1880,8 @@ lagg_hashmbuf(struct lagg_softc *sc, str goto out; if (sc->sc_flags & LAGG_F_HASHL3) { - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + p = fnv_32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = fnv_32_buf(&ip->ip_dst, sizeof(struct in_addr), p); } if (!(sc->sc_flags & LAGG_F_HASHL4)) break; @@ -1896,7 +1896,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str ports = lagg_gethdr(m, off, sizeof(*ports), &buf); if (ports == NULL) break; - p = hash32_buf(ports, sizeof(*ports), p); + p = fnv_32_buf(ports, sizeof(*ports), p); break; } break; @@ -1909,10 +1909,10 @@ lagg_hashmbuf(struct lagg_softc *sc, str if (ip6 == NULL) goto out; - p = hash32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); - p = hash32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); + p = fnv_32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); + p = fnv_32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); flow = ip6->ip6_flow & IPV6_FLOWLABEL_MASK; - p = hash32_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ + p = fnv_32_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ break; #endif } @@ -2087,12 +2087,15 @@ lagg_lb_attach(struct lagg_softc *sc) { struct lagg_port *lp; struct lagg_lb *lb; + uint32_t seed; lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; - lb->lb_key = arc4random(); + seed = arc4random(); + lb->lb_key = FNV1_32_INIT; + lb->lb_key = fnv_32_buf(&seed, sizeof(seed), lb->lb_key); sc->sc_psc = lb; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 01:18:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EAC696C; Fri, 23 Jan 2015 01:18:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3681D3; Fri, 23 Jan 2015 01:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0N1I99k034663; Fri, 23 Jan 2015 01:18:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0N1I9C9034662; Fri, 23 Jan 2015 01:18:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501230118.t0N1I9C9034662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 23 Jan 2015 01:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277555 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 01:18:09 -0000 Author: ian Date: Fri Jan 23 01:18:08 2015 New Revision: 277555 URL: https://svnweb.freebsd.org/changeset/base/277555 Log: Enable all the mmc/sd controllers, because there's no telling which ones any given board will be using. Yes, changing source is an unusually primitive power control implementation. Modified: head/sys/arm/freescale/imx/imx6_ccm.c Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Fri Jan 23 00:54:56 2015 (r277554) +++ head/sys/arm/freescale/imx/imx6_ccm.c Fri Jan 23 01:18:08 2015 (r277555) @@ -95,7 +95,7 @@ ccm_init_gates(struct ccm_softc *sc) WR4(sc, CCM_CCGR3, 0x3ff00000); /* DDR memory controller */ WR4(sc, CCM_CCGR4, 0x0000f300); /* pl301 bus crossbar */ WR4(sc, CCM_CCGR5, 0x0f000000); /* uarts */ - WR4(sc, CCM_CCGR6, 0x000000cc); /* usdhc 1 & 3 */ + WR4(sc, CCM_CCGR6, 0x000000ff); /* usdhc 1-4 */ } static int From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 07:30:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC4E875F; Fri, 23 Jan 2015 07:30:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A743999A; Fri, 23 Jan 2015 07:30:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0N7UxYG008494; Fri, 23 Jan 2015 07:30:59 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0N7Uwta008490; Fri, 23 Jan 2015 07:30:58 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201501230730.t0N7Uwta008490@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Fri, 23 Jan 2015 07:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277560 - in head: lib/libstand share/man/man9 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 07:31:00 -0000 Author: danfe (ports committer) Date: Fri Jan 23 07:30:57 2015 New Revision: 277560 URL: https://svnweb.freebsd.org/changeset/base/277560 Log: Fix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n' in bitfield argument is wrong, as it will be treated as bit 10, causing any code printing >=10 bits with bit 10 on as having a trailing comma. Newline (intended one) should be part of the format string (already present in the examples). Also fix grammar and kill EOL whitespace in comment while here. PR: 195005 Approved by: bdrewery Modified: head/lib/libstand/libstand.3 head/lib/libstand/printf.c head/share/man/man9/printf.9 head/sys/kern/subr_prf.c Modified: head/lib/libstand/libstand.3 ============================================================================== --- head/lib/libstand/libstand.3 Fri Jan 23 06:01:34 2015 (r277559) +++ head/lib/libstand/libstand.3 Fri Jan 23 07:30:57 2015 (r277560) @@ -288,7 +288,7 @@ Thus printf( .Qq reg=%b\en , 3, -.Qq \e10\e2BITTWO\e1BITONE\en +.Qq \e10\e2BITTWO\e1BITONE ); .Ed .Pp Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Fri Jan 23 06:01:34 2015 (r277559) +++ head/lib/libstand/printf.c Fri Jan 23 07:30:57 2015 (r277560) @@ -187,7 +187,7 @@ ksprintn(char *nbuf, uintmax_t num, int * the next characters (up to a control character, i.e. a character <= 32), * give the name of the register. Thus: * - * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); + * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE"); * * would produce output: * @@ -500,7 +500,7 @@ number: while (percent < fmt) PCHAR(*percent++); /* - * Since we ignore an formatting argument it is no + * Since we ignore a formatting argument it is no * longer safe to obey the remaining formatting * arguments as the arguments will no longer match * the format specs. Modified: head/share/man/man9/printf.9 ============================================================================== --- head/share/man/man9/printf.9 Fri Jan 23 06:01:34 2015 (r277559) +++ head/share/man/man9/printf.9 Fri Jan 23 07:30:57 2015 (r277560) @@ -151,7 +151,7 @@ void printf_test(void) { - printf("reg=%b\en", 3, "\e10\e2BITTWO\e1BITONE\en"); + printf("reg=%b\en", 3, "\e10\e2BITTWO\e1BITONE"); printf("out: %4D\en", "AAAA", ":"); } .Ed Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Jan 23 06:01:34 2015 (r277559) +++ head/sys/kern/subr_prf.c Fri Jan 23 07:30:57 2015 (r277560) @@ -598,7 +598,7 @@ ksprintn(char *nbuf, uintmax_t num, int * the next characters (up to a control character, i.e. a character <= 32), * give the name of the register. Thus: * - * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); + * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE"); * * would produce output: * @@ -911,7 +911,7 @@ number: while (percent < fmt) PCHAR(*percent++); /* - * Since we ignore a formatting argument it is no + * Since we ignore a formatting argument it is no * longer safe to obey the remaining formatting * arguments as the arguments will no longer match * the format specs. From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 07:36:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F4D8949; Fri, 23 Jan 2015 07:36:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE46A57; Fri, 23 Jan 2015 07:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0N7arSs011586; Fri, 23 Jan 2015 07:36:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0N7aqrV011578; Fri, 23 Jan 2015 07:36:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501230736.t0N7aqrV011578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 23 Jan 2015 07:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277561 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 07:36:53 -0000 Author: nwhitehorn Date: Fri Jan 23 07:36:51 2015 New Revision: 277561 URL: https://svnweb.freebsd.org/changeset/base/277561 Log: Use relocation-safe methods to determine the sizes of the exception handlers. A "size" symbol with its address set to the length of handler would be shifted forward with all other addresses when relocations are processed. Instead, just note the end and do the subtraction at runtime. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Jan 23 07:30:57 2015 (r277560) +++ head/sys/powerpc/aim/machdep.c Fri Jan 23 07:36:51 2015 (r277561) @@ -237,14 +237,14 @@ extern void *rfid_patch, *rfi_patch1, *r extern void *trapcode64; #endif -extern void *rstcode, *rstsize; -extern void *trapcode, *trapsize, *trapcode2; -extern void *slbtrap, *slbtrapsize; -extern void *alitrap, *alisize; -extern void *dsitrap, *dsisize; +extern void *rstcode, *rstcodeend; +extern void *trapcode, *trapcodeend, *trapcode2; +extern void *slbtrap, *slbtrapend; +extern void *alitrap, *aliend; +extern void *dsitrap, *dsiend; extern void *decrint, *decrsize; extern void *extint, *extsize; -extern void *dblow, *dbsize; +extern void *dblow, *dbend; extern void *imisstrap, *imisssize; extern void *dlmisstrap, *dlmisssize; extern void *dsmisstrap, *dsmisssize; @@ -255,7 +255,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ struct pcpu *pc; vm_offset_t startkernel, endkernel; void *generictrap; - size_t trap_offset; + size_t trap_offset, trapsize; void *kmdp; char *env; register_t msr, scratch; @@ -513,35 +513,44 @@ powerpc_init(vm_offset_t fdt, vm_offset_ *((register_t *)TRAP_TOCBASE) = toc; #endif - bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstsize); + trapsize = (size_t)&trapcodeend - (size_t)&trapcode; + + bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstcodeend - + (size_t)&rstcode); #ifdef KDB - bcopy(&dblow, (void *)(EXC_MCHK + trap_offset), (size_t)&dbsize); - bcopy(&dblow, (void *)(EXC_PGM + trap_offset), (size_t)&dbsize); - bcopy(&dblow, (void *)(EXC_TRC + trap_offset), (size_t)&dbsize); - bcopy(&dblow, (void *)(EXC_BPT + trap_offset), (size_t)&dbsize); + bcopy(&dblow, (void *)(EXC_MCHK + trap_offset), (size_t)&dbend - + (size_t)&dblow); + bcopy(&dblow, (void *)(EXC_PGM + trap_offset), (size_t)&dbend - + (size_t)&dblow); + bcopy(&dblow, (void *)(EXC_TRC + trap_offset), (size_t)&dbend - + (size_t)&dblow); + bcopy(&dblow, (void *)(EXC_BPT + trap_offset), (size_t)&dbend - + (size_t)&dblow); #else - bcopy(generictrap, (void *)EXC_MCHK, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_PGM, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_TRC, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_BPT, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_MCHK, trapsize); + bcopy(generictrap, (void *)EXC_PGM, trapsize); + bcopy(generictrap, (void *)EXC_TRC, trapsize); + bcopy(generictrap, (void *)EXC_BPT, trapsize); #endif - bcopy(&alitrap, (void *)(EXC_ALI + trap_offset), (size_t)&alisize); - bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsisize); - bcopy(generictrap, (void *)EXC_ISI, (size_t)&trapsize); + bcopy(&alitrap, (void *)(EXC_ALI + trap_offset), (size_t)&aliend - + (size_t)&alitrap); + bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsitrap - + (size_t)&dsitrap); + bcopy(generictrap, (void *)EXC_ISI, trapsize); #ifdef __powerpc64__ - bcopy(&slbtrap, (void *)EXC_DSE, (size_t)&slbtrapsize); - bcopy(&slbtrap, (void *)EXC_ISE, (size_t)&slbtrapsize); + bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap); + bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap); #endif - bcopy(generictrap, (void *)EXC_EXI, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_FPU, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_DECR, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_SC, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_FPA, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_PERF, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_VECAST_G4, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_VECAST_G5, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_EXI, trapsize); + bcopy(generictrap, (void *)EXC_FPU, trapsize); + bcopy(generictrap, (void *)EXC_DECR, trapsize); + bcopy(generictrap, (void *)EXC_SC, trapsize); + bcopy(generictrap, (void *)EXC_FPA, trapsize); + bcopy(generictrap, (void *)EXC_VEC, trapsize); + bcopy(generictrap, (void *)EXC_PERF, trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G4, trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G5, trapsize); #ifndef __powerpc64__ /* G2-specific TLB miss helper handlers */ bcopy(&imisstrap, (void *)EXC_IMISS, (size_t)&imisssize); Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Fri Jan 23 07:30:57 2015 (r277560) +++ head/sys/powerpc/aim/trap_subr32.S Fri Jan 23 07:36:51 2015 (r277561) @@ -299,10 +299,10 @@ CNAME(restorebridgesize) = .-CNAME(resto * not still hanging around in the trap handling region * once the MMU is turned on. */ - .globl CNAME(rstcode), CNAME(rstsize) + .globl CNAME(rstcode), CNAME(rstcodeend) CNAME(rstcode): ba cpu_reset -CNAME(rstsize) = . - CNAME(rstcode) +CNAME(rstcodeend): cpu_reset: bl 1f @@ -339,14 +339,14 @@ cpu_reset: * (except ISI/DSI, ALI, and the interrupts) */ - .globl CNAME(trapcode),CNAME(trapsize) + .globl CNAME(trapcode),CNAME(trapcodeend) CNAME(trapcode): mtsprg1 %r1 /* save SP */ mflr %r1 /* Save the old LR in r1 */ mtsprg2 %r1 /* And then in SPRG2 */ li %r1, 0x20 /* How to get the vector from LR */ bla generictrap /* LR & SPRG3 is exception # */ -CNAME(trapsize) = .-CNAME(trapcode) +CNAME(trapcodeend): /* * 64-bit version of trapcode. Identical, except it calls generictrap64. @@ -362,7 +362,7 @@ CNAME(trapcode64): /* * For ALI: has to save DSISR and DAR */ - .globl CNAME(alitrap),CNAME(alisize) + .globl CNAME(alitrap),CNAME(aliend) CNAME(alitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -386,7 +386,7 @@ CNAME(alitrap): mfsrr1 %r31 mtcr %r31 bla s_trap -CNAME(alisize) = .-CNAME(alitrap) +CNAME(aliend): /* * G2 specific: instuction TLB miss. @@ -594,7 +594,7 @@ CNAME(dsmisssize) = .-CNAME(dsmisstrap) * Has to handle BAT spills * and standard pagetable spills */ - .globl CNAME(dsitrap),CNAME(dsisize) + .globl CNAME(dsitrap),CNAME(dsiend) CNAME(dsitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -645,7 +645,7 @@ CNAME(dsitrap): 1: mflr %r28 /* save LR (SP already saved) */ bla disitrap -CNAME(dsisize) = .-CNAME(dsitrap) +CNAME(dsiend): /* * Preamble code for DSI/ISI traps @@ -883,7 +883,7 @@ CNAME(rfi_patch2): /* * In case of KDB we want a separate trap catcher for it */ - .globl CNAME(dblow),CNAME(dbsize) + .globl CNAME(dblow),CNAME(dbend) CNAME(dblow): mtsprg1 %r1 /* save SP */ mtsprg2 %r29 /* save r29 */ @@ -909,5 +909,5 @@ CNAME(dblow): stw %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ bla dbtrap -CNAME(dbsize) = .-CNAME(dblow) +CNAME(dbend): #endif /* KDB */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Jan 23 07:30:57 2015 (r277560) +++ head/sys/powerpc/aim/trap_subr64.S Fri Jan 23 07:36:51 2015 (r277561) @@ -294,7 +294,7 @@ dtrace_invop_calltrap_addr: * not still hanging around in the trap handling region * once the MMU is turned on. */ - .globl CNAME(rstcode), CNAME(rstsize) + .globl CNAME(rstcode), CNAME(rstcodeend) CNAME(rstcode): /* Explicitly set MSR[SF] */ mfmsr %r9 @@ -309,7 +309,7 @@ CNAME(rstcode): mtlr %r9 blr -CNAME(rstsize) = . - CNAME(rstcode) +CNAME(rstcodeend): cpu_reset: GET_TOCBASE(%r2) @@ -350,7 +350,7 @@ cpu_reset: * (except ISI/DSI, ALI, and the interrupts). Has to fit in 8 instructions! */ - .globl CNAME(trapcode),CNAME(trapsize) + .globl CNAME(trapcode),CNAME(trapcodeend) .p2align 3 CNAME(trapcode): mtsprg1 %r1 /* save SP */ @@ -361,7 +361,7 @@ CNAME(trapcode): mtlr %r1 li %r1, 0xA0 /* How to get the vector from LR */ blrl /* Branch to generictrap */ -CNAME(trapsize) = .-CNAME(trapcode) +CNAME(trapcodeend): /* * For SLB misses: do special things for the kernel @@ -369,7 +369,7 @@ CNAME(trapsize) = .-CNAME(trapcode) * Note: SPRG1 is always safe to overwrite any time the MMU is on, which is * the only time this can be called. */ - .globl CNAME(slbtrap),CNAME(slbtrapsize) + .globl CNAME(slbtrap),CNAME(slbtrapend) .p2align 3 CNAME(slbtrap): mtsprg1 %r1 /* save SP */ @@ -404,7 +404,7 @@ CNAME(slbtrap): mtlr %r1 GET_CPUINFO(%r1) blrl /* 124 bytes -- 4 to spare */ -CNAME(slbtrapsize) = .-CNAME(slbtrap) +CNAME(slbtrapend): kern_slbtrap: std %r2,(PC_SLBSAVE+136)(%r1) /* old LR */ @@ -525,7 +525,7 @@ kern_slbtrap: /* * For ALI: has to save DSISR and DAR */ - .globl CNAME(alitrap),CNAME(alisize) + .globl CNAME(alitrap),CNAME(aliend) CNAME(alitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -560,13 +560,13 @@ CNAME(alitrap): mfsrr1 %r31 mtcr %r31 blrl -CNAME(alisize) = .-CNAME(alitrap) +CNAME(aliend): /* * Similar to the above for DSI * Has to handle standard pagetable spills */ - .globl CNAME(dsitrap),CNAME(dsisize) + .globl CNAME(dsitrap),CNAME(dsiend) CNAME(dsitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -587,7 +587,7 @@ CNAME(dsitrap): ld %r1,0(%r1) mtlr %r1 blrl /* Branch to generictrap */ -CNAME(dsisize) = .-CNAME(dsitrap) +CNAME(dsiend): /* * Preamble code for DSI/ISI traps @@ -830,7 +830,7 @@ dbleave: /* * In case of KDB we want a separate trap catcher for it */ - .globl CNAME(dblow),CNAME(dbsize) + .globl CNAME(dblow),CNAME(dbend) CNAME(dblow): mtsprg1 %r1 /* save SP */ mtsprg2 %r29 /* save r29 */ @@ -869,5 +869,5 @@ CNAME(dblow): ld %r1,0(%r1) mtlr %r1 blrl /* Branch to generictrap */ -CNAME(dbsize) = .-CNAME(dblow) +CNAME(dbend): #endif /* KDB */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 13:26:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E14E7A5; Fri, 23 Jan 2015 13:26:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3DE3B4; Fri, 23 Jan 2015 13:26:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NDQaO8076312; Fri, 23 Jan 2015 13:26:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NDQaox076311; Fri, 23 Jan 2015 13:26:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201501231326.t0NDQaox076311@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 23 Jan 2015 13:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277562 - head/sbin/ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 13:26:36 -0000 Author: ae Date: Fri Jan 23 13:26:35 2015 New Revision: 277562 URL: https://svnweb.freebsd.org/changeset/base/277562 Log: After r270929 RAW IP code assumes that all IP fields are in network byte order. Fix ping(8) to pass an IP header with converted ip_off and ip_len fields, when IP_HDRINCL socket option used. Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Fri Jan 23 07:36:51 2015 (r277561) +++ head/sbin/ping/ping.c Fri Jan 23 13:26:35 2015 (r277562) @@ -713,7 +713,7 @@ main(int argc, char *const *argv) ip->ip_hl = sizeof(struct ip) >> 2; ip->ip_tos = tos; ip->ip_id = 0; - ip->ip_off = df ? IP_DF : 0; + ip->ip_off = htons(df ? IP_DF : 0); ip->ip_ttl = ttl; ip->ip_p = IPPROTO_ICMP; ip->ip_src.s_addr = source ? sock_in.sin_addr.s_addr : INADDR_ANY; @@ -1078,7 +1078,7 @@ pinger(void) if (options & F_HDRINCL) { cc += sizeof(struct ip); ip = (struct ip *)outpackhdr; - ip->ip_len = cc; + ip->ip_len = htons(cc); ip->ip_sum = in_cksum((u_short *)outpackhdr, cc); packet = outpackhdr; } From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 14:28:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2C004D0; Fri, 23 Jan 2015 14:28:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F70CC4A; Fri, 23 Jan 2015 14:28:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NESDju004472; Fri, 23 Jan 2015 14:28:13 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NESDMl004471; Fri, 23 Jan 2015 14:28:13 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231428.t0NESDMl004471@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 14:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277563 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 14:28:13 -0000 Author: will Date: Fri Jan 23 14:28:12 2015 New Revision: 277563 URL: https://svnweb.freebsd.org/changeset/base/277563 Log: When a CARP state change is caused by an ifconfig request, log it accordingly. Suggested by: glebius MFC after: 1 week MFC with: 277530 Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Jan 23 13:26:35 2015 (r277562) +++ head/sys/netinet/ip_carp.c Fri Jan 23 14:28:12 2015 (r277563) @@ -1702,12 +1702,14 @@ carp_ioctl(struct ifreq *ifr, u_long cmd switch (carpr.carpr_state) { case BACKUP: callout_stop(&sc->sc_ad_tmo); - carp_set_state(sc, BACKUP, "SIOCSVH"); + carp_set_state(sc, BACKUP, + "user requested via ifconfig"); carp_setrun(sc, 0); carp_delroute(sc); break; case MASTER: - carp_master_down_locked(sc, "SIOCSVH"); + carp_master_down_locked(sc, + "user requested via ifconfig"); break; default: break; From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 14:29:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D69E9633 for ; Fri, 23 Jan 2015 14:29:43 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D856C64 for ; Fri, 23 Jan 2015 14:29:43 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id vy18so7363794iec.8 for ; Fri, 23 Jan 2015 06:29:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=i7t9qiEpCF8t7mInRbyM7YeJrt9dYsoEn5OAOB/tBOc=; b=EOEe75871ao9yn8RdeCo9FQnpBoHKPVC5QPGuES6lWB9+kfMdsXlj56OgMu5SufmL2 HpkOrUrhMmj5kOs7y2ZkBKidNXe/DbwcGOfJNV1B/zoJFhqehklggYBmexiNQZZqNCzy xeXeXO8Gvigivd2Xy4hrMkh3qnTkruNpb1tmluqZWUobsbpsD5COexPqoBOrg5PtyL7n eAISkaOuahB0OhxwFVijBMXF6OUd7tdyiQ0LdPIEXkAvjcB8QpGOp69ZoNK2B457EeLl oJbt8Zub01Jc7U7eq1SkV2D8Tcm+yLb19MINNKMjorKOQ32eIJUBp69RwRpd1S9ERlrv PYCA== X-Gm-Message-State: ALoCoQkhh82kCnrfgGzH+gvfZQx7WZW/up06adsOKBPRyFRyIvDDpOu7cC/8AoGfzSveMMgcwHGr X-Received: by 10.42.95.12 with SMTP id d12mr8925349icn.12.1422023382582; Fri, 23 Jan 2015 06:29:42 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id c4sm723552igt.19.2015.01.23.06.29.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 06:29:41 -0800 (PST) Date: Fri, 23 Jan 2015 07:29:39 -0700 From: Will Andrews To: Gleb Smirnoff Subject: Re: svn commit: r277530 - head/sys/netinet Message-ID: <20150123142938.GC49380@sol.firepipe.net> References: <201501221709.t0MH9svg093005@svn.freebsd.org> <20150122230353.GQ15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="raC6veAxrt5nqIoY" Content-Disposition: inline In-Reply-To: <20150122230353.GQ15484@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Will Andrews X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 14:29:43 -0000 --raC6veAxrt5nqIoY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 23, 2015 at 02:03:53AM +0300, Gleb Smirnoff wrote: > Very nice, thanks! >=20 > The only thing I'd suggest to change is "SIOCSVH". You and me, we underst= and > this enchantment word, but average user Joe doesn't. :) May be a text like > "user requested" or something else. I don't insist on anything, as I am n= ot > native speaker, but anything except of SIOCSVH :) >=20 > P.S. Abbreviation "hw" might also be improved. Sounds good to me. Done. --=20 wca --raC6veAxrt5nqIoY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTCWtEACgkQF47idPgWcsWkfQCdF4MyYZspr/iT0fX71YSiPp6x ZtcAn3CWcvDeQJ41BZoRTi2p6hF1Yu49 =VFGW -----END PGP SIGNATURE----- --raC6veAxrt5nqIoY-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 14:30:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C66F477B; Fri, 23 Jan 2015 14:30:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30A4CFD; Fri, 23 Jan 2015 14:30:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NEUPrw007067; Fri, 23 Jan 2015 14:30:25 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NEUPFg007066; Fri, 23 Jan 2015 14:30:25 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231430.t0NEUPFg007066@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 14:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277564 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 14:30:25 -0000 Author: will Date: Fri Jan 23 14:30:24 2015 New Revision: 277564 URL: https://svnweb.freebsd.org/changeset/base/277564 Log: Log hardware interface up/down as "hardware" rather than just "hw". Suggested by: glebius MFC after: 1 week MFC with: 277530 Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Jan 23 14:28:12 2015 (r277563) +++ head/sys/netinet/ip_carp.c Fri Jan 23 14:30:24 2015 (r277564) @@ -2001,13 +2001,13 @@ carp_sc_state(struct carp_softc *sc) #ifdef INET6 callout_stop(&sc->sc_md6_tmo); #endif - carp_set_state(sc, INIT, "hw interface down"); + carp_set_state(sc, INIT, "hardware interface down"); carp_setrun(sc, 0); if (!sc->sc_suppress) carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; } else { - carp_set_state(sc, INIT, "hw interface up"); + carp_set_state(sc, INIT, "hardware interface up"); carp_setrun(sc, 0); if (sc->sc_suppress) carp_demote_adj(-V_carp_ifdown_adj, "interface up"); From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 15:14:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B135315D; Fri, 23 Jan 2015 15:14:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83542274; Fri, 23 Jan 2015 15:14:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NFEVM5027602; Fri, 23 Jan 2015 15:14:31 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NFEUlT027595; Fri, 23 Jan 2015 15:14:30 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201501231514.t0NFEUlT027595@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 23 Jan 2015 15:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277565 - in head/sys/dev: agp cx dc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 15:14:31 -0000 Author: kevlo Date: Fri Jan 23 15:14:30 2015 New Revision: 277565 URL: https://svnweb.freebsd.org/changeset/base/277565 Log: Remove break after return. Modified: head/sys/dev/agp/agp_nvidia.c head/sys/dev/cx/cxddk.c head/sys/dev/dc/if_dc.c Modified: head/sys/dev/agp/agp_nvidia.c ============================================================================== --- head/sys/dev/agp/agp_nvidia.c Fri Jan 23 14:30:24 2015 (r277564) +++ head/sys/dev/agp/agp_nvidia.c Fri Jan 23 15:14:30 2015 (r277565) @@ -274,11 +274,11 @@ static u_int32_t agp_nvidia_get_aperture(device_t dev) { switch (pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1) & 0x0f) { - case 0: return (512 * 1024 * 1024); break; - case 8: return (256 * 1024 * 1024); break; - case 12: return (128 * 1024 * 1024); break; - case 14: return (64 * 1024 * 1024); break; - case 15: return (32 * 1024 * 1024); break; + case 0: return (512 * 1024 * 1024); + case 8: return (256 * 1024 * 1024); + case 12: return (128 * 1024 * 1024); + case 14: return (64 * 1024 * 1024); + case 15: return (32 * 1024 * 1024); default: device_printf(dev, "Invalid aperture setting 0x%x\n", pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1)); Modified: head/sys/dev/cx/cxddk.c ============================================================================== --- head/sys/dev/cx/cxddk.c Fri Jan 23 14:30:24 2015 (r277564) +++ head/sys/dev/cx/cxddk.c Fri Jan 23 15:14:30 2015 (r277565) @@ -875,9 +875,9 @@ int cx_get_port (cx_chan_t *c) if (iftype) switch (c->type) { - case T_UNIV_V35: return 1; break; - case T_UNIV_RS449: return 2; break; - default: return -1; break; + case T_UNIV_V35: return 1; + case T_UNIV_RS449: return 2; + default: return -1; } else return 0; Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Jan 23 14:30:24 2015 (r277564) +++ head/sys/dev/dc/if_dc.c Fri Jan 23 15:14:30 2015 (r277565) @@ -671,20 +671,16 @@ dc_miibus_readreg(device_t dev, int phy, * code think there's a PHY here. */ return (BMSR_MEDIAMASK); - break; case MII_PHYIDR1: if (DC_IS_PNIC(sc)) return (DC_VENDORID_LO); return (DC_VENDORID_DEC); - break; case MII_PHYIDR2: if (DC_IS_PNIC(sc)) return (DC_DEVICEID_82C168); return (DC_DEVICEID_21143); - break; default: return (0); - break; } } else return (0); @@ -748,7 +744,6 @@ dc_miibus_readreg(device_t dev, int phy, device_printf(dev, "phy_read: bad phy register %x\n", reg); return (0); - break; } rval = CSR_READ_4(sc, phy_reg) & 0x0000FFFF; From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 15:55:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CAF3BF4; Fri, 23 Jan 2015 15:55:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48993920; Fri, 23 Jan 2015 15:55:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NFt4SD046753; Fri, 23 Jan 2015 15:55:04 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NFt420046752; Fri, 23 Jan 2015 15:55:04 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231555.t0NFt420046752@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 15:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277566 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 15:55:04 -0000 Author: will Date: Fri Jan 23 15:55:03 2015 New Revision: 277566 URL: https://svnweb.freebsd.org/changeset/base/277566 Log: Print transfer times for read, write, & overall independently. Round up calculated values for iops and average time per io to avoid a shifting display if there are 1000+ (or even 10000+) iops, or if an average time per io column is 1000+ ms. Reviewed by: ken MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1089947 on 2014/09/26 1093625 on 2014/09/29 1093650 on 2014/09/29 1095662 on 2014/10/09 Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Fri Jan 23 15:14:30 2015 (r277565) +++ head/usr.sbin/iostat/iostat.c Fri Jan 23 15:55:03 2015 (r277566) @@ -726,15 +726,17 @@ static void devstats(int perf_select, long double etime, int havelast) { int dn; - long double transfers_per_second, transfers_per_second_read, transfers_per_second_write; - long double kb_per_transfer, mb_per_second, mb_per_second_read, mb_per_second_write; + long double transfers_per_second, transfers_per_second_read; + long double transfers_per_second_write; + long double kb_per_transfer, mb_per_second, mb_per_second_read; + long double mb_per_second_write; u_int64_t total_bytes, total_transfers, total_blocks; u_int64_t total_bytes_read, total_transfers_read; u_int64_t total_bytes_write, total_transfers_write; long double busy_pct, busy_time; u_int64_t queue_len; - long double total_mb; - long double blocks_per_second, ms_per_transaction, total_duration; + long double total_mb, blocks_per_second, total_duration; + long double ms_per_other, ms_per_read, ms_per_write, ms_per_transaction; int firstline = 1; char *devname; @@ -746,8 +748,8 @@ devstats(int perf_select, long double et printf(" cpu "); printf("\n"); if (Iflag == 0) { - printf("device r/s w/s kr/s kw/s qlen " - "svc_t %%b "); + printf("device r/s w/s kr/s kw/s " + " ms/r ms/w ms/o ms/t qlen %%b "); } else { printf("device r/i w/i kr/i" " kw/i qlen tsvc_t/i sb/i "); @@ -786,6 +788,9 @@ devstats(int perf_select, long double et DSM_MB_PER_SECOND_WRITE, &mb_per_second_write, DSM_BLOCKS_PER_SECOND, &blocks_per_second, DSM_MS_PER_TRANSACTION, &ms_per_transaction, + DSM_MS_PER_TRANSACTION_READ, &ms_per_read, + DSM_MS_PER_TRANSACTION_WRITE, &ms_per_write, + DSM_MS_PER_TRANSACTION_OTHER, &ms_per_other, DSM_BUSY_PCT, &busy_pct, DSM_QUEUE_LENGTH, &queue_len, DSM_TOTAL_DURATION, &total_duration, @@ -820,13 +825,18 @@ devstats(int perf_select, long double et mb_per_second_write > ((long double).0005)/1024 || busy_pct > 0.5) { if (Iflag == 0) - printf("%-8.8s %5.1Lf %5.1Lf %7.1Lf %7.1Lf %4" PRIu64 " %5.1Lf %3.0Lf ", - devname, transfers_per_second_read, - transfers_per_second_write, + printf("%-8.8s %5d %5d %8.1Lf " + "%8.1Lf %5d %5d %5d %5d " + "%4" PRIu64 " %3.0Lf ", + devname, + (int)transfers_per_second_read, + (int)transfers_per_second_write, mb_per_second_read * 1024, mb_per_second_write * 1024, - queue_len, - ms_per_transaction, busy_pct); + (int)ms_per_read, (int)ms_per_write, + (int)ms_per_other, + (int)ms_per_transaction, + queue_len, busy_pct); else printf("%-8.8s %11.1Lf %11.1Lf " "%12.1Lf %12.1Lf %4" PRIu64 From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 16:03:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6976CF; Fri, 23 Jan 2015 16:03:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2CD8A3D; Fri, 23 Jan 2015 16:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NG33W9051363; Fri, 23 Jan 2015 16:03:03 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NG33Y3051362; Fri, 23 Jan 2015 16:03:03 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231603.t0NG33Y3051362@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 16:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277567 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 16:03:03 -0000 Author: will Date: Fri Jan 23 16:03:02 2015 New Revision: 277567 URL: https://svnweb.freebsd.org/changeset/base/277567 Log: Allow lists for "nooption" and "nooptions" keywords. usr.sbin/config/config.y According to config(5), the "device", "devices", "nodevice", "nodevices", "option", "options", "nooption", and "nooptions" keywords can all take a comma-separated list of values. However, the yacc code did not allow lists for "nooption" and "nooptions", only single values. This commit fixes the yacc code to allow comma separated values for all the above keywords. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1095296 on 2014/10/07 Modified: head/usr.sbin/config/config.y Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Fri Jan 23 15:55:03 2015 (r277566) +++ head/usr.sbin/config/config.y Fri Jan 23 16:03:02 2015 (r277567) @@ -178,7 +178,7 @@ Config_spec: } | OPTIONS Opt_list | - NOOPTION Save_id { rmopt_schedule(&opt, $2); } | + NOOPTION NoOpt_list | MAKEOPTIONS Mkopt_list | NOMAKEOPTION Save_id { rmopt_schedule(&mkopt, $2); } | @@ -225,6 +225,11 @@ Opt_list: Option ; +NoOpt_list: + NoOpt_list COMMA NoOption + | + NoOption + ; Option: Save_id { newopt(&opt, $1, NULL, 0); @@ -236,6 +241,11 @@ Option: newopt(&opt, $1, $3, 0); } ; +NoOption: + Save_id { + rmopt_schedule(&opt, $1); + }; + Opt_value: ID { $$ = $1; } | NUMBER { From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 16:05:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35B56620; Fri, 23 Jan 2015 16:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07E41AC2; Fri, 23 Jan 2015 16:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NG5lns052905; Fri, 23 Jan 2015 16:05:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NG5lND052904; Fri, 23 Jan 2015 16:05:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501231605.t0NG5lND052904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 23 Jan 2015 16:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277568 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 16:05:48 -0000 Author: ian Date: Fri Jan 23 16:05:47 2015 New Revision: 277568 URL: https://svnweb.freebsd.org/changeset/base/277568 Log: Add pinctrl driver support for the encoded input register config words that the linux guys made up on the fly (but didn't document) last August. This type of encoded config now appears in the imx6 fdt data. Modified: head/sys/arm/freescale/imx/imx_iomux.c Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Fri Jan 23 16:03:02 2015 (r277567) +++ head/sys/arm/freescale/imx/imx_iomux.c Fri Jan 23 16:05:47 2015 (r277568) @@ -117,10 +117,36 @@ WR4(struct iomux_softc *sc, bus_size_t o bus_write_4(sc->mem_res, off, val); } +static void +iomux_configure_input(struct iomux_softc *sc, uint32_t reg, uint32_t val) +{ + u_int select, mask, shift, width; + + /* If register and value are zero, there is nothing to configure. */ + if (reg == 0 && val == 0) + return; + + /* + * If the config value has 0xff in the high byte it is encoded: + * 31 23 15 7 0 + * | 0xff | shift | width | select | + * We need to mask out the old select value and OR in the new, using a + * mask of the given width and shifting the values up by shift. + */ + if ((val & 0xff000000) == 0xff000000) { + select = val & 0x000000ff; + width = (val & 0x0000ff00) >> 8; + shift = (val & 0x00ff0000) >> 16; + mask = ((1u << width) - 1) << shift; + val = (RD4(sc, reg) & ~mask) | (select << shift); + } + WR4(sc, reg, val); +} + static int iomux_configure_pins(device_t dev, phandle_t cfgxref) { - struct iomux_softc * sc; + struct iomux_softc *sc; struct pincfg *cfgtuples, *cfg; phandle_t cfgnode; int i, ntuples; @@ -137,8 +163,7 @@ iomux_configure_pins(device_t dev, phand for (i = 0, cfg = cfgtuples; i < ntuples; i++, cfg++) { sion = (cfg->padconf_val & PADCONF_SION) ? PADMUX_SION : 0; WR4(sc, cfg->mux_reg, cfg->mux_val | sion); - if (cfg->input_reg != 0) - WR4(sc, cfg->input_reg, cfg->input_val); + iomux_configure_input(sc, cfg->input_reg, cfg->input_val); if ((cfg->padconf_val & PADCONF_NONE) == 0) WR4(sc, cfg->padconf_reg, cfg->padconf_val); if (bootverbose) { From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 16:15:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD604A34; Fri, 23 Jan 2015 16:15:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE0A8C03; Fri, 23 Jan 2015 16:15:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NGFuAn057627; Fri, 23 Jan 2015 16:15:56 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NGFuQW057626; Fri, 23 Jan 2015 16:15:56 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231615.t0NGFuQW057626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 16:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277569 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 16:15:56 -0000 Author: will Date: Fri Jan 23 16:15:55 2015 New Revision: 277569 URL: https://svnweb.freebsd.org/changeset/base/277569 Log: Make "vmstat -i" respect the -c and -i options together. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1066735 on 2014/06/04 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:05:47 2015 (r277568) +++ head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:15:55 2015 (r277569) @@ -148,7 +148,7 @@ static void cpustats(void); static void pcpustats(int, u_long, int); static void devstats(void); static void doforkst(void); -static void dointr(void); +static void dointr(unsigned int, int); static void dosum(void); static void dovmstat(unsigned int, int); static void domemstat_malloc(void); @@ -325,7 +325,7 @@ retry_nlist: dotimes(); #endif if (todo & INTRSTAT) - dointr(); + dointr(interval, reps); if (todo & VMSTAT) dovmstat(interval, reps); exit(0); @@ -1165,61 +1165,132 @@ pcpustats(int ncpus, u_long cpumask, int } } -static void -dointr(void) +static unsigned int +read_intrcnts(unsigned long **intrcnts) { - unsigned long *intrcnt, uptime; - uint64_t inttotal; - size_t clen, inamlen, intrcntlen, istrnamlen; - unsigned int i, nintr; - char *intrname, *tintrname; + size_t intrcntlen; - uptime = getuptime(); if (kd != NULL) { kread(X_SINTRCNT, &intrcntlen, sizeof(intrcntlen)); - kread(X_SINTRNAMES, &inamlen, sizeof(inamlen)); - if ((intrcnt = malloc(intrcntlen)) == NULL || - (intrname = malloc(inamlen)) == NULL) + if ((*intrcnts = malloc(intrcntlen)) == NULL) err(1, "malloc()"); - kread(X_INTRCNT, intrcnt, intrcntlen); - kread(X_INTRNAMES, intrname, inamlen); + kread(X_INTRCNT, *intrcnts, intrcntlen); } else { - for (intrcnt = NULL, intrcntlen = 1024; ; intrcntlen *= 2) { - if ((intrcnt = reallocf(intrcnt, intrcntlen)) == NULL) + for (*intrcnts = NULL, intrcntlen = 1024; ; intrcntlen *= 2) { + *intrcnts = reallocf(*intrcnts, intrcntlen); + if (*intrcnts == NULL) err(1, "reallocf()"); if (mysysctl("hw.intrcnt", - intrcnt, &intrcntlen, NULL, 0) == 0) + *intrcnts, &intrcntlen, NULL, 0) == 0) break; } - for (intrname = NULL, inamlen = 1024; ; inamlen *= 2) { - if ((intrname = reallocf(intrname, inamlen)) == NULL) + } + + return (intrcntlen / sizeof(unsigned long)); +} + +static void +print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts, + char *intrnames, unsigned int nintr, + size_t istrnamlen, unsigned long long period) +{ + unsigned long *intrcnt, *old_intrcnt; + uint64_t inttotal, old_inttotal, total_count, total_rate; + char* intrname; + unsigned int i; + + inttotal = 0; + old_inttotal = 0; + intrname = intrnames; + for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) { + if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) { + unsigned long count, rate; + + count = *intrcnt - *old_intrcnt; + rate = (count * 1000 + period/2) / period; + (void)printf("%-*s %20lu %10lu\n", (int)istrnamlen, + intrname, count, rate); + } + intrname += strlen(intrname) + 1; + inttotal += *intrcnt++; + old_inttotal += *old_intrcnt++; + } + total_count = inttotal - old_inttotal; + total_rate = (total_count * 1000 + period/2) / period; + (void)printf("%-*s %20" PRIu64 " %10" PRIu64 "\n", (int)istrnamlen, + "Total", total_count, total_rate); +} + +static void +dointr(unsigned int interval, int reps) +{ + unsigned long *intrcnts; + unsigned long long uptime, period; + unsigned long *old_intrcnts = NULL; + size_t clen, inamlen, istrnamlen; + unsigned int rep; + char *intrnames, *intrname; + + uptime = getuptime(); + + /* Get the names of each interrupt source */ + if (kd != NULL) { + kread(X_SINTRNAMES, &inamlen, sizeof(inamlen)); + if ((intrnames = malloc(inamlen)) == NULL) + err(1, "malloc()"); + kread(X_INTRNAMES, intrnames, inamlen); + } else { + for (intrnames = NULL, inamlen = 1024; ; inamlen *= 2) { + if ((intrnames = reallocf(intrnames, inamlen)) == NULL) err(1, "reallocf()"); if (mysysctl("hw.intrnames", - intrname, &inamlen, NULL, 0) == 0) + intrnames, &inamlen, NULL, 0) == 0) break; } } - nintr = intrcntlen / sizeof(unsigned long); - tintrname = intrname; + + /* Determine the length of the longest interrupt name */ + intrname = intrnames; istrnamlen = strlen("interrupt"); - for (i = 0; i < nintr; i++) { - clen = strlen(tintrname); + while(*intrname != '\0') { + clen = strlen(intrname); if (clen > istrnamlen) istrnamlen = clen; - tintrname += clen + 1; + intrname += strlen(intrname) + 1; } (void)printf("%-*s %20s %10s\n", (int)istrnamlen, "interrupt", "total", "rate"); - inttotal = 0; - for (i = 0; i < nintr; i++) { - if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) - (void)printf("%-*s %20lu %10lu\n", (int)istrnamlen, - intrname, *intrcnt, *intrcnt / uptime); - intrname += strlen(intrname) + 1; - inttotal += *intrcnt++; + + /* + * Loop reps times printing differential interrupt counts. If reps is + * zero, then run just once, printing total counts + */ + period = uptime * 1000; + while(1) { + char *intrname; + unsigned int nintr; + + nintr = read_intrcnts(&intrcnts); + /* + * Initialize old_intrcnts to 0 for the first pass, so + * print_intrcnts will print total interrupts since boot + */ + if (old_intrcnts == NULL) { + old_intrcnts = calloc(nintr, sizeof(unsigned long)); + if (old_intrcnts == NULL) + err(1, "calloc()"); + } + + print_intrcnts(intrcnts, old_intrcnts, intrnames, nintr, + istrnamlen, period); + + free(old_intrcnts); + old_intrcnts = intrcnts; + if (reps >= 0 && --reps <= 0) + break; + usleep(interval * 1000); + period = interval; } - (void)printf("%-*s %20" PRIu64 " %10" PRIu64 "\n", (int)istrnamlen, - "Total", inttotal, inttotal / uptime); } static void From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 16:18:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6377C0C; Fri, 23 Jan 2015 16:18:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92983C42; Fri, 23 Jan 2015 16:18:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NGIebQ057993; Fri, 23 Jan 2015 16:18:40 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NGIeDv057991; Fri, 23 Jan 2015 16:18:40 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231618.t0NGIeDv057991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 16:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277570 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 16:18:40 -0000 Author: will Date: Fri Jan 23 16:18:39 2015 New Revision: 277570 URL: https://svnweb.freebsd.org/changeset/base/277570 Log: Use CLOCK_UPTIME to get the uptime instead of CLOCK_MONOTONIC. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1066740 on 2014/06/04 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:15:55 2015 (r277569) +++ head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:18:39 2015 (r277570) @@ -411,7 +411,7 @@ getuptime(void) { struct timespec sp; - (void)clock_gettime(CLOCK_MONOTONIC, &sp); + (void)clock_gettime(CLOCK_UPTIME, &sp); return(sp.tv_sec); } From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 16:21:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C16B2E0F; Fri, 23 Jan 2015 16:21:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC83DD03; Fri, 23 Jan 2015 16:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NGLWi0061336; Fri, 23 Jan 2015 16:21:32 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NGLWtE061335; Fri, 23 Jan 2015 16:21:32 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501231621.t0NGLWtE061335@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 16:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277571 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 16:21:33 -0000 Author: will Date: Fri Jan 23 16:21:31 2015 New Revision: 277571 URL: https://svnweb.freebsd.org/changeset/base/277571 Log: Use clock_gettime to measure the time that we spent asleep during "vmstat -i" instead of assuming it's what we asked for. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1066751 on 2014/06/04 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:18:39 2015 (r277570) +++ head/usr.bin/vmstat/vmstat.c Fri Jan 23 16:21:31 2015 (r277571) @@ -163,7 +163,7 @@ static void printhdr(int, u_long); static void usage(void); static long pct(long, long); -static long getuptime(void); +static long long getuptime(void); static char **getdrivedata(char **); @@ -406,14 +406,15 @@ getdrivedata(char **argv) return(argv); } -static long +/* Return system uptime in nanoseconds */ +static long long getuptime(void) { struct timespec sp; (void)clock_gettime(CLOCK_UPTIME, &sp); - return(sp.tv_sec); + return((long long)sp.tv_sec * 1000000000LL + sp.tv_nsec); } static void @@ -654,7 +655,7 @@ dovmstat(unsigned int interval, int reps u_long cpumask; int rate_adj; - uptime = getuptime(); + uptime = getuptime() / 1000000000LL; halfuptime = uptime / 2; rate_adj = 1; ncpus = 1; @@ -1192,7 +1193,7 @@ read_intrcnts(unsigned long **intrcnts) static void print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts, char *intrnames, unsigned int nintr, - size_t istrnamlen, unsigned long long period) + size_t istrnamlen, long long period_ms) { unsigned long *intrcnt, *old_intrcnt; uint64_t inttotal, old_inttotal, total_count, total_rate; @@ -1207,7 +1208,7 @@ print_intrcnts(unsigned long *intrcnts, unsigned long count, rate; count = *intrcnt - *old_intrcnt; - rate = (count * 1000 + period/2) / period; + rate = (count * 1000 + period_ms / 2) / period_ms; (void)printf("%-*s %20lu %10lu\n", (int)istrnamlen, intrname, count, rate); } @@ -1216,7 +1217,7 @@ print_intrcnts(unsigned long *intrcnts, old_inttotal += *old_intrcnt++; } total_count = inttotal - old_inttotal; - total_rate = (total_count * 1000 + period/2) / period; + total_rate = (total_count * 1000 + period_ms / 2) / period_ms; (void)printf("%-*s %20" PRIu64 " %10" PRIu64 "\n", (int)istrnamlen, "Total", total_count, total_rate); } @@ -1225,10 +1226,9 @@ static void dointr(unsigned int interval, int reps) { unsigned long *intrcnts; - unsigned long long uptime, period; + long long uptime, period_ms; unsigned long *old_intrcnts = NULL; size_t clen, inamlen, istrnamlen; - unsigned int rep; char *intrnames, *intrname; uptime = getuptime(); @@ -1265,10 +1265,10 @@ dointr(unsigned int interval, int reps) * Loop reps times printing differential interrupt counts. If reps is * zero, then run just once, printing total counts */ - period = uptime * 1000; + period_ms = uptime / 1000000; while(1) { - char *intrname; unsigned int nintr; + long long old_uptime; nintr = read_intrcnts(&intrcnts); /* @@ -1282,14 +1282,16 @@ dointr(unsigned int interval, int reps) } print_intrcnts(intrcnts, old_intrcnts, intrnames, nintr, - istrnamlen, period); + istrnamlen, period_ms); free(old_intrcnts); old_intrcnts = intrcnts; if (reps >= 0 && --reps <= 0) break; usleep(interval * 1000); - period = interval; + old_uptime = uptime; + uptime = getuptime(); + period_ms = (uptime - old_uptime) / 1000000; } } From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 18:12:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AA14E83; Fri, 23 Jan 2015 18:12:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1BD3B38; Fri, 23 Jan 2015 18:12:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NICi3f015232; Fri, 23 Jan 2015 18:12:44 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NICiMO015231; Fri, 23 Jan 2015 18:12:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201501231812.t0NICiMO015231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 23 Jan 2015 18:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277579 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 18:12:45 -0000 Author: jkim Date: Fri Jan 23 18:12:44 2015 New Revision: 277579 URL: https://svnweb.freebsd.org/changeset/base/277579 Log: Revert r216942. This commit was premature and caused too many complaints. PR: 162859 MFC after: 3 days Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Jan 23 18:11:48 2015 (r277578) +++ head/sys/dev/acpica/acpi_ec.c Fri Jan 23 18:12:44 2015 (r277579) @@ -620,7 +620,7 @@ EcGpeQueryHandler(void *Context) struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; - int retry, sci_enqueued; + int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -641,7 +641,6 @@ EcGpeQueryHandler(void *Context) * that may arise from running the query from causing another query * to be queued, we clear the pending flag only after running it. */ - sci_enqueued = sc->ec_sci_pend; for (retry = 0; retry < 2; retry++) { Status = EcCommand(sc, EC_COMMAND_QUERY); if (ACPI_SUCCESS(Status)) @@ -681,14 +680,6 @@ EcGpeQueryHandler(void *Context) device_printf(sc->ec_dev, "evaluation of query method %s failed: %s\n", qxx, AcpiFormatException(Status)); } - - /* Reenable runtime GPE if its execution was deferred. */ - if (sci_enqueued) { - Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit); - if (ACPI_FAILURE(Status)) - device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n", - AcpiFormatException(Status)); - } } /* @@ -722,10 +713,9 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) { + if (ACPI_SUCCESS(Status)) sc->ec_sci_pend = TRUE; - return (0); - } else + else printf("EcGpeHandler: queuing GPE query handler failed\n"); } return (ACPI_REENABLE_GPE); From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 18:55:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5128BB29; Fri, 23 Jan 2015 18:55:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE388C; Fri, 23 Jan 2015 18:55:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NIt5bQ036109; Fri, 23 Jan 2015 18:55:05 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NIt5KM036108; Fri, 23 Jan 2015 18:55:05 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201501231855.t0NIt5KM036108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 23 Jan 2015 18:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277594 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 18:55:05 -0000 Author: jkim Date: Fri Jan 23 18:55:04 2015 New Revision: 277594 URL: https://svnweb.freebsd.org/changeset/base/277594 Log: Simplify retry loops. No functional change. Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Jan 23 18:50:36 2015 (r277593) +++ head/sys/dev/acpica/acpi_ec.c Fri Jan 23 18:55:04 2015 (r277594) @@ -645,10 +645,8 @@ EcGpeQueryHandler(void *Context) Status = EcCommand(sc, EC_COMMAND_QUERY); if (ACPI_SUCCESS(Status)) break; - if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check", + if (ACPI_FAILURE(EcCheckStatus(sc, "retr_check", EC_EVENT_INPUT_BUFFER_EMPTY))) - continue; - else break; } sc->ec_sci_pend = FALSE; @@ -963,15 +961,13 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A gen_count = sc->ec_gencount; EC_SET_DATA(sc, Address); status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); - if (ACPI_FAILURE(status)) { - if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check", - EC_EVENT_INPUT_BUFFER_EMPTY))) - continue; - else - break; + if (ACPI_SUCCESS(status)) { + *Data = EC_GET_DATA(sc); + return (AE_OK); } - *Data = EC_GET_DATA(sc); - return (AE_OK); + if (ACPI_FAILURE(EcCheckStatus(sc, "retr_check", + EC_EVENT_INPUT_BUFFER_EMPTY))) + break; } device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n"); return (status); From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 19:24:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5790D34; Fri, 23 Jan 2015 19:24:00 +0000 (UTC) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D25643; Fri, 23 Jan 2015 19:24:00 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id p9so8719601lbv.8; Fri, 23 Jan 2015 11:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=CAtFbY/Y+t7L7OgfXmXb/avOUY16s2F1hHYO3Xlv0RQ=; b=vL/w08JR/7arHSnS56J7vNnCZpRj/Ny4oHQHKG/8o//DnGWvgu44L/sZoDtkWPO6IS cFZW8i5DYdXbEwQsMR610O9zQYp/buqUpduveDYlXzU3S80a4r9O755E1JmIoVtam61K iTJPjBSn6dISgnuscNy1e4ZEIjHascTCOngM0n82xPe78LIzaQfIFI8p/S2/52lVmRxE exzSrm5aAGlN+PKML2Zu/OyhMsWp7nGEQKNrFt2hklKGC0rP9atH7LTT7neb3NHsyLE5 c0zUfyhiRGBaH1aZht9Kotm2tuITFK/ZSh8pv7mjwSzQfF6LVbIxqbDLfPz+/V+ox0vo btfw== MIME-Version: 1.0 X-Received: by 10.152.44.228 with SMTP id h4mr8029868lam.31.1422041038014; Fri, 23 Jan 2015 11:23:58 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.25.155.4 with HTTP; Fri, 23 Jan 2015 11:23:57 -0800 (PST) In-Reply-To: <201501231618.t0NGIeDv057991@svn.freebsd.org> References: <201501231618.t0NGIeDv057991@svn.freebsd.org> Date: Fri, 23 Jan 2015 11:23:57 -0800 X-Google-Sender-Auth: 2fcIne5tbTux4fHZspg-UurFxsg Message-ID: Subject: Re: svn commit: r277570 - head/usr.bin/vmstat From: Davide Italiano To: Will Andrews Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 19:24:01 -0000 On Fri, Jan 23, 2015 at 8:18 AM, Will Andrews wrote: > Author: will > Date: Fri Jan 23 16:18:39 2015 > New Revision: 277570 > URL: https://svnweb.freebsd.org/changeset/base/277570 > > Log: > Use CLOCK_UPTIME to get the uptime instead of CLOCK_MONOTONIC. > > Submitted by: asomers > MFC after: 1 week > Sponsored by: Spectra Logic > MFSpectraBSD: 1066740 on 2014/06/04 > > Modified: > head/usr.bin/vmstat/vmstat.c > What's the rationale behind this change? Thanks, -- Davide From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 19:33:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F39F897; Fri, 23 Jan 2015 19:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC1279E; Fri, 23 Jan 2015 19:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NJX3D3055691; Fri, 23 Jan 2015 19:33:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NJX3DZ055690; Fri, 23 Jan 2015 19:33:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501231933.t0NJX3DZ055690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Jan 2015 19:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277601 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 19:33:04 -0000 Author: gjb Date: Fri Jan 23 19:33:03 2015 New Revision: 277601 URL: https://svnweb.freebsd.org/changeset/base/277601 Log: Document r276881, libedit UTF-8 support. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:22:18 2015 (r277600) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:03 2015 (r277601) @@ -791,6 +791,11 @@ strings were switched to the versions from the ELF Tool Chain project. + The libedit library + has been updated to include UTF-8 support, + adding UTF-8 support to the &man.sh.1; + shell. + OpenSSL has been updated to version 1.0.1l. From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 19:33:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B92E51B0; Fri, 23 Jan 2015 19:33:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5B4E7A0; Fri, 23 Jan 2015 19:33:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NJX60D055739; Fri, 23 Jan 2015 19:33:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NJX6m0055738; Fri, 23 Jan 2015 19:33:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501231933.t0NJX6m0055738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Jan 2015 19:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277602 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 19:33:06 -0000 Author: gjb Date: Fri Jan 23 19:33:05 2015 New Revision: 277602 URL: https://svnweb.freebsd.org/changeset/base/277602 Log: Document r277166, ptrace(2) Altivec register support. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:03 2015 (r277601) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:05 2015 (r277602) @@ -691,6 +691,10 @@ has been updated to support UTF-8, which additionally provides unicode support to &man.sh.1;. + The &man.ptrace.2; system + call has been updated include support for Altivec registers on + &os;/&arch.powerpc;. + <acronym>ABI</acronym> Compatibility From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 19:33:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73747302; Fri, 23 Jan 2015 19:33:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F34B7A4; Fri, 23 Jan 2015 19:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NJX9U8055789; Fri, 23 Jan 2015 19:33:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NJX9Wv055788; Fri, 23 Jan 2015 19:33:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501231933.t0NJX9Wv055788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Jan 2015 19:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277603 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 19:33:09 -0000 Author: gjb Date: Fri Jan 23 19:33:08 2015 New Revision: 277603 URL: https://svnweb.freebsd.org/changeset/base/277603 Log: Document r277458, support for cloud hosting providers added to the Release Engineering build tools. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:05 2015 (r277602) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:08 2015 (r277603) @@ -813,7 +813,10 @@ Release Engineering and Integration -   + The + Release Engineering build tools have been updated to include + support for producing virtual machine disk images for various + cloud hosting providers. From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 19:33:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85015447; Fri, 23 Jan 2015 19:33:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 710A17B1; Fri, 23 Jan 2015 19:33:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NJXlv7055908; Fri, 23 Jan 2015 19:33:47 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NJXlON055907; Fri, 23 Jan 2015 19:33:47 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501231933.t0NJXlON055907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Jan 2015 19:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277604 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 19:33:47 -0000 Author: gjb Date: Fri Jan 23 19:33:46 2015 New Revision: 277604 URL: https://svnweb.freebsd.org/changeset/base/277604 Log: Update the latest revision. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:08 2015 (r277603) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 23 19:33:46 2015 (r277604) @@ -20,7 +20,7 @@ $FreeBSD$ - + 2015 From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 20:24:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 226FDFA4; Fri, 23 Jan 2015 20:24:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C464D31; Fri, 23 Jan 2015 20:24:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NKODlM079973; Fri, 23 Jan 2015 20:24:13 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NKODZq079972; Fri, 23 Jan 2015 20:24:13 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201501232024.t0NKODZq079972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 23 Jan 2015 20:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277606 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 20:24:14 -0000 Author: cperciva Date: Fri Jan 23 20:24:13 2015 New Revision: 277606 URL: https://svnweb.freebsd.org/changeset/base/277606 Log: Provide a recipe of "true" for building the "release" target once its prerequisites are satisfied, in order to avoid having an implicit rule triggered by the presence of release.sh. Approved by: gjb Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Jan 23 19:43:57 2015 (r277605) +++ head/release/Makefile Fri Jan 23 20:24:13 2015 (r277606) @@ -279,6 +279,7 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release + @true real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 20:40:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 681A9555; Fri, 23 Jan 2015 20:40:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A568F13; Fri, 23 Jan 2015 20:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NKeW09086750; Fri, 23 Jan 2015 20:40:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NKeWqB086747; Fri, 23 Jan 2015 20:40:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501232040.t0NKeWqB086747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 23 Jan 2015 20:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277608 - head/contrib/gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 20:40:33 -0000 Author: pfg Date: Fri Jan 23 20:40:31 2015 New Revision: 277608 URL: https://svnweb.freebsd.org/changeset/base/277608 Log: MFV r277607: GDB: Fix memset thinkos. 2005-03-25 Anthony Green * remote.c (remote_store_registers): Fix memset usage. * std-regs.c (value_of_builtin_frame_reg): Ditto. (value_of_builtin_frame_fp_reg): Ditto. (value_of_builtin_frame_reg): Ditto. Reported by: Dirk Engling CID: 604160, 604161, 604162, 604163 MFC after: 5 days Modified: head/contrib/gdb/gdb/remote.c head/contrib/gdb/gdb/std-regs.c Directory Properties: head/contrib/gdb/ (props changed) Modified: head/contrib/gdb/gdb/remote.c ============================================================================== --- head/contrib/gdb/gdb/remote.c Fri Jan 23 20:32:19 2015 (r277607) +++ head/contrib/gdb/gdb/remote.c Fri Jan 23 20:40:31 2015 (r277608) @@ -3463,7 +3463,7 @@ remote_store_registers (int regnum) { int i; regs = alloca (rs->sizeof_g_packet); - memset (regs, rs->sizeof_g_packet, 0); + memset (regs, 0, rs->sizeof_g_packet); for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) { struct packet_reg *r = &rs->regs[i]; Modified: head/contrib/gdb/gdb/std-regs.c ============================================================================== --- head/contrib/gdb/gdb/std-regs.c Fri Jan 23 20:32:19 2015 (r277607) +++ head/contrib/gdb/gdb/std-regs.c Fri Jan 23 20:40:31 2015 (r277608) @@ -61,7 +61,7 @@ value_of_builtin_frame_reg (struct frame val = allocate_value (builtin_type_frame_reg); VALUE_LVAL (val) = not_lval; buf = VALUE_CONTENTS_RAW (val); - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); /* frame.base. */ if (frame != NULL) ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, @@ -87,7 +87,7 @@ value_of_builtin_frame_fp_reg (struct fr struct value *val = allocate_value (builtin_type_void_data_ptr); char *buf = VALUE_CONTENTS_RAW (val); if (frame == NULL) - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); else ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, get_frame_base_address (frame)); @@ -105,7 +105,7 @@ value_of_builtin_frame_pc_reg (struct fr struct value *val = allocate_value (builtin_type_void_data_ptr); char *buf = VALUE_CONTENTS_RAW (val); if (frame == NULL) - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); else ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, get_frame_pc (frame)); From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 20:56:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32CC68E5 for ; Fri, 23 Jan 2015 20:56:27 +0000 (UTC) Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECEEDC5 for ; Fri, 23 Jan 2015 20:56:26 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id rd18so9313879iec.3 for ; Fri, 23 Jan 2015 12:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=xJw6+SNLaJdvi5zk5ZlQAkt+2oN3sH3sS5Erc2YsWrc=; b=NoHlTWDLIzM2VddTPKfzsykwl1vGmjYI9QDue7qIJvUuYs3BIyesRjT1I3oaGU2V5h mGQZQWJTc9Ltf/zViuizge0SGMr9+DV5ZWDMTLX9Fvkp/sMQ4FxZT1QH3Qp9/rgnTJbU WZSOqSwDHWldApVWVQFTHpGfOULwq0V92RlFCLXjdnXMz7LJN0k1bw9JWIMPOUfjVkDS u8QphIxp1+x7ckW5xrJHPKRWYh+SnrbF28G+tEHOeAfqnTKzvzM7CkkinCLOVP84fVVg +qtjI63yrMK0wPTGRxl7yv3FXtLYyraBggOSqphiX5k4ZDhDn17ebMaQk5Qy03xa0zJc gjbw== X-Gm-Message-State: ALoCoQnddmaIQAW1RmPDG/obAdZ3JNRZkFNOlPxptRXLc8/d47dAPhKLpWN14c+Uhnj+GwEjiFvd X-Received: by 10.42.62.71 with SMTP id x7mr10221644ich.61.1422046585865; Fri, 23 Jan 2015 12:56:25 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id b89sm1424086iod.32.2015.01.23.12.56.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 12:56:25 -0800 (PST) Sender: Will Andrews Date: Fri, 23 Jan 2015 13:56:23 -0700 From: Will Andrews To: Davide Italiano Subject: Re: svn commit: r277570 - head/usr.bin/vmstat Message-ID: <20150123205617.GB56104@sol.firepipe.net> References: <201501231618.t0NGIeDv057991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MW5yreqqjyrRcusr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 20:56:27 -0000 --MW5yreqqjyrRcusr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 23, 2015 at 11:23:57AM -0800, Davide Italiano wrote: > What's the rationale behind this change? The rationale was to match the clock used to the name (and implied intent) of the variables used to store/manipulate the data. It's possible that 'uptime' is entirely the wrong term in vmstat, in which case the naming used elsewhere in vmstat needs to be changed too. --=20 wca --MW5yreqqjyrRcusr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTCtXEACgkQF47idPgWcsX8kQCfQQqHYo7buDDiEjv+ylkoQ5vo 1/QAnRqsG/LutbaBUqzgbLMwuda61vuk =X/YX -----END PGP SIGNATURE----- --MW5yreqqjyrRcusr-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:05:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7298AAF0; Fri, 23 Jan 2015 21:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF031DD; Fri, 23 Jan 2015 21:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NL50aq099392; Fri, 23 Jan 2015 21:05:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NL50B2099391; Fri, 23 Jan 2015 21:05:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501232105.t0NL50B2099391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Jan 2015 21:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277609 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:05:00 -0000 Author: gjb Date: Fri Jan 23 21:04:59 2015 New Revision: 277609 URL: https://svnweb.freebsd.org/changeset/base/277609 Log: When iterating through VMFORMATS, the VMBASE file is not removed or truncated to a zero-size file, which if used to create more than one disk image format, can result in accidental pollution of the target formatted disk image. Instead of using a single VMBASE image (vm.img, by default), use a single base file for each format, named as VMFORMAT.img, which produces VMBASE.VMFORMAT as the final formatted image. Reported by: cperciva MFC after: 1 month X-MFC-with: r277458, r277536 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Fri Jan 23 20:40:31 2015 (r277608) +++ head/release/Makefile.vm Fri Jan 23 21:04:59 2015 (r277609) @@ -50,8 +50,8 @@ vm-${_CW:tl}: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) CLEANDIRS+= ${VMTARGETS} -CLEANFILES+= ${VMBASE}.img . for FORMAT in ${VMFORMATS} +CLEANFILES+= ${FORMAT}.img CLEANFILES+= ${VMBASE}.${FORMAT} . endfor .endif @@ -65,7 +65,7 @@ vm-image: env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ - -i ${.OBJDIR}/${VMBASE}.img -s ${VMSIZE} -f ${FORMAT} \ + -i ${.OBJDIR}/${FORMAT}.img -s ${VMSIZE} -f ${FORMAT} \ -S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FORMAT} . endfor .endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:06:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15CEC4B; Fri, 23 Jan 2015 21:06:00 +0000 (UTC) Received: from smtp5.ore.mailhop.org (smtp5.ore.mailhop.org [54.186.10.118]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9B31F6; Fri, 23 Jan 2015 21:06:00 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp5.ore.mailhop.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YElQP-0006jB-Gr; Fri, 23 Jan 2015 21:05:53 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0NL5q0E018065; Fri, 23 Jan 2015 14:05:52 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18AGm9qMkLHXui13aybAPZQ Message-ID: <1422047152.1038.25.camel@freebsd.org> Subject: Re: svn commit: r277570 - head/usr.bin/vmstat From: Ian Lepore To: Will Andrews Date: Fri, 23 Jan 2015 14:05:52 -0700 In-Reply-To: <20150123205617.GB56104@sol.firepipe.net> References: <201501231618.t0NGIeDv057991@svn.freebsd.org> <20150123205617.GB56104@sol.firepipe.net> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: Davide Italiano , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:06:01 -0000 On Fri, 2015-01-23 at 13:56 -0700, Will Andrews wrote: > On Fri, Jan 23, 2015 at 11:23:57AM -0800, Davide Italiano wrote: > > What's the rationale behind this change? > > The rationale was to match the clock used to the name (and implied intent) > of the variables used to store/manipulate the data. > > It's possible that 'uptime' is entirely the wrong term in vmstat, in which > case the naming used elsewhere in vmstat needs to be changed too. > It seems like there's a good chance this is a step backwards. In the old days if you wanted a monotonic clock, uptime was your only option. Eventually we implemented clock_gettime() and CLOCK_MONOTONIC and likely someone changed the calls in vmstat but perhaps not related variable names. So now we've gone back to the wrong clock to match the old variable names. (I don't see anything in the vmstat manpage about actually displaying or using uptime values at all.) -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:06:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 918CBDA5; Fri, 23 Jan 2015 21:06:46 +0000 (UTC) Received: from smtp7.ore.mailhop.org (smtp7.ore.mailhop.org [54.149.250.69]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 725DE212; Fri, 23 Jan 2015 21:06:46 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp7.ore.mailhop.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1YEkqd-0004WP-7A; Fri, 23 Jan 2015 20:28:55 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0NKSqhG017742; Fri, 23 Jan 2015 13:28:52 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+DjbeZKBOMhuye/tvfO2wF Message-ID: <1422044932.1038.3.camel@freebsd.org> Subject: Re: svn commit: r277606 - head/release From: Ian Lepore To: Colin Percival Date: Fri, 23 Jan 2015 13:28:52 -0700 In-Reply-To: <201501232024.t0NKODZq079972@svn.freebsd.org> References: <201501232024.t0NKODZq079972@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:06:46 -0000 On Fri, 2015-01-23 at 20:24 +0000, Colin Percival wrote: > Author: cperciva > Date: Fri Jan 23 20:24:13 2015 > New Revision: 277606 > URL: https://svnweb.freebsd.org/changeset/base/277606 > > Log: > Provide a recipe of "true" for building the "release" target once its > prerequisites are satisfied, in order to avoid having an implicit rule > triggered by the presence of release.sh. > > Approved by: gjb > > Modified: > head/release/Makefile > > Modified: head/release/Makefile > ============================================================================== > --- head/release/Makefile Fri Jan 23 19:43:57 2015 (r277605) > +++ head/release/Makefile Fri Jan 23 20:24:13 2015 (r277606) > @@ -279,6 +279,7 @@ ftp: packagesystem > cp *.txz MANIFEST ftp > > release: real-release vm-release cloudware-release > + @true > > real-release: > ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj > Wouldn't '.PHONY: release' be a better/more-correct fix? -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:07:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B04F0EE0; Fri, 23 Jan 2015 21:07:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98B3321D; Fri, 23 Jan 2015 21:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NL7EHw099763; Fri, 23 Jan 2015 21:07:14 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NL79a8099736; Fri, 23 Jan 2015 21:07:09 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501232107.t0NL79a8099736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 23 Jan 2015 21:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277610 - in head: bin/ln lib/libc/include lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:07:14 -0000 Author: jilles Date: Fri Jan 23 21:07:08 2015 New Revision: 277610 URL: https://svnweb.freebsd.org/changeset/base/277610 Log: Add futimens and utimensat system calls. The core kernel part is patch file utimes.2008.4.diff from pluknet@FreeBSD.org. I updated the code for API changes, added the manual page and added compatibility code for old kernels. There is also audit and Capsicum support. A new UTIME_* constant might allow setting birthtimes in future. Differential Revision: https://reviews.freebsd.org/D1426 Submitted by: pluknet (partially) Reviewed by: delphij, pluknet, rwatson Relnotes: yes Added: head/lib/libc/sys/futimens.c (contents, props changed) head/lib/libc/sys/utimensat.2 (contents, props changed) head/lib/libc/sys/utimensat.c (contents, props changed) Modified: head/bin/ln/symlink.7 head/lib/libc/include/libc_private.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/share/man/man4/rights.4 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/syscalls.master head/sys/kern/vfs_syscalls.c head/sys/sys/capsicum.h head/sys/sys/param.h head/sys/sys/stat.h head/sys/sys/syscallsubr.h head/usr.bin/kdump/kdump.c Modified: head/bin/ln/symlink.7 ============================================================================== --- head/bin/ln/symlink.7 Fri Jan 23 21:04:59 2015 (r277609) +++ head/bin/ln/symlink.7 Fri Jan 23 21:07:08 2015 (r277610) @@ -29,7 +29,7 @@ .\" @(#)symlink.7 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd December 29, 2014 +.Dd January 23, 2015 .Dt SYMLINK 7 .Os .Sh NAME @@ -147,9 +147,10 @@ unless given the .Dv AT_SYMLINK_NOFOLLOW flag: .Xr fchmodat 2 , -.Xr fchownat 2 +.Xr fchownat 2 , +.Xr fstatat 2 and -.Xr fstatat 2 . +.Xr utimensat 2 . .Pp The owner and group of an existing symbolic link can be changed by means of the Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Fri Jan 23 21:04:59 2015 (r277609) +++ head/lib/libc/include/libc_private.h Fri Jan 23 21:07:08 2015 (r277610) @@ -357,6 +357,10 @@ int __libc_system(const char *); int __libc_tcdrain(int); int __fcntl_compat(int fd, int cmd, ...); +int __sys_futimens(int fd, const struct timespec *times) __hidden; +int __sys_utimensat(int fd, const char *path, + const struct timespec *times, int flag) __hidden; + /* execve() with PATH processing to implement posix_spawnp() */ int _execvpe(const char *, char * const *, char * const *); Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Fri Jan 23 21:04:59 2015 (r277609) +++ head/lib/libc/sys/Makefile.inc Fri Jan 23 21:07:08 2015 (r277610) @@ -38,6 +38,10 @@ SRCS+= ${SYSCALL_COMPAT_SRCS} NOASM+= ${SYSCALL_COMPAT_SRCS:S/.c/.o/} .endif +SRCS+= futimens.c utimensat.c +NOASM+= futimens.o utimensat.o +PSEUDO+= _futimens.o _utimensat.o + INTERPOSED = \ accept \ accept4 \ @@ -310,6 +314,7 @@ MAN+= sctp_generic_recvmsg.2 \ umask.2 \ undelete.2 \ unlink.2 \ + utimensat.2 \ utimes.2 \ utrace.2 \ uuidgen.2 \ @@ -442,6 +447,7 @@ MLINKS+=timer_settime.2 timer_getoverrun timer_settime.2 timer_gettime.2 MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 +MLINKS+=utimensat.2 futimens.2 MLINKS+=utimes.2 futimes.2 \ utimes.2 futimesat.2 \ utimes.2 lutimes.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Fri Jan 23 21:04:59 2015 (r277609) +++ head/lib/libc/sys/Symbol.map Fri Jan 23 21:07:08 2015 (r277610) @@ -397,7 +397,9 @@ FBSD_1.3 { }; FBSD_1.4 { + futimens; ppoll; + utimensat; }; FBSDprivate_1.0 { Added: head/lib/libc/sys/futimens.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/futimens.c Fri Jan 23 21:07:08 2015 (r277610) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2015 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include + +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +int +futimens(int fd, const struct timespec times[2]) +{ + struct timeval now, tv[2], *tvp; + struct stat sb; + + if (__getosreldate() >= 1100056) + return (__sys_futimens(fd, times)); + + if (times == NULL || (times[0].tv_nsec == UTIME_NOW && + times[1].tv_nsec == UTIME_NOW)) + tvp = NULL; + else if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) + return (0); + else { + if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && + times[0].tv_nsec != UTIME_NOW && + times[0].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && + times[1].tv_nsec != UTIME_NOW && + times[1].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + tv[0].tv_sec = times[0].tv_sec; + tv[0].tv_usec = times[0].tv_nsec / 1000; + tv[1].tv_sec = times[1].tv_sec; + tv[1].tv_usec = times[1].tv_nsec / 1000; + tvp = tv; + if (times[0].tv_nsec == UTIME_OMIT || + times[1].tv_nsec == UTIME_OMIT) { + if (_fstat(fd, &sb) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_OMIT) { + tv[0].tv_sec = sb.st_atim.tv_sec; + tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; + } + if (times[1].tv_nsec == UTIME_OMIT) { + tv[1].tv_sec = sb.st_mtim.tv_sec; + tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; + } + } + if (times[0].tv_nsec == UTIME_NOW || + times[1].tv_nsec == UTIME_NOW) { + if (gettimeofday(&now, NULL) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_NOW) + tv[0] = now; + if (times[1].tv_nsec == UTIME_NOW) + tv[1] = now; + } + } + return (futimes(fd, tvp)); +} Added: head/lib/libc/sys/utimensat.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/utimensat.2 Fri Jan 23 21:07:08 2015 (r277610) @@ -0,0 +1,292 @@ +.\" $NetBSD: utimes.2,v 1.13 1999/03/22 19:45:11 garbled Exp $ +.\" +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2012, Jilles Tjoelker +.\" +.\" 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. +.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. +.\" +.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd January 23, 2015 +.Dt UTIMENSAT 2 +.Os +.Sh NAME +.Nm futimens , +.Nm utimensat +.Nd set file access and modification times +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/stat.h +.Ft int +.Fn futimens "int fd" "const struct timespec times[2]" +.Ft int +.Fo utimensat +.Fa "int fd" +.Fa "const char *path" +.Fa "const struct timespec times[2]" +.Fa "int flag" +.Fc +.Sh DESCRIPTION +The access and modification times of the file named by +.Fa path +or referenced by +.Fa fd +are changed as specified by the argument +.Fa times . +The inode-change-time of the file is set to the current time. +.Pp +If +.Fa path +specifies a relative path, +it is relative to the current working directory if +.Fa fd +is +.Dv AT_FDCWD +and otherwise relative to the directory associated with the file descriptor +.Fa fd . +.Pp +The +.Va tv_nsec +field of a +.Vt timespec +structure +can be set to the special value +.Dv UTIME_NOW +to set the current time, or to +.Dv UTIME_OMIT +to leave the time unchanged. +In either case, the +.Va tv_sec +field is ignored. +.Pp +If +.Fa times +is +.No non- Ns Dv NULL , +it is assumed to point to an array of two timespec structures. +The access time is set to the value of the first element, and the +modification time is set to the value of the second element. +For file systems that support file birth (creation) times (such as +.Dv UFS2 ) , +the birth time will be set to the value of the second element +if the second element is older than the currently set birth time. +To set both a birth time and a modification time, +two calls are required; the first to set the birth time +and the second to set the (presumably newer) modification time. +Ideally a new system call will be added that allows the setting +of all three times at once. +If +.Fa times +is +.Dv NULL , +this is equivalent to passing +a pointer to an array of two timespec structures +with both +.Va tv_nsec +fields set to +.Dv UTIME_NOW . +.Pp +If both +.Va tv_nsec +fields are +.Dv UTIME_OMIT , +the timestamps remain unchanged and +no permissions are needed for the file itself, +although search permissions may be required for the path prefix. +The call may or may not succeed if the named file does not exist. +.Pp +If both +.Va tv_nsec +fields are +.Dv UTIME_NOW , +the caller must be the owner of the file, have permission to +write the file, or be the super-user. +.Pp +For all other values of the timestamps, +the caller must be the owner of the file or be the super-user. +.Pp +The values for the +.Fa flag +argument of the +.Fn utimensat +system call +are constructed by a bitwise-inclusive OR of flags from the following list, +defined in +.In fcntl.h : +.Bl -tag -width indent +.It Dv AT_SYMLINK_NOFOLLOW +If +.Fa path +names a symbolic link, the symbolic link's times are changed. +By default, +.Fn utimensat +changes the times of the file referenced by the symbolic link. +.El +.Sh RETURN VALUES +.Rv -std +.Sh COMPATIBILITY +If the running kernel does not support this system call, +a wrapper emulates it using +.Xr fstatat 2 , +.Xr futimesat 2 +and +.Xr lutimes 2 . +As a result, timestamps will be rounded down to the nearest microsecond, +.Dv UTIME_OMIT +is not atomic and +.Dv AT_SYMLINK_NOFOLLOW +is not available with a path relative to a file descriptor. +.Sh ERRORS +These system calls will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +The +.Fa times +argument is +.Dv NULL , +or both +.Va tv_nsec +values are +.Dv UTIME_NOW , +and the effective user ID of the process does not +match the owner of the file, and is not the super-user, and write +access is denied. +.It Bq Er EFAULT +The +.Fa times +argument +points outside the process's allocated address space. +.It Bq Er EINVAL +The +.Va tv_usec +component of at least one of the values specified by the +.Fa times +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 EPERM +The +.Fa times +argument is not +.Dv NULL +nor are both +.Va tv_nsec +values +.Dv UTIME_NOW , +nor are both +.Va tv_nsec +values +.Dv UTIME_OMIT +and the calling process's effective user ID +does not match the owner of the file and is not the super-user. +.It Bq Er EPERM +The named file has its immutable or append-only flag set, see the +.Xr chflags 2 +manual page for more information. +.It Bq Er EROFS +The file system containing the file is mounted read-only. +.El +.Pp +The +.Fn futimens +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument +does not refer to a valid descriptor. +.El +.Pp +The +.Fn utimensat +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix. +.It Bq Er EBADF +The +.Fa path +argument does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er EFAULT +The +.Fa path +argument +points outside the process's allocated address space. +.It Bq Er ELOOP +Too many symbolic links were encountered in translating the pathname. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded +.Dv NAME_MAX +characters, or an entire path name exceeded +.Dv PATH_MAX +characters. +.It Bq Er ENOENT +The named file does not exist. +.It Bq Er ENOTDIR +A component of the path prefix is not a directory. +.It Bq Er ENOTDIR +The +.Fa path +argument is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.It Bq Er ENOTSUP +The running kernel does not support this system call and +.Dv AT_SYMLINK_NOFOLLOW +is used with a path relative to a file descriptor. +.El +.Sh SEE ALSO +.Xr chflags 2 , +.Xr stat 2 , +.Xr symlink 2 , +.Xr utimes 2 , +.Xr utime 3 , +.Xr symlink 7 +.Sh STANDARDS +The +.Fn futimens +and +.Fn utimensat +system calls are expected to conform to +.St -p1003.1-2008 . +.Sh HISTORY +The +.Fn futimens +and +.Fn utimensat +system calls appeared in +.Fx 11.0 . Added: head/lib/libc/sys/utimensat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/utimensat.c Fri Jan 23 21:07:08 2015 (r277610) @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 2015 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include + +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +int +utimensat(int fd, const char *path, const struct timespec times[2], int flag) +{ + struct timeval now, tv[2], *tvp; + struct stat sb; + + if (__getosreldate() >= 1100056) + return (__sys_utimensat(fd, path, times, flag)); + + if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) { + errno = EINVAL; + return (-1); + } + if (times == NULL || (times[0].tv_nsec == UTIME_NOW && + times[1].tv_nsec == UTIME_NOW)) + tvp = NULL; + else if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) + return (0); + else { + if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && + times[0].tv_nsec != UTIME_NOW && + times[0].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && + times[1].tv_nsec != UTIME_NOW && + times[1].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + tv[0].tv_sec = times[0].tv_sec; + tv[0].tv_usec = times[0].tv_nsec / 1000; + tv[1].tv_sec = times[1].tv_sec; + tv[1].tv_usec = times[1].tv_nsec / 1000; + tvp = tv; + if (times[0].tv_nsec == UTIME_OMIT || + times[1].tv_nsec == UTIME_OMIT) { + if (fstatat(fd, path, &sb, flag) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_OMIT) { + tv[0].tv_sec = sb.st_atim.tv_sec; + tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; + } + if (times[1].tv_nsec == UTIME_OMIT) { + tv[1].tv_sec = sb.st_mtim.tv_sec; + tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; + } + } + if (times[0].tv_nsec == UTIME_NOW || + times[1].tv_nsec == UTIME_NOW) { + if (gettimeofday(&now, NULL) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_NOW) + tv[0] = now; + if (times[1].tv_nsec == UTIME_NOW) + tv[1] = now; + } + } + if ((flag & AT_SYMLINK_NOFOLLOW) == 0) + return (futimesat(fd, path, tvp)); + else if ((flag & AT_SYMLINK_NOFOLLOW) != 0 && + (fd == AT_FDCWD || path[0] == '/')) + return (lutimes(path, tvp)); + else { + errno = ENOTSUP; + return (-1); + } +} Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Fri Jan 23 21:04:59 2015 (r277609) +++ head/share/man/man4/rights.4 Fri Jan 23 21:07:08 2015 (r277610) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2013 +.Dd January 23, 2015 .Dt RIGHTS 4 .Os .Sh NAME @@ -272,9 +272,13 @@ with the flag. .It Dv CAP_FUTIMES Permit -.Xr futimes 2 +.Xr futimens 2 and +.Xr futimes 2 , +and permit .Xr futimesat 2 +and +.Xr utimensat 2 if the .Dv CAP_LOOKUP right is also present. Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri Jan 23 21:07:08 2015 (r277610) @@ -1300,6 +1300,49 @@ freebsd32_futimesat(struct thread *td, s } int +freebsd32_futimens(struct thread *td, struct freebsd32_futimens_args *uap) +{ + struct timespec32 ts32[2]; + struct timespec ts[2], *tsp; + int error; + + if (uap->times != NULL) { + error = copyin(uap->times, ts32, sizeof(ts32)); + if (error) + return (error); + CP(ts32[0], ts[0], tv_sec); + CP(ts32[0], ts[0], tv_nsec); + CP(ts32[1], ts[1], tv_sec); + CP(ts32[1], ts[1], tv_nsec); + tsp = ts; + } else + tsp = NULL; + return (kern_futimens(td, uap->fd, tsp, UIO_SYSSPACE)); +} + +int +freebsd32_utimensat(struct thread *td, struct freebsd32_utimensat_args *uap) +{ + struct timespec32 ts32[2]; + struct timespec ts[2], *tsp; + int error; + + if (uap->times != NULL) { + error = copyin(uap->times, ts32, sizeof(ts32)); + if (error) + return (error); + CP(ts32[0], ts[0], tv_sec); + CP(ts32[0], ts[0], tv_nsec); + CP(ts32[1], ts[1], tv_sec); + CP(ts32[1], ts[1], tv_nsec); + tsp = ts; + } else + tsp = NULL; + return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE, + tsp, UIO_SYSSPACE, uap->flag)); +} + +int freebsd32_adjtime(struct thread *td, struct freebsd32_adjtime_args *uap) { struct timeval32 tv32; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/compat/freebsd32/syscalls.master Fri Jan 23 21:07:08 2015 (r277610) @@ -1069,3 +1069,8 @@ 545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ u_int nfds, const struct timespec32 *ts, \ const sigset_t *set); } +546 AUE_FUTIMES STD { int freebsd32_futimens(int fd, \ + struct timespec *times); } +547 AUE_FUTIMESAT STD { int freebsd32_utimensat(int fd, \ + char *path, \ + struct timespec *times, int flag); } Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/kern/capabilities.conf Fri Jan 23 21:07:08 2015 (r277610) @@ -220,8 +220,9 @@ fsync ftruncate ## -## Allow futimes(2), subject to capability rights. +## Allow futimens(2) and futimes(2), subject to capability rights. ## +futimens futimes ## @@ -453,6 +454,7 @@ readlinkat renameat symlinkat unlinkat +utimensat ## ## Allow entry into open(2). This system call will fail, since access to the Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/kern/syscalls.master Fri Jan 23 21:07:08 2015 (r277610) @@ -983,5 +983,10 @@ 545 AUE_POLL STD { int ppoll(struct pollfd *fds, u_int nfds, \ const struct timespec *ts, \ const sigset_t *set); } +546 AUE_FUTIMES STD { int futimens(int fd, \ + struct timespec *times); } +547 AUE_FUTIMESAT STD { int utimensat(int fd, \ + char *path, \ + struct timespec *times, int flag); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/kern/vfs_syscalls.c Fri Jan 23 21:07:08 2015 (r277610) @@ -95,10 +95,12 @@ SDT_PROBE_DEFINE2(vfs, , stat, mode, "ch SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); static int chroot_refuse_vdir_fds(struct filedesc *fdp); -static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); static int kern_chflagsat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, u_long flags, int atflag); static int setfflags(struct thread *td, struct vnode *, u_long); +static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); +static int getutimens(const struct timespec *, enum uio_seg, + struct timespec *, int *); static int setutimes(struct thread *td, struct vnode *, const struct timespec *, int, int); static int vn_access(struct vnode *vp, int user_flags, struct ucred *cred, @@ -3007,7 +3009,53 @@ getutimes(usrtvp, tvpseg, tsp) } /* - * Common implementation code for utimes(), lutimes(), and futimes(). + * Common implementation code for futimens(), utimensat(). + */ +#define UTIMENS_NULL 0x1 +#define UTIMENS_EXIT 0x2 +static int +getutimens(const struct timespec *usrtsp, enum uio_seg tspseg, + struct timespec *tsp, int *retflags) +{ + struct timespec tsnow; + int error; + + vfs_timestamp(&tsnow); + *retflags = 0; + if (usrtsp == NULL) { + tsp[0] = tsnow; + tsp[1] = tsnow; + *retflags |= UTIMENS_NULL; + return (0); + } + if (tspseg == UIO_SYSSPACE) { + tsp[0] = usrtsp[0]; + tsp[1] = usrtsp[1]; + } else if ((error = copyin(usrtsp, tsp, sizeof(*tsp) * 2)) != 0) + return (error); + if (tsp[0].tv_nsec == UTIME_OMIT && tsp[1].tv_nsec == UTIME_OMIT) + *retflags |= UTIMENS_EXIT; + if (tsp[0].tv_nsec == UTIME_NOW && tsp[1].tv_nsec == UTIME_NOW) + *retflags |= UTIMENS_NULL; + if (tsp[0].tv_nsec == UTIME_OMIT) + tsp[0].tv_sec = VNOVAL; + else if (tsp[0].tv_nsec == UTIME_NOW) + tsp[0] = tsnow; + else if (tsp[0].tv_nsec < 0 || tsp[0].tv_nsec >= 1000000000L) + return (EINVAL); + if (tsp[1].tv_nsec == UTIME_OMIT) + tsp[1].tv_sec = VNOVAL; + else if (tsp[1].tv_nsec == UTIME_NOW) + tsp[1] = tsnow; + else if (tsp[1].tv_nsec < 0 || tsp[1].tv_nsec >= 1000000000L) + return (EINVAL); + + return (0); +} + +/* + * Common implementation code for utimes(), lutimes(), futimes(), futimens(), + * and utimensat(). */ static int setutimes(td, vp, ts, numtimes, nullflag) @@ -3196,6 +3244,80 @@ kern_futimes(struct thread *td, int fd, return (error); } +int +sys_futimens(struct thread *td, struct futimens_args *uap) +{ + + return (kern_futimens(td, uap->fd, uap->times, UIO_USERSPACE)); +} + +int +kern_futimens(struct thread *td, int fd, struct timespec *tptr, + enum uio_seg tptrseg) +{ + struct timespec ts[2]; + struct file *fp; + cap_rights_t rights; + int error, flags; + + AUDIT_ARG_FD(fd); + error = getutimens(tptr, tptrseg, ts, &flags); + if (error != 0) + return (error); + if (flags & UTIMENS_EXIT) + return (0); + error = getvnode(td->td_proc->p_fd, fd, + cap_rights_init(&rights, CAP_FUTIMES), &fp); + if (error != 0) + return (error); +#ifdef AUDIT + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode, 0); +#endif + error = setutimes(td, fp->f_vnode, ts, 2, flags & UTIMENS_NULL); + fdrop(fp, td); + return (error); +} + +int +sys_utimensat(struct thread *td, struct utimensat_args *uap) +{ + + return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->times, UIO_USERSPACE, uap->flag)); +} + +int +kern_utimensat(struct thread *td, int fd, char *path, enum uio_seg pathseg, + struct timespec *tptr, enum uio_seg tptrseg, int flag) +{ + struct nameidata nd; + struct timespec ts[2]; + int error, flags; + + if (flag & ~AT_SYMLINK_NOFOLLOW) + return (EINVAL); + + if ((error = getutimens(tptr, tptrseg, ts, &flags)) != 0) + return (error); + NDINIT_AT(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : + FOLLOW) | AUDITVNODE1, pathseg, path, fd, td); + if ((error = namei(&nd)) != 0) + return (error); + /* + * We are allowed to call namei() regardless of 2xUTIME_OMIT. + * POSIX states: + * "If both tv_nsec fields are UTIME_OMIT... EACCESS may be detected." + * "Search permission is denied by a component of the path prefix." + */ + NDFREE(&nd, NDF_ONLY_PNBUF); + if ((flags & UTIMENS_EXIT) == 0) + error = setutimes(td, nd.ni_vp, ts, 2, flags & UTIMENS_NULL); + vrele(nd.ni_vp); + return (error); +} + /* * Truncate a file given its path name. */ Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/sys/capsicum.h Fri Jan 23 21:07:08 2015 (r277610) @@ -146,9 +146,9 @@ #define CAP_FSTATAT (CAP_FSTAT | CAP_LOOKUP) /* Allows for fstatfs(2). */ #define CAP_FSTATFS CAPRIGHT(0, 0x0000000000100000ULL) -/* Allows for futimes(2). */ +/* Allows for futimens(2) and futimes(2). */ #define CAP_FUTIMES CAPRIGHT(0, 0x0000000000200000ULL) -/* Allows for futimes(2) and futimesat(2). */ +/* Allows for futimens(2), futimes(2), futimesat(2) and utimensat(2). */ #define CAP_FUTIMESAT (CAP_FUTIMES | CAP_LOOKUP) /* Allows for linkat(2) and renameat(2) (destination directory descriptor). */ #define CAP_LINKAT (CAP_LOOKUP | 0x0000000000400000ULL) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/sys/param.h Fri Jan 23 21:07:08 2015 (r277610) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100055 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100056 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/stat.h ============================================================================== --- head/sys/sys/stat.h Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/sys/stat.h Fri Jan 23 21:07:08 2015 (r277610) @@ -307,6 +307,11 @@ struct nstat { #endif /* __BSD_VISIBLE */ +#if __POSIX_VISIBLE >= 200809 +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif + #ifndef _KERNEL __BEGIN_DECLS #if __BSD_VISIBLE @@ -322,6 +327,9 @@ int fchmod(int, mode_t); #endif #if __POSIX_VISIBLE >= 200809 int fchmodat(int, const char *, mode_t, int); +int futimens(int fd, const struct timespec times[2]); +int utimensat(int fd, const char *path, const struct timespec times[2], + int flag); #endif int fstat(int, struct stat *); #if __BSD_VISIBLE Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Fri Jan 23 21:04:59 2015 (r277609) +++ head/sys/sys/syscallsubr.h Fri Jan 23 21:07:08 2015 (r277610) @@ -99,6 +99,8 @@ int kern_fstatfs(struct thread *td, int int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); +int kern_futimens(struct thread *td, int fd, struct timespec *tptr, + enum uio_seg tptrseg); int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, @@ -220,6 +222,9 @@ int kern_unlinkat(struct thread *td, int enum uio_seg pathseg, ino_t oldinum); int kern_utimesat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); +int kern_utimensat(struct thread *td, int fd, char *path, + enum uio_seg pathseg, struct timespec *tptr, enum uio_seg tptrseg, + int follow); int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); int kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status, Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Fri Jan 23 21:04:59 2015 (r277609) +++ head/usr.bin/kdump/kdump.c Fri Jan 23 21:07:08 2015 (r277610) @@ -714,6 +714,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_readlinkat: case SYS_renameat: case SYS_unlinkat: + case SYS_utimensat: putchar('('); atfdname(*ip, decimal); c = ','; From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:07:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E7BD7D; Fri, 23 Jan 2015 21:07:37 +0000 (UTC) Received: from mail-pd0-x236.google.com (mail-pd0-x236.google.com [IPv6:2607:f8b0:400e:c02::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45781224; Fri, 23 Jan 2015 21:07:37 +0000 (UTC) Received: by mail-pd0-f182.google.com with SMTP id z10so8440493pdj.13; Fri, 23 Jan 2015 13:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=xNn3H/3RIUUxD55Pfz45BzsxddVYWJU/HZQfp/sMhNE=; b=u3CtqkdF9C+/MnposBvdLOI9ifmM4kpEU6VywlmFqV4lk8uR1NSz3VO9cfNMcdkdEO 0EVp5YqeU3+DNuUID2KoSkHxrCvbEUVQAQIMN+yWjT35qDFcCfI1MPvKFfGR0n9mXq7U 962yJLV2YlXeiMubGH1hP7qr5/F4eEZWGTuQVvY/qPK0M8G6CRhHW8VkbihtutNp6NgG P83Ijpa3h+p5l3Ru5KznrJ+MqIX9bFERDMokhR6YSsvryrHhYyYZvSIWJkVyzVqPUmIV iujM6Qsgsikcmh+GatEXYAALq3pE1Tsr2lg8kf5dIojryHAXnvLbx2AkXPnszg87TCSo h8BA== X-Received: by 10.68.68.201 with SMTP id y9mr14318896pbt.110.1422047256941; Fri, 23 Jan 2015 13:07:36 -0800 (PST) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id ua7sm2825993pab.37.2015.01.23.13.07.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 13:07:36 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_E5ED9687-BCE0-41C5-9DB4-D90B6B0E0FB2"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r277606 - head/release From: Garrett Cooper In-Reply-To: <1422044932.1038.3.camel@freebsd.org> Date: Fri, 23 Jan 2015 13:07:33 -0800 Message-Id: <1E8B88AF-4661-47D3-A51D-1671381D51B4@gmail.com> References: <201501232024.t0NKODZq079972@svn.freebsd.org> <1422044932.1038.3.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Colin Percival X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:07:37 -0000 --Apple-Mail=_E5ED9687-BCE0-41C5-9DB4-D90B6B0E0FB2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 23, 2015, at 12:28, Ian Lepore wrote: > On Fri, 2015-01-23 at 20:24 +0000, Colin Percival wrote: >> Author: cperciva >> Date: Fri Jan 23 20:24:13 2015 >> New Revision: 277606 >> URL: https://svnweb.freebsd.org/changeset/base/277606 >>=20 >> Log: >> Provide a recipe of "true" for building the "release" target once = its >> prerequisites are satisfied, in order to avoid having an implicit = rule >> triggered by the presence of release.sh. >>=20 >> Approved by: gjb >>=20 >> Modified: >> head/release/Makefile >>=20 >> Modified: head/release/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/release/Makefile Fri Jan 23 19:43:57 2015 = (r277605) >> +++ head/release/Makefile Fri Jan 23 20:24:13 2015 = (r277606) >> @@ -279,6 +279,7 @@ ftp: packagesystem >> cp *.txz MANIFEST ftp >>=20 >> release: real-release vm-release cloudware-release >> + @true >>=20 >> real-release: >> ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj >>=20 >=20 > Wouldn't '.PHONY: release' be a better/more-correct fix? +1 . Thanks for being me to the comment... --Apple-Mail=_E5ED9687-BCE0-41C5-9DB4-D90B6B0E0FB2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUwrgWAAoJEMZr5QU6S73ewkgH/0DjMEVnY+4ioGuYNAcGrGXV G64t0aLxVmBR283rDfok8W/YGpzAT7o0lWi+WG50TqOmYnRUMi4upw7glDKX8pLV XSQsqAujnZHMV9ZxseybFf/+nMVrtG7CwqD+wigD35FU1vaHsgtwT1uE97qTnUXm HGagQE3EGn6zSpzyT+gQUrrSJCqhJTnQdUVUjnirWWVB1KmzV6JwPk3PFZQE8VBw Y1e46S5dQCo4O05AfNzLGbDZ99Ud3ql7Ha5AGUt0gUg0Sbtf//Y2bbWKoJ+DDkQS SB1xhiOTJ9ONZQ1eGXX+YTq8R6s/Kooj89YMArsIHr6Cdu8aL6CW0rEJ8PXVGP4= =WrJA -----END PGP SIGNATURE----- --Apple-Mail=_E5ED9687-BCE0-41C5-9DB4-D90B6B0E0FB2-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:08:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C6031DD; Fri, 23 Jan 2015 21:08:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6775F234; Fri, 23 Jan 2015 21:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NL8Scp099986; Fri, 23 Jan 2015 21:08:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NL8PH3099971; Fri, 23 Jan 2015 21:08:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501232108.t0NL8PH3099971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 23 Jan 2015 21:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277611 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:08:28 -0000 Author: jilles Date: Fri Jan 23 21:08:24 2015 New Revision: 277611 URL: https://svnweb.freebsd.org/changeset/base/277611 Log: Run make sysent. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -693,6 +693,16 @@ struct freebsd32_ppoll_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; }; +struct freebsd32_futimens_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; +}; +struct freebsd32_utimensat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; + char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -825,6 +835,8 @@ int freebsd32_procctl(struct thread *, s int freebsd32_procctl(struct thread *, struct freebsd32_procctl_args *); #endif int freebsd32_ppoll(struct thread *, struct freebsd32_ppoll_args *); +int freebsd32_futimens(struct thread *, struct freebsd32_futimens_args *); +int freebsd32_utimensat(struct thread *, struct freebsd32_utimensat_args *); #ifdef COMPAT_43 @@ -1240,6 +1252,8 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ppoll AUE_POLL +#define FREEBSD32_SYS_AUE_freebsd32_futimens AUE_FUTIMES +#define FREEBSD32_SYS_AUE_freebsd32_utimensat AUE_FUTIMESAT #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #define FREEBSD32_SYS_syscall 0 @@ -453,4 +453,6 @@ #define FREEBSD32_SYS_freebsd32_procctl 544 #define FREEBSD32_SYS_freebsd32_procctl 544 #define FREEBSD32_SYS_freebsd32_ppoll 545 -#define FREEBSD32_SYS_MAXSYSCALL 546 +#define FREEBSD32_SYS_freebsd32_futimens 546 +#define FREEBSD32_SYS_freebsd32_utimensat 547 +#define FREEBSD32_SYS_MAXSYSCALL 548 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ const char *freebsd32_syscallnames[] = { @@ -579,4 +579,6 @@ const char *freebsd32_syscallnames[] = { "freebsd32_procctl", /* 544 = freebsd32_procctl */ #endif "freebsd32_ppoll", /* 545 = freebsd32_ppoll */ + "freebsd32_futimens", /* 546 = freebsd32_futimens */ + "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #include "opt_compat.h" @@ -616,4 +616,6 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ #endif { AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */ + { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 546 = freebsd32_futimens */ + { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3309,6 +3309,24 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* freebsd32_futimens */ + case 546: { + struct freebsd32_futimens_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->times; /* struct timespec * */ + *n_args = 2; + break; + } + /* freebsd32_utimensat */ + case 547: { + struct freebsd32_utimensat_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->path; /* char * */ + uarg[2] = (intptr_t) p->times; /* struct timespec * */ + iarg[3] = p->flag; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8873,6 +8891,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_futimens */ + case 546: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct timespec *"; + break; + default: + break; + }; + break; + /* freebsd32_utimensat */ + case 547: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "char *"; + break; + case 2: + p = "struct timespec *"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10751,6 +10801,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_futimens */ + case 546: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_utimensat */ + case 547: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/kern/init_sysent.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #include "opt_compat.h" @@ -580,4 +580,6 @@ struct sysent sysent[] = { { AS(aio_mlock_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 543 = aio_mlock */ { AS(procctl_args), (sy_call_t *)sys_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = procctl */ { AS(ppoll_args), (sy_call_t *)sys_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = ppoll */ + { AS(futimens_args), (sy_call_t *)sys_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = futimens */ + { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/kern/syscalls.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ const char *syscallnames[] = { @@ -553,4 +553,6 @@ const char *syscallnames[] = { "aio_mlock", /* 543 = aio_mlock */ "procctl", /* 544 = procctl */ "ppoll", /* 545 = ppoll */ + "futimens", /* 546 = futimens */ + "utimensat", /* 547 = utimensat */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/kern/systrace_args.c Fri Jan 23 21:08:24 2015 (r277611) @@ -3382,6 +3382,24 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* futimens */ + case 546: { + struct futimens_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->times; /* struct timespec * */ + *n_args = 2; + break; + } + /* utimensat */ + case 547: { + struct utimensat_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->path; /* char * */ + uarg[2] = (intptr_t) p->times; /* struct timespec * */ + iarg[3] = p->flag; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -9019,6 +9037,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* futimens */ + case 546: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct timespec *"; + break; + default: + break; + }; + break; + /* utimensat */ + case 547: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "char *"; + break; + case 2: + p = "struct timespec *"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10962,6 +11012,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* futimens */ + case 546: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* utimensat */ + case 547: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/sys/syscall.h Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #define SYS_syscall 0 @@ -463,4 +463,6 @@ #define SYS_aio_mlock 543 #define SYS_procctl 544 #define SYS_ppoll 545 -#define SYS_MAXSYSCALL 546 +#define SYS_futimens 546 +#define SYS_utimensat 547 +#define SYS_MAXSYSCALL 548 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/sys/syscall.mk Fri Jan 23 21:08:24 2015 (r277611) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 276654 2015-01-04 10:34:02Z dchagin +# created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles MIASM = \ syscall.o \ exit.o \ @@ -410,4 +410,6 @@ MIASM = \ pipe2.o \ aio_mlock.o \ procctl.o \ - ppoll.o + ppoll.o \ + futimens.o \ + utimensat.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Fri Jan 23 21:07:08 2015 (r277610) +++ head/sys/sys/sysproto.h Fri Jan 23 21:08:24 2015 (r277611) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 276654 2015-01-04 10:34:02Z dchagin + * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 21:07:08Z jilles */ #ifndef _SYS_SYSPROTO_H_ @@ -1819,6 +1819,16 @@ struct ppoll_args { char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; }; +struct futimens_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; +}; +struct utimensat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; + char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2211,6 +2221,8 @@ int sys_pipe2(struct thread *, struct pi int sys_aio_mlock(struct thread *, struct aio_mlock_args *); int sys_procctl(struct thread *, struct procctl_args *); int sys_ppoll(struct thread *, struct ppoll_args *); +int sys_futimens(struct thread *, struct futimens_args *); +int sys_utimensat(struct thread *, struct utimensat_args *); #ifdef COMPAT_43 @@ -2917,6 +2929,8 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_aio_mlock AUE_NULL #define SYS_AUE_procctl AUE_NULL #define SYS_AUE_ppoll AUE_POLL +#define SYS_AUE_futimens AUE_FUTIMES +#define SYS_AUE_utimensat AUE_FUTIMESAT #undef PAD_ #undef PADL_ From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:12:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43FC036A for ; Fri, 23 Jan 2015 21:12:55 +0000 (UTC) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E19B131E for ; Fri, 23 Jan 2015 21:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=4rKD3WRhBFxw+9UBN4m+QDEuo6Q=; b=h4reBvAfPab1ORfZN+ lthwpVoO+kg2zkj8qgS2BrbIATEshQwEhgbgxSqbxXcKYg7MOPVshGvyf3FlxUrG hLHqAXM6xsHKbkxNZE2qJqm2G1VFTEnsyOL4PBKNzxsqnjnjqyEGm4DRjjEM29wH 29izrEASTnPLvnEmGf04QfvVE= Received: by filter0229p1mdw1.sendgrid.net with SMTP id filter0229p1mdw1.19585.54C2B95028 2015-01-23 21:12:48.938404009 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd-041 (SG) with ESMTP id 14b18a3e3e4.3484.420f59 for ; Fri, 23 Jan 2015 21:12:48 +0000 (UTC) Received: (qmail 59306 invoked from network); 23 Jan 2015 21:12:12 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 23 Jan 2015 21:12:12 -0000 Received: (qmail 5362 invoked from network); 23 Jan 2015 21:12:01 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 23 Jan 2015 21:12:01 -0000 Message-ID: <54C2B921.3090007@freebsd.org> Date: Fri, 23 Jan 2015 13:12:01 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r277606 - head/release References: <201501232024.t0NKODZq079972@svn.freebsd.org> <1422044932.1038.3.camel@freebsd.org> In-Reply-To: <1422044932.1038.3.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNEY/C9bdalNEc7WTs3zjb1wLy1hZFYGmsN41u /4h3jK37LC0ilA07yS8C2IqrkVN15MxRzruupkC+vIGWEIIGsQgqx2DHIKbBA8EJsMoG+3bdncKyvc KUgZRWUUfNsLwFYkZ9GoFAdKGex/8LTln8V2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:12:55 -0000 On 01/23/15 12:28, Ian Lepore wrote: > On Fri, 2015-01-23 at 20:24 +0000, Colin Percival wrote: >> release: real-release vm-release cloudware-release >> + @true >> >> real-release: >> ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj >> > > Wouldn't '.PHONY: release' be a better/more-correct fix? Could be. I was inspired by the use of ${DO_NADA} in ports Makefiles, but perhaps that's for targets which truly do nothing rather than targets which serve only to activate their dependencies... if anyone else has opinions on this please email me directly; no point clogging up the mailing list. I'll adjust based on feedback (which is currently leaning in favour of .PHONY). -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:18:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB69850C; Fri, 23 Jan 2015 21:18:05 +0000 (UTC) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B444348; Fri, 23 Jan 2015 21:18:05 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id 10so7954657lbg.10; Fri, 23 Jan 2015 13:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=w6UB5727e1ZlEFG93tudy2gDmw3ZNNoYYvOKkTY+wno=; b=xootc1VLfaGroURUvESbbijrSywsWNV0nFygVnp+DJGKlGxQlM5umCtkqgCF5G5RxE kj5XD3qwHCZwK+ldkNgpyh9XzktQ8ArmnO331/ByzJRs5PtPErbFxn7YDirz1t7qQPDM uugLNBIE4Rg+YnAsVNuWfF121KlAQH6ARsoyE+ZSdCoZJq5AcqmtgT6lsGCctkhl+caW 0Uieuj0YpbHO3RkPaiGigzNm/O+eTowsv4oIIU9q6EhLiUm4HLOsi3ZDBjtMijrX6e8B 2/0vm9g7XucfDv3Hv5apkhB4sIm3tqQqntqSXfNeNoHNP2+pq/ZBRuc7ORFe+pnKIEGy LxTw== MIME-Version: 1.0 X-Received: by 10.152.44.228 with SMTP id h4mr8454209lam.31.1422047883459; Fri, 23 Jan 2015 13:18:03 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.25.155.4 with HTTP; Fri, 23 Jan 2015 13:18:03 -0800 (PST) In-Reply-To: <20150123205617.GB56104@sol.firepipe.net> References: <201501231618.t0NGIeDv057991@svn.freebsd.org> <20150123205617.GB56104@sol.firepipe.net> Date: Fri, 23 Jan 2015 13:18:03 -0800 X-Google-Sender-Auth: -Nx1CTRrJSCQsFeVl9v1RakdKDM Message-ID: Subject: Re: svn commit: r277570 - head/usr.bin/vmstat From: Davide Italiano To: Will Andrews Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:18:06 -0000 On Fri, Jan 23, 2015 at 12:56 PM, Will Andrews wrote: > On Fri, Jan 23, 2015 at 11:23:57AM -0800, Davide Italiano wrote: >> What's the rationale behind this change? > > The rationale was to match the clock used to the name (and implied intent) > of the variables used to store/manipulate the data. > > It's possible that 'uptime' is entirely the wrong term in vmstat, in which > case the naming used elsewhere in vmstat needs to be changed too. > > -- > wca I don't think this is a reason strong enough, we should rather go the other way around as already suggested. I would like to see this reverted. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:34:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 659E3C29; Fri, 23 Jan 2015 21:34:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51924779; Fri, 23 Jan 2015 21:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NLY90U013704; Fri, 23 Jan 2015 21:34:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NLY9if013703; Fri, 23 Jan 2015 21:34:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501232134.t0NLY9if013703@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Jan 2015 21:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277612 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:34:09 -0000 Author: emaste Date: Fri Jan 23 21:34:08 2015 New Revision: 277612 URL: https://svnweb.freebsd.org/changeset/base/277612 Log: Restore addr2line to cross tools Addr2line is not required for the build, and a per-arch binary is no longer required with the switch to the ELF Tool Chain. However, building these tools during the cross tools stage can be useful for developers who cross build HEAD from stable/10, and adds very little to the build time. Reviewed by: ian, imp Differential Revision: https://reviews.freebsd.org/D1583 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 23 21:08:24 2015 (r277611) +++ head/Makefile.inc1 Fri Jan 23 21:34:08 2015 (r277612) @@ -1437,6 +1437,9 @@ _elftctools= lib/libelftc \ usr.bin/nm \ usr.bin/size \ usr.bin/strings +# These are not required by the build, but can be useful for developers who +# cross-build on a FreeBSD 10 host: +_elftctools+= usr.bin/addr2line .endif .endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 21:49:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACAB82E8; Fri, 23 Jan 2015 21:49:07 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9158D0; Fri, 23 Jan 2015 21:49:07 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id n12so9826353wgh.6; Fri, 23 Jan 2015 13:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8uxXlsVFcubfqVG2HelUTxmqDMmS/tELOOMkfCP8v+0=; b=CBV/1EPuALh292SaFwprOajAuY3IqP6IN2ckwarOdMQJaojVJeu5rnh0h8iRHpmvUO IqkugO8r0jLkxezsygXgerHGp3wteR5gsIuuMw+TemgrOUeMec7HpU2VywXLst3WXesM Af8Xs+KTkzjFp4QOtVRdYbaZplx5gRg2B/hR+VGn8eoRGB0ipkpuloMNTSJos9tPrQnZ Z8YdQzgD44H01nwWrzs+QVjxr1c6cCGR3+iF/Hn4VnA9/6+m3IAFJ2MAt56SDWYMKmel tsICB3KRPXUAqFxh//Evlq5nk6ChsQ0pPsmy7fy6IgjnX9FgHNJVypz/bO+SjhqCNnrI zJAQ== MIME-Version: 1.0 X-Received: by 10.180.211.176 with SMTP id nd16mr7690935wic.23.1422049745804; Fri, 23 Jan 2015 13:49:05 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.17.129 with HTTP; Fri, 23 Jan 2015 13:49:05 -0800 (PST) In-Reply-To: References: <201501231618.t0NGIeDv057991@svn.freebsd.org> <20150123205617.GB56104@sol.firepipe.net> Date: Fri, 23 Jan 2015 14:49:05 -0700 X-Google-Sender-Auth: 9JScbwcbmzkiNI2PEEHN_E0e5ZE Message-ID: Subject: Re: svn commit: r277570 - head/usr.bin/vmstat From: Alan Somers To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Will Andrews X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 21:49:07 -0000 On Fri, Jan 23, 2015 at 2:18 PM, Davide Italiano wrote: > On Fri, Jan 23, 2015 at 12:56 PM, Will Andrews wrote: >> On Fri, Jan 23, 2015 at 11:23:57AM -0800, Davide Italiano wrote: >>> What's the rationale behind this change? >> >> The rationale was to match the clock used to the name (and implied intent) >> of the variables used to store/manipulate the data. >> >> It's possible that 'uptime' is entirely the wrong term in vmstat, in which >> case the naming used elsewhere in vmstat needs to be changed too. >> >> -- >> wca > > I don't think this is a reason strong enough, we should rather go the > other way around as already suggested. > I would like to see this reverted. > > Thanks, > > -- > Davide > I agree with Ian that vmstat ought to be using a monotonic clock, and that the ideal change would be to rename all of its "uptime" variables accordingly. But reverting this change would be the worst possible outcome because we'd be back in the original situation of wrong variable names that are wrongly set. As is, the change has no functional effect because CLOCK_MONOTONIC and CLOCK_UPTIME are identical (see kern_clock_gettime). -Alan From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 22:24:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4043BA10; Fri, 23 Jan 2015 22:24:02 +0000 (UTC) Date: Fri, 23 Jan 2015 22:23:57 +0000 From: Glen Barber To: Ian Lepore Subject: Re: svn commit: r277606 - head/release Message-ID: <20150123222357.GD1264@hub.FreeBSD.org> References: <201501232024.t0NKODZq079972@svn.freebsd.org> <1422044932.1038.3.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <1422044932.1038.3.camel@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 22:24:03 -0000 --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 23, 2015 at 01:28:52PM -0700, Ian Lepore wrote: > On Fri, 2015-01-23 at 20:24 +0000, Colin Percival wrote: > > Author: cperciva > > Date: Fri Jan 23 20:24:13 2015 > > New Revision: 277606 > > URL: https://svnweb.freebsd.org/changeset/base/277606 > >=20 > > Log: > > Provide a recipe of "true" for building the "release" target once its > > prerequisites are satisfied, in order to avoid having an implicit rule > > triggered by the presence of release.sh. > > =20 > > Approved by: gjb > >=20 > > Modified: > > head/release/Makefile > >=20 > > Modified: head/release/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/Makefile Fri Jan 23 19:43:57 2015 (r277605) > > +++ head/release/Makefile Fri Jan 23 20:24:13 2015 (r277606) > > @@ -279,6 +279,7 @@ ftp: packagesystem > > cp *.txz MANIFEST ftp > > =20 > > release: real-release vm-release cloudware-release > > + @true > > =20 > > real-release: > > ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj > >=20 >=20 > Wouldn't '.PHONY: release' be a better/more-correct fix? >=20 I'm not sure this is a more proper fix in how this Makefile is set up currently. Prior to my recent changes, 'release' invoked each RELEASE_TARGETS entry individually, which in turn invoke 'system' and 'packagesystem', if needed. The disc1.iso target uses the literal 'release' directory to populate the CDROM image, which after success, 'make release' will not do anything because the 'release' target is up-to-date. This is the intended behavior, which with Colin's '@true' addition, keeps the behavior consistent with what previously happened. I do want to change where the disc1.iso bits get installed, after which adding 'touch ${.TARGET}' to the release target should continue to do the right thing. Glen --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJUwsn9AAoJEAMUWKVHj+KTQDQQAIN1msJZZ2QNHk6G1bIYHJX1 VcnTy3vvHjNnD/Zu9DhCpnenc0Uy5laFH/04ncXAkaAtdmZh9TycKttS/JMihgr1 s5XpjnyWOxhtkatvarI7EyBHC/frEVMv1B/iQQmi1CGwKpbMIctIzsk7DB5nOMRP 3kUFT6/dFPkhCcFnI0d9zIp+SbQDEfPkAQyqEd9cWvfWHkKJPNs2dzruSnZfVuef nWShXga0BG+ilB2ZFQQNC5kh0PQowHoIcYz0F2Lm6EL8xz45t9s23iY3oQe76VW4 pj8ctBuzbwC2p6fPaHV9me098bAnRoNXZrYwiz2sD+vNXOP0LpLNdY0aHNYlDcQ4 eWGO5EEaw3uE/veZNcv7JH9bLZ4lqtq778JNvn83IJ2DkrFVLZYKpcBg6ql7nyWJ quFZK2iXmIbbxk1sX53xYnQqmk2lgTPlUHK+aQ1ixR+AMqElWIk9P29tLbujphWT EYF/KSgr+KnyqzwchJGjZOVplIlN9SQ5jbA4FfuZc/kfCXEvSpGMEjcpFH3pqsSo zsWCtkRNVTX+wSNn/KJsZ/QlYlK20KPNnx6Mvqv9CjS2cHAbhwfYxTIpkKQTZWOX 8OVj45hdd/OIebrqTCtj0qSoMKmbn1N7BKI1MLz/hH0ynNv83zsDEE3VDmeRYdUv vgwPFvC1WWlW9Pi/ScXB =oBur -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 23 23:53:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE6C050B; Fri, 23 Jan 2015 23:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9053380A; Fri, 23 Jan 2015 23:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0NNrvHB086575; Fri, 23 Jan 2015 23:53:57 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0NNrvpq086574; Fri, 23 Jan 2015 23:53:57 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501232353.t0NNrvpq086574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Fri, 23 Jan 2015 23:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277622 - head/sys/boot/i386/libfirewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 23:53:57 -0000 Author: will Date: Fri Jan 23 23:53:56 2015 New Revision: 277622 URL: https://svnweb.freebsd.org/changeset/base/277622 Log: Fix panic in firewire and creation of invalid config ROM. (This change was supposed to be included in r277508.) sys/boot/i386/libfirewire/firewire.c: Fix configuration ROM generation count wrapping logic so that the generation count is never outside of allowed limits (0x2 -> 0xF). Submitted by: gibbs MFC after: 1 week MFC with: 277508 Sponsored by: Spectra Logic MFSpectraBSD: 1110685 on 2015/01/05 Modified: head/sys/boot/i386/libfirewire/firewire.c Modified: head/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- head/sys/boot/i386/libfirewire/firewire.c Fri Jan 23 23:52:33 2015 (r277621) +++ head/sys/boot/i386/libfirewire/firewire.c Fri Jan 23 23:53:56 2015 (r277622) @@ -233,7 +233,8 @@ fw_init_crom(struct fwohci_softc *sc) src->businfo.cyc_clk_acc = 100; src->businfo.max_rec = sc->maxrec; src->businfo.max_rom = MAXROM_4; - src->businfo.generation = 1; +#define FW_GENERATION_CHANGEABLE 2 + src->businfo.generation = FW_GENERATION_CHANGEABLE; src->businfo.link_spd = sc->speed; src->businfo.eui64.hi = sc->eui.hi; @@ -313,11 +314,14 @@ fw_crom(struct fwohci_softc *sc) src = &sc->crom_src_buf->src; crom_load(src, (uint32_t *)newrom, CROMSIZE); if (bcmp(newrom, sc->config_rom, CROMSIZE) != 0) { - /* bump generation and reload */ - src->businfo.generation ++; - /* generation must be between 0x2 and 0xF */ + /* Bump generation and reload. */ + src->businfo.generation++; + + /* Handle generation count wraps. */ if (src->businfo.generation < 2) - src->businfo.generation ++; + src->businfo.generation = 2; + + /* Recalculate CRC to account for generation change. */ crom_load(src, (uint32_t *)newrom, CROMSIZE); bcopy(newrom, (void *)sc->config_rom, CROMSIZE); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 00:04:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 001388FB; Sat, 24 Jan 2015 00:04:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC8F90C; Sat, 24 Jan 2015 00:04:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O04Y4r092669; Sat, 24 Jan 2015 00:04:34 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O04YDf092668; Sat, 24 Jan 2015 00:04:34 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501240004.t0O04YDf092668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 24 Jan 2015 00:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277624 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 00:04:35 -0000 Author: will Date: Sat Jan 24 00:04:34 2015 New Revision: 277624 URL: https://svnweb.freebsd.org/changeset/base/277624 Log: Bump config(8) minor version for r277567. Config files built using this version that take advantage of the bugfix won't be buildable using older config(8). Submitted by: imp MFC after: 1 week MFC with: 277567 Modified: head/usr.sbin/config/configvers.h Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Fri Jan 23 23:54:55 2015 (r277623) +++ head/usr.sbin/config/configvers.h Sat Jan 24 00:04:34 2015 (r277624) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600013 +#define CONFIGVERS 600014 #define MAJOR_VERS(x) ((x) / 100000) From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 00:35:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94A1C165; Sat, 24 Jan 2015 00:35:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8039CBE4; Sat, 24 Jan 2015 00:35:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O0Zofj007195; Sat, 24 Jan 2015 00:35:50 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O0Zopt007194; Sat, 24 Jan 2015 00:35:50 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201501240035.t0O0Zopt007194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 24 Jan 2015 00:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277626 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 00:35:50 -0000 Author: neel Date: Sat Jan 24 00:35:49 2015 New Revision: 277626 URL: https://svnweb.freebsd.org/changeset/base/277626 Log: Add macro to identify AVIC capability (advanced virtual interrupt controller) in AMD processors. Submitted by: Dmitry Luhtionov (dmitryluhtionov@gmail.com) Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Sat Jan 24 00:27:50 2015 (r277625) +++ head/sys/amd64/vmm/amd/svm.c Sat Jan 24 00:35:49 2015 (r277626) @@ -80,6 +80,7 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLF #define AMD_CPUID_SVM_DECODE_ASSIST BIT(7) /* Decode assist */ #define AMD_CPUID_SVM_PAUSE_INC BIT(10) /* Pause intercept filter. */ #define AMD_CPUID_SVM_PAUSE_FTH BIT(12) /* Pause filter threshold */ +#define AMD_CPUID_SVM_AVIC BIT(13) /* AVIC present */ #define VMCB_CACHE_DEFAULT (VMCB_CACHE_ASID | \ VMCB_CACHE_IOPM | \ From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 00:37:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8DEF2DA; Sat, 24 Jan 2015 00:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A721C07; Sat, 24 Jan 2015 00:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O0bgOX007470; Sat, 24 Jan 2015 00:37:42 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O0bfmf007467; Sat, 24 Jan 2015 00:37:41 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501240037.t0O0bfmf007467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 24 Jan 2015 00:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277627 - in head/etc/tests: . rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 00:37:42 -0000 Author: will Date: Sat Jan 24 00:37:41 2015 New Revision: 277627 URL: https://svnweb.freebsd.org/changeset/base/277627 Log: Add routing_test:static_ipv6_loopback_route_for_each_fib. It tests that all FIBs get a static IPv6 loopback route. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1048456 on 2014/03/13 1114523 on 2015/01/23 Added: head/etc/tests/rc.d/ head/etc/tests/rc.d/Makefile (contents, props changed) head/etc/tests/rc.d/routing_test.sh (contents, props changed) Modified: head/etc/tests/Makefile Modified: head/etc/tests/Makefile ============================================================================== --- head/etc/tests/Makefile Sat Jan 24 00:35:49 2015 (r277626) +++ head/etc/tests/Makefile Sat Jan 24 00:37:41 2015 (r277627) @@ -7,4 +7,6 @@ TESTSDIR= ${TESTSBASE}/etc .PATH: ${.CURDIR:H:H}/tests KYUAFILE= yes +TESTS_SUBDIRS+= rc.d + .include Added: head/etc/tests/rc.d/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/tests/rc.d/Makefile Sat Jan 24 00:37:41 2015 (r277627) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/etc/rc.d + +ATF_TESTS_SH+= routing_test + +.include Added: head/etc/tests/rc.d/routing_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/tests/rc.d/routing_test.sh Sat Jan 24 00:37:41 2015 (r277627) @@ -0,0 +1,138 @@ +# +# Copyright (c) 2014 Spectra Logic Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions, and the following disclaimer, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# substantially similar to the "NO WARRANTY" disclaimer below +# ("Disclaimer") and any redistribution must be conditioned upon +# including a substantially similar Disclaimer requirement for further +# binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGES. +# +# Authors: Alan Somers (Spectra Logic Corporation) +# +# $FreeBSD$ + +atf_test_case static_ipv6_loopback_route_for_each_fib cleanup +static_ipv6_loopback_route_for_each_fib_head() +{ + atf_set "descr" "Every FIB should have a static IPv6 loopback route" + atf_set "require.user" "root" + atf_set "require.config" "fibs" + atf_set "require.progs" "sysrc" +} +static_ipv6_loopback_route_for_each_fib_body() +{ + # Configure the TAP interface to use an RFC5737 nonrouteable address + # and a non-default fib + ADDR="192.0.2.2" + SUBNET="192.0.2.0" + MASK="24" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + + get_fibs 1 + get_tap + + # Configure a TAP interface in /etc/rc.conf. Register the sysrc + # variable for cleanup. + echo "ifconfig_${TAP}" >> "sysrc_vars_to_cleanup" + sysrc ifconfig_${TAP}="${ADDR}/${MASK} fib ${FIB0}" + + # Start the interface + service netif start ${TAP} + # Check for an IPv6 loopback route + setfib ${FIB0} netstat -rn -f inet6 | grep -q "^::1.*lo0$" + if [ 0 -eq $? ]; then + atf_pass + else + setfib ${FIB0} netstat -rn -f inet6 + atf_fail "Did not find an IPv6 loopback route" + fi +} +static_ipv6_loopback_route_for_each_fib_cleanup() +{ + cleanup_sysrc + cleanup_tap +} + +atf_init_test_cases() +{ + atf_add_test_case static_ipv6_loopback_route_for_each_fib +} + +# Looks up one or more fibs from the configuration data and validates them. +# Returns the results in the env varilables FIB0, FIB1, etc. +# parameter numfibs The number of fibs to lookup +get_fibs() +{ + NUMFIBS=$1 + net_fibs=`sysctl -n net.fibs` + i=0 + while [ $i -lt "$NUMFIBS" ]; do + fib=`atf_config_get "fibs" | \ + awk -v i=$(( i + 1 )) '{print $i}'` + echo "fib is ${fib}" + eval FIB${i}=${fib} + if [ "$fib" -ge "$net_fibs" ]; then + msg="The ${i}th configured fib is ${fub}, which is " + msg="$msg not less than net.fibs (${net_fibs})" + atf_skip "$msg" + fi + i=$(( $i + 1 )) + done +} + + +# Creates a new tap(4) interface, registers it for cleanup, and returns the +# name via the environment variable TAP +get_tap() +{ + local TAPN=0 + while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do + if [ "$TAPN" -ge 8 ]; then + atf_skip "Could not create a tap(4) interface" + else + TAPN=$(($TAPN + 1)) + fi + done + local TAPD=tap${TAPN} + # Record the TAP device so we can clean it up later + echo ${TAPD} >> "tap_devices_to_cleanup" + TAP=${TAPD} +} + +cleanup_sysrc() +{ + for var in `cat "sysrc_vars_to_cleanup"`; do + sysrc -x $var + done +} + +cleanup_tap() +{ + for TAPD in `cat "tap_devices_to_cleanup"`; do + ifconfig ${TAPD} destroy + done +} From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 00:43:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24D13646; Sat, 24 Jan 2015 00:43:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10262CBC; Sat, 24 Jan 2015 00:43:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O0h2S8011636; Sat, 24 Jan 2015 00:43:02 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O0h21i011635; Sat, 24 Jan 2015 00:43:02 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501240043.t0O0h21i011635@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 24 Jan 2015 00:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277629 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 00:43:03 -0000 Author: will Date: Sat Jan 24 00:43:02 2015 New Revision: 277629 URL: https://svnweb.freebsd.org/changeset/base/277629 Log: When creating or updating a node, use vfs_timestamp() for "now" instead of gethrestime(), to allow the administrator to decide the appropriate timestamp precision instead of always using nanosecond precision. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jan 24 00:40:42 2015 (r277628) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jan 24 00:43:02 2015 (r277629) @@ -794,7 +794,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d gen = vap->va_nblocks; /* ditto */ } else { obj = 0; - gethrestime(&now); + vfs_timestamp(&now); gen = dmu_tx_get_txg(tx); } @@ -1426,7 +1426,7 @@ zfs_tstamp_update_setup(znode_t *zp, uin { timestruc_t now; - gethrestime(&now); + vfs_timestamp(&now); if (have_tx) { /* will sa_bulk_update happen really soon? */ zp->z_atime_dirty = 0; From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 01:53:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FD14E6; Sat, 24 Jan 2015 01:53:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B91C362; Sat, 24 Jan 2015 01:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O1rTkC046941; Sat, 24 Jan 2015 01:53:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O1rTGa046939; Sat, 24 Jan 2015 01:53:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201501240153.t0O1rTGa046939@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 24 Jan 2015 01:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277632 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 01:53:29 -0000 Author: gonzo Date: Sat Jan 24 01:53:28 2015 New Revision: 277632 URL: https://svnweb.freebsd.org/changeset/base/277632 Log: After interrupt read value from register to make sure it reached hardware. This should fix "Spurious inteerupt" message Suggested by ian@ Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sat Jan 24 01:50:52 2015 (r277631) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sat Jan 24 01:53:28 2015 (r277632) @@ -356,6 +356,8 @@ am335x_lcd_intr(void *arg) reg = LCD_READ4(sc, LCD_IRQSTATUS); LCD_WRITE4(sc, LCD_IRQSTATUS, reg); + /* Read value back to make sure it reached the hardware */ + reg = LCD_READ4(sc, LCD_IRQSTATUS); if (reg & IRQ_SYNC_LOST) { reg = LCD_READ4(sc, LCD_RASTER_CTRL); @@ -401,6 +403,8 @@ am335x_lcd_intr(void *arg) done: LCD_WRITE4(sc, LCD_END_OF_INT_IND, 0); + /* Read value back to make sure it reached the hardware */ + reg = LCD_READ4(sc, LCD_END_OF_INT_IND); } static int From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 01:58:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B444126B; Sat, 24 Jan 2015 01:58:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA2A390; Sat, 24 Jan 2015 01:58:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O1wGkE047725; Sat, 24 Jan 2015 01:58:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O1wGu3047724; Sat, 24 Jan 2015 01:58:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501240158.t0O1wGu3047724@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 24 Jan 2015 01:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277633 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 01:58:16 -0000 Author: nwhitehorn Date: Sat Jan 24 01:58:15 2015 New Revision: 277633 URL: https://svnweb.freebsd.org/changeset/base/277633 Log: Fix typo in r277561. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Jan 24 01:53:28 2015 (r277632) +++ head/sys/powerpc/aim/machdep.c Sat Jan 24 01:58:15 2015 (r277633) @@ -535,7 +535,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ #endif bcopy(&alitrap, (void *)(EXC_ALI + trap_offset), (size_t)&aliend - (size_t)&alitrap); - bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsitrap - + bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsiend - (size_t)&dsitrap); bcopy(generictrap, (void *)EXC_ISI, trapsize); #ifdef __powerpc64__ From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 04:41:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA49EE23; Sat, 24 Jan 2015 04:41:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5997A83; Sat, 24 Jan 2015 04:41:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O4fFH0025930; Sat, 24 Jan 2015 04:41:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O4fFG3025928; Sat, 24 Jan 2015 04:41:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201501240441.t0O4fFG3025928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 24 Jan 2015 04:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277637 - in head/sys: conf modules/cxgbe/if_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 04:41:16 -0000 Author: np Date: Sat Jan 24 04:41:14 2015 New Revision: 277637 URL: https://svnweb.freebsd.org/changeset/base/277637 Log: Make sure the compiler flag to get cxgbe(4) to compile with gcc is used only when gcc is being used. This is what r277225 should have been. Suggested by: dim@ Modified: head/sys/conf/files head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 24 03:04:08 2015 (r277636) +++ head/sys/conf/files Sat Jan 24 04:41:14 2015 (r277637) @@ -1141,7 +1141,7 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ - compile-with "${NORMAL_C} -I$S/dev/cxgbe -fms-extensions" + compile-with "${NORMAL_C} -I$S/dev/cxgbe ${GCC_MS_EXTENSIONS}" dev/cxgbe/t4_main.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_netmap.c optional cxgbe pci \ Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Sat Jan 24 03:04:08 2015 (r277636) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Sat Jan 24 04:41:14 2015 (r277637) @@ -23,6 +23,7 @@ SRCS+= t4_tracer.c # Provide the timestamp of a packet in its header mbuf. #CFLAGS+= -DT4_PKT_TIMESTAMP -CFLAGS+= -I${CXGBE} -fms-extensions +CFLAGS+= -I${CXGBE} .include +CFLAGS+= ${GCC_MS_EXTENSIONS} From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 04:52:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16AF3D9; Sat, 24 Jan 2015 04:52:21 +0000 (UTC) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A82B3B88; Sat, 24 Jan 2015 04:52:20 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id gd6so814325lab.4; Fri, 23 Jan 2015 20:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=GLHW3I4jbIDVexj1XfybSNxEgkkbSXOiA/vqXELpJF4=; b=o5zN4rxnksH6sCm47+sdfBtTkpszqNgPkKBaMd3mSxm3XygAeGZNTQzpPln1T3LFwM mPcTvgLkYU+VPV5I5OTzpPJHZyTK7g77CW93V0K/r5AWX1/Q5Hin7VHp9gZFH/kSjqWu 80HZ9lYTNcVqxjhGzQjtDZPzAW+PdNx7+QgQsUPqm3lURezDGYGTP/XocLTFFEiVW9Vd xlEh0pD7s+n87WSQLK6ZJxIkfJuCuAi1NAtUtSKL5O120xEZNGwvSwD5yPJpEp7O2xdH xx9N2c+UF0ZkBuH7T1BazHjcv34p5vygoKoUNQ6zeQ0i47kzez3ghoTOoXg0MB/ddzCg 9rog== MIME-Version: 1.0 X-Received: by 10.112.12.134 with SMTP id y6mr10943491lbb.34.1422075138663; Fri, 23 Jan 2015 20:52:18 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.10.168 with HTTP; Fri, 23 Jan 2015 20:52:18 -0800 (PST) Date: Fri, 23 Jan 2015 20:52:18 -0800 X-Google-Sender-Auth: VfjbERBOOmglkLVuB9n0i5aFc3s Message-ID: Subject: WITHOUT_CASPER not working anymore ? Re: svn commit: r276788 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump From: Luigi Rizzo To: Xin LI Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 04:52:21 -0000 Not that i mind if it is intentional (though it seems not), but after this commit tcpdump does not build anymore with -DWITHOUT_CASPER. To be precise, the failure is when you do a buildworld with WITHOUT_CASPER, which does not install the libcapsicum headers. I understand that there is a change in the macro that defines support (from HAVE_LIBCAPSICUM to HAVE_CAPSICUM), but it seems to me that in the chunk below (for tcpdump.c, but other sources are affected too) the #ifdef HAVE_CAPSICUM / #endif block contains headers that are totally unrelated to capsicum: you should probably protect the headers. @@ -70,25 +76,24 @@ #include #ifdef __FreeBSD__ #include -#include -#include #include -#include -#include -#include -#ifdef HAVE_LIBCAPSICUM #include #include #include #include -#endif /* HAVE_LIBCAPSICUM */ -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ */ +#ifdef HAVE_CAPSICUM +#include +#include +#include +#include +#include +#endif /* HAVE_CAPSICUM */ #ifndef WIN32 #include #include #include #include -#include #endif /* WIN32 */ /* capabilities convinience library */ I am happy to send a patch but would be more comfortable if you could review/deal with it yourself. cheers luigi On Wed, Jan 7, 2015 at 11:55 AM, Xin LI wrote: > Author: delphij > Date: Wed Jan 7 19:55:18 2015 > New Revision: 276788 > URL: https://svnweb.freebsd.org/changeset/base/276788 > > Log: > MFV r276761: tcpdump 4.6.2. From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 04:53:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 059A821D; Sat, 24 Jan 2015 04:53:27 +0000 (UTC) Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEA2EB92; Sat, 24 Jan 2015 04:53:26 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id ft15so1645896pdb.5; Fri, 23 Jan 2015 20:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=CCXWDjaQTwAeUKqxHkTn/t6SdRRbTYUYgRf9vRFonwM=; b=J2Rd3+4HtllWtEqefrBW7vXeum1Cka/x/9A9AKwhSeMH3qqXcSUCUDpOnMRNC4nbcO N37NFiHmqnQetQRDDmogFYRc/W6dzdIlM+xUXECaGj9m3SqCZmJWZuivprrPaH581Kd0 VDYikaSb1H/kuai47HvqbaeneGPcCiXy1/AYq5fzcgaMrf8LMIfb6S4XkNCgiH1CW/FL m1bAVzQ83eAGD3xDN8A1X+yhgkqqPdt9j4a9v/jzKHI4YhWtLeAvOJ19lw61esGWUaId gl7Bs++8f6/1vcuGFjth9t0L5b5cAzp2s5iQTKBVDS+wCnuUAn0tQ4huSyWh5XKnWbzG 8p9w== X-Received: by 10.68.129.6 with SMTP id ns6mr16419401pbb.137.1422075206382; Fri, 23 Jan 2015 20:53:26 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:ecbe:280c:8546:4daf? ([2601:8:ab80:7d6:ecbe:280c:8546:4daf]) by mx.google.com with ESMTPSA id v2sm3411959pdm.77.2015.01.23.20.53.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 20:53:25 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_AE487524-55E1-4D84-AE02-C22C6B5AB13A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: WITHOUT_CASPER not working anymore ? Re: svn commit: r276788 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump From: Garrett Cooper In-Reply-To: Date: Fri, 23 Jan 2015 20:53:22 -0800 Message-Id: References: To: Luigi Rizzo X-Mailer: Apple Mail (2.1878.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 04:53:27 -0000 --Apple-Mail=_AE487524-55E1-4D84-AE02-C22C6B5AB13A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jan 23, 2015, at 20:52, Luigi Rizzo wrote: > Not that i mind if it is intentional (though it seems not), but after this > commit tcpdump does not build anymore with -DWITHOUT_CASPER. > > To be precise, the failure is when you do a buildworld with WITHOUT_CASPER, > which does not install the libcapsicum headers. > > I understand that there is a change in the macro that defines support > (from HAVE_LIBCAPSICUM to HAVE_CAPSICUM), but it seems to me > that in the chunk below (for tcpdump.c, but other sources are affected too) > the #ifdef HAVE_CAPSICUM / #endif block contains headers > that are totally unrelated to capsicum: > you should probably protect the headers. > > > @@ -70,25 +76,24 @@ > #include > #ifdef __FreeBSD__ > #include > -#include > -#include > #include > -#include > -#include > -#include > -#ifdef HAVE_LIBCAPSICUM > #include > #include > #include > #include > -#endif /* HAVE_LIBCAPSICUM */ > -#endif /* __FreeBSD__ */ > +#endif /* __FreeBSD__ */ > +#ifdef HAVE_CAPSICUM > +#include > +#include > +#include > +#include > +#include > +#endif /* HAVE_CAPSICUM */ > #ifndef WIN32 > #include > #include > #include > #include > -#include > #endif /* WIN32 */ > > /* capabilities convinience library */ > > I am happy to send a patch but would be more comfortable if you could > review/deal with it yourself. Someone else reported this too on the mailing lists... --Apple-Mail=_AE487524-55E1-4D84-AE02-C22C6B5AB13A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUwyVDAAoJEMZr5QU6S73e8zgH/1dwxJqLJDNXKdlc8D3toZY1 +amno/ZKfev766s1uOT6Nw1B0eEvYLWzai6za1p9ugrTR+TMvtII5mADDXg41XBQ vBS4ohgftCs8Ro7Ld2HUUBHY9UKxCgkIsENI3YQq+SpG8CeLq2lcWb2IGmj7OuzQ S6JHtAn35Xht7L/gZ/N/q0RzNweod6fpSQcvio27ao8bXSGNsSrGNvpqKlNoa2SH gdpojI4oseBWMLZzwdu5vhgnpgTfJLwrcuBN6LffmA7kOZJYLwKZ7sgqQg5lEs8X IPAgPf1ite6//hTqB1+nl5wKrBQK3v9PIwtI/FxkK3f9DpCDxlLCxpyGBByGVaM= =OGV1 -----END PGP SIGNATURE----- --Apple-Mail=_AE487524-55E1-4D84-AE02-C22C6B5AB13A-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 06:06:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B710475D; Sat, 24 Jan 2015 06:06:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A38CB1FA; Sat, 24 Jan 2015 06:06:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O66lZE065808; Sat, 24 Jan 2015 06:06:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O66lpm065807; Sat, 24 Jan 2015 06:06:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501240606.t0O66lpm065807@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 24 Jan 2015 06:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277638 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 06:06:47 -0000 Author: delphij Date: Sat Jan 24 06:06:46 2015 New Revision: 277638 URL: https://svnweb.freebsd.org/changeset/base/277638 Log: Don't include libcapsicum headers when requested. Reported by: luigi MFC after: 14 days X-MFC-with: r276788 Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Sat Jan 24 04:41:14 2015 (r277637) +++ head/contrib/tcpdump/tcpdump.c Sat Jan 24 06:06:46 2015 (r277638) @@ -77,12 +77,12 @@ extern int SIZE_BUF; #ifdef __FreeBSD__ #include #include +#endif /* __FreeBSD__ */ +#ifdef HAVE_CAPSICUM #include #include #include #include -#endif /* __FreeBSD__ */ -#ifdef HAVE_CAPSICUM #include #include #include @@ -966,8 +966,8 @@ main(int argc, char **argv) FILE *VFile; #ifdef HAVE_CAPSICUM cap_rights_t rights; - int cansandbox; #endif /* HAVE_CAPSICUM */ + int cansandbox; #ifdef WIN32 if(wsockinit() != 0) return 1; From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 08:48:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C709BD5D; Sat, 24 Jan 2015 08:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2B1A359; Sat, 24 Jan 2015 08:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0O8m6iE039965; Sat, 24 Jan 2015 08:48:06 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0O8m6dN039964; Sat, 24 Jan 2015 08:48:06 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201501240848.t0O8m6dN039964@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sat, 24 Jan 2015 08:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277641 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 08:48:06 -0000 Author: luigi Date: Sat Jan 24 08:48:05 2015 New Revision: 277641 URL: https://svnweb.freebsd.org/changeset/base/277641 Log: do not strip /stand This is a temporary workaround until the elftoolchain's version of strip is fixed: The previous (GNU) strip, when acting on a file with multiple links, would modify the one and only file in place (which means creating a new stripped copy, and then writing it back to the original). The new version from elftoolchain creates the new file and then unlinks the old one and renames the new. With multiple hard links, the original remains alive. In the /stand directory, this ends up creating 80+ copies of the same file. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sat Jan 24 08:35:49 2015 (r277640) +++ head/release/picobsd/build/picobsd Sat Jan 24 08:48:05 2015 (r277641) @@ -734,8 +734,8 @@ populate_mfs_tree() { [ -n "${copy_files}" ] && do_copyfiles ${dst} copy_files do_copyfiles_user ${dst} || true [ -n "${links}" ] && do_links ${dst} links - strip ${dst}/libexec/* ${dst}/lib/* ${dst}/stand/* 2> /dev/null || true - + strip ${dst}/libexec/* ${dst}/lib/* 2> /dev/null || true + # strip ${dst}/stand/* 2> /dev/null || true # The 'import_files' mechanism is deprecated, as it requires # root permissions to follow the symlinks, and also does # not let you rename the entries. @@ -756,7 +756,7 @@ populate_mfs_tree() { # override the owner echo "/set uid=0 gid=0" > mtree.out mtree -ic -p ${dst} -k "" >> mtree.out - log "mtre.out at ${BUILDDIR}/mtree.out" + log "mtree.out at ${BUILDDIR}/mtree.out size ${MFS_SIZE}k" makefs -t ffs -o bsize=4096 -o fsize=512 \ -s ${MFS_SIZE}k -f 1000 -F mtree.out ${c_fs} ${dst} ls -l ${c_fs} ) From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 12:43:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BEF0C2; Sat, 24 Jan 2015 12:43:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 676FCC53; Sat, 24 Jan 2015 12:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OChb71051243; Sat, 24 Jan 2015 12:43:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OChaqf051241; Sat, 24 Jan 2015 12:43:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501241243.t0OChaqf051241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 24 Jan 2015 12:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277642 - in head: share/man/man3 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 12:43:37 -0000 Author: kib Date: Sat Jan 24 12:43:36 2015 New Revision: 277642 URL: https://svnweb.freebsd.org/changeset/base/277642 Log: Provide individual prototype and generate macros for the red-black tree. This helps to reduce code size in statically linked applications. Submitted by: Sebastian Huber MFC after: 2 weeks Modified: head/share/man/man3/tree.3 head/sys/sys/tree.h Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Sat Jan 24 08:48:05 2015 (r277641) +++ head/share/man/man3/tree.3 Sat Jan 24 12:43:36 2015 (r277642) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2013 +.Dd January 24, 2015 .Dt TREE 3 .Os .Sh NAME @@ -53,8 +53,26 @@ .Nm SPLAY_REMOVE , .Nm RB_PROTOTYPE , .Nm RB_PROTOTYPE_STATIC , +.Nm RB_PROTOTYPE_INSERT , +.Nm RB_PROTOTYPE_INSERT_COLOR , +.Nm RB_PROTOTYPE_REMOVE , +.Nm RB_PROTOTYPE_REMOVE_COLOR , +.Nm RB_PROTOTYPE_FIND , +.Nm RB_PROTOTYPE_NFIND , +.Nm RB_PROTOTYPE_NEXT , +.Nm RB_PROTOTYPE_PREV , +.Nm RB_PROTOTYPE_MINMAX , .Nm RB_GENERATE , .Nm RB_GENERATE_STATIC , +.Nm RB_GENERATE_INSERT , +.Nm RB_GENERATE_INSERT_COLOR , +.Nm RB_GENERATE_REMOVE , +.Nm RB_GENERATE_REMOVE_COLOR , +.Nm RB_GENERATE_FIND , +.Nm RB_GENERATE_NFIND , +.Nm RB_GENERATE_NEXT , +.Nm RB_GENERATE_PREV , +.Nm RB_GENERATE_MINMAX , .Nm RB_ENTRY , .Nm RB_HEAD , .Nm RB_INITIALIZER , @@ -111,8 +129,26 @@ .Fn SPLAY_REMOVE NAME "SPLAY_HEAD *head" "struct TYPE *elm" .Fn RB_PROTOTYPE NAME TYPE FIELD CMP .Fn RB_PROTOTYPE_STATIC NAME TYPE FIELD CMP +.Fn RB_PROTOTYPE_INSERT NAME TYPE ATTR +.Fn RB_PROTOTYPE_INSERT_COLOR NAME TYPE ATTR +.Fn RB_PROTOTYPE_REMOVE NAME TYPE ATTR +.Fn RB_PROTOTYPE_REMOVE_COLOR NAME TYPE ATTR +.Fn RB_PROTOTYPE_FIND NAME TYPE ATTR +.Fn RB_PROTOTYPE_NFIND NAME TYPE ATTR +.Fn RB_PROTOTYPE_NEXT NAME TYPE ATTR +.Fn RB_PROTOTYPE_PREV NAME TYPE ATTR +.Fn RB_PROTOTYPE_MINMAX NAME TYPE ATTR .Fn RB_GENERATE NAME TYPE FIELD CMP .Fn RB_GENERATE_STATIC NAME TYPE FIELD CMP +.Fn RB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR +.Fn RB_GENERATE_INSERT_COLOR NAME TYPE FIELD ATTR +.Fn RB_GENERATE_REMOVE NAME TYPE FIELD ATTR +.Fn RB_GENERATE_REMOVE_COLOR NAME TYPE FIELD ATTR +.Fn RB_GENERATE_FIND NAME TYPE FIELD CMP ATTR +.Fn RB_GENERATE_NFIND NAME TYPE FIELD CMP ATTR +.Fn RB_GENERATE_NEXT NAME TYPE FIELD ATTR +.Fn RB_GENERATE_PREV NAME TYPE FIELD ATTR +.Fn RB_GENERATE_MINMAX NAME TYPE FIELD ATTR .Fn RB_ENTRY TYPE .Fn RB_HEAD HEADNAME TYPE .Fn RB_INITIALIZER "RB_HEAD *head" @@ -377,6 +413,27 @@ The .Fa FIELD argument is the name of the element defined by .Fn RB_ENTRY . +Individual prototypes can be declared with +.Fn RB_PROTOTYPE_INSERT , +.Fn RB_PROTOTYPE_INSERT_COLOR , +.Fn RB_PROTOTYPE_REMOVE , +.Fn RB_PROTOTYPE_REMOVE_COLOR , +.Fn RB_PROTOTYPE_FIND , +.Fn RB_PROTOTYPE_NFIND , +.Fn RB_PROTOTYPE_NEXT , +.Fn RB_PROTOTYPE_PREV , +and +.Fn RB_PROTOTYPE_MINMAX +in case not all functions are required. The individual prototype macros expect +.Fa NAME , +.Fa TYPE , +and +.Fa ATTR +arguments. The +.Fa ATTR +argument must be empty for global functions or +.Fa static +for static functions. .Pp The function bodies are generated with the .Fn RB_GENERATE @@ -388,6 +445,18 @@ These macros take the same arguments as and .Fn RB_PROTOTYPE_STATIC macros, but should be used only once. +As an alternative individual function bodies are generated with the +.Fn RB_GENERATE_INSERT , +.Fn RB_GENERATE_INSERT_COLOR , +.Fn RB_GENERATE_REMOVE , +.Fn RB_GENERATE_REMOVE_COLOR , +.Fn RB_GENERATE_FIND , +.Fn RB_GENERATE_NFIND , +.Fn RB_GENERATE_NEXT , +.Fn RB_GENERATE_PREV , +and +.Fn RB_GENERATE_MINMAX +macros. .Pp Finally, the Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Sat Jan 24 08:48:05 2015 (r277641) +++ head/sys/sys/tree.h Sat Jan 24 12:43:36 2015 (r277642) @@ -383,16 +383,33 @@ struct { \ #define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static) #define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ -attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \ -attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ -attr struct type *name##_RB_REMOVE(struct name *, struct type *); \ -attr struct type *name##_RB_INSERT(struct name *, struct type *); \ -attr struct type *name##_RB_FIND(struct name *, struct type *); \ -attr struct type *name##_RB_NFIND(struct name *, struct type *); \ -attr struct type *name##_RB_NEXT(struct type *); \ -attr struct type *name##_RB_PREV(struct type *); \ -attr struct type *name##_RB_MINMAX(struct name *, int); \ - \ + RB_PROTOTYPE_INSERT_COLOR(name, type, attr); \ + RB_PROTOTYPE_REMOVE_COLOR(name, type, attr); \ + RB_PROTOTYPE_INSERT(name, type, attr); \ + RB_PROTOTYPE_REMOVE(name, type, attr); \ + RB_PROTOTYPE_FIND(name, type, attr); \ + RB_PROTOTYPE_NFIND(name, type, attr); \ + RB_PROTOTYPE_NEXT(name, type, attr); \ + RB_PROTOTYPE_PREV(name, type, attr); \ + RB_PROTOTYPE_MINMAX(name, type, attr); +#define RB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ + attr void name##_RB_INSERT_COLOR(struct name *, struct type *) +#define RB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ + attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *) +#define RB_PROTOTYPE_REMOVE(name, type, attr) \ + attr struct type *name##_RB_REMOVE(struct name *, struct type *) +#define RB_PROTOTYPE_INSERT(name, type, attr) \ + attr struct type *name##_RB_INSERT(struct name *, struct type *) +#define RB_PROTOTYPE_FIND(name, type, attr) \ + attr struct type *name##_RB_FIND(struct name *, struct type *) +#define RB_PROTOTYPE_NFIND(name, type, attr) \ + attr struct type *name##_RB_NFIND(struct name *, struct type *) +#define RB_PROTOTYPE_NEXT(name, type, attr) \ + attr struct type *name##_RB_NEXT(struct type *) +#define RB_PROTOTYPE_PREV(name, type, attr) \ + attr struct type *name##_RB_PREV(struct type *) +#define RB_PROTOTYPE_MINMAX(name, type, attr) \ + attr struct type *name##_RB_MINMAX(struct name *, int) /* Main rb operation. * Moves node close to the key of elm to top @@ -402,6 +419,17 @@ attr struct type *name##_RB_MINMAX(struc #define RB_GENERATE_STATIC(name, type, field, cmp) \ RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static) #define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ + RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ + RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ + RB_GENERATE_INSERT(name, type, field, cmp, attr) \ + RB_GENERATE_REMOVE(name, type, field, attr) \ + RB_GENERATE_FIND(name, type, field, cmp, attr) \ + RB_GENERATE_NFIND(name, type, field, cmp, attr) \ + RB_GENERATE_NEXT(name, type, field, attr) \ + RB_GENERATE_PREV(name, type, field, attr) \ + RB_GENERATE_MINMAX(name, type, field, attr) + +#define RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ { \ @@ -444,8 +472,9 @@ name##_RB_INSERT_COLOR(struct name *head } \ } \ RB_COLOR(head->rbh_root, field) = RB_BLACK; \ -} \ - \ +} + +#define RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \ attr void \ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ { \ @@ -522,8 +551,9 @@ name##_RB_REMOVE_COLOR(struct name *head } \ if (elm) \ RB_COLOR(elm, field) = RB_BLACK; \ -} \ - \ +} + +#define RB_GENERATE_REMOVE(name, type, field, attr) \ attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ @@ -590,7 +620,8 @@ color: \ name##_RB_REMOVE_COLOR(head, parent, child); \ return (old); \ } \ - \ + +#define RB_GENERATE_INSERT(name, type, field, cmp, attr) \ /* Inserts a node into the RB tree */ \ attr struct type * \ name##_RB_INSERT(struct name *head, struct type *elm) \ @@ -620,8 +651,9 @@ name##_RB_INSERT(struct name *head, stru RB_ROOT(head) = elm; \ name##_RB_INSERT_COLOR(head, elm); \ return (NULL); \ -} \ - \ +} + +#define RB_GENERATE_FIND(name, type, field, cmp, attr) \ /* Finds the node with the same key as elm */ \ attr struct type * \ name##_RB_FIND(struct name *head, struct type *elm) \ @@ -638,8 +670,9 @@ name##_RB_FIND(struct name *head, struct return (tmp); \ } \ return (NULL); \ -} \ - \ +} + +#define RB_GENERATE_NFIND(name, type, field, cmp, attr) \ /* Finds the first node greater than or equal to the search key */ \ attr struct type * \ name##_RB_NFIND(struct name *head, struct type *elm) \ @@ -659,8 +692,9 @@ name##_RB_NFIND(struct name *head, struc return (tmp); \ } \ return (res); \ -} \ - \ +} + +#define RB_GENERATE_NEXT(name, type, field, attr) \ /* ARGSUSED */ \ attr struct type * \ name##_RB_NEXT(struct type *elm) \ @@ -681,8 +715,9 @@ name##_RB_NEXT(struct type *elm) \ } \ } \ return (elm); \ -} \ - \ +} + +#define RB_GENERATE_PREV(name, type, field, attr) \ /* ARGSUSED */ \ attr struct type * \ name##_RB_PREV(struct type *elm) \ @@ -703,8 +738,9 @@ name##_RB_PREV(struct type *elm) \ } \ } \ return (elm); \ -} \ - \ +} + +#define RB_GENERATE_MINMAX(name, type, field, attr) \ attr struct type * \ name##_RB_MINMAX(struct name *head, int val) \ { \ From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 12:51:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCC024AB; Sat, 24 Jan 2015 12:51:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE959C98; Sat, 24 Jan 2015 12:51:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OCpHBO053456; Sat, 24 Jan 2015 12:51:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OCpGa8053192; Sat, 24 Jan 2015 12:51:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501241251.t0OCpGa8053192@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 24 Jan 2015 12:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 12:51:18 -0000 Author: kib Date: Sat Jan 24 12:51:15 2015 New Revision: 277643 URL: https://svnweb.freebsd.org/changeset/base/277643 Log: Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed for i386, and from the code inspection, nothing in the arm/mips/sparc64 implementations depends on it. Discussed with: imp, nwhitehorn Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/arm/arm/mem.c head/sys/dev/mem/memdev.c head/sys/i386/i386/mem.c head/sys/mips/mips/mem.c head/sys/sparc64/sparc64/mem.c Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Sat Jan 24 12:43:36 2015 (r277642) +++ head/sys/arm/arm/mem.c Sat Jan 24 12:51:15 2015 (r277643) @@ -82,8 +82,6 @@ memrw(struct cdev *dev, struct uio *uio, int error = 0; vm_offset_t addr, eaddr; - GIANT_REQUIRED; - while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { Modified: head/sys/dev/mem/memdev.c ============================================================================== --- head/sys/dev/mem/memdev.c Sat Jan 24 12:43:36 2015 (r277642) +++ head/sys/dev/mem/memdev.c Sat Jan 24 12:51:15 2015 (r277643) @@ -52,7 +52,7 @@ static struct cdev *memdev, *kmemdev; static struct cdevsw mem_cdevsw = { .d_version = D_VERSION, - .d_flags = D_MEM|D_NEEDGIANT, + .d_flags = D_MEM, .d_open = memopen, .d_read = memrw, .d_write = memrw, Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Sat Jan 24 12:43:36 2015 (r277642) +++ head/sys/i386/i386/mem.c Sat Jan 24 12:51:15 2015 (r277643) @@ -86,10 +86,6 @@ memrw(struct cdev *dev, struct uio *uio, int error = 0; vm_offset_t addr; - /* XXX UPS Why ? */ - GIANT_REQUIRED; - - if (dev2unit(dev) != CDEV_MINOR_MEM && dev2unit(dev) != CDEV_MINOR_KMEM) return EIO; Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Sat Jan 24 12:43:36 2015 (r277642) +++ head/sys/mips/mips/mem.c Sat Jan 24 12:51:15 2015 (r277643) @@ -85,8 +85,6 @@ memrw(struct cdev *dev, struct uio *uio, cnt = 0; error = 0; - GIANT_REQUIRED; - pmap_page_init(&m); while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Sat Jan 24 12:43:36 2015 (r277642) +++ head/sys/sparc64/sparc64/mem.c Sat Jan 24 12:51:15 2015 (r277643) @@ -99,8 +99,6 @@ memrw(struct cdev *dev, struct uio *uio, error = 0; ova = 0; - GIANT_REQUIRED; - while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 13:07:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8902280A; Sat, 24 Jan 2015 13:07:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74724E38; Sat, 24 Jan 2015 13:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OD7AeQ061261; Sat, 24 Jan 2015 13:07:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OD78D2061246; Sat, 24 Jan 2015 13:07:08 GMT (envelope-from br@FreeBSD.org) Message-Id: <201501241307.t0OD78D2061246@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 24 Jan 2015 13:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277644 - in head/sys: arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 13:07:10 -0000 Author: br Date: Sat Jan 24 13:07:07 2015 New Revision: 277644 URL: https://svnweb.freebsd.org/changeset/base/277644 Log: Add support for audio transmitting, include drivers for: o Digital Audio Multiplexer (AUDMUX) o Smart Direct Memory Access Controller (SDMA) o Synchronous Serial Interface (SSI) Disable by default as it depends on SDMA firmware. Sponsored by: Machdep, Inc. Added: head/sys/arm/freescale/imx/imx6_audmux.c (contents, props changed) head/sys/arm/freescale/imx/imx6_sdma.c (contents, props changed) head/sys/arm/freescale/imx/imx6_sdma.h (contents, props changed) head/sys/arm/freescale/imx/imx6_ssi.c (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_anatopreg.h head/sys/arm/freescale/imx/imx6_anatopvar.h head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h head/sys/boot/fdt/dts/arm/apalis-imx6.dts head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/files.imx6 Sat Jan 24 13:07:07 2015 (r277644) @@ -28,6 +28,9 @@ arm/freescale/imx/imx_machdep.c standar arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio arm/freescale/imx/imx_i2c.c optional fsliic +arm/freescale/imx/imx6_sdma.c optional sdma +arm/freescale/imx/imx6_audmux.c optional sound +arm/freescale/imx/imx6_ssi.c optional sound # # Optional devices. @@ -52,3 +55,19 @@ arm/freescale/imx/imx6_usbphy.c optiona # Not ready yet... # #arm/freescale/imx/imx51_ipuv3.c optional sc + +# SDMA firmware +sdma_fw.c optional sdma_fw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk sdma-imx6q-to1.bin:sdma_fw -msdma -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "sdma_fw.c" +sdma-imx6q-to1.fwo optional sdma_fw \ + dependency "sdma-imx6q-to1.bin" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} sdma-imx6q-to1.bin" \ + no-implicit-rule \ + clean "sdma-imx6q-to1.fwo" +sdma-imx6q-to1.bin optional sdma_fw \ + dependency "$S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ + compile-with "uudecode < $S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ + no-obj no-implicit-rule \ + clean "sdma-imx6q-to1.bin" Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/imx6_anatop.c Sat Jan 24 13:07:07 2015 (r277644) @@ -710,6 +710,27 @@ out: return (err); } +uint32_t +pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd) +{ + int reg; + + /* + * Audio PLL (PLL4). + * PLL output frequency = Fref * (DIV_SELECT + NUM/DENOM) + */ + + reg = (IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE); + reg &= ~(IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK << \ + IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT); + reg |= (mfi << IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO, reg); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO_NUM, mfn); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO_DENOM, mfd); + + return (0); +} + static int imx6_anatop_probe(device_t dev) { Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopreg.h Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/imx6_anatopreg.h Sat Jan 24 13:07:07 2015 (r277644) @@ -58,6 +58,9 @@ #define IMX6_ANALOG_CCM_PLL_SYS_NUM 0x050 #define IMX6_ANALOG_CCM_PLL_SYS_DENOM 0x060 #define IMX6_ANALOG_CCM_PLL_AUDIO 0x070 +#define IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE (1 << 13) +#define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT 0 +#define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK 0x7f #define IMX6_ANALOG_CCM_PLL_AUDIO_SET 0x074 #define IMX6_ANALOG_CCM_PLL_AUDIO_CLR 0x078 #define IMX6_ANALOG_CCM_PLL_AUDIO_TOG 0x07C Modified: head/sys/arm/freescale/imx/imx6_anatopvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopvar.h Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/imx6_anatopvar.h Sat Jan 24 13:07:07 2015 (r277644) @@ -42,4 +42,6 @@ void imx6_anatop_write_4(bus_size_t _off uint32_t imx6_get_cpu_clock(void); +uint32_t pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd); + #endif Added: head/sys/arm/freescale/imx/imx6_audmux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_audmux.c Sat Jan 24 13:07:07 2015 (r277644) @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * i.MX6 Digital Audio Multiplexer (AUDMUX) + * Chapter 16, i.MX 6Dual/6Quad Applications Processor Reference Manual, + * Rev. 1, 04/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) + +#define AUDMUX_PTCR(n) (0x8 * (n - 1)) /* Port Timing Control Register */ +#define PTCR_TFS_DIR (1 << 31) /* Transmit Frame Sync Direction Control */ +#define PTCR_TFSEL_S 27 /* Transmit Frame Sync Select */ +#define PTCR_TFSEL_M 0xf +#define PTCR_TCLKDIR (1 << 26) /* Transmit Clock Direction Control */ +#define PTCR_TCSEL_S 22 /* Transmit Clock Select. */ +#define PTCR_TCSEL_M 0xf +#define PTCR_RFS_DIR (1 << 21) /* Receive Frame Sync Direction Control */ +#define PTCR_SYN (1 << 11) +#define AUDMUX_PDCR(n) (0x8 * (n - 1) + 0x4) /* Port Data Control Reg */ +#define PDCR_RXDSEL_S 13 /* Receive Data Select */ +#define PDCR_RXDSEL_M 0x3 +#define PDCR_RXDSEL_PORT(n) (n - 1) + +struct audmux_softc { + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; +}; + +static struct resource_spec audmux_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +audmux_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx6q-audmux")) + return (ENXIO); + + device_set_desc(dev, "i.MX6 Digital Audio Multiplexer"); + return (BUS_PROBE_DEFAULT); +} + +static int +audmux_configure(struct audmux_softc *sc, + int ssi_port, int audmux_port) +{ + uint32_t reg; + + /* Direction: output */ + reg = (PTCR_TFS_DIR | PTCR_TCLKDIR | PTCR_SYN); + WRITE4(sc, AUDMUX_PTCR(audmux_port), reg); + + /* Select source */ + reg = (PDCR_RXDSEL_PORT(ssi_port) << PDCR_RXDSEL_S); + WRITE4(sc, AUDMUX_PDCR(audmux_port), reg); + + return (0); +} + +static int +audmux_attach(device_t dev) +{ + struct audmux_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, audmux_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* + * Direct SSI1 output to AUDMUX5 pins. + * TODO: dehardcore this. + */ + audmux_configure(sc, 1, 5); + + return (0); +}; + +static device_method_t audmux_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, audmux_probe), + DEVMETHOD(device_attach, audmux_attach), + { 0, 0 } +}; + +static driver_t audmux_driver = { + "audmux", + audmux_methods, + sizeof(struct audmux_softc), +}; + +static devclass_t audmux_devclass; + +DRIVER_MODULE(audmux, simplebus, audmux_driver, audmux_devclass, 0, 0); Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/imx6_ccm.c Sat Jan 24 13:07:07 2015 (r277644) @@ -94,7 +94,7 @@ ccm_init_gates(struct ccm_softc *sc) WR4(sc, CCM_CCGR2, 0x0fffffc0); /* ipmux & ipsync (bridges), iomux, i2c */ WR4(sc, CCM_CCGR3, 0x3ff00000); /* DDR memory controller */ WR4(sc, CCM_CCGR4, 0x0000f300); /* pl301 bus crossbar */ - WR4(sc, CCM_CCGR5, 0x0f000000); /* uarts */ + WR4(sc, CCM_CCGR5, 0x0ffc00c0); /* uarts, ssi, sdma */ WR4(sc, CCM_CCGR6, 0x000000ff); /* usdhc 1-4 */ } @@ -180,6 +180,58 @@ ccm_probe(device_t dev) } void +imx_ccm_ssi_configure(device_t _ssidev) +{ + struct ccm_softc *sc; + uint32_t reg; + + sc = ccm_sc; + + /* + * Select PLL4 (Audio PLL) clock multiplexer as source. + * PLL output frequency = Fref * (DIV_SELECT + NUM/DENOM). + */ + + reg = RD4(sc, CCM_CSCMR1); + reg &= ~(SSI_CLK_SEL_M << SSI1_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI1_CLK_SEL_S); + reg &= ~(SSI_CLK_SEL_M << SSI2_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI2_CLK_SEL_S); + reg &= ~(SSI_CLK_SEL_M << SSI3_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI3_CLK_SEL_S); + WR4(sc, CCM_CSCMR1, reg); + + /* + * Ensure we have set hardware-default values + * for pre and post dividers. + */ + + /* SSI1 and SSI3 */ + reg = RD4(sc, CCM_CS1CDR); + /* Divide by 2 */ + reg &= ~(SSI_CLK_PODF_MASK << SSI1_CLK_PODF_SHIFT); + reg &= ~(SSI_CLK_PODF_MASK << SSI3_CLK_PODF_SHIFT); + reg |= (0x1 << SSI1_CLK_PODF_SHIFT); + reg |= (0x1 << SSI3_CLK_PODF_SHIFT); + /* Divide by 4 */ + reg &= ~(SSI_CLK_PRED_MASK << SSI1_CLK_PRED_SHIFT); + reg &= ~(SSI_CLK_PRED_MASK << SSI3_CLK_PRED_SHIFT); + reg |= (0x3 << SSI1_CLK_PRED_SHIFT); + reg |= (0x3 << SSI3_CLK_PRED_SHIFT); + WR4(sc, CCM_CS1CDR, reg); + + /* SSI2 */ + reg = RD4(sc, CCM_CS2CDR); + /* Divide by 2 */ + reg &= ~(SSI_CLK_PODF_MASK << SSI2_CLK_PODF_SHIFT); + reg |= (0x1 << SSI2_CLK_PODF_SHIFT); + /* Divide by 4 */ + reg &= ~(SSI_CLK_PRED_MASK << SSI2_CLK_PRED_SHIFT); + reg |= (0x3 << SSI2_CLK_PRED_SHIFT); + WR4(sc, CCM_CS2CDR, reg); +} + +void imx_ccm_usb_enable(device_t _usbdev) { Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Sat Jan 24 12:51:15 2015 (r277643) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Sat Jan 24 13:07:07 2015 (r277644) @@ -29,6 +29,26 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CSCMR1 0x01C +#define SSI1_CLK_SEL_S 10 +#define SSI2_CLK_SEL_S 12 +#define SSI3_CLK_SEL_S 14 +#define SSI_CLK_SEL_M 0x3 +#define SSI_CLK_SEL_508_PFD 0 +#define SSI_CLK_SEL_454_PFD 1 +#define SSI_CLK_SEL_PLL4 2 +#define CCM_CSCMR2 0x020 +#define CCM_CS1CDR 0x028 +#define SSI1_CLK_PODF_SHIFT 0 +#define SSI1_CLK_PRED_SHIFT 6 +#define SSI3_CLK_PODF_SHIFT 16 +#define SSI3_CLK_PRED_SHIFT 22 +#define SSI_CLK_PODF_MASK 0x3f +#define SSI_CLK_PRED_MASK 0x7 +#define CCM_CS2CDR 0x02C +#define SSI2_CLK_PODF_SHIFT 0 +#define SSI2_CLK_PRED_SHIFT 6 +#define CCM_CSCDR2 0x038 #define CCM_CLPCR 0x054 #define CCM_CLPCR_LPM_MASK 0x03 #define CCM_CLPCR_LPM_RUN 0x00 Added: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_sdma.c Sat Jan 24 13:07:07 2015 (r277644) @@ -0,0 +1,518 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * i.MX6 Smart Direct Memory Access Controller (sDMA) + * Chapter 41, i.MX 6Dual/6Quad Applications Processor Reference Manual, + * Rev. 1, 04/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define MAX_BD (PAGE_SIZE / sizeof(struct sdma_buffer_descriptor)) + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) + +struct sdma_softc *sdma_sc; + +static struct resource_spec sdma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void +sdma_intr(void *arg) +{ + struct sdma_buffer_descriptor *bd; + struct sdma_channel *channel; + struct sdma_conf *conf; + struct sdma_softc *sc; + int pending; + int i; + int j; + + sc = arg; + + pending = READ4(sc, SDMAARM_INTR); + + /* Ack intr */ + WRITE4(sc, SDMAARM_INTR, pending); + + for (i = 0; i < SDMA_N_CHANNELS; i++) { + if ((pending & (1 << i)) == 0) + continue; + channel = &sc->channel[i]; + conf = channel->conf; + if (!conf) + continue; + for (j = 0; j < conf->num_bd; j++) { + bd = &channel->bd[j]; + bd->mode.status |= BD_DONE; + if (bd->mode.status & BD_RROR) + printf("sDMA error\n"); + } + + conf->ih(conf->ih_user, 1); + + WRITE4(sc, SDMAARM_HSTART, (1 << i)); + } +} + +static int +sdma_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx6q-sdma")) + return (ENXIO); + + device_set_desc(dev, "i.MX6 Smart Direct Memory Access Controller"); + return (BUS_PROBE_DEFAULT); +} + +int +sdma_start(int chn) +{ + struct sdma_softc *sc; + + sc = sdma_sc; + + WRITE4(sc, SDMAARM_HSTART, (1 << chn)); + + return (0); +} + +int +sdma_stop(int chn) +{ + struct sdma_softc *sc; + + sc = sdma_sc; + + WRITE4(sc, SDMAARM_STOP_STAT, (1 << chn)); + + return (0); +} + +int +sdma_alloc(void) +{ + struct sdma_channel *channel; + struct sdma_softc *sc; + int found; + int chn; + int i; + + sc = sdma_sc; + found = 0; + + /* Channel 0 can't be used */ + for (i = 1; i < SDMA_N_CHANNELS; i++) { + channel = &sc->channel[i]; + if (channel->in_use == 0) { + channel->in_use = 1; + found = 1; + break; + } + } + + if (!found) + return (-1); + + chn = i; + + /* Allocate area for buffer descriptors */ + channel->bd = (void *)kmem_alloc_contig(kernel_arena, + PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); + + return (chn); +} + +int +sdma_free(int chn) +{ + struct sdma_channel *channel; + struct sdma_softc *sc; + + sc = sdma_sc; + + channel = &sc->channel[chn]; + channel->in_use = 0; + + kmem_free(kernel_arena, (vm_offset_t)channel->bd, + PAGE_SIZE); + + return (0); +} + +static int +sdma_overrides(struct sdma_softc *sc, int chn, + int evt, int host, int dsp) +{ + int reg; + + /* Ignore sDMA requests */ + reg = READ4(sc, SDMAARM_EVTOVR); + if (evt) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_EVTOVR, reg); + + /* Ignore enable bit (HE) */ + reg = READ4(sc, SDMAARM_HOSTOVR); + if (host) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_HOSTOVR, reg); + + /* Prevent sDMA channel from starting */ + reg = READ4(sc, SDMAARM_DSPOVR); + if (!dsp) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_DSPOVR, reg); + + return (0); +} + +int +sdma_configure(int chn, struct sdma_conf *conf) +{ + struct sdma_buffer_descriptor *bd0; + struct sdma_buffer_descriptor *bd; + struct sdma_context_data *context; + struct sdma_channel *channel; + struct sdma_softc *sc; +#if 0 + int timeout; + int ret; +#endif + int i; + + sc = sdma_sc; + + channel = &sc->channel[chn]; + channel->conf = conf; + + /* Ensure operation has stopped */ + sdma_stop(chn); + + /* Set priority and enable the channel */ + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + WRITE4(sc, SDMAARM_CHNENBL(conf->event), (1 << chn)); + + sdma_overrides(sc, chn, 0, 0, 0); + + if (conf->num_bd > MAX_BD) { + device_printf(sc->dev, "Error: too much buffer" + " descriptors requested\n"); + return (-1); + } + + for (i = 0; i < conf->num_bd; i++) { + bd = &channel->bd[i]; + bd->mode.command = conf->command; + bd->mode.status = BD_DONE | BD_EXTD | BD_CONT | BD_INTR; + if (i == (conf->num_bd - 1)) + bd->mode.status |= BD_WRAP; + bd->mode.count = conf->period; + bd->buffer_addr = conf->saddr + (conf->period * i); + bd->ext_buffer_addr = 0; + } + + sc->ccb[chn].base_bd_ptr = vtophys(channel->bd); + sc->ccb[chn].current_bd_ptr = vtophys(channel->bd); + + /* + * Load context. + * + * i.MX6 Reference Manual: Appendix A SDMA Scripts + * A.3.1.7.1 (mcu_2_app) + */ + + /* + * TODO: allow using other scripts + */ + context = sc->context; + memset(context, 0, sizeof(*context)); + context->channel_state.pc = sc->fw_scripts->mcu_2_app_addr; + + /* + * Tx FIFO 0 address (r6) + * Event_mask (r1) + * Event2_mask (r0) + * Watermark level (r7) + */ + + if (conf->event > 32) { + context->gReg[0] = (1 << (conf->event % 32)); + context->gReg[1] = 0; + } else { + context->gReg[0] = 0; + context->gReg[1] = (1 << conf->event); + } + + context->gReg[6] = conf->daddr; + context->gReg[7] = conf->word_length; + + bd0 = sc->bd0; + bd0->mode.command = C0_SETDM; + bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.count = sizeof(*context) / 4; + bd0->buffer_addr = sc->context_phys; + bd0->ext_buffer_addr = 2048 + (sizeof(*context) / 4) * chn; + + WRITE4(sc, SDMAARM_HSTART, 1); + +#if 0 + /* Debug purposes */ + + timeout = 1000; + while (!(ret = READ4(sc, SDMAARM_INTR) & 1)) { + if (timeout-- <= 0) + break; + DELAY(10); + }; + + if (!ret) { + device_printf(sc->dev, "Failed to load context.\n"); + return (-1); + } + + WRITE4(sc, SDMAARM_INTR, ret); + + device_printf(sc->dev, "Context loaded successfully.\n"); +#endif + + return (0); +} + +static int +load_firmware(struct sdma_softc *sc) +{ + struct sdma_firmware_header *header; + const struct firmware *fp; + + fp = firmware_get("sdma_fw"); + if (fp == NULL) { + device_printf(sc->dev, "Can't get firmware.\n"); + return (-1); + } + + header = (struct sdma_firmware_header *)fp->data; + if (header->magic != FW_HEADER_MAGIC) { + device_printf(sc->dev, "Can't use firmware.\n"); + return (-1); + } + + sc->fw_header = header; + sc->fw_scripts = (void *)((char *)header + + header->script_addrs_start); + + return (0); +} + +static int +boot_firmware(struct sdma_softc *sc) +{ + struct sdma_buffer_descriptor *bd0; + uint32_t *ram_code; + int timeout; + int ret; + int chn; + int sz; + int i; + + ram_code = (void *)((char *)sc->fw_header + + sc->fw_header->ram_code_start); + + /* Make sure SDMA has not started yet */ + WRITE4(sc, SDMAARM_MC0PTR, 0); + + sz = SDMA_N_CHANNELS * sizeof(struct sdma_channel_control) + \ + sizeof(struct sdma_context_data); + sc->ccb = (void *)kmem_alloc_contig(kernel_arena, + sz, M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + sc->ccb_phys = vtophys(sc->ccb); + + sc->context = (void *)((char *)sc->ccb + \ + SDMA_N_CHANNELS * sizeof(struct sdma_channel_control)); + sc->context_phys = vtophys(sc->context); + + /* Disable all the channels */ + for (i = 0; i < SDMA_N_EVENTS; i++) + WRITE4(sc, SDMAARM_CHNENBL(i), 0); + + /* All channels have priority 0 */ + for (i = 0; i < SDMA_N_CHANNELS; i++) + WRITE4(sc, SDMAARM_SDMA_CHNPRI(i), 0); + + /* Channel 0 is used for booting firmware */ + chn = 0; + + sc->bd0 = (void *)kmem_alloc_contig(kernel_arena, + PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); + bd0 = sc->bd0; + sc->ccb[chn].base_bd_ptr = vtophys(bd0); + sc->ccb[chn].current_bd_ptr = vtophys(bd0); + + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + + sdma_overrides(sc, chn, 1, 0, 0); + + /* XXX: not sure what is that */ + WRITE4(sc, SDMAARM_CHN0ADDR, 0x4050); + + WRITE4(sc, SDMAARM_CONFIG, 0); + WRITE4(sc, SDMAARM_MC0PTR, sc->ccb_phys); + WRITE4(sc, SDMAARM_CONFIG, CONFIG_CSM); + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + + bd0->mode.command = C0_SETPM; + bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.count = sc->fw_header->ram_code_size / 2; + bd0->buffer_addr = vtophys(ram_code); + bd0->ext_buffer_addr = sc->fw_scripts->ram_code_start_addr; + + WRITE4(sc, SDMAARM_HSTART, 1); + + timeout = 100; + while (!(ret = READ4(sc, SDMAARM_INTR) & 1)) { + if (timeout-- <= 0) + break; + DELAY(10); + }; + + if (ret == 0) { + device_printf(sc->dev, "SDMA failed to boot\n"); + return (-1); + } + + WRITE4(sc, SDMAARM_INTR, ret); + +#if 0 + device_printf(sc->dev, "SDMA booted successfully.\n"); +#endif + + /* Debug is disabled */ + WRITE4(sc, SDMAARM_ONCE_ENB, 0); + + return (0); +} + +static int +sdma_attach(device_t dev) +{ + struct sdma_softc *sc; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, sdma_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + sdma_sc = sc; + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, sdma_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + if (load_firmware(sc) == -1) + return (ENXIO); + + if (boot_firmware(sc) == -1) + return (ENXIO); + + return (0); +}; + +static device_method_t sdma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sdma_probe), + DEVMETHOD(device_attach, sdma_attach), + { 0, 0 } +}; + +static driver_t sdma_driver = { + "sdma", + sdma_methods, + sizeof(struct sdma_softc), +}; + +static devclass_t sdma_devclass; + +DRIVER_MODULE(sdma, simplebus, sdma_driver, sdma_devclass, 0, 0); Added: head/sys/arm/freescale/imx/imx6_sdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_sdma.h Sat Jan 24 13:07:07 2015 (r277644) @@ -0,0 +1,245 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define SDMAARM_MC0PTR 0x00 /* ARM platform Channel 0 Pointer */ +#define SDMAARM_INTR 0x04 /* Channel Interrupts */ +#define SDMAARM_STOP_STAT 0x08 /* Channel Stop/Channel Status */ +#define SDMAARM_HSTART 0x0C /* Channel Start */ +#define SDMAARM_EVTOVR 0x10 /* Channel Event Override */ +#define SDMAARM_DSPOVR 0x14 /* Channel BP Override */ +#define SDMAARM_HOSTOVR 0x18 /* Channel ARM platform Override */ +#define SDMAARM_EVTPEND 0x1C /* Channel Event Pending */ +#define SDMAARM_RESET 0x24 /* Reset Register */ +#define SDMAARM_EVTERR 0x28 /* DMA Request Error Register */ +#define SDMAARM_INTRMASK 0x2C /* Channel ARM platform Interrupt Mask */ +#define SDMAARM_PSW 0x30 /* Schedule Status */ +#define SDMAARM_EVTERRDBG 0x34 /* DMA Request Error Register */ +#define SDMAARM_CONFIG 0x38 /* Configuration Register */ +#define CONFIG_CSM 0x3 +#define SDMAARM_SDMA_LOCK 0x3C /* SDMA LOCK */ +#define SDMAARM_ONCE_ENB 0x40 /* OnCE Enable */ +#define SDMAARM_ONCE_DATA 0x44 /* OnCE Data Register */ +#define SDMAARM_ONCE_INSTR 0x48 /* OnCE Instruction Register */ +#define SDMAARM_ONCE_STAT 0x4C /* OnCE Status Register */ +#define SDMAARM_ONCE_CMD 0x50 /* OnCE Command Register */ +#define SDMAARM_ILLINSTADDR 0x58 /* Illegal Instruction Trap Address */ +#define SDMAARM_CHN0ADDR 0x5C /* Channel 0 Boot Address */ +#define SDMAARM_EVT_MIRROR 0x60 /* DMA Requests */ +#define SDMAARM_EVT_MIRROR2 0x64 /* DMA Requests 2 */ +#define SDMAARM_XTRIG_CONF1 0x70 /* Cross-Trigger Events Configuration Register 1 */ +#define SDMAARM_XTRIG_CONF2 0x74 /* Cross-Trigger Events Configuration Register 2 */ +#define SDMAARM_SDMA_CHNPRI(n) (0x100 + 0x4 * n) /* Channel Priority Registers */ +#define SDMAARM_CHNENBL(n) (0x200 + 0x4 * n) /* Channel Enable RAM */ + +/* SDMA Event Mappings */ +#define SSI1_RX_1 35 +#define SSI1_TX_1 36 +#define SSI1_RX_0 37 +#define SSI1_TX_0 38 +#define SSI2_RX_1 39 +#define SSI2_TX_1 40 +#define SSI2_RX_0 41 +#define SSI2_TX_0 42 +#define SSI3_RX_1 43 +#define SSI3_TX_1 44 +#define SSI3_RX_0 45 +#define SSI3_TX_0 46 + +#define C0_ADDR 0x01 +#define C0_LOAD 0x02 +#define C0_DUMP 0x03 +#define C0_SETCTX 0x07 +#define C0_GETCTX 0x03 +#define C0_SETDM 0x01 +#define C0_SETPM 0x04 +#define C0_GETDM 0x02 +#define C0_GETPM 0x08 + +#define BD_DONE 0x01 +#define BD_WRAP 0x02 +#define BD_CONT 0x04 +#define BD_INTR 0x08 +#define BD_RROR 0x10 +#define BD_LAST 0x20 +#define BD_EXTD 0x80 + +/* sDMA data transfer length */ +#define CMD_4BYTES 0 +#define CMD_3BYTES 3 +#define CMD_2BYTES 2 +#define CMD_1BYTES 1 + +struct sdma_firmware_header { + uint32_t magic; + uint32_t version_major; + uint32_t version_minor; + uint32_t script_addrs_start; + uint32_t num_script_addrs; + uint32_t ram_code_start; + uint32_t ram_code_size; +}; + +struct sdma_mode_count { + uint16_t count; + uint8_t status; + uint8_t command; +}; + +struct sdma_buffer_descriptor { + struct sdma_mode_count mode; + uint32_t buffer_addr; + uint32_t ext_buffer_addr; +} __packed; + +struct sdma_channel_control { + uint32_t current_bd_ptr; + uint32_t base_bd_ptr; + uint32_t unused[2]; +} __packed; + +struct sdma_state_registers { + uint32_t pc :14; + uint32_t unused1: 1; + uint32_t t : 1; + uint32_t rpc :14; + uint32_t unused0: 1; + uint32_t sf : 1; + uint32_t spc :14; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 13:50:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27405E2D; Sat, 24 Jan 2015 13:50:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 085691DF; Sat, 24 Jan 2015 13:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0ODoE0j080356; Sat, 24 Jan 2015 13:50:14 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0ODoEFD080352; Sat, 24 Jan 2015 13:50:14 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501241350.t0ODoEFD080352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 24 Jan 2015 13:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277645 - in head: bin/cp bin/mv usr.bin/touch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 13:50:15 -0000 Author: jilles Date: Sat Jan 24 13:50:13 2015 New Revision: 277645 URL: https://svnweb.freebsd.org/changeset/base/277645 Log: cp,mv,touch: Set timestamps with nanosecond precision. This uses utimensat(). Modified: head/bin/cp/utils.c head/bin/mv/mv.c head/usr.bin/touch/touch.c Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Sat Jan 24 13:07:07 2015 (r277644) +++ head/bin/cp/utils.c Sat Jan 24 13:50:13 2015 (r277645) @@ -330,7 +330,7 @@ copy_special(struct stat *from_stat, int int setfile(struct stat *fs, int fd) { - static struct timeval tv[2]; + static struct timespec tspec[2]; struct stat ts; int rval, gotstat, islink, fdval; @@ -340,10 +340,11 @@ setfile(struct stat *fs, int fd) fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO; - TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atim); - TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtim); - if (islink ? lutimes(to.p_path, tv) : utimes(to.p_path, tv)) { - warn("%sutimes: %s", islink ? "l" : "", to.p_path); + tspec[0] = fs->st_atim; + tspec[1] = fs->st_mtim; + if (utimensat(AT_FDCWD, to.p_path, tspec, + islink ? AT_SYMLINK_NOFOLLOW : 0)) { + warn("utimensat: %s", to.p_path); rval = 1; } if (fdval ? fstat(fd, &ts) : Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Sat Jan 24 13:07:07 2015 (r277644) +++ head/bin/mv/mv.c Sat Jan 24 13:50:13 2015 (r277645) @@ -273,7 +273,7 @@ do_move(const char *from, const char *to static int fastcopy(const char *from, const char *to, struct stat *sbp) { - struct timeval tval[2]; + struct timespec ts[2]; static u_int blen = MAXPHYS; static char *bp = NULL; mode_t oldmode; @@ -350,10 +350,9 @@ err: if (unlink(to)) } else warn("%s: cannot stat", to); - tval[0].tv_sec = sbp->st_atime; - tval[1].tv_sec = sbp->st_mtime; - tval[0].tv_usec = tval[1].tv_usec = 0; - if (utimes(to, tval)) + ts[0] = sbp->st_atim; + ts[1] = sbp->st_mtim; + if (utimensat(AT_FDCWD, to, ts, 0)) warn("%s: set times", to); if (close(to_fd)) { Modified: head/usr.bin/touch/touch.c ============================================================================== --- head/usr.bin/touch/touch.c Sat Jan 24 13:07:07 2015 (r277644) +++ head/usr.bin/touch/touch.c Sat Jan 24 13:50:13 2015 (r277645) @@ -56,10 +56,10 @@ static const char sccsid[] = "@(#)touch. #include #include -static void stime_arg1(const char *, struct timeval *); -static void stime_arg2(const char *, int, struct timeval *); -static void stime_darg(const char *, struct timeval *); -static void stime_file(const char *, struct timeval *); +static void stime_arg1(const char *, struct timespec *); +static void stime_arg2(const char *, int, struct timespec *); +static void stime_darg(const char *, struct timespec *); +static void stime_file(const char *, struct timespec *); static int timeoffset(const char *); static void usage(const char *); @@ -67,19 +67,17 @@ int main(int argc, char *argv[]) { struct stat sb; - struct timeval tv[2]; - int (*stat_f)(const char *, struct stat *); - int (*utimes_f)(const char *, const struct timeval *); + struct timespec ts[2]; + int atflag; int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; char *p; char *myname; myname = basename(argv[0]); Aflag = aflag = cflag = mflag = timeset = 0; - stat_f = stat; - utimes_f = utimes; - if (gettimeofday(&tv[0], NULL) == -1) - err(1, "gettimeofday"); + atflag = 0; + if (clock_gettime(CLOCK_REALTIME, &ts[0]) == -1) + err(1, "clock_gettime(CLOCK_REALTIME)"); while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) switch(ch) { @@ -94,26 +92,25 @@ main(int argc, char *argv[]) break; case 'd': timeset = 1; - stime_darg(optarg, tv); + stime_darg(optarg, ts); break; case 'f': /* No-op for compatibility. */ break; case 'h': cflag = 1; - stat_f = lstat; - utimes_f = lutimes; + atflag = AT_SYMLINK_NOFOLLOW; break; case 'm': mflag = 1; break; case 'r': timeset = 1; - stime_file(optarg, tv); + stime_file(optarg, ts); break; case 't': timeset = 1; - stime_arg1(optarg, tv); + stime_arg1(optarg, ts); break; default: usage(myname); @@ -132,9 +129,9 @@ main(int argc, char *argv[]) * that time once and for all here. */ if (aflag) - tv[0].tv_sec += Aflag; + ts[0].tv_sec += Aflag; if (mflag) - tv[1].tv_sec += Aflag; + ts[1].tv_sec += Aflag; Aflag = 0; /* done our job */ } } else { @@ -148,11 +145,11 @@ main(int argc, char *argv[]) len = p - argv[0]; if (*p == '\0' && (len == 8 || len == 10)) { timeset = 1; - stime_arg2(*argv++, len == 10, tv); + stime_arg2(*argv++, len == 10, ts); } } /* Both times default to the same. */ - tv[1] = tv[0]; + ts[1] = ts[0]; } if (*argv == NULL) @@ -163,7 +160,7 @@ main(int argc, char *argv[]) for (rval = 0; *argv; ++argv) { /* See if the file exists. */ - if (stat_f(*argv, &sb) != 0) { + if (fstatat(AT_FDCWD, *argv, &sb, atflag) != 0) { if (errno != ENOENT) { rval = 1; warn("%s", *argv); @@ -187,9 +184,9 @@ main(int argc, char *argv[]) } if (!aflag) - TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim); + ts[0] = sb.st_atim; if (!mflag) - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); + ts[1] = sb.st_mtim; /* * We're adjusting the times based on the file times, not a @@ -197,17 +194,17 @@ main(int argc, char *argv[]) */ if (Aflag) { if (aflag) { - TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atim); - tv[0].tv_sec += Aflag; + ts[0] = sb.st_atim; + ts[0].tv_sec += Aflag; } if (mflag) { - TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); - tv[1].tv_sec += Aflag; + ts[1] = sb.st_mtim; + ts[1].tv_sec += Aflag; } } - /* Try utimes(2). */ - if (!utimes_f(*argv, tv)) + /* Try utimensat(2). */ + if (!utimensat(AT_FDCWD, *argv, ts, atflag)) continue; /* If the user specified a time, nothing else we can do. */ @@ -223,7 +220,7 @@ main(int argc, char *argv[]) * The permission checks are different, too, in that the * ability to write the file is sufficient. Take a shot. */ - if (!utimes_f(*argv, NULL)) + if (!utimensat(AT_FDCWD, *argv, NULL, atflag)) continue; rval = 1; @@ -235,7 +232,7 @@ main(int argc, char *argv[]) #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; static void -stime_arg1(const char *arg, struct timeval *tvp) +stime_arg1(const char *arg, struct timespec *tvp) { time_t now; struct tm *t; @@ -291,7 +288,7 @@ stime_arg1(const char *arg, struct timev if (tvp[0].tv_sec == -1) goto terr; - tvp[0].tv_usec = tvp[1].tv_usec = 0; + tvp[0].tv_nsec = tvp[1].tv_nsec = 0; return; terr: @@ -299,7 +296,7 @@ terr: } static void -stime_arg2(const char *arg, int year, struct timeval *tvp) +stime_arg2(const char *arg, int year, struct timespec *tvp) { time_t now; struct tm *t; @@ -325,18 +322,18 @@ stime_arg2(const char *arg, int year, st errx(1, "out of range or illegal time specification: MMDDhhmm[yy]"); - tvp[0].tv_usec = tvp[1].tv_usec = 0; + tvp[0].tv_nsec = tvp[1].tv_nsec = 0; } static void -stime_darg(const char *arg, struct timeval *tvp) +stime_darg(const char *arg, struct timespec *tvp) { struct tm t = { .tm_sec = 0 }; const char *fmt, *colon; char *p; int val, isutc = 0; - tvp[0].tv_usec = 0; + tvp[0].tv_nsec = 0; t.tm_isdst = -1; colon = strchr(arg, ':'); if (colon == NULL || strchr(colon + 1, ':') == NULL) @@ -349,9 +346,9 @@ stime_darg(const char *arg, struct timev /* POSIX: must have at least one digit after dot */ if ((*p == '.' || *p == ',') && isdigit((unsigned char)p[1])) { p++; - val = 100000; + val = 100000000; while (isdigit((unsigned char)*p)) { - tvp[0].tv_usec += val * (*p - '0'); + tvp[0].tv_nsec += val * (*p - '0'); p++; val /= 10; } @@ -403,14 +400,14 @@ timeoffset(const char *arg) } static void -stime_file(const char *fname, struct timeval *tvp) +stime_file(const char *fname, struct timespec *tsp) { struct stat sb; if (stat(fname, &sb)) err(1, "%s", fname); - TIMESPEC_TO_TIMEVAL(tvp, &sb.st_atim); - TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); + tsp[0] = sb.st_atim; + tsp[1] = sb.st_mtim; } static void From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:25:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A9A4F83; Sat, 24 Jan 2015 15:25:37 +0000 (UTC) Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [54.149.88.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A956C6B; Sat, 24 Jan 2015 15:25:37 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YF28e-0002G5-2o; Sat, 24 Jan 2015 14:56:40 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0OEub74026935; Sat, 24 Jan 2015 07:56:37 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19pLfVgL+8Oo5lSp1/4cQn9 Message-ID: <1422111397.1038.53.camel@freebsd.org> Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 From: Ian Lepore To: Konstantin Belousov Date: Sat, 24 Jan 2015 07:56:37 -0700 In-Reply-To: <201501241251.t0OCpGa8053192@svn.freebsd.org> References: <201501241251.t0OCpGa8053192@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:25:37 -0000 On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Jan 24 12:51:15 2015 > New Revision: 277643 > URL: https://svnweb.freebsd.org/changeset/base/277643 > > Log: > Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed > for i386, and from the code inspection, nothing in the > arm/mips/sparc64 implementations depends on it. > I'm not sure I agree with that. On arm the memrw() implementation uses a single statically-allocated page of kva space into which it maps each physical page in turn in the main loop. What prevents preemption or multicore access to /dev/mem from trying to use that single page for multiple operations at once? -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:33:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6E5A255; Sat, 24 Jan 2015 15:33:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76372D30; Sat, 24 Jan 2015 15:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OFXhPj032390; Sat, 24 Jan 2015 15:33:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OFXh2w032389; Sat, 24 Jan 2015 15:33:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501241533.t0OFXh2w032389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 24 Jan 2015 15:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277646 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:33:43 -0000 Author: kib Date: Sat Jan 24 15:33:42 2015 New Revision: 277646 URL: https://svnweb.freebsd.org/changeset/base/277646 Log: Avoid calling vmspace_free() while owning the process lock. Freeing of an vm space may require obtaining sleepable locks. Hold the process to keep the pointer valid, and change trylock to lock, since there is no longer two process locks owned simultaneously in vm_pageout_oom(). Note that after the process lock is dropped, process might exec, and no longer qualify as the owner of biggest vm space. In collaboration with: rstone Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Jan 24 13:50:13 2015 (r277645) +++ head/sys/vm/vm_pageout.c Sat Jan 24 15:33:42 2015 (r277646) @@ -1516,15 +1516,15 @@ vm_pageout_oom(int shortage) FOREACH_PROC_IN_SYSTEM(p) { int breakout; - if (PROC_TRYLOCK(p) == 0) - continue; + PROC_LOCK(p); + /* * If this is a system, protected or killed process, skip it. */ - if (p->p_state != PRS_NORMAL || - (p->p_flag & (P_INEXEC | P_PROTECTED | P_SYSTEM)) || - (p->p_pid == 1) || P_KILLED(p) || - ((p->p_pid < 48) && (swap_pager_avail != 0))) { + if (p->p_state != PRS_NORMAL || (p->p_flag & (P_INEXEC | + P_PROTECTED | P_SYSTEM | P_WEXIT)) != 0 || + p->p_pid == 1 || P_KILLED(p) || + (p->p_pid < 48 && swap_pager_avail != 0)) { PROC_UNLOCK(p); continue; } @@ -1557,11 +1557,14 @@ vm_pageout_oom(int shortage) PROC_UNLOCK(p); continue; } + _PHOLD(p); if (!vm_map_trylock_read(&vm->vm_map)) { - vmspace_free(vm); + _PRELE(p); PROC_UNLOCK(p); + vmspace_free(vm); continue; } + PROC_UNLOCK(p); size = vmspace_swap_count(vm); vm_map_unlock_read(&vm->vm_map); if (shortage == VM_OOM_MEM) @@ -1573,16 +1576,19 @@ vm_pageout_oom(int shortage) */ if (size > bigsize) { if (bigproc != NULL) - PROC_UNLOCK(bigproc); + PRELE(bigproc); bigproc = p; bigsize = size; - } else - PROC_UNLOCK(p); + } else { + PRELE(p); + } } sx_sunlock(&allproc_lock); if (bigproc != NULL) { + PROC_LOCK(bigproc); killproc(bigproc, "out of swap space"); sched_nice(bigproc, PRIO_MIN); + _PRELE(bigproc); PROC_UNLOCK(bigproc); wakeup(&vm_cnt.v_free_count); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:40:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69A434C1; Sat, 24 Jan 2015 15:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55D93D63; Sat, 24 Jan 2015 15:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OFerLw034512; Sat, 24 Jan 2015 15:40:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OFerWa034511; Sat, 24 Jan 2015 15:40:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501241540.t0OFerWa034511@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 24 Jan 2015 15:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277647 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:40:53 -0000 Author: mav Date: Sat Jan 24 15:40:52 2015 New Revision: 277647 URL: https://svnweb.freebsd.org/changeset/base/277647 Log: Fix wrong LUN reference in XCOPY block-to-block operation. This could cause data corruption due to accessing wrong LUN in case of retries on write errors. Failed writes were retried to read LUN. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Sat Jan 24 15:33:42 2015 (r277646) +++ head/sys/cam/ctl/ctl_tpc.c Sat Jan 24 15:40:52 2015 (r277647) @@ -916,7 +916,7 @@ tpc_process_b2b(struct tpc_list *list) /*control*/ 0); tiow->io->io_hdr.retries = 3; tiow->lun = dl; - tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tior; + tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); TAILQ_INSERT_TAIL(prun, tior, rlinks); From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:42:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5999860A; Sat, 24 Jan 2015 15:42:51 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF94E02; Sat, 24 Jan 2015 15:42:50 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0OFgeuw051880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Jan 2015 17:42:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0OFgeuw051880 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0OFgesv051879; Sat, 24 Jan 2015 17:42:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 24 Jan 2015 17:42:40 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 Message-ID: <20150124154240.GV42409@kib.kiev.ua> References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422111397.1038.53.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:42:51 -0000 On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: > On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Jan 24 12:51:15 2015 > > New Revision: 277643 > > URL: https://svnweb.freebsd.org/changeset/base/277643 > > > > Log: > > Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed > > for i386, and from the code inspection, nothing in the > > arm/mips/sparc64 implementations depends on it. > > > > I'm not sure I agree with that. On arm the memrw() implementation uses > a single statically-allocated page of kva space into which it maps each > physical page in turn in the main loop. What prevents preemption or > multicore access to /dev/mem from trying to use that single page for > multiple operations at once? I see, thank you for noting this. But, I do not think that Giant is a solution for the problem. uiomove() call accesses userspace, which may fault and cause sleep. If the thread sleeps, the Giant is automatically dropped, so there is no real protection. I think dump exclusive sx around whole memrw() should be enough. I can revert the commit for now, or I can leave it as is while writing the patch with sx and waiting for somebody review. What would you prefer ? P.S. mips uses uiomove_fromphys(), avoiding transient mapping, and sparc allocates KVA when needed. From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:49:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C154C79B; Sat, 24 Jan 2015 15:49:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACD00E26; Sat, 24 Jan 2015 15:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OFnfPT037941; Sat, 24 Jan 2015 15:49:41 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OFnfHK037939; Sat, 24 Jan 2015 15:49:41 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501241549.t0OFnfHK037939@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 24 Jan 2015 15:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277648 - in head: contrib/netbsd-tests/lib/libc/c063 lib/libc/tests/c063 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:49:41 -0000 Author: jilles Date: Sat Jan 24 15:49:40 2015 New Revision: 277648 URL: https://svnweb.freebsd.org/changeset/base/277648 Log: Enable utimensat tests from NetBSD. As with other tests from c063, a required #include was missing. Modified: head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c head/lib/libc/tests/c063/Makefile Modified: head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Sat Jan 24 15:40:52 2015 (r277647) +++ head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Sat Jan 24 15:49:40 2015 (r277648) @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_utimensat.c,v 1.5 20 #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #define DIR "dir" Modified: head/lib/libc/tests/c063/Makefile ============================================================================== --- head/lib/libc/tests/c063/Makefile Sat Jan 24 15:40:52 2015 (r277647) +++ head/lib/libc/tests/c063/Makefile Sat Jan 24 15:49:40 2015 (r277648) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/lib/libc/c063 -#TODO: t_o_search, t_utimensat +#TODO: t_o_search NETBSD_ATF_TESTS_C= faccessat NETBSD_ATF_TESTS_C+= fchmodat @@ -18,6 +18,7 @@ NETBSD_ATF_TESTS_C+= readlinkat NETBSD_ATF_TESTS_C+= renameat NETBSD_ATF_TESTS_C+= symlinkat NETBSD_ATF_TESTS_C+= unlinkat +NETBSD_ATF_TESTS_C+= utimensat CFLAGS+= -D_INCOMPLETE_XOPEN_C063 From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 15:51:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A48E7906; Sat, 24 Jan 2015 15:51:23 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46031EC5; Sat, 24 Jan 2015 15:51:23 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0OFpH0c054117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Jan 2015 17:51:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0OFpH0c054117 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0OFpHIC054116; Sat, 24 Jan 2015 17:51:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 24 Jan 2015 17:51:17 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 Message-ID: <20150124155117.GW42409@kib.kiev.ua> References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> <20150124154240.GV42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150124154240.GV42409@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 15:51:23 -0000 On Sat, Jan 24, 2015 at 05:42:40PM +0200, Konstantin Belousov wrote: > On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: > > On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sat Jan 24 12:51:15 2015 > > > New Revision: 277643 > > > URL: https://svnweb.freebsd.org/changeset/base/277643 > > > > > > Log: > > > Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed > > > for i386, and from the code inspection, nothing in the > > > arm/mips/sparc64 implementations depends on it. > > > > > > > I'm not sure I agree with that. On arm the memrw() implementation uses > > a single statically-allocated page of kva space into which it maps each > > physical page in turn in the main loop. What prevents preemption or > > multicore access to /dev/mem from trying to use that single page for > > multiple operations at once? > > I see, thank you for noting this. > > But, I do not think that Giant is a solution for the problem. uiomove() > call accesses userspace, which may fault and cause sleep. If the > thread sleeps, the Giant is automatically dropped, so there is no real > protection. > > I think dump exclusive sx around whole memrw() should be enough. > > I can revert the commit for now, or I can leave it as is while > writing the patch with sx and waiting for somebody review. What > would you prefer ? > > P.S. mips uses uiomove_fromphys(), avoiding transient mapping, > and sparc allocates KVA when needed. Like this. diff --git a/sys/arm/arm/mem.c b/sys/arm/arm/mem.c index 30d4b1d..58b0d25 100644 --- a/sys/arm/arm/mem.c +++ b/sys/arm/arm/mem.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -72,6 +73,9 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); struct mem_range_softc mem_range_softc; +static struct sx tmppt_lock; +SX_SYSINIT(tmppt, &tmppt_lock, "mem4map"); + /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) @@ -107,6 +111,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags) } if (!address_valid) return (EINVAL); + sx_xlock(&tmppt_lock); pmap_kenter((vm_offset_t)_tmppt, v); o = (int)uio->uio_offset & PAGE_MASK; c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK)); @@ -114,6 +119,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags) c = min(c, (u_int)iov->iov_len); error = uiomove((caddr_t)&_tmppt[o], (int)c, uio); pmap_qremove((vm_offset_t)_tmppt, 1); + sx_xunlock(&tmppt_lock); continue; } else if (dev2unit(dev) == CDEV_MINOR_KMEM) { From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 16:21:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5B07FB6; Sat, 24 Jan 2015 16:21:16 +0000 (UTC) Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 948B41C0; Sat, 24 Jan 2015 16:21:16 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YF39G-0005T9-Tv; Sat, 24 Jan 2015 16:01:23 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0OG1LMX027462; Sat, 24 Jan 2015 09:01:21 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18iK+Wh6yD0LjWl746IcYuo Message-ID: <1422115281.1038.57.camel@freebsd.org> Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 From: Ian Lepore To: Konstantin Belousov Date: Sat, 24 Jan 2015 09:01:21 -0700 In-Reply-To: <20150124154240.GV42409@kib.kiev.ua> References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> <20150124154240.GV42409@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 16:21:16 -0000 On Sat, 2015-01-24 at 17:42 +0200, Konstantin Belousov wrote: > On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: > > On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sat Jan 24 12:51:15 2015 > > > New Revision: 277643 > > > URL: https://svnweb.freebsd.org/changeset/base/277643 > > > > > > Log: > > > Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed > > > for i386, and from the code inspection, nothing in the > > > arm/mips/sparc64 implementations depends on it. > > > > > > > I'm not sure I agree with that. On arm the memrw() implementation uses > > a single statically-allocated page of kva space into which it maps each > > physical page in turn in the main loop. What prevents preemption or > > multicore access to /dev/mem from trying to use that single page for > > multiple operations at once? > > I see, thank you for noting this. > > But, I do not think that Giant is a solution for the problem. uiomove() > call accesses userspace, which may fault and cause sleep. If the > thread sleeps, the Giant is automatically dropped, so there is no real > protection. > > I think dump exclusive sx around whole memrw() should be enough. > > I can revert the commit for now, or I can leave it as is while > writing the patch with sx and waiting for somebody review. What > would you prefer ? > > P.S. mips uses uiomove_fromphys(), avoiding transient mapping, > and sparc allocates KVA when needed. I had planned to look into this today or tomorrow, so no need to revert. I'll study the other implementations and see what works well for arm. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 16:59:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18768724; Sat, 24 Jan 2015 16:59:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053916AF; Sat, 24 Jan 2015 16:59:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OGxcxP071105; Sat, 24 Jan 2015 16:59:38 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OGxcxC071104; Sat, 24 Jan 2015 16:59:38 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201501241659.t0OGxcxC071104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sat, 24 Jan 2015 16:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277649 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 16:59:39 -0000 Author: rstone Date: Sat Jan 24 16:59:38 2015 New Revision: 277649 URL: https://svnweb.freebsd.org/changeset/base/277649 Log: vmspace_release() may sleep if the last reference is being released, so add a WITNESS_WARN() to catch cases where it is called with a non-sleepable lock held. MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jan 24 15:49:40 2015 (r277648) +++ head/sys/vm/vm_map.c Sat Jan 24 16:59:38 2015 (r277649) @@ -344,6 +344,9 @@ void vmspace_free(struct vmspace *vm) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "vmspace_free() called with non-sleepable lock held"); + if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 17:11:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD54983; Sat, 24 Jan 2015 17:11:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F10137EC; Sat, 24 Jan 2015 17:11:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OHBB2h079587; Sat, 24 Jan 2015 17:11:11 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OHBB2C079586; Sat, 24 Jan 2015 17:11:11 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501241711.t0OHBB2C079586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 24 Jan 2015 17:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277650 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 17:11:12 -0000 Author: will Date: Sat Jan 24 17:11:11 2015 New Revision: 277650 URL: https://svnweb.freebsd.org/changeset/base/277650 Log: Add tests/etc/rc.d to mtree. Submitted by: stefanf MFC after: 1 week MFC with: 277627 Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sat Jan 24 16:59:38 2015 (r277649) +++ head/etc/mtree/BSD.tests.dist Sat Jan 24 17:11:11 2015 (r277650) @@ -52,6 +52,8 @@ .. .. etc + rc.d + .. .. games .. From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 17:32:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE0D1D0B; Sat, 24 Jan 2015 17:32:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 819F0A34; Sat, 24 Jan 2015 17:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OHWkhc089057; Sat, 24 Jan 2015 17:32:46 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OHWkD3089056; Sat, 24 Jan 2015 17:32:46 GMT (envelope-from will@FreeBSD.org) Message-Id: <201501241732.t0OHWkD3089056@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 24 Jan 2015 17:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277651 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 17:32:46 -0000 Author: will Date: Sat Jan 24 17:32:45 2015 New Revision: 277651 URL: https://svnweb.freebsd.org/changeset/base/277651 Log: Add vm.panic_on_oom sysctl, which enables those who would rather panic than kill a process, when the system runs out of memory. Defaults to off. Usually, this is most useful when the OOM condition is due to mismanagement of memory, on a system where the applications in question don't respond well to being killed. In theory, if the system is properly managed, it shouldn't be possible to hit this condition. If it does, the panic can be more desirable for some users (since it can be a good means of finding the root cause) rather than killing the largest process and continuing on its merry way. As kib@ mentions in the differential, there is also protect(1), which uses procctl(PROC_SPROTECT) to ensure that some processes are immune. However, a panic approach is still useful in some environments. This is primarily intended as a development/debugging tool. Differential Revision: D1627 Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Jan 24 17:11:11 2015 (r277650) +++ head/sys/vm/vm_pageout.c Sat Jan 24 17:32:45 2015 (r277651) @@ -180,6 +180,12 @@ static int vm_swap_enabled = 1; static int vm_swap_idle_enabled = 0; #endif +static int vm_panic_on_oom = 0; + +SYSCTL_INT(_vm, OID_AUTO, panic_on_oom, + CTLFLAG_RWTUN, &vm_panic_on_oom, 0, + "panic on out of memory instead of killing the largest process"); + SYSCTL_INT(_vm, OID_AUTO, pageout_wakeup_thresh, CTLFLAG_RW, &vm_pageout_wakeup_thresh, 0, "free page threshold for waking up the pageout daemon"); @@ -1585,6 +1591,8 @@ vm_pageout_oom(int shortage) } sx_sunlock(&allproc_lock); if (bigproc != NULL) { + if (vm_panic_on_oom != 0) + panic("out of swap space"); PROC_LOCK(bigproc); killproc(bigproc, "out of swap space"); sched_nice(bigproc, PRIO_MIN); From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 18:33:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD4E3BAE; Sat, 24 Jan 2015 18:33:10 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE9FF81; Sat, 24 Jan 2015 18:33:09 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id t0OIWd7L021376; Sat, 24 Jan 2015 12:33:08 -0600 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp2.rice.edu with ESMTP id 1s3b7hrvft-1; Sat, 24 Jan 2015 12:33:08 -0600 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 1B5E24C0282; Sat, 24 Jan 2015 12:33:08 -0600 (CST) Message-ID: <54C3E563.4070903@rice.edu> Date: Sat, 24 Jan 2015 12:33:07 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Konstantin Belousov , Ian Lepore Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> <20150124154240.GV42409@kib.kiev.ua> In-Reply-To: <20150124154240.GV42409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1501240198 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 18:33:10 -0000 On 01/24/2015 09:42, Konstantin Belousov wrote: > On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: >> On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Sat Jan 24 12:51:15 2015 >>> New Revision: 277643 >>> URL: https://svnweb.freebsd.org/changeset/base/277643 >>> >>> Log: >>> Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed >>> for i386, and from the code inspection, nothing in the >>> arm/mips/sparc64 implementations depends on it. >>> >> I'm not sure I agree with that. On arm the memrw() implementation uses >> a single statically-allocated page of kva space into which it maps each >> physical page in turn in the main loop. What prevents preemption or >> multicore access to /dev/mem from trying to use that single page for >> multiple operations at once? > I see, thank you for noting this. > > But, I do not think that Giant is a solution for the problem. uiomove() > call accesses userspace, which may fault and cause sleep. If the > thread sleeps, the Giant is automatically dropped, so there is no real > protection. > > I think dump exclusive sx around whole memrw() should be enough. > > I can revert the commit for now, or I can leave it as is while > writing the patch with sx and waiting for somebody review. What > would you prefer ? > > P.S. mips uses uiomove_fromphys(), avoiding transient mapping, > and sparc allocates KVA when needed. > > While we're here, it's worth noting that the arm version of /dev/mem is not functionally equivalent to that of amd64 or i386. Arm disallows access to non-DRAM addresses through /dev/mem. From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 18:53:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8993514; Sat, 24 Jan 2015 18:53:52 +0000 (UTC) Received: from smtp6.ore.mailhop.org (smtp6.ore.mailhop.org [54.149.35.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 669891B3; Sat, 24 Jan 2015 18:53:52 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp6.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YF5q5-0001Ea-Vp; Sat, 24 Jan 2015 18:53:46 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t0OIrhSx028822; Sat, 24 Jan 2015 11:53:43 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1/8g6knC+8vHA0Y0eqVwyNl Message-ID: <1422125623.1038.68.camel@freebsd.org> Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 From: Ian Lepore To: Alan Cox Date: Sat, 24 Jan 2015 11:53:43 -0700 In-Reply-To: <54C3E563.4070903@rice.edu> References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> <20150124154240.GV42409@kib.kiev.ua> <54C3E563.4070903@rice.edu> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 18:53:52 -0000 On Sat, 2015-01-24 at 12:33 -0600, Alan Cox wrote: > On 01/24/2015 09:42, Konstantin Belousov wrote: > > On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: > >> On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: > >>> Author: kib > >>> Date: Sat Jan 24 12:51:15 2015 > >>> New Revision: 277643 > >>> URL: https://svnweb.freebsd.org/changeset/base/277643 > >>> > >>> Log: > >>> Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed > >>> for i386, and from the code inspection, nothing in the > >>> arm/mips/sparc64 implementations depends on it. > >>> > >> I'm not sure I agree with that. On arm the memrw() implementation uses > >> a single statically-allocated page of kva space into which it maps each > >> physical page in turn in the main loop. What prevents preemption or > >> multicore access to /dev/mem from trying to use that single page for > >> multiple operations at once? > > I see, thank you for noting this. > > > > But, I do not think that Giant is a solution for the problem. uiomove() > > call accesses userspace, which may fault and cause sleep. If the > > thread sleeps, the Giant is automatically dropped, so there is no real > > protection. > > > > I think dump exclusive sx around whole memrw() should be enough. > > > > I can revert the commit for now, or I can leave it as is while > > writing the patch with sx and waiting for somebody review. What > > would you prefer ? > > > > P.S. mips uses uiomove_fromphys(), avoiding transient mapping, > > and sparc allocates KVA when needed. > > > > > > While we're here, it's worth noting that the arm version of /dev/mem is > not functionally equivalent to that of amd64 or i386. Arm disallows > access to non-DRAM addresses through /dev/mem. That's true for the read/write interface, but not for mmap(). In fact, we have users insisting that mmap() on /dev/mem should provide userland access to memory-mapped devices, and we have ARM architecture rules that say you can't map the same physical address multiple times with different attributes, such as being Device memory in the kernel and Strongly Ordered when mapped into userland. But if the memory isn't mapped S-O for userland, they have no hope of usefully accessing the devices (because they don't have access to cache and buffer maintenance). Even "normal" memory has a variety of attributes that make the temporary mappings done in memrw() a bit iffy, although I'm not sure we're doing anything right now that could lead to trouble. Trouble lurks though if we ever start using some of the more subtle features of the arm memory architecture, such as turning off the sharable attribute on pages that are inherently per-cpu to avoid the overhead of hardware cache coherence when we know only one core can access the pages. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 19:13:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60DCD6A5; Sat, 24 Jan 2015 19:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9423A0; Sat, 24 Jan 2015 19:13:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OJD5Vb039194; Sat, 24 Jan 2015 19:13:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OJD4xT039188; Sat, 24 Jan 2015 19:13:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201501241913.t0OJD4xT039188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 24 Jan 2015 19:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277652 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 19:13:05 -0000 Author: bapt Date: Sat Jan 24 19:13:03 2015 New Revision: 277652 URL: https://svnweb.freebsd.org/changeset/base/277652 Log: Allow negative numbers in -u and -g options PR: 196514 MFC after: 1 week Added: head/usr.sbin/pw/tests/pw_groupshow.sh (contents, props changed) head/usr.sbin/pw/tests/pw_usershow.sh (contents, props changed) Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sat Jan 24 17:32:45 2015 (r277651) +++ head/usr.sbin/pw/pw_group.c Sat Jan 24 19:13:03 2015 (r277652) @@ -68,7 +68,11 @@ pw_group(struct userconf * cnf, int mode }; if (a_gid != NULL) { - if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) + const char *teststr; + teststr = a_gid->val; + if (*teststr == '-') + teststr++; + if (strspn(teststr, "0123456789") != strlen(teststr)) errx(EX_USAGE, "-g expects a number"); } Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat Jan 24 17:32:45 2015 (r277651) +++ head/usr.sbin/pw/pw_user.c Sat Jan 24 19:13:03 2015 (r277652) @@ -322,7 +322,10 @@ pw_user(struct userconf * cnf, int mode, a_name = NULL; } } else { - if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) + const char *teststr = a_uid->val; + if (*teststr == '-') + teststr++; + if (strspn(teststr, "0123456789") != strlen(teststr)) errx(EX_USAGE, "-u expects a number"); } Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Sat Jan 24 17:32:45 2015 (r277651) +++ head/usr.sbin/pw/tests/Makefile Sat Jan 24 19:13:03 2015 (r277652) @@ -9,9 +9,11 @@ ATF_TESTS_SH= pw_etcdir \ pw_lock \ pw_groupdel \ pw_groupmod \ + pw_groupshow \ pw_useradd \ pw_userdel \ - pw_usermod + pw_usermod \ + pw_usershow .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Added: head/usr.sbin/pw/tests/pw_groupshow.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_groupshow.sh Sat Jan 24 19:13:03 2015 (r277652) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test negative uid are still valid +# PR: 196514 +atf_test_case show_group_with_negative_number +show_group_with_negative_number_body() { + populate_etc_skel + atf_check -s exit:0 \ + -o inline:"wheel:*:0:root\n" \ + ${PW} groupshow -n wheel -g -1 +} + +atf_init_test_cases() { + atf_add_test_case show_group_with_negative_number +} Added: head/usr.sbin/pw/tests/pw_usershow.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_usershow.sh Sat Jan 24 19:13:03 2015 (r277652) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test negative uid are still valid +# PR: 196514 +atf_test_case show_user_with_negative_number +show_user_with_negative_number_body() { + populate_etc_skel + atf_check -s exit:0 \ + -o inline:"root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" \ + ${PW} usershow -n root -u -1 +} + +atf_init_test_cases() { + atf_add_test_case show_user_with_negative_number +} From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 19:27:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 521A7B61; Sat, 24 Jan 2015 19:27:48 +0000 (UTC) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C89668E; Sat, 24 Jan 2015 19:27:48 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id fa1so3741093pad.8; Sat, 24 Jan 2015 11:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=FxM8tyfjVWQYeAek09eDEOMkYLFKcnjLUQcYSs+TgCA=; b=MSEklTIYx4Hy1copbKvCd4cnbfvDY1P47sC3tKixmi+ll6J3KKrNgDDVegNEGnuWZ/ Qu1TM5QfSiZDBoKlSefHON8HT+VxqgW16sIcATYBIlTOZQ1eW/kdYo00rtrJxa5U6kOP BNaApHHXPu2IrztWNBwtJj/6GvG9+k63zxYg+hjSUW+34esK6WA8JvZl7YEkAw8ui+el NkkwPn0aDU1NNREKGbBV8utAQQgkcFSNH84l2TG7Ne1m3r2P0Y+8rXRGkBBTJeC7ICWo N1p0HAkzC13uL2ebUMBCPe9a+mYFGFjg8NK5bSP5/ndV8BLjEOB1X6/aWxdkDBSYva3J xKpg== X-Received: by 10.68.226.69 with SMTP id rq5mr21970833pbc.116.1422127667583; Sat, 24 Jan 2015 11:27:47 -0800 (PST) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id kr10sm5503540pdb.42.2015.01.24.11.27.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Jan 2015 11:27:46 -0800 (PST) References: <201501241549.t0OFnfHK037939@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201501241549.t0OFnfHK037939@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (12B440) From: Garrett Cooper Subject: Re: svn commit: r277648 - in head: contrib/netbsd-tests/lib/libc/c063 lib/libc/tests/c063 Date: Sat, 24 Jan 2015 11:27:45 -0800 To: Jilles Tjoelker Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 19:27:48 -0000 > On Jan 24, 2015, at 07:49, Jilles Tjoelker wrote: >=20 > Author: jilles > Date: Sat Jan 24 15:49:40 2015 > New Revision: 277648 > URL: https://svnweb.freebsd.org/changeset/base/277648 >=20 > Log: > Enable utimensat tests from NetBSD. >=20 > As with other tests from c063, a required #include was missi= ng. >=20 > Modified: > head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c > head/lib/libc/tests/c063/Makefile >=20 > Modified: head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Sat Jan 24 15= :40:52 2015 (r277647) > +++ head/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c Sat Jan 24 15= :49:40 2015 (r277648) > @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_utimensat.c,v 1.5 20 > #include > #include > #include > +#ifdef __FreeBSD__ > +#include > +#endif > #include >=20 > #define DIR "dir" Thanks jilles!= From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 19:34:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C436DD33; Sat, 24 Jan 2015 19:34:12 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE6A7B8; Sat, 24 Jan 2015 19:34:12 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id lj1so3770313pab.6; Sat, 24 Jan 2015 11:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=6QqjdjotDJ0ig3AlBdasUbYmTCveORG6OJjAq2pcpPM=; b=kNdg7yxAy73vIJvPvTD7wQPlj868bXoDf1z157V019LIOkYBwTVAuIaP7+JILWV3Nz niGML9kvZicfoTWqx5Y2ScbjiZB97XlGQhwBJx1f066/qiOeO3CaptwaPtL7jeNsjVnU GWu4NxYes27xHsGrsELwztZgVVDYzCNOgHxe6Sm/acyJyQOtstFYXHD+Oo4oB0CRQR/5 SCIryw0UD4PldvEzu+4tKuvrVHqtVmxZSAAjrY22SOI22EseL4APsbn0AqP6c3hjvPRs fmJx1N6KwmNk61rMsk3mULWRTsT76v3A1NhDx3qlIbs2s0JU4btnFESF3lxx2bgZ5d1L oMfw== X-Received: by 10.70.103.5 with SMTP id fs5mr22163297pdb.16.1422128051886; Sat, 24 Jan 2015 11:34:11 -0800 (PST) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id kl11sm5466056pbd.89.2015.01.24.11.34.11 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Jan 2015 11:34:11 -0800 (PST) References: <201501241732.t0OHWkD3089056@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201501241732.t0OHWkD3089056@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (12B440) From: Garrett Cooper Subject: Re: svn commit: r277651 - head/sys/vm Date: Sat, 24 Jan 2015 11:34:10 -0800 To: Will Andrews Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 19:34:12 -0000 > On Janc 24, 2015, at 09:32, Will Andrews wrote: >=20 > Author: will > Date: Sat Jan 24 17:32:45 2015 > New Revision: 277651 > URL: https://svnweb.freebsd.org/changeset/base/277651 >=20 > Log: > Add vm.panic_on_oom sysctl, which enables those who would rather panic th= an > kill a process, when the system runs out of memory. Defaults to off. >=20 > Usually, this is most useful when the OOM condition is due to mismanageme= nt > of memory, on a system where the applications in question don't respond w= ell > to being killed. >=20 > In theory, if the system is properly managed, it shouldn't be possible to= > hit this condition. If it does, the panic can be more desirable for some > users (since it can be a good means of finding the root cause) rather tha= n > killing the largest process and continuing on its merry way. >=20 > As kib@ mentions in the differential, there is also protect(1), which use= s > procctl(PROC_SPROTECT) to ensure that some processes are immune. However= , > a panic approach is still useful in some environments. This is primarily= > intended as a development/debugging tool. Hi Will! Could you please add a kernel option to set the default from 0 to 1, or p= rovide a tunable so the value could be set in loader.conf? Thanks!= From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 19:49:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EA432D8; Sat, 24 Jan 2015 19:49:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A55C8E8; Sat, 24 Jan 2015 19:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OJnSuW054827; Sat, 24 Jan 2015 19:49:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OJnSCI054826; Sat, 24 Jan 2015 19:49:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201501241949.t0OJnSCI054826@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 24 Jan 2015 19:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277653 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 19:49:28 -0000 Author: adrian Date: Sat Jan 24 19:49:27 2015 New Revision: 277653 URL: https://svnweb.freebsd.org/changeset/base/277653 Log: Change the permissions from 0660 to 0600. Otherwise people in wheel can do things with netmap, including but not limited to promisc transmit/receive. Approved by: luigi MFC after: 1 week Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Jan 24 19:13:03 2015 (r277652) +++ head/sys/dev/netmap/netmap.c Sat Jan 24 19:49:27 2015 (r277653) @@ -3075,10 +3075,10 @@ netmap_init(void) #ifdef __FreeBSD__ /* support for the 'eternal' flag */ netmap_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, - &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0660, + &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "netmap"); #else - netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, + netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "netmap"); #endif if (!netmap_dev) From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 19:50:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DD3C41A; Sat, 24 Jan 2015 19:50:28 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 2A91F8F1; Sat, 24 Jan 2015 19:50:28 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id D4F71341F85E; Sat, 24 Jan 2015 11:50:27 -0800 (PST) Message-ID: <54C3F7F1.90808@freebsd.org> Date: Sat, 24 Jan 2015 11:52:17 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r277653 - head/sys/dev/netmap References: <201501241949.t0OJnSCI054826@svn.freebsd.org> In-Reply-To: <201501241949.t0OJnSCI054826@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 19:50:28 -0000 Wasn't this pointed out by James K? On 1/24/15 11:49 AM, Adrian Chadd wrote: > Author: adrian > Date: Sat Jan 24 19:49:27 2015 > New Revision: 277653 > URL: https://svnweb.freebsd.org/changeset/base/277653 > > Log: > Change the permissions from 0660 to 0600. > > Otherwise people in wheel can do things with netmap, including > but not limited to promisc transmit/receive. > > Approved by: luigi > MFC after: 1 week > > Modified: > head/sys/dev/netmap/netmap.c > > Modified: head/sys/dev/netmap/netmap.c > ============================================================================== > --- head/sys/dev/netmap/netmap.c Sat Jan 24 19:13:03 2015 (r277652) > +++ head/sys/dev/netmap/netmap.c Sat Jan 24 19:49:27 2015 (r277653) > @@ -3075,10 +3075,10 @@ netmap_init(void) > #ifdef __FreeBSD__ > /* support for the 'eternal' flag */ > netmap_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, > - &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0660, > + &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, > "netmap"); > #else > - netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, > + netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, > "netmap"); > #endif > if (!netmap_dev) > From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 20:18:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7D9FE32 for ; Sat, 24 Jan 2015 20:18:25 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86F0CB95 for ; Sat, 24 Jan 2015 20:18:25 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id y20so2911276ier.1 for ; Sat, 24 Jan 2015 12:18:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=g35Dlg0p67k34RbuLlNOUuUICGCp6nTcTDIHFCP2yzc=; b=H2WnVl+zHEpQXLJCHAZQTGuPTqvCl3BcdRgsni92d3zoj9xrJ4FOS8njVLB0jsmIsk wIhIG+x643ZfAlwkoUWnm8WwVKLfMbg0BvqQcIAqaeEoEAUKIN6+8neJgiDMU0wrzkqt nKqUL4l8c6211oYR2s5Xcrti1YxPLSxh9TCqo/fRSoyXNlMFIpJoG50eFtnOHIceWp8w r/IHKuwIOCaUf2ANqz0nc2JJvvPytG4c/M9cVFy4U3FJLndXQUcProuMqia6V0UqvWZJ VxMFEzrslTki2A1e3WZTJ1cG9vIM2e+o9pY9H5iUtNqDoh49Pp9715brAigoDD4SNZ4g SpPQ== X-Gm-Message-State: ALoCoQk4pRpoHYOH4ET5hfoSZ8R5Ig4Mce1p+CApt7xnE/RuNHO/VDCi6ORq1mcG/AChuIqPh5Kn X-Received: by 10.42.169.197 with SMTP id c5mr14128475icz.72.1422130704508; Sat, 24 Jan 2015 12:18:24 -0800 (PST) Received: from sol.firepipe.net (c-50-183-92-30.hsd1.co.comcast.net. [50.183.92.30]) by mx.google.com with ESMTPSA id m10sm3122758ioi.28.2015.01.24.12.18.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 12:18:23 -0800 (PST) Sender: Will Andrews Date: Sat, 24 Jan 2015 13:18:22 -0700 From: Will Andrews To: Garrett Cooper Subject: Re: svn commit: r277651 - head/sys/vm Message-ID: <20150124201820.GD57177@sol.firepipe.net> References: <201501241732.t0OHWkD3089056@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bajzpZikUji1w+G9" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 20:18:25 -0000 --bajzpZikUji1w+G9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 24, 2015 at 11:34:10AM -0800, Garrett Cooper wrote: > Could you please add a kernel option to set the default from > 0 to 1, or provide a tunable so the value could be set in loader.conf? Hi Garrett, The sysctl is configured as a CTLFLAG_RWTUN, so it can be configured in loader.conf or sysctl.conf already. I don't see a need for an option. --=20 wca --bajzpZikUji1w+G9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTD/gsACgkQF47idPgWcsUheACfe++B/f2Uggp9Zvm7oztfX6cB foQAmwcz3zdh/jjIVdOrhj85BEHQN+PT =Xrp9 -----END PGP SIGNATURE----- --bajzpZikUji1w+G9-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 20:18:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 742E0F6B; Sat, 24 Jan 2015 20:18:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60421B9B; Sat, 24 Jan 2015 20:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OKIcBM069294; Sat, 24 Jan 2015 20:18:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OKIc1o069293; Sat, 24 Jan 2015 20:18:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501242018.t0OKIc1o069293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 24 Jan 2015 20:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277655 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 20:18:38 -0000 Author: ian Date: Sat Jan 24 20:18:37 2015 New Revision: 277655 URL: https://svnweb.freebsd.org/changeset/base/277655 Log: Reimplement fdt_clock_register_provider() correctly. It turns out you can't use OF_xref_from_device() to implement the function that registers the xref association with the device. Pointy hat: ian Submitted by: loos Modified: head/sys/dev/fdt/fdt_clock.c Modified: head/sys/dev/fdt/fdt_clock.c ============================================================================== --- head/sys/dev/fdt/fdt_clock.c Sat Jan 24 20:16:34 2015 (r277654) +++ head/sys/dev/fdt/fdt_clock.c Sat Jan 24 20:18:37 2015 (r277655) @@ -149,7 +149,8 @@ void fdt_clock_register_provider(device_t provider) { - OF_device_register_xref(OF_xref_from_device(provider), provider); + OF_device_register_xref( + OF_xref_from_node(ofw_bus_get_node(provider)), provider); } void From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 20:21:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96DDB154; Sat, 24 Jan 2015 20:21:15 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74F6BC42; Sat, 24 Jan 2015 20:21:15 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id t0OKL5Io016166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 24 Jan 2015 12:21:06 -0800 Message-ID: <54C3FEB1.5020808@freebsd.org> Date: Sat, 24 Jan 2015 12:21:05 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Ian Lepore , Alan Cox Subject: Re: svn commit: r277643 - in head/sys: arm/arm dev/mem i386/i386 mips/mips sparc64/sparc64 References: <201501241251.t0OCpGa8053192@svn.freebsd.org> <1422111397.1038.53.camel@freebsd.org> <20150124154240.GV42409@kib.kiev.ua> <54C3E563.4070903@rice.edu> <1422125623.1038.68.camel@freebsd.org> In-Reply-To: <1422125623.1038.68.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbyUfPry+xI+SjU5ef9Y5120FqyWUK8x98idyvBpxDidr1sqMj0007Kv1rJVfzIdRgo51RzJzpnLTUNiNla1VnObpGuC0lQOfA= X-Sonic-ID: C;BFUmhgak5BGeL6nrCx1YGw== M;Whubhgak5BGeL6nrCx1YGw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 20:21:15 -0000 On 01/24/15 10:53, Ian Lepore wrote: > On Sat, 2015-01-24 at 12:33 -0600, Alan Cox wrote: >> On 01/24/2015 09:42, Konstantin Belousov wrote: >>> On Sat, Jan 24, 2015 at 07:56:37AM -0700, Ian Lepore wrote: >>>> On Sat, 2015-01-24 at 12:51 +0000, Konstantin Belousov wrote: >>>>> Author: kib >>>>> Date: Sat Jan 24 12:51:15 2015 >>>>> New Revision: 277643 >>>>> URL: https://svnweb.freebsd.org/changeset/base/277643 >>>>> >>>>> Log: >>>>> Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed >>>>> for i386, and from the code inspection, nothing in the >>>>> arm/mips/sparc64 implementations depends on it. >>>>> >>>> I'm not sure I agree with that. On arm the memrw() implementation uses >>>> a single statically-allocated page of kva space into which it maps each >>>> physical page in turn in the main loop. What prevents preemption or >>>> multicore access to /dev/mem from trying to use that single page for >>>> multiple operations at once? >>> I see, thank you for noting this. >>> >>> But, I do not think that Giant is a solution for the problem. uiomove() >>> call accesses userspace, which may fault and cause sleep. If the >>> thread sleeps, the Giant is automatically dropped, so there is no real >>> protection. >>> >>> I think dump exclusive sx around whole memrw() should be enough. >>> >>> I can revert the commit for now, or I can leave it as is while >>> writing the patch with sx and waiting for somebody review. What >>> would you prefer ? >>> >>> P.S. mips uses uiomove_fromphys(), avoiding transient mapping, >>> and sparc allocates KVA when needed. >>> >>> >> While we're here, it's worth noting that the arm version of /dev/mem is >> not functionally equivalent to that of amd64 or i386. Arm disallows >> access to non-DRAM addresses through /dev/mem. > That's true for the read/write interface, but not for mmap(). In fact, > we have users insisting that mmap() on /dev/mem should provide userland > access to memory-mapped devices, and we have ARM architecture rules that > say you can't map the same physical address multiple times with > different attributes, such as being Device memory in the kernel and > Strongly Ordered when mapped into userland. But if the memory isn't > mapped S-O for userland, they have no hope of usefully accessing the > devices (because they don't have access to cache and buffer > maintenance). > > Even "normal" memory has a variety of attributes that make the temporary > mappings done in memrw() a bit iffy, although I'm not sure we're doing > anything right now that could lead to trouble. Trouble lurks though if > we ever start using some of the more subtle features of the arm memory > architecture, such as turning off the sharable attribute on pages that > are inherently per-cpu to avoid the overhead of hardware cache coherence > when we know only one core can access the pages. sparc64 also does not allow mmap() of device memory through /dev/mem for this reason. This leads to a whole bunch of #ifdef in X drivers. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 20:25:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3132BE; Sat, 24 Jan 2015 20:25:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A986AC62; Sat, 24 Jan 2015 20:25:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OKPMbh073666; Sat, 24 Jan 2015 20:25:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OKPM1p073665; Sat, 24 Jan 2015 20:25:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501242025.t0OKPM1p073665@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 24 Jan 2015 20:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277656 - head/contrib/gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 20:25:22 -0000 Author: pfg Date: Sat Jan 24 20:25:21 2015 New Revision: 277656 URL: https://svnweb.freebsd.org/changeset/base/277656 Log: MFV: r277654 gdb: Add missing break statements 2004-05-21 Jim Blandy * dwarf2expr.c (execute_stack_op): Add 'break' statements after cases for DW_OP_div and DW_OP_shr. (Thanks to Reva Cuthbertson.) Sourceware commit 99c87dab95747d380392a3698740507a21ad3236 CID: 1008254 MFC after: 4 days Modified: head/contrib/gdb/gdb/dwarf2expr.c Directory Properties: head/contrib/gdb/ (props changed) Modified: head/contrib/gdb/gdb/dwarf2expr.c ============================================================================== --- head/contrib/gdb/gdb/dwarf2expr.c Sat Jan 24 20:18:37 2015 (r277655) +++ head/contrib/gdb/gdb/dwarf2expr.c Sat Jan 24 20:25:21 2015 (r277656) @@ -575,6 +575,7 @@ execute_stack_op (struct dwarf_expr_cont break; case DW_OP_div: binop = BINOP_DIV; + break; case DW_OP_minus: binop = BINOP_SUB; break; @@ -595,6 +596,7 @@ execute_stack_op (struct dwarf_expr_cont break; case DW_OP_shr: binop = BINOP_RSH; + break; case DW_OP_shra: binop = BINOP_RSH; val1 = value_from_longest (signed_address_type (), first); From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 20:27:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02ADA40C; Sat, 24 Jan 2015 20:27:33 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBCBCC73; Sat, 24 Jan 2015 20:27:32 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id y10so4349597pdj.7; Sat, 24 Jan 2015 12:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=3KcHtZxUJJF6A2j0kY126/SGaoT83fh9XcFgYh+yIr0=; b=FeyB/fvsgBGju1vXQlZO4f21o7ThN2SbSkaGoFE4Bg8C7mIKcMB+kFg+5gPG5HWYQR 8jR4VuxlLy88gPGdGrYbmZUSngIwc7t/vGoKwcWf39+/LigMpMjXymNfPYVsSwSSCpyw nXgBv87mXBVtWhhEXDmbI5slg/UJnwUc8nzhk1OYZ3eIEz1wLqJBPkDGKYWJaFxP/0G5 +5gR1waLRRJHkNZgQbfjNtyXA+BHdb4EwFkk/XJIYw+0lvuB22X43CekPmSqfC+p/ns6 TGl60hWht6ItZQSz9lSRIQawn8hs83rp93LiR4jUMnear/DCalKSfboSckR0FGGUcnv6 JSyg== X-Received: by 10.68.202.98 with SMTP id kh2mr22342243pbc.6.1422131252267; Sat, 24 Jan 2015 12:27:32 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:d4ec:854d:6b4d:4d67? ([2601:8:ab80:7d6:d4ec:854d:6b4d:4d67]) by mx.google.com with ESMTPSA id kp1sm5563062pbd.54.2015.01.24.12.27.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Jan 2015 12:27:31 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_02029983-C99A-40C6-A56A-77CE2DF96B11"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r277651 - head/sys/vm From: Garrett Cooper In-Reply-To: <20150124201820.GD57177@sol.firepipe.net> Date: Sat, 24 Jan 2015 12:27:29 -0800 Message-Id: <22E1D4B7-D83F-4D62-8C28-3473E98AE6BC@gmail.com> References: <201501241732.t0OHWkD3089056@svn.freebsd.org> <20150124201820.GD57177@sol.firepipe.net> To: Will Andrews X-Mailer: Apple Mail (2.1878.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 20:27:33 -0000 --Apple-Mail=_02029983-C99A-40C6-A56A-77CE2DF96B11 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jan 24, 2015, at 12:18, Will Andrews wrote: > On Sat, Jan 24, 2015 at 11:34:10AM -0800, Garrett Cooper wrote: >> Could you please add a kernel option to set the default from >> 0 to 1, or provide a tunable so the value could be set in = loader.conf? >=20 > Hi Garrett, >=20 > The sysctl is configured as a CTLFLAG_RWTUN, so it can be configured = in > loader.conf or sysctl.conf already. I don't see a need for an option. Ah, missed that part of the diff =97 carry on :). Thanks! --Apple-Mail=_02029983-C99A-40C6-A56A-77CE2DF96B11 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUxAAyAAoJEMZr5QU6S73esGkH/2T/SIs6Xv7WLHs4+pfgppgO SKO9UXg3hfZPR5oboK4g9IzqkBH6QRSAqoEMJVUsA5rQ87GaBCAbzfho75lZp7zt eCRmopr/q4nJF4ylKKmu0Zy9juWn4nmmrw5m1kp11A78h43JGX/Vu9/MFOIFyAxb RTrv/4h3xreZ5XgCCqZy+qsGoHgqy4weViWFJID1VDjJGbKGBSP3CTKwyJ2lwt7O 1kZ5Rp4Ycs+1W94tUFB9fVeYJ2+5+DEp4VwOvKt3jpQIHmZhh60FgU3tWu+zOMxG ULZ5FVkFScPKsf/uBhDIGNSSpuWuGW4zqk4Y142muRuA7pYbYeDNk2lbpLiLJyQ= =yITB -----END PGP SIGNATURE----- --Apple-Mail=_02029983-C99A-40C6-A56A-77CE2DF96B11-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 21:04:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15228217; Sat, 24 Jan 2015 21:04:16 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF242FCE; Sat, 24 Jan 2015 21:04:15 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id vy18so2957567iec.8; Sat, 24 Jan 2015 13:04:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ANP9sepwb63CGc6xLerlFzacynRbq72cH7vMS7TnWsU=; b=Mtm7/tyb7U5edCJRB/OUeCt1tnKqIhUQyXSrmdlElx7oxjtc4IUfNIgAmpsNexHyaC BMlteVEyrD46qtLt3OIRUgI7jQcuCjoTcvdfEhT2ysNxsWNSl1iNoeSFq4piXk3ROtYz ePQCfbDBZoEoLcAgDIxRdgB+CIKpSLdRYzDUNJ7ZAuei1FReaDQmzMlo40HptmbfMxnH /Bi4M036FKQ+R8k83fOkYSfaCZEmDQ52Sn3IuCJWNeqDSkD42lvCpZNh6thaFYIugJr3 sZCbjYvFwbpMtdZagFAb3UUKpLo6cS37IyqEZz5Jwa5P90tRmr2jYeymZGjTucj/7k5w YA6Q== MIME-Version: 1.0 X-Received: by 10.107.136.158 with SMTP id s30mr10653656ioi.8.1422133455261; Sat, 24 Jan 2015 13:04:15 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Sat, 24 Jan 2015 13:04:15 -0800 (PST) In-Reply-To: <54C3F7F1.90808@freebsd.org> References: <201501241949.t0OJnSCI054826@svn.freebsd.org> <54C3F7F1.90808@freebsd.org> Date: Sat, 24 Jan 2015 13:04:15 -0800 X-Google-Sender-Auth: DpJbpg8LBWg8PPWUQdt-KA0z180 Message-ID: Subject: Re: svn commit: r277653 - head/sys/dev/netmap From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 21:04:16 -0000 Eep, I'll make sure I add that to the next commit / MFC. Thanks, -adrian On 24 January 2015 at 11:52, Alfred Perlstein wrote: > Wasn't this pointed out by James K? > > > On 1/24/15 11:49 AM, Adrian Chadd wrote: >> >> Author: adrian >> Date: Sat Jan 24 19:49:27 2015 >> New Revision: 277653 >> URL: https://svnweb.freebsd.org/changeset/base/277653 >> >> Log: >> Change the permissions from 0660 to 0600. >> Otherwise people in wheel can do things with netmap, including >> but not limited to promisc transmit/receive. >> Approved by: luigi >> MFC after: 1 week >> >> Modified: >> head/sys/dev/netmap/netmap.c >> >> Modified: head/sys/dev/netmap/netmap.c >> >> ============================================================================== >> --- head/sys/dev/netmap/netmap.c Sat Jan 24 19:13:03 2015 >> (r277652) >> +++ head/sys/dev/netmap/netmap.c Sat Jan 24 19:49:27 2015 >> (r277653) >> @@ -3075,10 +3075,10 @@ netmap_init(void) >> #ifdef __FreeBSD__ >> /* support for the 'eternal' flag */ >> netmap_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, >> - &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0660, >> + &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, >> "netmap"); >> #else >> - netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, >> 0660, >> + netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, >> 0600, >> "netmap"); >> #endif >> if (!netmap_dev) >> > From owner-svn-src-head@FreeBSD.ORG Sat Jan 24 21:05:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 018D2356; Sat, 24 Jan 2015 21:05:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF2DFFD5; Sat, 24 Jan 2015 21:05:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0OL5IAH094104; Sat, 24 Jan 2015 21:05:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0OL5IYq094103; Sat, 24 Jan 2015 21:05:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501242105.t0OL5IYq094103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 24 Jan 2015 21:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277659 - head/contrib/gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2015 21:05:19 -0000 Author: pfg Date: Sat Jan 24 21:05:18 2015 New Revision: 277659 URL: https://svnweb.freebsd.org/changeset/base/277659 Log: MFV r277658: GDB: Replace use of sprintf. 2005-03-17 Mark Kettenis * corelow.c (get_core_register_section): Replace usage of sprintf and strcpy with xstrprintf and xstrdup. Sourceware commit: 3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a CID: 1006819 MFC after: 4 days Modified: head/contrib/gdb/gdb/corelow.c Directory Properties: head/contrib/gdb/ (props changed) Modified: head/contrib/gdb/gdb/corelow.c ============================================================================== --- head/contrib/gdb/gdb/corelow.c Sat Jan 24 21:00:51 2015 (r277658) +++ head/contrib/gdb/gdb/corelow.c Sat Jan 24 21:05:18 2015 (r277659) @@ -432,15 +432,16 @@ get_core_register_section (char *name, char *human_name, int required) { - char section_name[100]; + static char *section_name = NULL; struct bfd_section *section; bfd_size_type size; char *contents; + xfree (section_name); if (PIDGET (inferior_ptid)) - sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid)); + section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid)); else - strcpy (section_name, name); + section_name = xstrdup (name); section = bfd_get_section_by_name (core_bfd, section_name); if (! section)