From owner-svn-src-all@freebsd.org Sun Nov 8 00:08:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05444A28BBA; Sun, 8 Nov 2015 00:08:23 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1AB1324; Sun, 8 Nov 2015 00:08:22 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicll6 with SMTP id ll6so49984035wic.0; Sat, 07 Nov 2015 16:08:21 -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=CNMTBweTObB8Htcc1Czh6XX2oWqKx6hpeq9h/YeZflg=; b=CDoNjQvwIegCFyCAPqZnb1RRdJnKrrgn2pg2OfxS748lafQKm2fG8W79kvTlfM1Br6 E9dDTbWLY7oZE20U5SzDGJdOS9oEebAiTK5ovkeZY8TuH1Ps9VTAtjonoTwSlRqkj5kS qnp/If6Z1EG1hSc4KtxoX7W05Srbhjhrd63Up1ns7xbcBZRtKDZnWWIC+ht9HMwAGU5H Hk+Lx0TCpkX8XaflNVSsOtTdHlykqS+hLL4JDt7efy5wYmyJOm6xHtU2WQEDPRQ5oWbc SSa5UQwarDxiOSYg8D4dP2Vo+svsdz50tn8FTFcaEo4aU+cVjiES8NGPI2U/SGMLLbG7 WX5Q== X-Received: by 10.194.86.161 with SMTP id q1mr26602626wjz.88.1446941301141; Sat, 07 Nov 2015 16:08:21 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id ee5sm7426025wjd.17.2015.11.07.16.08.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2015 16:08:20 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 8 Nov 2015 01:08:18 +0100 From: Baptiste Daroussin To: Hajimu UMEMOTO Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290522 - head/share/timedef Message-ID: <20151108000818.GE31396@ivaldir.etoilebsd.net> References: <201511072354.tA7NsEPs032069@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tMbDGjvJuJijemkf" Content-Disposition: inline In-Reply-To: <201511072354.tA7NsEPs032069@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:08:23 -0000 --tMbDGjvJuJijemkf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 07, 2015 at 11:54:14PM +0000, Hajimu UMEMOTO wrote: > Author: ume > Date: Sat Nov 7 23:54:14 2015 > New Revision: 290522 > URL: https://svnweb.freebsd.org/changeset/base/290522 >=20 > Log: > Fix alignment of the short month names for CJK locales, > as far as I could edit them. >=20 They are auto generated, I will try to have a look to fix the generation to= ol so we won't get hit by it next time. Thanks for the fix! Best regards, Bapt --tMbDGjvJuJijemkf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlY+knIACgkQ8kTtMUmk6Ew1FgCfTFONDr2pMdZdOvhL1JK5/euN 7B8An21Ky2RUGDxab4WkvkQpEkUkDsil =K+tI -----END PGP SIGNATURE----- --tMbDGjvJuJijemkf-- From owner-svn-src-all@freebsd.org Sun Nov 8 00:15:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E8D3A28DDE; Sun, 8 Nov 2015 00:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2001992; Sun, 8 Nov 2015 00:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 570F61C60; Sun, 8 Nov 2015 00:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8A588123E7; Sun, 8 Nov 2015 00:15:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3tqddFC575-1; Sun, 8 Nov 2015 00:15:04 +0000 (UTC) Subject: Re: svn commit: r290522 - head/share/timedef DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C1602123E0 To: Baptiste Daroussin , Hajimu UMEMOTO References: <201511072354.tA7NsEPs032069@repo.freebsd.org> <20151108000818.GE31396@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <563E940C.5080708@FreeBSD.org> Date: Sat, 7 Nov 2015 16:15:08 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151108000818.GE31396@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MvdsSqWIXfDlUEPPbDUwm6LDcGVPn4UEG" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:15:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MvdsSqWIXfDlUEPPbDUwm6LDcGVPn4UEG Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/7/2015 4:08 PM, Baptiste Daroussin wrote: > On Sat, Nov 07, 2015 at 11:54:14PM +0000, Hajimu UMEMOTO wrote: >> Author: ume >> Date: Sat Nov 7 23:54:14 2015 >> New Revision: 290522 >> URL: https://svnweb.freebsd.org/changeset/base/290522 >> >> Log: >> Fix alignment of the short month names for CJK locales, >> as far as I could edit them. >> >=20 > They are auto generated, I will try to have a look to fix the generatio= n tool so > we won't get hit by it next time. >=20 > Thanks for the fix! >=20 How much effort is involved to generate them? Should the build generate them instead? --=20 Regards, Bryan Drewery --MvdsSqWIXfDlUEPPbDUwm6LDcGVPn4UEG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWPpQMAAoJEDXXcbtuRpfP2VkH/0ZwLD/1iq5CzKZsH2gt+Jce w8TPevB4biurIJVXwmRlVW/P13DG2tHcLp8c4uLtqs5RSpfwOnOWFvSKK+JeLwaO mCBesR0JvXnT1ljuJufxTrgMW3m31sPJiRPdOXMSS+QVvaUtdl2ZC43POAU5rhrq Ts6k3794jZQQ0Y7hsPBN5BZ0xzJVNuqgp6nLdfv+0ORwWU3S0CrumAlju0Be89y7 syvTRTZ58SBjx59drSc/mnz65P3FtT2Yukg/ke7lwrV8vEDpg2rKsqQlFcoqECWk JDDNzj0xeyWcPoqaNL0+0obcYc146vU+uKwYFOyF77ryDtcy1Km1KRNzbST5vr0= =TMpM -----END PGP SIGNATURE----- --MvdsSqWIXfDlUEPPbDUwm6LDcGVPn4UEG-- From owner-svn-src-all@freebsd.org Sun Nov 8 00:50:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88DCA2240F; Sun, 8 Nov 2015 00:50:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 733051798; Sun, 8 Nov 2015 00:50:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80o6ox048256; Sun, 8 Nov 2015 00:50:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80o6qZ048255; Sun, 8 Nov 2015 00:50:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511080050.tA80o6qZ048255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290523 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:07 -0000 Author: bdrewery Date: Sun Nov 8 00:50:06 2015 New Revision: 290523 URL: https://svnweb.freebsd.org/changeset/base/290523 Log: Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE. ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m' even if already set in environment when starting up. The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE manually in the buildenv shell make automatic workarounds too tricky here. ZSH should really respect variables set in the environment before trashing them. X-MFC-With: r290423 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 7 23:54:14 2015 (r290522) +++ head/Makefile.inc1 Sun Nov 8 00:50:06 2015 (r290523) @@ -784,6 +784,9 @@ buildenvvars: .PHONY BUILDENV_DIR?= ${.CURDIR} buildenv: .PHONY @echo Entering world for ${TARGET_ARCH}:${TARGET} +.if ${BUILDENV_SHELL:M*zsh*} + @echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE} +.endif @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \ || true From owner-svn-src-all@freebsd.org Sun Nov 8 00:50:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43653A22424; Sun, 8 Nov 2015 00:50:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C18A17A6; Sun, 8 Nov 2015 00:50:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80oAkf048303; Sun, 8 Nov 2015 00:50:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80oAkW048301; Sun, 8 Nov 2015 00:50:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511080050.tA80oAkW048301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290524 - in head: share/mk 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:11 -0000 Author: bdrewery Date: Sun Nov 8 00:50:09 2015 New Revision: 290524 URL: https://svnweb.freebsd.org/changeset/base/290524 Log: FAST_DEPEND: Don't include depend files when using 'make -V'. This is especially noticeable in the kernel obj directory since it includes so many files. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Nov 8 00:50:06 2015 (r290523) +++ head/share/mk/bsd.dep.mk Sun Nov 8 00:50:09 2015 (r290524) @@ -62,7 +62,9 @@ DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} .for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" .sinclude "${DEPENDFILE}.${__obj}" +.endif DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj} .endfor .endif # ${MK_FAST_DEPEND} == "yes" Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sun Nov 8 00:50:06 2015 (r290523) +++ head/sys/conf/kern.post.mk Sun Nov 8 00:50:09 2015 (r290524) @@ -206,7 +206,9 @@ DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${SYSTEM_OBJS} .for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" .sinclude ".depend.${__obj}" +.endif DEPENDFILES_OBJS+= .depend.${__obj} .endfor .endif # ${MK_FAST_DEPEND} == "yes" From owner-svn-src-all@freebsd.org Sun Nov 8 00:50:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC8D6A2244C; Sun, 8 Nov 2015 00:50:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A877918B0; Sun, 8 Nov 2015 00:50:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80oDFq048351; Sun, 8 Nov 2015 00:50:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80oDdV048349; Sun, 8 Nov 2015 00:50:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511080050.tA80oDdV048349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290525 - in head: share/mk 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:15 -0000 Author: bdrewery Date: Sun Nov 8 00:50:13 2015 New Revision: 290525 URL: https://svnweb.freebsd.org/changeset/base/290525 Log: FAST_DEPEND: Don't enable when .MAKE.MODE=meta. This is because the .meta files generated from filemon already contain a list of all files read to generate the object. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Nov 8 00:50:09 2015 (r290524) +++ head/share/mk/bsd.dep.mk Sun Nov 8 00:50:13 2015 (r290525) @@ -55,7 +55,7 @@ MKDEPCMD?= mkdep .endif DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} -.if ${MK_FAST_DEPEND} == "yes" +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" DEPENDFILES+= ${DEPENDFILE}.* DEPEND_CFLAGS+= -MD -MP -MF${DEPENDFILE}.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sun Nov 8 00:50:09 2015 (r290524) +++ head/sys/conf/kern.post.mk Sun Nov 8 00:50:13 2015 (r290525) @@ -199,7 +199,7 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDFILES= .depend -.if ${MK_FAST_DEPEND} == "yes" +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" DEPENDFILES+= .depend.* DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} From owner-svn-src-all@freebsd.org Sun Nov 8 00:50:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB325A22486; Sun, 8 Nov 2015 00:50:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6775C1A3E; Sun, 8 Nov 2015 00:50:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80oJJC048410; Sun, 8 Nov 2015 00:50:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80oI9B048396; Sun, 8 Nov 2015 00:50:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511080050.tA80oI9B048396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290526 - in head: . share/mk sys/conf tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:20 -0000 Author: bdrewery Date: Sun Nov 8 00:50:18 2015 New Revision: 290526 URL: https://svnweb.freebsd.org/changeset/base/290526 Log: Add built-in ccache build support via WITH_CCACHE_BUILD option. ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not used to achieve a safe pseudo-incremental build. This is explained in more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the cache, but with a full cache saves 30-50% in build times. When combined with the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the resulting dependency file, which it does not do when using mkdep(1)/'CC -E'. Stats are provided at the end of this message. This removes the need to modify /etc/make.conf with the CC:= and CXX:= lines which conflicted with external compiler support [3] (causing the bootstrap compiler to not be built which lead to obscure failures [4]), incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid Clang errors with parenthesis, and did not work with META_MODE. The option name was picked to match the existing option in ports. This feature is available for both in-src and out-of-src builds that use /usr/share/mk. Linking, assembly compiles, and pre-processing avoid using ccache since it is only overhead. ccache does nothing special in these modes, although there is no harm in calling it for them. CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap compiler to hash the content of the compiler binary to determine if it should be a cache miss. For external compilers the 'mtime' option is used as it is more efficient and likely to be correct. Future work may optimize the 'content' check using the same checks as whether a bootstrap compiler is needed to be built. The CCACHE_CPP2 pessimization is currently default in our devel/ccache port due to Clang requiring it. Clang's -Wparentheses-equality, -Wtautological-compare, and -Wself-assign warnings do not mix well with compiling already-pre-processed code that may have expanded macros that trigger the warnings. GCC has so far not had this issue so it is allowed to disable the CCACHE_CPP2 default in our port. Sharing a cache between multiple checkouts, or systems, is explained in the ccache manual. Sharing a cache over NFS would likely not be worth it, but syncing cache directories between systems may be useful for an organization. There is also a memcached backend available [5]. Due to using an object directory outside of the source directory though you will need to ensure that both are in the same prefix and all users use the same layout. A possible working layout is as follows: Source: /some/prefix/src1 Source: /some/prefix/src2 Source: /some/prefix/src3 Objdir: /some/prefix/obj Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace all absolute paths to be relative. Using something like this is required due to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache adds into its hash for the object without CCACHE_BASEDIR. distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc. I have not personally tested this and assume it will not mix well with using the bootstrap compiler. The cache from buildworld can be reused in a subdir by first running 'make buildenv' (from r290424). Note that the cache is currently different depending on whether -j is used or not due to ccache enabling -fdiagnostics-color automatically if stderr is a TTY, which bmake only does if not using -j. The system I used for testing was: WITNESS Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log. The arc was fully populated with src tree files and ccache objects. RAM: 76GiB CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz 2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16 The WITH_FAST_DEPEND feature was used for comparison here as well to show the dramatic time savings with a full cache. buildworld: x buildworld-before + buildworld-ccache-empty * buildworld-ccache-full % buildworld-ccache-full-fastdep # buildworld-fastdep +-------------------------------------------------------------------------------+ |% * # +| |% * # +| |% * # xxx +| | |A | | A| | A | |A | | A | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 3744.13 3794.31 3752.25 3763.5633 26.935139 + 3 4519 4525.04 4520.73 4521.59 3.1104823 Difference at 95.0% confidence 758.027 +/- 43.4565 20.1412% +/- 1.15466% (Student's t, pooled s = 19.1726) * 3 1823.08 1827.2 1825.62 1825.3 2.0785572 Difference at 95.0% confidence -1938.26 +/- 43.298 -51.5007% +/- 1.15045% (Student's t, pooled s = 19.1026) % 3 1266.96 1279.37 1270.47 1272.2667 6.3971113 Difference at 95.0% confidence -2491.3 +/- 44.3704 -66.1952% +/- 1.17895% (Student's t, pooled s = 19.5758) # 3 3153.34 3155.16 3154.2 3154.2333 0.91045776 Difference at 95.0% confidence -609.33 +/- 43.1943 -16.1902% +/- 1.1477% (Student's t, pooled s = 19.0569) buildkernel: x buildkernel-before + buildkernel-ccache-empty * buildkernel-ccache-empty-fastdep % buildkernel-ccache-full # buildkernel-ccache-full-fastdep @ buildkernel-fastdep +-------------------------------------------------------------------------------+ |# @ % * | |# @ % * x + | |# @ % * xx ++| | MA | | MA| | A | | A | |A | | A | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 571.57 573.94 571.79 572.43333 1.3094401 + 3 727.97 731.91 728.06 729.31333 2.2492295 Difference at 95.0% confidence 156.88 +/- 4.17129 27.4058% +/- 0.728695% (Student's t, pooled s = 1.84034) * 3 527.1 528.29 528.08 527.82333 0.63516402 Difference at 95.0% confidence -44.61 +/- 2.33254 -7.79305% +/- 0.407478% (Student's t, pooled s = 1.02909) % 3 400.4 401.05 400.62 400.69 0.3306055 Difference at 95.0% confidence -171.743 +/- 2.16453 -30.0023% +/- 0.378128% (Student's t, pooled s = 0.954969) # 3 201.94 203.34 202.28 202.52 0.73020545 Difference at 95.0% confidence -369.913 +/- 2.40293 -64.6212% +/- 0.419774% (Student's t, pooled s = 1.06015) @ 3 369.12 370.57 369.3 369.66333 0.79033748 Difference at 95.0% confidence -202.77 +/- 2.45131 -35.4225% +/- 0.428227% (Student's t, pooled s = 1.0815) [1] https://ccache.samba.org/performance.html [2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html [3] https://reviews.freebsd.org/D3484 [5] https://github.com/jrosdahl/ccache/pull/30 PR: 182944 [4] MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Relnotes: yes Added: head/tools/build/options/WITH_CCACHE_BUILD (contents, props changed) Modified: head/Makefile head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk head/share/mk/local.meta.sys.mk head/share/mk/sys.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 8 00:50:13 2015 (r290525) +++ head/Makefile Sun Nov 8 00:50:18 2015 (r290526) @@ -100,6 +100,10 @@ # For more information, see the build(7) manual page. # +# This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION +# can be cached for sub-makes. +.include + # Note: we use this awkward construct to be compatible with FreeBSD's # old make used in 10.0 and 9.2 and earlier. .if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" && !make(showconfig) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 8 00:50:13 2015 (r290525) +++ head/Makefile.inc1 Sun Nov 8 00:50:18 2015 (r290526) @@ -379,7 +379,7 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="$ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ SIZE="${XSIZE}" -.if ${XCC:M/*} +.if ${XCC:N${CCACHE_BIN}:M/*} .if defined(CROSS_BINUTILS_PREFIX) # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a # directory, but the compiler will look in the right place for it's @@ -456,7 +456,7 @@ LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMP -isystem ${LIB32TMP}/usr/include/ \ -L${LIB32TMP}/usr/lib32 \ -B${LIB32TMP}/usr/lib32 -.if ${XCC:M/*} +.if ${XCC:N${CCACHE_BIN}:M/*} LIB32FLAGS+= --sysroot=${WORLDTMP} .endif @@ -1599,7 +1599,7 @@ _elftctools= lib/libelftc \ # If an full path to an external cross compiler is given, don't build # a cross compiler. -.if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" +.if ${XCC:N${CCACHE_BIN}:M/*} == "" && ${MK_CROSS_COMPILER} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang _clang_libs= lib/clang Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/bsd.compiler.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -25,6 +25,71 @@ .if !target(____) ____: +.include + +# Handle ccache after CC is determined, but not if CC/CXX are already +# overridden with a manual setup. +.if ${MK_CCACHE_BUILD:Uno} == "yes" && \ + (${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "") +# CC is always prepended with the ccache wrapper rather than modifying +# PATH since it is more clear that ccache is used and avoids wasting time +# for mkdep/linking/asm builds. +LOCALBASE?= /usr/local +CCACHE_WRAPPER_PATH?= ${LOCALBASE}/libexec/ccache +CCACHE_BIN?= ${LOCALBASE}/bin/ccache +.if exists(${CCACHE_BIN}) +# Export to ensure sub-makes can filter it out for mkdep/linking and +# to chain down into kernel build which won't include this file. +.export CCACHE_BIN +# Expand and export some variables so they may be based on make vars. +# This allows doing something like the following in the environment: +# CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' +.for var in CCACHE_LOGFILE CCACHE_BASEDIR +.if defined(${var}) +${var}:= ${${var}} +.export ${var} +.endif +.endfor +# Handle bootstrapped compiler changes properly by hashing their content +# rather than checking mtime. For external compilers it should be safe +# to use the more optimal mtime check. +# XXX: CCACHE_COMPILERCHECK= string: +.if ${CC:N${CCACHE_BIN}:[1]:M/*} == "" +CCACHE_COMPILERCHECK?= content +.else +CCACHE_COMPILERCHECK?= mtime +.endif +.export CCACHE_COMPILERCHECK +# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. +PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} +# Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. +CCACHE_PATH= +.export CCACHE_PATH +# Override various toolchain vars. +.for var in CC CXX HOST_CC HOST_CXX +.if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" +${var}:= ${CCACHE_BIN} ${${var}} +.endif +.endfor +# GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache. +# The port enables it due to ccache passing preprocessed C to clang +# which fails with -Wparentheses-equality, -Wtautological-compare, and +# -Wself-assign on macro-expanded lines. +.if defined(COMPILER_TYPE) && ${COMPILER_TYPE} == "gcc" +CCACHE_NOCPP2= 1 +.export CCACHE_NOCPP2 +.endif +# Canonicalize CCACHE_DIR for meta mode usage. +.if defined(CCACHE_DIR) && empty(.MAKE.META.IGNORE_PATHS:M${CCACHE_DIR}) +CCACHE_DIR:= ${CCACHE_DIR:tA} +.MAKE.META.IGNORE_PATHS+= ${CCACHE_DIR} +.export CCACHE_DIR +.endif +ccache-print-options: .PHONY + @${CCACHE_BIN} -p +.endif # exists(${CCACHE_BIN}) +.endif # ${MK_CCACHE_BUILD} == "yes" + # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # CC and COMPILER_* settings here. Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/bsd.dep.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -48,11 +48,13 @@ CTAGSFLAGS?= GTAGSFLAGS?= -o HTAGSFLAGS?= -.if ${CC} != "cc" -MKDEPCMD?= CC='${CC} ${DEPFLAGS}' mkdep -.else -MKDEPCMD?= mkdep +_MKDEPCC:= ${CC:N${CCACHE_BIN}} +# XXX: DEPFLAGS can come out once Makefile.inc1 properly passes down +# CXXFLAGS. +.if !empty(DEPFLAGS) +_MKDEPCC+= ${DEPFLAGS} .endif +MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} .if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/bsd.lib.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -109,21 +109,23 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .asm.po: - ${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp -DPROF ${PO_CFLAGS} \ + ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.So: - ${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ + ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .S.po: - ${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + -o ${.TARGET} ${CTFCONVERT_CMD} .S.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ + -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .if !defined(_SKIP_BUILD) @@ -249,7 +251,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif - ${_LD} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ + ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${SOBJS} | tsort -q` ${LDADD} .if ${MK_CTF} != "no" Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/bsd.opts.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -66,6 +66,7 @@ __DEFAULT_YES_OPTIONS = \ WARNS __DEFAULT_NO_OPTIONS = \ + CCACHE_BUILD \ FAST_DEPEND \ CTF \ DEBUG_FILES \ Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/bsd.prog.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -82,9 +82,11 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ + ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \ + ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} @@ -112,9 +114,11 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ + ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \ + ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/local.meta.sys.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -186,12 +186,6 @@ UPDATE_DEPENDFILE= NO # define the list of places that contain files we are responsible for .MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT} -.if defined(CCACHE_DIR) -CCACHE_DIR := ${CCACHE_DIR:tA} -.MAKE.META.IGNORE_PATHS += ${CCACHE_DIR} -.export CCACHE_DIR -.endif - CSU_DIR.${MACHINE_ARCH} ?= csu/${MACHINE_ARCH} CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}} Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/share/mk/sys.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -317,11 +317,11 @@ YFLAGS ?= -d ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} .S.o: - ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.o: - ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/sys/conf/kern.post.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -195,6 +195,7 @@ SFILES_CDDL= ${SFILES:M*/cddl/*} kernel-depend: .depend # The argument list can be very long, so use make -V and xargs to # pass it to mkdep. +_MKDEPCC:= ${CC:N${CCACHE_BIN}} SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} @@ -219,14 +220,14 @@ DEPENDFILES_OBJS+= .depend.${__obj} .if ${MK_FAST_DEPEND} == "no" rm -f ${.TARGET}.tmp ${MAKE} -V CFILES_NOCDDL -V SYSTEM_CFILES -V GEN_CFILES | \ - CC="${CC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} ${MAKE} -V CFILES_CDDL | \ - CC="${CC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ ${FBT_CFLAGS} ${DTRACE_CFLAGS} ${MAKE} -V SFILES_NOCDDL | \ - CC="${CC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} ${MAKE} -V SFILES_CDDL | \ - CC="${CC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} mv ${.TARGET}.tmp ${.TARGET} .else : > ${.TARGET} Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sun Nov 8 00:50:13 2015 (r290525) +++ head/sys/conf/kern.pre.mk Sun Nov 8 00:50:18 2015 (r290526) @@ -128,7 +128,7 @@ CFLAGS+= ${CONF_CFLAGS} LINTFLAGS= ${LINTOBJKERNFLAGS} NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} -NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} Added: head/tools/build/options/WITH_CCACHE_BUILD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CCACHE_BUILD Sun Nov 8 00:50:18 2015 (r290526) @@ -0,0 +1,42 @@ +.\" $FreeBSD$ +Set to use +.Xr ccache 1 +for the build. +No configuration is required except to install the +.Sy devel/ccache +package. +Using with +.Xr distcc 1 +should set +.Sy CCACHE_PREFIX=/usr/local/bin/distcc . +The default cache directory of +.Pa $HOME/.ccache +will be used, which can be overridden by setting +.Sy CCACHE_DIR . +The +.Sy CCACHE_COMPILERCHECK +option defaults to +.Sy content +when using the in-tree bootstrap compiler, +and +.Sy mtime +when using an external compiler. +The +.Sy CCACHE_CPP2 +option is used for Clang but not GCC. +ccache works best when combined with the +.Sy WITH_FAST_DEPEND +option. +.Pp +Sharing a cache between multiple work directories requires using a layout +similar to +.Pa /some/prefix/src +.Pa /some/prefix/obj +and an environment such as: +.Bd -literal -offset indent +CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' +.Ed +.Pp +See +.Xr ccache 1 +for more configuration options. From owner-svn-src-all@freebsd.org Sun Nov 8 00:50:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB932A22507; Sun, 8 Nov 2015 00:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92CE21D50; Sun, 8 Nov 2015 00:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80oki4048481; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80ok3p048479; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080050.tA80ok3p048479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 00:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290527 - in stable/9: sbin/camcontrol share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:48 -0000 Author: ngie Date: Sun Nov 8 00:50:46 2015 New Revision: 290527 URL: https://svnweb.freebsd.org/changeset/base/290527 Log: MFstable/10 r290385: MFC r289913,r289916: r289913: Use 't' (bits) not 'i' (bytes) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database as the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is 4 bits wide, not 4 bytes wide 1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf Bug 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division r289916: Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the mode value isn't always clipped to -1 when (resolution * size) == 32, which would have been the case with values => {4i,32b,32t}. This seems to have been broken in r64382. PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: stable/9/sbin/camcontrol/modeedit.c stable/9/share/misc/scsi_modes Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/camcontrol/ (props changed) stable/9/share/ (props changed) stable/9/share/misc/ (props changed) Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:46 2015 (r290527) @@ -246,7 +246,7 @@ editentry_set(char *name, char *newvalue * currently workaround it (even for int64's), so we have to kludge it. */ #define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - (int)0xffffffff: (1 << (resolution * (size))) - 1) + INT_MAX: (1 << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0') Modified: stable/9/share/misc/scsi_modes ============================================================================== --- stable/9/share/misc/scsi_modes Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/share/misc/scsi_modes Sun Nov 8 00:50:46 2015 (r290527) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-all@freebsd.org Sun Nov 8 00:54:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2024AA226C5; Sun, 8 Nov 2015 00:54:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5CD0110D; Sun, 8 Nov 2015 00:54:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA80sfbB051203; Sun, 8 Nov 2015 00:54:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80sfng051202; Sun, 8 Nov 2015 00:54:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511080054.tA80sfng051202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 8 Nov 2015 00:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290528 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:54:43 -0000 Author: bdrewery Date: Sun Nov 8 00:54:41 2015 New Revision: 290528 URL: https://svnweb.freebsd.org/changeset/base/290528 Log: Regen after r290526 for WITH_CCACHE_BUILD. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Nov 8 00:50:46 2015 (r290527) +++ head/share/man/man5/src.conf.5 Sun Nov 8 00:54:41 2015 (r290528) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 290435 2015-11-06 05:28:08Z bdrewery .\" $FreeBSD$ -.Dd November 5, 2015 +.Dd November 7, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -230,6 +230,49 @@ Set to not build Capsicum support into s .It Va WITHOUT_CASPER .\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd Set to not build Casper program and related libraries. +.It Va WITH_CCACHE_BUILD +.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 290526 2015-11-08 00:50:18Z bdrewery +Set to use +.Xr ccache 1 +for the build. +No configuration is required except to install the +.Sy devel/ccache +package. +Using with +.Xr distcc 1 +should set +.Sy CCACHE_PREFIX=/usr/local/bin/distcc . +The default cache directory of +.Pa $HOME/.ccache +will be used, which can be overridden by setting +.Sy CCACHE_DIR . +The +.Sy CCACHE_COMPILERCHECK +option defaults to +.Sy content +when using the in-tree bootstrap compiler, +and +.Sy mtime +when using an external compiler. +The +.Sy CCACHE_CPP2 +option is used for Clang but not GCC. +ccache works best when combined with the +.Sy WITH_FAST_DEPEND +option. +.Pp +Sharing a cache between multiple work directories requires using a layout +similar to +.Pa /some/prefix/src +.Pa /some/prefix/obj +and an environment such as: +.Bd -literal -offset indent +CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' +.Ed +.Pp +See +.Xr ccache 1 +for more configuration options. .It Va WITHOUT_CCD .\" from FreeBSD: head/tools/build/options/WITHOUT_CCD 277678 2015-01-25 04:52:48Z ngie Set to not build From owner-svn-src-all@freebsd.org Sun Nov 8 01:36:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 595BDA22E9A; Sun, 8 Nov 2015 01:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 326981037; Sun, 8 Nov 2015 01:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA81aJ9x062560; Sun, 8 Nov 2015 01:36:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA81aJqQ062557; Sun, 8 Nov 2015 01:36:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511080136.tA81aJqQ062557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Nov 2015 01:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290529 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 01:36:20 -0000 Author: markj Date: Sun Nov 8 01:36:18 2015 New Revision: 290529 URL: https://svnweb.freebsd.org/changeset/base/290529 Log: Ensure that deactivated pages that are not expected to be reused are reclaimed in FIFO order by the pagedaemon. Previously we would enqueue such pages at the head of the inactive queue, yielding a LIFO reclaim order. Reviewed by: alc MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Nov 8 00:54:41 2015 (r290528) +++ head/sys/vm/vm_page.c Sun Nov 8 01:36:18 2015 (r290529) @@ -2536,14 +2536,16 @@ vm_page_unwire(vm_page_t m, uint8_t queu * processes. This optimization causes one-time-use metadata to be * reused more quickly. * - * Normally athead is 0 resulting in LRU operation. athead is set - * to 1 if we want this page to be 'as if it were placed in the cache', - * except without unmapping it from the process address space. + * Normally noreuse is FALSE, resulting in LRU operation. noreuse is set + * to TRUE if we want this page to be 'as if it were placed in the cache', + * except without unmapping it from the process address space. In + * practice this is implemented by inserting the page at the head of the + * queue, using a marker page to guide FIFO insertion ordering. * * The page must be locked. */ static inline void -_vm_page_deactivate(vm_page_t m, int athead) +_vm_page_deactivate(vm_page_t m, boolean_t noreuse) { struct vm_pagequeue *pq; int queue; @@ -2554,7 +2556,7 @@ _vm_page_deactivate(vm_page_t m, int ath * Ignore if the page is already inactive, unless it is unlikely to be * reactivated. */ - if ((queue = m->queue) == PQ_INACTIVE && !athead) + if ((queue = m->queue) == PQ_INACTIVE && !noreuse) return; if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { pq = &vm_phys_domain(m)->vmd_pagequeues[PQ_INACTIVE]; @@ -2569,8 +2571,9 @@ _vm_page_deactivate(vm_page_t m, int ath vm_pagequeue_lock(pq); } m->queue = PQ_INACTIVE; - if (athead) - TAILQ_INSERT_HEAD(&pq->pq_pl, m, plinks.q); + if (noreuse) + TAILQ_INSERT_BEFORE(&vm_phys_domain(m)->vmd_inacthead, + m, plinks.q); else TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); vm_pagequeue_cnt_inc(pq); @@ -2587,7 +2590,7 @@ void vm_page_deactivate(vm_page_t m) { - _vm_page_deactivate(m, 0); + _vm_page_deactivate(m, FALSE); } /* @@ -2600,7 +2603,7 @@ void vm_page_deactivate_noreuse(vm_page_t m) { - _vm_page_deactivate(m, 1); + _vm_page_deactivate(m, TRUE); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Nov 8 00:54:41 2015 (r290528) +++ head/sys/vm/vm_page.h Sun Nov 8 01:36:18 2015 (r290529) @@ -229,6 +229,7 @@ struct vm_domain { int vmd_pass; /* local pagedaemon pass */ int vmd_last_active_scan; struct vm_page vmd_marker; /* marker for pagedaemon private use */ + struct vm_page vmd_inacthead; /* marker for LRU-defeating insertions */ }; extern struct vm_domain vm_dom[MAXMEMDOM]; Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Nov 8 00:54:41 2015 (r290528) +++ head/sys/vm/vm_pageout.c Sun Nov 8 01:36:18 2015 (r290529) @@ -1630,6 +1630,9 @@ vm_pageout_worker(void *arg) KASSERT(domain->vmd_segs != 0, ("domain without segments")); domain->vmd_last_active_scan = ticks; vm_pageout_init_marker(&domain->vmd_marker, PQ_INACTIVE); + vm_pageout_init_marker(&domain->vmd_inacthead, PQ_INACTIVE); + TAILQ_INSERT_HEAD(&domain->vmd_pagequeues[PQ_INACTIVE].pq_pl, + &domain->vmd_inacthead, plinks.q); /* * The pageout daemon worker is never done, so loop forever. From owner-svn-src-all@freebsd.org Sun Nov 8 01:38:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A6B2A22F51; Sun, 8 Nov 2015 01:38:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C55D120E; Sun, 8 Nov 2015 01:38:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA81cv8U062687; Sun, 8 Nov 2015 01:38:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA81cv4w062683; Sun, 8 Nov 2015 01:38:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511080138.tA81cv4w062683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Nov 2015 01:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290530 - in head/sys: fs/procfs 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 01:38:58 -0000 Author: markj Date: Sun Nov 8 01:38:56 2015 New Revision: 290530 URL: https://svnweb.freebsd.org/changeset/base/290530 Log: - Consistently use PROC_ASSERT_HELD() to verify that a process' hold count is non-zero. - Include the process address in the PROC_ASSERT_HELD() and PROC_ASSERT_NOT_HELD() assertion messages so that the corresponding process can be found easily when debugging. MFC after: 1 week Modified: head/sys/fs/procfs/procfs_dbregs.c head/sys/fs/procfs/procfs_fpregs.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/fs/procfs/procfs_dbregs.c ============================================================================== --- head/sys/fs/procfs/procfs_dbregs.c Sun Nov 8 01:36:18 2015 (r290529) +++ head/sys/fs/procfs/procfs_dbregs.c Sun Nov 8 01:38:56 2015 (r290530) @@ -98,7 +98,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) return (0); PROC_LOCK(p); - KASSERT(p->p_lock > 0, ("proc not held")); + PROC_ASSERT_HELD(p); if (p_candebug(td, p) != 0) { PROC_UNLOCK(p); return (EPERM); Modified: head/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- head/sys/fs/procfs/procfs_fpregs.c Sun Nov 8 01:36:18 2015 (r290529) +++ head/sys/fs/procfs/procfs_fpregs.c Sun Nov 8 01:38:56 2015 (r290530) @@ -92,7 +92,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) return (0); PROC_LOCK(p); - KASSERT(p->p_lock > 0, ("proc not held")); + PROC_ASSERT_HELD(p); if (p_candebug(td, p)) { PROC_UNLOCK(p); return (EPERM); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sun Nov 8 01:36:18 2015 (r290529) +++ head/sys/kern/sys_process.c Sun Nov 8 01:38:56 2015 (r290530) @@ -251,8 +251,7 @@ proc_rwmem(struct proc *p, struct uio *u * curthread but we can't assert that.) This keeps the process * from exiting out from under us until this operation completes. */ - KASSERT(p->p_lock >= 1, ("%s: process %p (pid %d) not held", __func__, - p, p->p_pid)); + PROC_ASSERT_HELD(p); /* * The map we want... Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Nov 8 01:36:18 2015 (r290529) +++ head/sys/sys/proc.h Sun Nov 8 01:38:56 2015 (r290530) @@ -824,13 +824,13 @@ extern pid_t pid_max; #define _PHOLD(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ KASSERT(!((p)->p_flag & P_WEXIT) || (p) == curproc, \ - ("PHOLD of exiting process")); \ + ("PHOLD of exiting process %p", p)); \ (p)->p_lock++; \ if (((p)->p_flag & P_INMEM) == 0) \ faultin((p)); \ } while (0) -#define PROC_ASSERT_HELD(p) do { \ - KASSERT((p)->p_lock > 0, ("process not held")); \ +#define PROC_ASSERT_HELD(p) do { \ + KASSERT((p)->p_lock > 0, ("process %p not held", p)); \ } while (0) #define PRELE(p) do { \ @@ -845,8 +845,8 @@ extern pid_t pid_max; if (((p)->p_flag & P_WEXIT) && (p)->p_lock == 0) \ wakeup(&(p)->p_lock); \ } while (0) -#define PROC_ASSERT_NOT_HELD(p) do { \ - KASSERT((p)->p_lock == 0, ("process held")); \ +#define PROC_ASSERT_NOT_HELD(p) do { \ + KASSERT((p)->p_lock == 0, ("process %p held", p)); \ } while (0) #define PROC_UPDATE_COW(p) do { \ From owner-svn-src-all@freebsd.org Sun Nov 8 01:41:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1D5EA220EB; Sun, 8 Nov 2015 01:41:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FE814AE; Sun, 8 Nov 2015 01:41:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA81fick064646; Sun, 8 Nov 2015 01:41:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA81fitC064644; Sun, 8 Nov 2015 01:41:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511080141.tA81fitC064644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Nov 2015 01:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290531 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 01:41:46 -0000 Author: markj Date: Sun Nov 8 01:41:44 2015 New Revision: 290531 URL: https://svnweb.freebsd.org/changeset/base/290531 Log: Add a manual page for PHOLD() and friends. MFC after: 1 week Added: head/share/man/man9/PHOLD.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Nov 8 01:38:56 2015 (r290530) +++ head/share/man/man9/Makefile Sun Nov 8 01:41:44 2015 (r290531) @@ -209,6 +209,7 @@ MAN= accept_filter.9 \ pfind.9 \ pget.9 \ pgfind.9 \ + PHOLD.9 \ physio.9 \ pmap.9 \ pmap_activate.9 \ @@ -1314,6 +1315,11 @@ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_wlock.9 \ pfil.9 pfil_wunlock.9 MLINKS+=pfind.9 zpfind.9 +MLINKS+=PHOLD.9 PRELE.9 \ + PHOLD.9 _PHOLD.9 \ + PHOLD.9 _PRELE.9 \ + PHOLD.9 PROC_ASSERT_HELD.9 \ + PHOLD.9 PROC_ASSERT_NOT_HELD.9 MLINKS+=pmap_copy.9 pmap_copy_page.9 MLINKS+=pmap_extract.9 pmap_extract_and_hold.9 MLINKS+=pmap_init.9 pmap_init2.9 Added: head/share/man/man9/PHOLD.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PHOLD.9 Sun Nov 8 01:41:44 2015 (r290531) @@ -0,0 +1,67 @@ +.\" Copyright (c) 2015 Mark Johnston +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 7, 2015 +.Dt PHOLD 9 +.Os +.Sh NAME +.Nm PHOLD +.Nd hold a process +.Sh SYNOPSIS +.In sys/proc.h +.Fn PHOLD "struct proc *p" +.Fn _PHOLD "struct proc *p" +.Fn PRELE "struct proc *p" +.Fn _PRELE "struct proc *p" +.Fn PROC_ASSERT_HELD "struct proc *p" +.Fn PROC_ASSERT_NOT_HELD "struct proc *p" +.Sh DESCRIPTION +The +.Fn PHOLD +macro increments the hold count of a process, and the +.Fn PRELE +macro decrements the hold count of a process. +.Pp +If a process with a non-zero hold count attempts to exit, it will sleep until +its hold count has reached zero before the kernel begins releasing resources +associated with the process. +Once a process has started exiting, it is invalid to increase its hold count. +Thus, callers must not attempt to hold a process that has the +.Dv P_WEXIT +flag set. +The VM daemon will not swap out the kernel stack of a thread belonging to a +process with a non-zero hold count. +.Pp +The +.Fn _PHOLD +and +.Fn _PRELE +macros are identical to +.Fn PHOLD +and +.Fn PRELE , +except that they must be called with the process lock held. +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . From owner-svn-src-all@freebsd.org Sun Nov 8 01:43:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DFAA22156; Sun, 8 Nov 2015 01:43:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E65921874; Sun, 8 Nov 2015 01:43:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DCD101194; Sun, 8 Nov 2015 01:43:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 94F4A127AB; Sun, 8 Nov 2015 01:43:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7kwySHYkaEcw; Sun, 8 Nov 2015 01:43:22 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4E9EE127A8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r290531 - head/share/man/man9 From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: <201511080141.tA81fitC064644@repo.freebsd.org> Date: Sat, 7 Nov 2015 17:43:17 -0800 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7C0173DE-0EC7-427C-AFBD-3F851B4C8E69@FreeBSD.org> References: <201511080141.tA81fitC064644@repo.freebsd.org> To: Mark Johnston X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 01:43:26 -0000 Thanks for this!=20 Regards, Bryan Drewery > On Nov 7, 2015, at 17:41, Mark Johnston wrote: >=20 > Author: markj > Date: Sun Nov 8 01:41:44 2015 > New Revision: 290531 > URL: https://svnweb.freebsd.org/changeset/base/290531 >=20 > Log: > Add a manual page for PHOLD() and friends. >=20 > MFC after: 1 week >=20 > Added: > head/share/man/man9/PHOLD.9 (contents, props changed) > Modified: > head/share/man/man9/Makefile >=20 > Modified: head/share/man/man9/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/share/man/man9/Makefile Sun Nov 8 01:38:56 2015 (r290530) > +++ head/share/man/man9/Makefile Sun Nov 8 01:41:44 2015 (r290531) > @@ -209,6 +209,7 @@ MAN=3D accept_filter.9 \ > pfind.9 \ > pget.9 \ > pgfind.9 \ > + PHOLD.9 \ > physio.9 \ > pmap.9 \ > pmap_activate.9 \ > @@ -1314,6 +1315,11 @@ MLINKS+=3Dpfil.9 pfil_add_hook.9 \ > pfil.9 pfil_wlock.9 \ > pfil.9 pfil_wunlock.9 > MLINKS+=3Dpfind.9 zpfind.9 > +MLINKS+=3DPHOLD.9 PRELE.9 \ > + PHOLD.9 _PHOLD.9 \ > + PHOLD.9 _PRELE.9 \ > + PHOLD.9 PROC_ASSERT_HELD.9 \ > + PHOLD.9 PROC_ASSERT_NOT_HELD.9 > MLINKS+=3Dpmap_copy.9 pmap_copy_page.9 > MLINKS+=3Dpmap_extract.9 pmap_extract_and_hold.9 > MLINKS+=3Dpmap_init.9 pmap_init2.9 >=20 > Added: head/share/man/man9/PHOLD.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man9/PHOLD.9 Sun Nov 8 01:41:44 2015 (r290531) > @@ -0,0 +1,67 @@ > +.\" Copyright (c) 2015 Mark Johnston > +.\" > +.\" 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 th= e > +.\" documentation and/or other materials provided with the distributio= n. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS= OR > +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, > +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, B= UT > +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF U= SE, > +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY= > +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd November 7, 2015 > +.Dt PHOLD 9 > +.Os > +.Sh NAME > +.Nm PHOLD > +.Nd hold a process > +.Sh SYNOPSIS > +.In sys/proc.h > +.Fn PHOLD "struct proc *p" > +.Fn _PHOLD "struct proc *p" > +.Fn PRELE "struct proc *p" > +.Fn _PRELE "struct proc *p" > +.Fn PROC_ASSERT_HELD "struct proc *p" > +.Fn PROC_ASSERT_NOT_HELD "struct proc *p" > +.Sh DESCRIPTION > +The > +.Fn PHOLD > +macro increments the hold count of a process, and the > +.Fn PRELE > +macro decrements the hold count of a process. > +.Pp > +If a process with a non-zero hold count attempts to exit, it will sleep u= ntil > +its hold count has reached zero before the kernel begins releasing resour= ces > +associated with the process. > +Once a process has started exiting, it is invalid to increase its hold co= unt. > +Thus, callers must not attempt to hold a process that has the > +.Dv P_WEXIT > +flag set. > +The VM daemon will not swap out the kernel stack of a thread belonging to= a > +process with a non-zero hold count. > +.Pp > +The > +.Fn _PHOLD > +and > +.Fn _PRELE > +macros are identical to > +.Fn PHOLD > +and > +.Fn PRELE , > +except that they must be called with the process lock held. > +.Sh AUTHORS > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . >=20 From owner-svn-src-all@freebsd.org Sun Nov 8 02:06:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93453A22935; Sun, 8 Nov 2015 02:06:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 580DE13E4; Sun, 8 Nov 2015 02:06:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA826I5k071249; Sun, 8 Nov 2015 02:06:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA826HJR071239; Sun, 8 Nov 2015 02:06:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080206.tA826HJR071239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 02:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290532 - in head: lib/libc/tests/locale tools/regression/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 02:06:19 -0000 Author: ngie Date: Sun Nov 8 02:06:17 2015 New Revision: 290532 URL: https://svnweb.freebsd.org/changeset/base/290532 Log: Integrate tools/regression/lib/libc/locale into the FreeBSD test suite as lib/libc/tests/locale MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/locale/btowc_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-btowc.c head/lib/libc/tests/locale/c16rtomb_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-c16rtomb.c head/lib/libc/tests/locale/iswctype_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-iswctype.c head/lib/libc/tests/locale/mblen_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mblen.c head/lib/libc/tests/locale/mbrlen_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbrlen.c head/lib/libc/tests/locale/mbrtoc16_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbrtoc16.c head/lib/libc/tests/locale/mbrtowc_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbrtowc.c head/lib/libc/tests/locale/mbsnrtowcs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbsnrtowcs.c head/lib/libc/tests/locale/mbsrtowcs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbsrtowcs.c head/lib/libc/tests/locale/mbstowcs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbstowcs.c head/lib/libc/tests/locale/mbtowc_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-mbtowc.c head/lib/libc/tests/locale/towctrans_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-towctrans.c head/lib/libc/tests/locale/wcrtomb_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-wcrtomb.c head/lib/libc/tests/locale/wcsnrtombs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-wcsnrtombs.c head/lib/libc/tests/locale/wcsrtombs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-wcsrtombs.c head/lib/libc/tests/locale/wcstombs_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-wcstombs.c head/lib/libc/tests/locale/wctomb_test.c - copied, changed from r290531, head/tools/regression/lib/libc/locale/test-wctomb.c Deleted: head/tools/regression/lib/libc/locale/ Modified: head/lib/libc/tests/locale/Makefile Modified: head/lib/libc/tests/locale/Makefile ============================================================================== --- head/lib/libc/tests/locale/Makefile Sun Nov 8 01:41:44 2015 (r290531) +++ head/lib/libc/tests/locale/Makefile Sun Nov 8 02:06:17 2015 (r290532) @@ -2,6 +2,24 @@ .include +ATF_TESTS_C+= btowc_test +ATF_TESTS_C+= c16rtomb_test +ATF_TESTS_C+= iswctype_test +ATF_TESTS_C+= mblen_test +ATF_TESTS_C+= mbrlen_test +ATF_TESTS_C+= mbrtoc16_test +ATF_TESTS_C+= mbrtowc_2_test +ATF_TESTS_C+= mbsnrtowcs_2_test +ATF_TESTS_C+= mbsrtowcs_test +ATF_TESTS_C+= mbstowcs_2_test +ATF_TESTS_C+= mbtowc_2_test +ATF_TESTS_C+= towctrans_test +ATF_TESTS_C+= wcrtomb_test +ATF_TESTS_C+= wcsnrtombs_test +ATF_TESTS_C+= wcsrtombs_test +ATF_TESTS_C+= wcstombs_test +ATF_TESTS_C+= wctomb_2_test + NETBSD_ATF_TESTS_C= io_test NETBSD_ATF_TESTS_C+= mbrtowc_test NETBSD_ATF_TESTS_C+= mbstowcs_test @@ -13,7 +31,13 @@ NETBSD_ATF_TESTS_C+= wcsspn_test NETBSD_ATF_TESTS_C+= wcstod_test NETBSD_ATF_TESTS_C+= wctomb_test -CFLAGS.t_wctomb.c+= -Wno-stack-protector +SRCS.mbrtowc_2_test= mbrtowc_test.c +SRCS.mbsnrtowcs_2_test= mbsnrtowcs_test.c +SRCS.mbstowcs_2_test= mbstowcs_test.c +SRCS.mbtowc_2_test= mbtowc_test.c +SRCS.wctomb_2_test= wctomb_test.c + +CFLAGS.t_wctomb.c+= -Wno-stack-protector .include "../Makefile.netbsd-tests" Copied and modified: head/lib/libc/tests/locale/btowc_test.c (from r290531, head/tools/regression/lib/libc/locale/test-btowc.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-btowc.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/btowc_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -42,32 +41,31 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(btowc_test); +ATF_TC_BODY(btowc_test, tc) { int i; - printf("1..2\n"); - - /* - * C/POSIX locale. - */ - assert(btowc(EOF) == WEOF); - assert(wctob(WEOF) == EOF); + /* C/POSIX locale. */ + ATF_REQUIRE(btowc(EOF) == WEOF); + ATF_REQUIRE(wctob(WEOF) == EOF); for (i = 0; i < UCHAR_MAX; i++) - assert(btowc(i) == (wchar_t)i && i == (int)wctob(i)); + ATF_REQUIRE(btowc(i) == (wchar_t)i && i == (int)wctob(i)); - /* - * Japanese (EUC) locale. - */ + /* Japanese (EUC) locale. */ + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); + ATF_REQUIRE(MB_CUR_MAX > 1); + ATF_REQUIRE(btowc('A') == L'A' && wctob(L'A') == 'A'); + ATF_REQUIRE(btowc(0xa3) == WEOF && wctob(0xa3c1) == EOF); - assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); - assert(MB_CUR_MAX > 1); - assert(btowc('A') == L'A' && wctob(L'A') == 'A'); - assert(btowc(0xa3) == WEOF && wctob(0xa3c1) == EOF); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - btowc()\n"); - printf("ok 2 - wctob()\n"); + ATF_TP_ADD_TC(tp, btowc_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/c16rtomb_test.c (from r290531, head/tools/regression/lib/libc/locale/test-c16rtomb.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-c16rtomb.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/c16rtomb_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -41,105 +40,103 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(c16rtomb_test); +ATF_TC_BODY(c16rtomb_test, tc) { mbstate_t s; char buf[MB_LEN_MAX + 1]; - /* - * C/POSIX locale. - */ - - printf("1..1\n"); + /* C/POSIX locale. */ /* * If the buffer argument is NULL, c16 is implicitly 0, * c16rtomb() resets its internal state. */ - assert(c16rtomb(NULL, L'\0', NULL) == 1); - assert(c16rtomb(NULL, 0xdc00, NULL) == 1); + ATF_REQUIRE(c16rtomb(NULL, L'\0', NULL) == 1); + ATF_REQUIRE(c16rtomb(NULL, 0xdc00, NULL) == 1); /* Null wide character. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0, &s) == 1); - assert((unsigned char)buf[0] == 0 && (unsigned char)buf[1] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0, &s) == 1); + ATF_REQUIRE((unsigned char)buf[0] == 0 && (unsigned char)buf[1] == 0xcc); /* Latin letter A, internal state. */ - assert(c16rtomb(NULL, L'\0', NULL) == 1); - assert(c16rtomb(NULL, L'A', NULL) == 1); + ATF_REQUIRE(c16rtomb(NULL, L'\0', NULL) == 1); + ATF_REQUIRE(c16rtomb(NULL, L'A', NULL) == 1); /* Latin letter A. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, L'A', &s) == 1); - assert((unsigned char)buf[0] == 'A' && (unsigned char)buf[1] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, L'A', &s) == 1); + ATF_REQUIRE((unsigned char)buf[0] == 'A' && (unsigned char)buf[1] == 0xcc); /* Unicode character 'Pile of poo'. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0xd83d, &s) == 0); - assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); - assert(errno == EILSEQ); - assert((unsigned char)buf[0] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0xd83d, &s) == 0); + ATF_REQUIRE(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); + ATF_REQUIRE(errno == EILSEQ); + ATF_REQUIRE((unsigned char)buf[0] == 0xcc); - /* - * ISO8859-1. - */ + /* ISO8859-1. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-1"), + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-1"), "en_US.ISO8859-1") == 0); /* Unicode character 'Euro sign'. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0x20ac, &s) == (size_t)-1); - assert(errno == EILSEQ); - assert((unsigned char)buf[0] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0x20ac, &s) == (size_t)-1); + ATF_REQUIRE(errno == EILSEQ); + ATF_REQUIRE((unsigned char)buf[0] == 0xcc); - /* - * ISO8859-15. - */ + /* ISO8859-15. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-15"), + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-15"), "en_US.ISO8859-15") == 0); /* Unicode character 'Euro sign'. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0x20ac, &s) == 1); - assert((unsigned char)buf[0] == 0xa4 && (unsigned char)buf[1] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0x20ac, &s) == 1); + ATF_REQUIRE((unsigned char)buf[0] == 0xa4 && (unsigned char)buf[1] == 0xcc); - /* - * UTF-8. - */ + /* UTF-8. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0); + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0); /* Unicode character 'Pile of poo'. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0xd83d, &s) == 0); - assert(c16rtomb(buf, 0xdca9, &s) == 4); - assert((unsigned char)buf[0] == 0xf0 && (unsigned char)buf[1] == 0x9f && + ATF_REQUIRE(c16rtomb(buf, 0xd83d, &s) == 0); + ATF_REQUIRE(c16rtomb(buf, 0xdca9, &s) == 4); + ATF_REQUIRE((unsigned char)buf[0] == 0xf0 && (unsigned char)buf[1] == 0x9f && (unsigned char)buf[2] == 0x92 && (unsigned char)buf[3] == 0xa9 && (unsigned char)buf[4] == 0xcc); /* Invalid code; 'Pile of poo' without the trail surrogate. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0xd83d, &s) == 0); - assert(c16rtomb(buf, L'A', &s) == (size_t)-1); - assert(errno == EILSEQ); - assert((unsigned char)buf[0] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0xd83d, &s) == 0); + ATF_REQUIRE(c16rtomb(buf, L'A', &s) == (size_t)-1); + ATF_REQUIRE(errno == EILSEQ); + ATF_REQUIRE((unsigned char)buf[0] == 0xcc); /* Invalid code; 'Pile of poo' without the lead surrogate. */ memset(&s, 0, sizeof(s)); memset(buf, 0xcc, sizeof(buf)); - assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); - assert(errno == EILSEQ); - assert((unsigned char)buf[0] == 0xcc); + ATF_REQUIRE(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); + ATF_REQUIRE(errno == EILSEQ); + ATF_REQUIRE((unsigned char)buf[0] == 0xcc); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, c16rtomb_test); - printf("ok 1 - c16rtomb()\n"); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/iswctype_test.c (from r290531, head/tools/regression/lib/libc/locale/test-iswctype.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-iswctype.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/iswctype_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -34,15 +34,16 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(iswctype_test); +ATF_TC_BODY(iswctype_test, tc) { wctype_t t; int i, j; @@ -64,39 +65,36 @@ main(int argc, char *argv[]) { "xdigit", iswxdigit } }; - printf("1..2\n"); - - /* - * C/POSIX locale. - */ + /* C/POSIX locale. */ for (i = 0; i < sizeof(cls) / sizeof(*cls); i++) { t = wctype(cls[i].name); - assert(t != 0); + ATF_REQUIRE(t != 0); for (j = 0; j < 256; j++) - assert(cls[i].func(j) == iswctype(j, t)); + ATF_REQUIRE(cls[i].func(j) == iswctype(j, t)); } t = wctype("elephant"); - assert(t == 0); + ATF_REQUIRE(t == 0); for (i = 0; i < 256; i++) - assert(iswctype(i, t) == 0); + ATF_REQUIRE(iswctype(i, t) == 0); - /* - * Japanese (EUC) locale. - */ - assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); + /* Japanese (EUC) locale. */ + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); for (i = 0; i < sizeof(cls) / sizeof(*cls); i++) { t = wctype(cls[i].name); - assert(t != 0); + ATF_REQUIRE(t != 0); for (j = 0; j < 65536; j++) - assert(cls[i].func(j) == iswctype(j, t)); + ATF_REQUIRE(cls[i].func(j) == iswctype(j, t)); } t = wctype("elephant"); - assert(t == 0); + ATF_REQUIRE(t == 0); for (i = 0; i < 65536; i++) - assert(iswctype(i, t) == 0); + ATF_REQUIRE(iswctype(i, t) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - iswctype()\n"); - printf("ok 2 - wctype()\n"); + ATF_TP_ADD_TC(tp, iswctype_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/mblen_test.c (from r290531, head/tools/regression/lib/libc/locale/test-mblen.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-mblen.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/mblen_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -35,15 +35,16 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(mblen_test); +ATF_TC_BODY(mblen_test, tc) { size_t len; char buf[MB_LEN_MAX + 1]; @@ -54,61 +55,65 @@ main(int argc, char *argv[]) printf("1..1\n"); - assert(MB_CUR_MAX == 1); + ATF_REQUIRE(MB_CUR_MAX == 1); /* No shift states in C locale. */ - assert(mblen(NULL, 0) == 0); + ATF_REQUIRE(mblen(NULL, 0) == 0); /* Null wide character. */ memset(buf, 0xcc, sizeof(buf)); buf[0] = '\0'; - assert(mblen(buf, 1) == 0); + ATF_REQUIRE(mblen(buf, 1) == 0); /* Latin letter A. */ buf[0] = 'A'; - assert(mblen(buf, 1) == 1); + ATF_REQUIRE(mblen(buf, 1) == 1); /* Incomplete character sequence. */ buf[0] = '\0'; - assert(mblen(buf, 0) == -1); - assert(mblen(NULL, 0) == 0); + ATF_REQUIRE(mblen(buf, 0) == -1); + ATF_REQUIRE(mblen(NULL, 0) == 0); /* * Japanese (EUC) locale. */ - assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); - assert(MB_CUR_MAX > 1); + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); + ATF_REQUIRE(MB_CUR_MAX > 1); /* No shift states in EUC. */ - assert(mblen(NULL, 0) == 0); + ATF_REQUIRE(mblen(NULL, 0) == 0); /* Null wide character. */ memset(buf, 0xcc, sizeof(buf)); buf[0] = '\0'; - assert(mblen(buf, 1) == 0); + ATF_REQUIRE(mblen(buf, 1) == 0); /* Latin letter A. */ buf[0] = 'A'; - assert(mblen(buf, 1) == 1); + ATF_REQUIRE(mblen(buf, 1) == 1); /* Incomplete character sequence. */ buf[0] = '\0'; - assert(mblen(buf, 0) == -1); - assert(mblen(NULL, 0) == 0); + ATF_REQUIRE(mblen(buf, 0) == -1); + ATF_REQUIRE(mblen(NULL, 0) == 0); /* Incomplete character sequence (truncated double-byte). */ memset(buf, 0xcc, sizeof(buf)); buf[0] = 0xa3; buf[1] = 0x00; - assert(mblen(buf, 1) == -1); - assert(mblen(NULL, 0) == 0); + ATF_REQUIRE(mblen(buf, 1) == -1); + ATF_REQUIRE(mblen(NULL, 0) == 0); /* Same as above, but complete. */ buf[1] = 0xc1; - assert(mblen(buf, 2) == 2); + ATF_REQUIRE(mblen(buf, 2) == 2); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - mblen()\n"); + ATF_TP_ADD_TC(tp, mblen_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/mbrlen_test.c (from r290531, head/tools/regression/lib/libc/locale/test-mbrlen.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-mbrlen.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/mbrlen_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -44,86 +43,85 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(mbrlen_test); +ATF_TC_BODY(mbrlen_test, tc) { mbstate_t s; size_t len; char buf[MB_LEN_MAX + 1]; - /* - * C/POSIX locale. - */ - - printf("1..1\n"); - - assert(MB_CUR_MAX == 1); + /* C/POSIX locale. */ + ATF_REQUIRE(MB_CUR_MAX == 1); /* Null wide character, internal state. */ memset(buf, 0xcc, sizeof(buf)); buf[0] = 0; - assert(mbrlen(buf, 1, NULL) == 0); + ATF_REQUIRE(mbrlen(buf, 1, NULL) == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 1, &s) == 0); + ATF_REQUIRE(mbrlen(buf, 1, &s) == 0); /* Latin letter A, internal state. */ - assert(mbrlen(NULL, 0, NULL) == 0); + ATF_REQUIRE(mbrlen(NULL, 0, NULL) == 0); buf[0] = 'A'; - assert(mbrlen(buf, 1, NULL) == 1); + ATF_REQUIRE(mbrlen(buf, 1, NULL) == 1); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 1, &s) == 1); + ATF_REQUIRE(mbrlen(buf, 1, &s) == 1); /* Incomplete character sequence. */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 0, &s) == (size_t)-2); + ATF_REQUIRE(mbrlen(buf, 0, &s) == (size_t)-2); - /* - * Japanese (EUC) locale. - */ + /* Japanese (EUC) locale. */ - assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); - assert(MB_CUR_MAX > 1); + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); + ATF_REQUIRE(MB_CUR_MAX > 1); /* Null wide character, internal state. */ - assert(mbrlen(NULL, 0, NULL) == 0); + ATF_REQUIRE(mbrlen(NULL, 0, NULL) == 0); memset(buf, 0xcc, sizeof(buf)); buf[0] = 0; - assert(mbrlen(buf, 1, NULL) == 0); + ATF_REQUIRE(mbrlen(buf, 1, NULL) == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 1, &s) == 0); + ATF_REQUIRE(mbrlen(buf, 1, &s) == 0); /* Latin letter A, internal state. */ - assert(mbrlen(NULL, 0, NULL) == 0); + ATF_REQUIRE(mbrlen(NULL, 0, NULL) == 0); buf[0] = 'A'; - assert(mbrlen(buf, 1, NULL) == 1); + ATF_REQUIRE(mbrlen(buf, 1, NULL) == 1); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 1, &s) == 1); + ATF_REQUIRE(mbrlen(buf, 1, &s) == 1); /* Incomplete character sequence (zero length). */ memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 0, &s) == (size_t)-2); + ATF_REQUIRE(mbrlen(buf, 0, &s) == (size_t)-2); /* Incomplete character sequence (truncated double-byte). */ memset(buf, 0xcc, sizeof(buf)); buf[0] = 0xa3; buf[1] = 0x00; memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 1, &s) == (size_t)-2); + ATF_REQUIRE(mbrlen(buf, 1, &s) == (size_t)-2); /* Same as above, but complete. */ buf[1] = 0xc1; memset(&s, 0, sizeof(s)); - assert(mbrlen(buf, 2, &s) == 2); + ATF_REQUIRE(mbrlen(buf, 2, &s) == 2); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - mbrlen()\n"); + ATF_TP_ADD_TC(tp, mbrlen_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/mbrtoc16_test.c (from r290531, head/tools/regression/lib/libc/locale/test-mbrtoc16.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-mbrtoc16.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/mbrtoc16_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -41,8 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(mbrtoc16_test); +ATF_TC_BODY(mbrtoc16_test, tc) { mbstate_t s; size_t len; @@ -55,141 +56,145 @@ main(int argc, char *argv[]) printf("1..1\n"); /* Null wide character, internal state. */ - assert(mbrtoc16(&c16, "", 1, NULL) == 0); - assert(c16 == 0); + ATF_REQUIRE(mbrtoc16(&c16, "", 1, NULL) == 0); + ATF_REQUIRE(c16 == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "", 1, &s) == 0); - assert(c16 == 0); + ATF_REQUIRE(mbrtoc16(&c16, "", 1, &s) == 0); + ATF_REQUIRE(c16 == 0); /* Latin letter A, internal state. */ - assert(mbrtoc16(NULL, 0, 0, NULL) == 0); - assert(mbrtoc16(&c16, "A", 1, NULL) == 1); - assert(c16 == L'A'); + ATF_REQUIRE(mbrtoc16(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtoc16(&c16, "A", 1, NULL) == 1); + ATF_REQUIRE(c16 == L'A'); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "A", 1, &s) == 1); - assert(c16 == L'A'); + ATF_REQUIRE(mbrtoc16(&c16, "A", 1, &s) == 1); + ATF_REQUIRE(c16 == L'A'); /* Incomplete character sequence. */ c16 = L'z'; memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); - assert(c16 == L'z'); + ATF_REQUIRE(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); + ATF_REQUIRE(c16 == L'z'); /* Check that mbrtoc16() doesn't access the buffer when n == 0. */ c16 = L'z'; memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); - assert(c16 == L'z'); + ATF_REQUIRE(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); + ATF_REQUIRE(c16 == L'z'); /* Check that mbrtoc16() doesn't read ahead too aggressively. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "AB", 2, &s) == 1); - assert(c16 == L'A'); - assert(mbrtoc16(&c16, "C", 1, &s) == 1); - assert(c16 == L'C'); + ATF_REQUIRE(mbrtoc16(&c16, "AB", 2, &s) == 1); + ATF_REQUIRE(c16 == L'A'); + ATF_REQUIRE(mbrtoc16(&c16, "C", 1, &s) == 1); + ATF_REQUIRE(c16 == L'C'); /* * ISO-8859-1. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-1"), + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-1"), "en_US.ISO8859-1") == 0); /* Currency sign. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "\xa4", 1, &s) == 1); - assert(c16 == 0xa4); + ATF_REQUIRE(mbrtoc16(&c16, "\xa4", 1, &s) == 1); + ATF_REQUIRE(c16 == 0xa4); /* * ISO-8859-15. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-15"), + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-15"), "en_US.ISO8859-15") == 0); /* Euro sign. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "\xa4", 1, &s) == 1); - assert(c16 == 0x20ac); + ATF_REQUIRE(mbrtoc16(&c16, "\xa4", 1, &s) == 1); + ATF_REQUIRE(c16 == 0x20ac); /* * UTF-8. */ - assert(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0); + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0); /* Null wide character, internal state. */ - assert(mbrtoc16(NULL, 0, 0, NULL) == 0); - assert(mbrtoc16(&c16, "", 1, NULL) == 0); - assert(c16 == 0); + ATF_REQUIRE(mbrtoc16(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtoc16(&c16, "", 1, NULL) == 0); + ATF_REQUIRE(c16 == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "", 1, &s) == 0); - assert(c16 == 0); + ATF_REQUIRE(mbrtoc16(&c16, "", 1, &s) == 0); + ATF_REQUIRE(c16 == 0); /* Latin letter A, internal state. */ - assert(mbrtoc16(NULL, 0, 0, NULL) == 0); - assert(mbrtoc16(&c16, "A", 1, NULL) == 1); - assert(c16 == L'A'); + ATF_REQUIRE(mbrtoc16(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtoc16(&c16, "A", 1, NULL) == 1); + ATF_REQUIRE(c16 == L'A'); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "A", 1, &s) == 1); - assert(c16 == L'A'); + ATF_REQUIRE(mbrtoc16(&c16, "A", 1, &s) == 1); + ATF_REQUIRE(c16 == L'A'); /* Incomplete character sequence (zero length). */ c16 = L'z'; memset(&s, 0, sizeof(s)); - assert(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); - assert(c16 == L'z'); + ATF_REQUIRE(mbrtoc16(&c16, "", 0, &s) == (size_t)-2); + ATF_REQUIRE(c16 == L'z'); /* Incomplete character sequence (truncated double-byte). */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\xc3", 1, &s) == (size_t)-2); + ATF_REQUIRE(mbrtoc16(&c16, "\xc3", 1, &s) == (size_t)-2); /* Same as above, but complete. */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\xc3\x84", 2, &s) == 2); - assert(c16 == 0xc4); + ATF_REQUIRE(mbrtoc16(&c16, "\xc3\x84", 2, &s) == 2); + ATF_REQUIRE(c16 == 0xc4); /* Test restarting behaviour. */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\xc3", 1, &s) == (size_t)-2); - assert(c16 == 0); - assert(mbrtoc16(&c16, "\xb7", 1, &s) == 1); - assert(c16 == 0xf7); + ATF_REQUIRE(mbrtoc16(&c16, "\xc3", 1, &s) == (size_t)-2); + ATF_REQUIRE(c16 == 0); + ATF_REQUIRE(mbrtoc16(&c16, "\xb7", 1, &s) == 1); + ATF_REQUIRE(c16 == 0xf7); /* Surrogate pair. */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\xf0\x9f\x92\xa9", 4, &s) == 4); - assert(c16 == 0xd83d); - assert(mbrtoc16(&c16, "", 0, &s) == (size_t)-3); - assert(c16 == 0xdca9); + ATF_REQUIRE(mbrtoc16(&c16, "\xf0\x9f\x92\xa9", 4, &s) == 4); + ATF_REQUIRE(c16 == 0xd83d); + ATF_REQUIRE(mbrtoc16(&c16, "", 0, &s) == (size_t)-3); + ATF_REQUIRE(c16 == 0xdca9); /* Letter e with acute, precomposed. */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\xc3\xa9", 2, &s) == 2); - assert(c16 == 0xe9); + ATF_REQUIRE(mbrtoc16(&c16, "\xc3\xa9", 2, &s) == 2); + ATF_REQUIRE(c16 == 0xe9); /* Letter e with acute, combined. */ memset(&s, 0, sizeof(s)); c16 = 0; - assert(mbrtoc16(&c16, "\x65\xcc\x81", 3, &s) == 1); - assert(c16 == 0x65); - assert(mbrtoc16(&c16, "\xcc\x81", 2, &s) == 2); - assert(c16 == 0x301); + ATF_REQUIRE(mbrtoc16(&c16, "\x65\xcc\x81", 3, &s) == 1); + ATF_REQUIRE(c16 == 0x65); + ATF_REQUIRE(mbrtoc16(&c16, "\xcc\x81", 2, &s) == 2); + ATF_REQUIRE(c16 == 0x301); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - mbrtoc16()\n"); + ATF_TP_ADD_TC(tp, mbrtoc16_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/mbrtowc_test.c (from r290531, head/tools/regression/lib/libc/locale/test-mbrtowc.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-mbrtowc.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/mbrtowc_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -44,8 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(mbrtowc_test); +ATF_TC_BODY(mbrtowc_test, tc) { mbstate_t s; size_t len; @@ -58,78 +59,78 @@ main(int argc, char *argv[]) printf("1..1\n"); - assert(MB_CUR_MAX == 1); + ATF_REQUIRE(MB_CUR_MAX == 1); /* Null wide character, internal state. */ memset(buf, 0xcc, sizeof(buf)); buf[0] = 0; - assert(mbrtowc(&wc, buf, 1, NULL) == 0); - assert(wc == 0); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, NULL) == 0); + ATF_REQUIRE(wc == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 1, &s) == 0); - assert(wc == 0); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == 0); + ATF_REQUIRE(wc == 0); /* Latin letter A, internal state. */ - assert(mbrtowc(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtowc(NULL, 0, 0, NULL) == 0); buf[0] = 'A'; - assert(mbrtowc(&wc, buf, 1, NULL) == 1); - assert(wc == L'A'); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, NULL) == 1); + ATF_REQUIRE(wc == L'A'); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 1, &s) == 1); - assert(wc == L'A'); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == 1); + ATF_REQUIRE(wc == L'A'); /* Incomplete character sequence. */ wc = L'z'; memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); - assert(wc == L'z'); + ATF_REQUIRE(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); + ATF_REQUIRE(wc == L'z'); /* Check that mbrtowc() doesn't access the buffer when n == 0. */ wc = L'z'; memset(&s, 0, sizeof(s)); buf[0] = '\0'; - assert(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); - assert(wc == L'z'); + ATF_REQUIRE(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); + ATF_REQUIRE(wc == L'z'); /* * Japanese (EUC) locale. */ - assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); - assert(MB_CUR_MAX > 1); + ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0); + ATF_REQUIRE(MB_CUR_MAX > 1); /* Null wide character, internal state. */ - assert(mbrtowc(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtowc(NULL, 0, 0, NULL) == 0); memset(buf, 0xcc, sizeof(buf)); buf[0] = 0; - assert(mbrtowc(&wc, buf, 1, NULL) == 0); - assert(wc == 0); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, NULL) == 0); + ATF_REQUIRE(wc == 0); /* Null wide character. */ memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 1, &s) == 0); - assert(wc == 0); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == 0); + ATF_REQUIRE(wc == 0); /* Latin letter A, internal state. */ - assert(mbrtowc(NULL, 0, 0, NULL) == 0); + ATF_REQUIRE(mbrtowc(NULL, 0, 0, NULL) == 0); buf[0] = 'A'; - assert(mbrtowc(&wc, buf, 1, NULL) == 1); - assert(wc == L'A'); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, NULL) == 1); + ATF_REQUIRE(wc == L'A'); /* Latin letter A. */ memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 1, &s) == 1); - assert(wc == L'A'); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == 1); + ATF_REQUIRE(wc == L'A'); /* Incomplete character sequence (zero length). */ wc = L'z'; memset(&s, 0, sizeof(s)); - assert(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); - assert(wc == L'z'); + ATF_REQUIRE(mbrtowc(&wc, buf, 0, &s) == (size_t)-2); + ATF_REQUIRE(wc == L'z'); /* Incomplete character sequence (truncated double-byte). */ memset(buf, 0xcc, sizeof(buf)); @@ -137,27 +138,31 @@ main(int argc, char *argv[]) buf[1] = 0x00; memset(&s, 0, sizeof(s)); wc = 0; - assert(mbrtowc(&wc, buf, 1, &s) == (size_t)-2); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == (size_t)-2); /* Same as above, but complete. */ buf[1] = 0xc1; memset(&s, 0, sizeof(s)); wc = 0; - assert(mbrtowc(&wc, buf, 2, &s) == 2); - assert(wc == 0xa3c1); + ATF_REQUIRE(mbrtowc(&wc, buf, 2, &s) == 2); + ATF_REQUIRE(wc == 0xa3c1); /* Test restarting behaviour. */ memset(buf, 0xcc, sizeof(buf)); buf[0] = 0xa3; memset(&s, 0, sizeof(s)); wc = 0; - assert(mbrtowc(&wc, buf, 1, &s) == (size_t)-2); - assert(wc == 0); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == (size_t)-2); + ATF_REQUIRE(wc == 0); buf[0] = 0xc1; - assert(mbrtowc(&wc, buf, 1, &s) == 1); - assert(wc == 0xa3c1); + ATF_REQUIRE(mbrtowc(&wc, buf, 1, &s) == 1); + ATF_REQUIRE(wc == 0xa3c1); +} + +ATF_TP_ADD_TCS(tp) +{ - printf("ok 1 - mbrtowc()\n"); + ATF_TP_ADD_TC(tp, mbrtowc_test); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/locale/mbsnrtowcs_test.c (from r290531, head/tools/regression/lib/libc/locale/test-mbsnrtowcs.c) ============================================================================== --- head/tools/regression/lib/libc/locale/test-mbsnrtowcs.c Sun Nov 8 01:41:44 2015 (r290531, copy source) +++ head/lib/libc/tests/locale/mbsnrtowcs_test.c Sun Nov 8 02:06:17 2015 (r290532) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -43,19 +42,17 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(mbsnrtowcs_test); +ATF_TC_BODY(mbsnrtowcs_test, tc) { char srcbuf[128]; wchar_t dstbuf[128]; char *src; mbstate_t s; - /* - * C/POSIX locale. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Nov 8 03:34:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01773A27B49; Sun, 8 Nov 2015 03:34:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD6701A8F; Sun, 8 Nov 2015 03:34:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA83YJcE097763; Sun, 8 Nov 2015 03:34:19 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA83YJow097762; Sun, 8 Nov 2015 03:34:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511080334.tA83YJow097762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Nov 2015 03:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290533 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 03:34:21 -0000 Author: gonzo Date: Sun Nov 8 03:34:19 2015 New Revision: 290533 URL: https://svnweb.freebsd.org/changeset/base/290533 Log: - Replace semaphore-base locking with sleep/wait synchronization: sema_trywait/sema_timedwait can't be used while holding non-sleepable mutex - Fix infinite loop if response from VideoCore never received Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Nov 8 02:06:17 2015 (r290532) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Nov 8 03:34:19 2015 (r290533) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -83,7 +82,7 @@ struct bcm_mbox_softc { bus_space_tag_t bst; bus_space_handle_t bsh; int msg[BCM2835_MBOX_CHANS]; - struct sema sema[BCM2835_MBOX_CHANS]; + int have_message[BCM2835_MBOX_CHANS]; }; #define mbox_read_4(sc, reg) \ @@ -121,9 +120,11 @@ bcm_mbox_intr(void *arg) struct bcm_mbox_softc *sc = arg; int chan; + MBOX_LOCK(sc); while (!(mbox_read_4(sc, REG_STATUS) & STATUS_EMPTY)) if (bcm_mbox_read_msg(sc, &chan) == 0) - sema_post(&sc->sema[chan]); + wakeup(&sc->have_message[chan]); + MBOX_UNLOCK(sc); } static int @@ -175,7 +176,7 @@ bcm_mbox_attach(device_t dev) mtx_init(&sc->lock, "vcio mbox", NULL, MTX_DEF); for (i = 0; i < BCM2835_MBOX_CHANS; i++) { sc->msg[i] = 0; - sema_init(&sc->sema[i], 0, "mbox"); + sc->have_message[i] = 0; } /* Read all pending messages */ @@ -198,6 +199,7 @@ bcm_mbox_write(device_t dev, int chan, u dprintf("bcm_mbox_write: chan %d, data %08x\n", chan, data); MBOX_LOCK(sc); + sc->have_message[chan] = 0; while ((mbox_read_4(sc, REG_STATUS) & STATUS_FULL) && --limit) DELAY(5); if (limit == 0) { @@ -222,11 +224,12 @@ bcm_mbox_read(device_t dev, int chan, ui err = 0; MBOX_LOCK(sc); if (!cold) { - while (sema_trywait(&sc->sema[chan]) == 0) { - /* do not unlock sc while waiting for the mbox */ - if (sema_timedwait(&sc->sema[chan], 10*hz) == 0) - break; - printf("timeout sema for chan %d\n", chan); + if (sc->have_message[chan] == 0) { + if (mtx_sleep(&sc->have_message[chan], &sc->lock, 0, + "mbox", 10*hz) != 0) { + device_printf(dev, "timeout waiting for message on chan %d\n", chan); + err = ETIMEDOUT; + } } } else { do { @@ -246,6 +249,7 @@ bcm_mbox_read(device_t dev, int chan, ui */ *data = MBOX_DATA(sc->msg[chan]); sc->msg[chan] = 0; + sc->have_message[chan] = 0; out: MBOX_UNLOCK(sc); dprintf("bcm_mbox_read: chan %d, data %08x\n", chan, *data); From owner-svn-src-all@freebsd.org Sun Nov 8 03:53:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D273A27F6A; Sun, 8 Nov 2015 03:53:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E40351203; Sun, 8 Nov 2015 03:53:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA83rVlQ003527; Sun, 8 Nov 2015 03:53:31 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA83rVsi003526; Sun, 8 Nov 2015 03:53:31 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511080353.tA83rVsi003526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Nov 2015 03:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290534 - head/sys/contrib/vchiq/interface/compat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 03:53:33 -0000 Author: gonzo Date: Sun Nov 8 03:53:31 2015 New Revision: 290534 URL: https://svnweb.freebsd.org/changeset/base/290534 Log: Fix locking for VCHI driver by matching sleepable/non-sleepable APIs: - Emulate Linux mutex API using sx(9) locks with only exclusive operations instead of mutex(9), in Linux mutexes are sleepable. - Emulate Linux rwlock_t using rwlock(9) instead of sx(9). rwlock_t in Linux are spin locks Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h ============================================================================== --- head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Sun Nov 8 03:34:19 2015 (r290533) +++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Sun Nov 8 03:53:31 2015 (r290534) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -146,51 +147,46 @@ typedef struct mtx spinlock_t; * Mutex API */ struct mutex { - struct mtx mtx; + struct sx mtx; }; -#define lmutex_init(lock) mtx_init(&(lock)->mtx, #lock, NULL, MTX_DEF) -#define lmutex_lock(lock) mtx_lock(&(lock)->mtx) -#define lmutex_unlock(lock) mtx_unlock(&(lock)->mtx) -#define lmutex_destroy(lock) mtx_destroy(&(lock)->mtx) +#define lmutex_init(lock) sx_init(&(lock)->mtx, #lock) +#define lmutex_lock(lock) sx_xlock(&(lock)->mtx) +#define lmutex_unlock(lock) sx_unlock(&(lock)->mtx) +#define lmutex_destroy(lock) sx_destroy(&(lock)->mtx) -static __inline int -lmutex_lock_interruptible(struct mutex *lock) -{ - mtx_lock(&(lock)->mtx); - return 0; -} +#define lmutex_lock_interruptible(lock) sx_xlock_sig(&(lock)->mtx) /* * Rwlock API */ -typedef struct sx rwlock_t; +typedef struct rwlock rwlock_t; #if defined(SX_ADAPTIVESPIN) && !defined(SX_NOADAPTIVE) #define SX_NOADAPTIVE SX_ADAPTIVESPIN #endif #define DEFINE_RWLOCK(name) \ - struct sx name; \ + struct rwlock name; \ SX_SYSINIT(name, &name, #name) -#define rwlock_init(rwlock) sx_init_flags(rwlock, "VCHI rwlock", SX_NOADAPTIVE) -#define read_lock(rwlock) sx_slock(rwlock) -#define read_unlock(rwlock) sx_sunlock(rwlock) +#define rwlock_init(rwlock) rw_init(rwlock, "VCHI rwlock") +#define read_lock(rwlock) rw_rlock(rwlock) +#define read_unlock(rwlock) rw_unlock(rwlock) -#define write_lock(rwlock) sx_xlock(rwlock) -#define write_unlock(rwlock) sx_xunlock(rwlock) +#define write_lock(rwlock) rw_wlock(rwlock) +#define write_unlock(rwlock) rw_unlock(rwlock) #define write_lock_irqsave(rwlock, flags) \ do { \ - sx_xlock(rwlock); \ + rw_wlock(rwlock); \ (void) &(flags); \ } while (0) #define write_unlock_irqrestore(rwlock, flags) \ - sx_xunlock(rwlock) + rw_unlock(rwlock) -#define read_lock_bh(rwlock) sx_slock(rwlock) -#define read_unlock_bh(rwlock) sx_sunlock(rwlock) -#define write_lock_bh(rwlock) sx_xlock(rwlock) -#define write_unlock_bh(rwlock) sx_xunlock(rwlock) +#define read_lock_bh(rwlock) rw_rlock(rwlock) +#define read_unlock_bh(rwlock) rw_unlock(rwlock) +#define write_lock_bh(rwlock) rw_wlock(rwlock) +#define write_unlock_bh(rwlock) rw_unlock(rwlock) /* * Timer API From owner-svn-src-all@freebsd.org Sun Nov 8 03:54:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F42A27FBF; Sun, 8 Nov 2015 03:54:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33C3F1363; Sun, 8 Nov 2015 03:54:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA83sFTE003596; Sun, 8 Nov 2015 03:54:15 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA83sFnX003595; Sun, 8 Nov 2015 03:54:15 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511080354.tA83sFnX003595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Nov 2015 03:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290535 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 03:54:16 -0000 Author: gonzo Date: Sun Nov 8 03:54:15 2015 New Revision: 290535 URL: https://svnweb.freebsd.org/changeset/base/290535 Log: vchiq interrupt is MP safe, add respective flag to bus_setup_intr Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Sun Nov 8 03:53:31 2015 (r290534) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Sun Nov 8 03:54:15 2015 (r290535) @@ -164,7 +164,7 @@ bcm_vchiq_attach(device_t dev) vchiq_core_initialize(); /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, bcm_vchiq_intr, sc, &sc->intr_hl) != 0) { bus_release_resource(dev, SYS_RES_IRQ, rid, From owner-svn-src-all@freebsd.org Sun Nov 8 04:15:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7480A29296; Sun, 8 Nov 2015 04:15:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4921B20; Sun, 8 Nov 2015 04:15:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA84FqYI009325; Sun, 8 Nov 2015 04:15:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA84FqX1009324; Sun, 8 Nov 2015 04:15:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511080415.tA84FqX1009324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Nov 2015 04:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290536 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 04:15:53 -0000 Author: gonzo Date: Sun Nov 8 04:15:52 2015 New Revision: 290536 URL: https://svnweb.freebsd.org/changeset/base/290536 Log: Fix some of WITNESS complaints and bootup lock by removing msg_avail condvar/mutex. They're basically no-op because error is not propagated up the call chain. We still report message failures in VC service callback Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Sun Nov 8 03:54:15 2015 (r290535) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Sun Nov 8 04:15:52 2015 (r290536) @@ -104,11 +104,6 @@ struct bcm2835_audio_info { /* VCHI data */ struct mtx vchi_lock; - /* MSG reply */ - struct mtx msg_avail_lock; - struct cv msg_avail_cv; - uint32_t msg_result; - VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; VCHI_SERVICE_HANDLE_T vchi_handle; @@ -162,8 +157,11 @@ bcm2835_audio_callback(void *param, cons status = vchi_msg_dequeue(sc->vchi_handle, &m, sizeof m, &msg_len, VCHI_FLAGS_NONE); if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { - sc->msg_result = m.u.result.success; - cv_signal(&sc->msg_avail_cv); + if (m.u.result.success) { + device_printf(sc->dev, + "msg type %08x failed\n", + m.type); + } } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { struct bcm2835_audio_chinfo *ch = m.u.complete.cookie; @@ -333,8 +331,6 @@ bcm2835_audio_update_controls(struct bcm if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - sc->msg_result = -1; - m.type = VC_AUDIO_MSG_TYPE_CONTROL; m.u.control.dest = sc->dest; if (sc->volume > 99) @@ -348,12 +344,6 @@ bcm2835_audio_update_controls(struct bcm if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - mtx_lock(&sc->msg_avail_lock); - cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); - if (sc->msg_result) - printf("%s failed: %d\n", __func__, sc->msg_result); - mtx_unlock(&sc->msg_avail_lock); - vchi_service_release(sc->vchi_handle); } VCHIQ_VCHI_UNLOCK(sc); @@ -369,8 +359,6 @@ bcm2835_audio_update_params(struct bcm28 if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - sc->msg_result = -1; - m.type = VC_AUDIO_MSG_TYPE_CONFIG; m.u.config.channels = AFMT_CHANNEL(ch->fmt); m.u.config.samplerate = ch->spd; @@ -382,12 +370,6 @@ bcm2835_audio_update_params(struct bcm28 if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - mtx_lock(&sc->msg_avail_lock); - cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); - if (sc->msg_result) - printf("%s failed: %d\n", __func__, sc->msg_result); - mtx_unlock(&sc->msg_avail_lock); - vchi_service_release(sc->vchi_handle); } VCHIQ_VCHI_UNLOCK(sc); @@ -831,8 +813,6 @@ bcm2835_audio_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "bcm2835_audio softc"); mtx_init(&sc->vchi_lock, "bcm2835_audio", "vchi_lock", MTX_DEF); - mtx_init(&sc->msg_avail_lock, "msg_avail_mtx", "msg_avail_mtx", MTX_DEF); - cv_init(&sc->msg_avail_cv, "msg_avail_cv"); mtx_init(&sc->data_lock, "data_mtx", "data_mtx", MTX_DEF); cv_init(&sc->data_cv, "data_cv"); sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; @@ -869,8 +849,6 @@ bcm2835_audio_detach(device_t dev) return r; mtx_destroy(&sc->vchi_lock); - mtx_destroy(&sc->msg_avail_lock); - cv_destroy(&sc->msg_avail_cv); mtx_destroy(&sc->data_lock); cv_destroy(&sc->data_cv); From owner-svn-src-all@freebsd.org Sun Nov 8 06:37:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D57AA29720; Sun, 8 Nov 2015 06:37:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE7EF1825; Sun, 8 Nov 2015 06:37:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA86boko049661; Sun, 8 Nov 2015 06:37:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA86bo8V049654; Sun, 8 Nov 2015 06:37:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080637.tA86bo8V049654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 06:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290537 - in head: lib/libc/tests/stdio 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 06:37:52 -0000 Author: ngie Date: Sun Nov 8 06:37:50 2015 New Revision: 290537 URL: https://svnweb.freebsd.org/changeset/base/290537 Log: Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite as lib/libc/tests/stdio - Fix some whitespace - Convert the testcases to ATF - Convert "/dev/null" to _PATH_DEVNULL MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/stdio/fdopen_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-fdopen.c head/lib/libc/tests/stdio/fopen_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-fopen.c head/lib/libc/tests/stdio/freopen_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-freopen.c head/lib/libc/tests/stdio/getdelim_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-getdelim.c head/lib/libc/tests/stdio/mkostemp_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-mkostemp.c head/lib/libc/tests/stdio/open_memstream_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-open_memstream.c head/lib/libc/tests/stdio/open_wmemstream_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-open_wmemstream.c head/lib/libc/tests/stdio/perror_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-perror.c head/lib/libc/tests/stdio/print_positional_test.c - copied unchanged from r290536, head/tools/regression/lib/libc/stdio/test-print-positional.c head/lib/libc/tests/stdio/printbasic_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-printbasic.c head/lib/libc/tests/stdio/printfloat_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-printfloat.c head/lib/libc/tests/stdio/scanfloat_test.c - copied, changed from r290536, head/tools/regression/lib/libc/stdio/test-scanfloat.c Deleted: head/tools/regression/lib/libc/stdio/ Modified: head/lib/libc/tests/stdio/Makefile head/lib/libc/tests/stdio/fmemopen2_test.c Modified: head/lib/libc/tests/stdio/Makefile ============================================================================== --- head/lib/libc/tests/stdio/Makefile Sun Nov 8 04:15:52 2015 (r290536) +++ head/lib/libc/tests/stdio/Makefile Sun Nov 8 06:37:50 2015 (r290537) @@ -1,6 +1,20 @@ # $FreeBSD$ -ATF_TESTS_C= fmemopen2_test +ATF_TESTS_C+= fdopen_test +ATF_TESTS_C+= fmemopen2_test +ATF_TESTS_C+= fopen2_test +ATF_TESTS_C+= freopen_test +ATF_TESTS_C+= getdelim_test +ATF_TESTS_C+= mkostemp_test +ATF_TESTS_C+= open_memstream_test +ATF_TESTS_C+= open_wmemstream_test +ATF_TESTS_C+= perror_test +ATF_TESTS_C+= print_positional_test +ATF_TESTS_C+= printbasic_test +ATF_TESTS_C+= printfloat_test +ATF_TESTS_C+= scanfloat_test + +SRCS.fopen2_test= fopen_test.c NETBSD_ATF_TESTS_C= clearerr_test NETBSD_ATF_TESTS_C+= fflush_test Copied and modified: head/lib/libc/tests/stdio/fdopen_test.c (from r290536, head/tools/regression/lib/libc/stdio/test-fdopen.c) ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fdopen.c Sun Nov 8 04:15:52 2015 (r290536, copy source) +++ head/lib/libc/tests/stdio/fdopen_test.c Sun Nov 8 06:37:50 2015 (r290537) @@ -27,13 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -static int testnum = 1; +#include static void runtest(const char *fname, int intmode, const char *strmode, bool success) @@ -42,64 +44,182 @@ runtest(const char *fname, int intmode, int fd; fd = open(fname, intmode); - if (fd == -1) { - printf("not ok %d - open(\"%s\", %#x) failed\n", - testnum++, fname, intmode); - return; - } + ATF_REQUIRE_MSG(fd != -1, + "open(\"%s\", %#x) failed; errno=%d", fname, intmode, errno); + fp = fdopen(fd, strmode); if (fp == NULL) { close(fd); - if (success) - printf("not ok %d - " - "fdopen(open(\"%s\", %#x), \"%s\") failed\n", - testnum++, fname, intmode, strmode); - else - printf("ok %d - " - "fdopen(open(\"%s\", %#x), \"%s\") failed\n", - testnum++, fname, intmode, strmode); + ATF_REQUIRE_MSG(success == false, + "fdopen(open(\"%s\", %#x), \"%s\") succeeded unexpectedly", + fname, intmode, strmode); return; } - if (success) - printf("ok %d - " - "fdopen(open(\"%s\", %#x), \"%s\") succeeded\n", - testnum++, fname, intmode, strmode); - else - printf("not ok %d - " - "fdopen(open(\"%s\", %#x), \"%s\") succeeded\n", - testnum++, fname, intmode, strmode); + ATF_REQUIRE_MSG(success == true, + "fdopen(open(\"%s\", %#x), \"%s\") failed; errno=%d", + fname, intmode, strmode, errno); fclose(fp); } -/* - * Test program for fdopen(). - */ -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(null__O_RDONLY__r_test); +ATF_TC_BODY(null__O_RDONLY__r_test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDONLY, "r", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_WRONLY__r_test); +ATF_TC_BODY(null__O_WRONLY__r_test, tc) +{ + + runtest(_PATH_DEVNULL, O_WRONLY, "r", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDWR__r_test); +ATF_TC_BODY(null__O_RDWR__r_test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDWR, "r", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDONLY__w_test); +ATF_TC_BODY(null__O_RDONLY__w_test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDONLY, "w", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_WRONLY__w_test); +ATF_TC_BODY(null__O_WRONLY__w_test, tc) +{ + + runtest(_PATH_DEVNULL, O_WRONLY, "w", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDWR__w_test); +ATF_TC_BODY(null__O_RDWR__w_test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDWR, "w", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDONLY__a_test); +ATF_TC_BODY(null__O_RDONLY__a_test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDONLY, "a", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_WRONLY__a_test); +ATF_TC_BODY(null__O_WRONLY__a_test, tc) +{ + + runtest(_PATH_DEVNULL, O_WRONLY, "a", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDWR__test); +ATF_TC_BODY(null__O_RDWR__test, tc) +{ + + runtest(_PATH_DEVNULL, O_RDWR, "a", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDONLY__r_append); +ATF_TC_BODY(null__O_RDONLY__r_append, tc) +{ + + runtest(_PATH_DEVNULL, O_RDONLY, "r+", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_WRONLY__r_append); +ATF_TC_BODY(null__O_WRONLY__r_append, tc) +{ + + runtest(_PATH_DEVNULL, O_WRONLY, "r+", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDWR__r_append); +ATF_TC_BODY(null__O_RDWR__r_append, tc) +{ + + runtest(_PATH_DEVNULL, O_RDWR, "r+", true); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDONLY__w_append); +ATF_TC_BODY(null__O_RDONLY__w_append, tc) +{ + + runtest(_PATH_DEVNULL, O_RDONLY, "w+", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_WRONLY__w_append); +ATF_TC_BODY(null__O_WRONLY__w_append, tc) +{ + + runtest(_PATH_DEVNULL, O_WRONLY, "w+", false); +} + +ATF_TC_WITHOUT_HEAD(null__O_RDWR__w_append); +ATF_TC_BODY(null__O_RDWR__w_append, tc) +{ + + runtest(_PATH_DEVNULL, O_RDWR, "w+", true); +} + +ATF_TC_WITHOUT_HEAD(sh__O_EXEC__r); +ATF_TC_BODY(sh__O_EXEC__r, tc) { - printf("1..19\n"); - runtest("/dev/null", O_RDONLY, "r", true); - runtest("/dev/null", O_WRONLY, "r", false); - runtest("/dev/null", O_RDWR, "r", true); - runtest("/dev/null", O_RDONLY, "w", false); - runtest("/dev/null", O_WRONLY, "w", true); - runtest("/dev/null", O_RDWR, "w", true); - runtest("/dev/null", O_RDONLY, "a", false); - runtest("/dev/null", O_WRONLY, "a", true); - runtest("/dev/null", O_RDWR, "a", true); - runtest("/dev/null", O_RDONLY, "r+", false); - runtest("/dev/null", O_WRONLY, "r+", false); - runtest("/dev/null", O_RDWR, "r+", true); - runtest("/dev/null", O_RDONLY, "w+", false); - runtest("/dev/null", O_WRONLY, "w+", false); - runtest("/dev/null", O_RDWR, "w+", true); + runtest("/bin/sh", O_EXEC, "r", false); +} + +ATF_TC_WITHOUT_HEAD(sh__O_EXEC__w); +ATF_TC_BODY(sh__O_EXEC__w, tc) +{ + runtest("/bin/sh", O_EXEC, "w", false); +} + +ATF_TC_WITHOUT_HEAD(sh__O_EXEC__r_append); +ATF_TC_BODY(sh__O_EXEC__r_append, tc) +{ + runtest("/bin/sh", O_EXEC, "r+", false); +} + +ATF_TC_WITHOUT_HEAD(sh__O_EXEC__w_append); +ATF_TC_BODY(sh__O_EXEC__w_append, tc) +{ + runtest("/bin/sh", O_EXEC, "w+", false); +} - return 0; +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, null__O_RDONLY__r_test); + ATF_TP_ADD_TC(tp, null__O_WRONLY__r_test); + ATF_TP_ADD_TC(tp, null__O_RDWR__r_test); + ATF_TP_ADD_TC(tp, null__O_RDONLY__w_test); + ATF_TP_ADD_TC(tp, null__O_WRONLY__w_test); + ATF_TP_ADD_TC(tp, null__O_RDWR__w_test); + ATF_TP_ADD_TC(tp, null__O_RDONLY__a_test); + ATF_TP_ADD_TC(tp, null__O_WRONLY__a_test); + ATF_TP_ADD_TC(tp, null__O_RDWR__test); + ATF_TP_ADD_TC(tp, null__O_RDONLY__r_append); + ATF_TP_ADD_TC(tp, null__O_WRONLY__r_append); + ATF_TP_ADD_TC(tp, null__O_RDWR__r_append); + ATF_TP_ADD_TC(tp, null__O_RDONLY__w_append); + ATF_TP_ADD_TC(tp, null__O_WRONLY__w_append); + ATF_TP_ADD_TC(tp, null__O_RDWR__w_append); + ATF_TP_ADD_TC(tp, sh__O_EXEC__r); + ATF_TP_ADD_TC(tp, sh__O_EXEC__w); + ATF_TP_ADD_TC(tp, sh__O_EXEC__r_append); + ATF_TP_ADD_TC(tp, sh__O_EXEC__w_append); + + return (atf_no_error()); } -/* vim:ts=8:cin:sw=8 - * */ +/* + vim:ts=8:cin:sw=8 + */ Modified: head/lib/libc/tests/stdio/fmemopen2_test.c ============================================================================== --- head/lib/libc/tests/stdio/fmemopen2_test.c Sun Nov 8 04:15:52 2015 (r290536) +++ head/lib/libc/tests/stdio/fmemopen2_test.c Sun Nov 8 06:37:50 2015 (r290537) @@ -35,15 +35,13 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include ATF_TC_WITHOUT_HEAD(test_preexisting); ATF_TC_BODY(test_preexisting, tc) { - /* - * Use a pre-existing buffer. - */ - + /* Use a pre-existing buffer. */ char buf[512]; char buf2[512]; char str[] = "Test writing some stuff"; @@ -74,7 +72,7 @@ ATF_TC_BODY(test_preexisting, tc) nofr = fread(buf2, 1, sizeof(buf2), fp); ATF_REQUIRE(nofr == sizeof(buf2)); - /* + /* * Since a write on a FILE * retrieved by fmemopen * will add a '\0' (if there's space), we can check * the strings for equality. @@ -106,10 +104,7 @@ ATF_TC_BODY(test_preexisting, tc) ATF_TC_WITHOUT_HEAD(test_autoalloc); ATF_TC_BODY(test_autoalloc, tc) { - /* - * Let fmemopen allocate the buffer. - */ - + /* Let fmemopen allocate the buffer. */ char str[] = "A quick test"; FILE *fp; long pos; @@ -130,9 +125,7 @@ ATF_TC_BODY(test_autoalloc, tc) pos = ftell(fp); ATF_REQUIRE(pos == 512); - /* - * Try to write past the end, we should get a short object count (0) - */ + /* Try to write past the end, we should get a short object count (0) */ nofw = fwrite("a", 1, 1, fp); ATF_REQUIRE(nofw == 0); @@ -173,10 +166,7 @@ ATF_TC_BODY(test_data_length, tc) nofw = fwrite(str, 1, sizeof(str), fp); ATF_REQUIRE(nofw == sizeof(str)); - /* - * Now seek to the end and check that ftell - * gives us sizeof(str). - */ + /* Now seek to the end and check that ftell gives us sizeof(str). */ rc = fseek(fp, 0, SEEK_END); ATF_REQUIRE(rc == 0); pos = ftell(fp); @@ -264,9 +254,7 @@ ATF_TC_BODY(test_append_binary_pos, tc) ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); - /* - * Make sure that a pre-allocated buffer behaves correctly. - */ + /* Make sure that a pre-allocated buffer behaves correctly. */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); ATF_REQUIRE(ftell(fp) == strlen(buf)); @@ -276,9 +264,7 @@ ATF_TC_BODY(test_append_binary_pos, tc) ATF_TC_WITHOUT_HEAD(test_size_0); ATF_TC_BODY(test_size_0, tc) { - /* - * POSIX mandates that we return EINVAL if size is 0. - */ + /* POSIX mandates that we return EINVAL if size is 0. */ FILE *fp; Copied and modified: head/lib/libc/tests/stdio/fopen_test.c (from r290536, head/tools/regression/lib/libc/stdio/test-fopen.c) ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fopen.c Sun Nov 8 04:15:52 2015 (r290536, copy source) +++ head/lib/libc/tests/stdio/fopen_test.c Sun Nov 8 06:37:50 2015 (r290537) @@ -27,9 +27,12 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include +#include +#include +#include + +#include /* * O_ACCMODE is currently defined incorrectly. This is what it should be. @@ -37,32 +40,21 @@ __FBSDID("$FreeBSD$"); */ #define CORRECT_O_ACCMODE (O_ACCMODE | O_EXEC) -static int testnum = 1; - static void runtest(const char *fname, const char *mode) { FILE *fp; - int fd, flags, wantedflags; + int exp_fget_ret, fget_ret, fd, flags, wantedflags; fp = fopen(fname, mode); - if (fp == NULL) { - printf("not ok %d - fopen(\"%s\", \"%s\") failed\n", - testnum++, fname, mode); - printf("not ok %d - FD_CLOEXEC # SKIP\n", - testnum++); - return; - } + ATF_REQUIRE_MSG(fp != NULL, + "fopen(\"%s\", \"%s\") failed", fname, mode); fd = fileno(fp); - if (fd < 0) - printf("not ok %d - fileno() failed\n", testnum++); - else - printf("ok %d - fopen(\"%s\", \"%s\") and fileno() succeeded\n", - testnum++, fname, mode); - if (fcntl(fd, F_GETFD) == (strchr(mode, 'e') != NULL ? FD_CLOEXEC : 0)) - printf("ok %d - FD_CLOEXEC flag correct\n", testnum++); - else - printf("not ok %d - FD_CLOEXEC flag incorrect\n", testnum++); + ATF_REQUIRE_MSG(fd >= 0, "fileno() failed for fopen"); + exp_fget_ret = strchr(mode, 'e') != NULL ? FD_CLOEXEC : 0; + ATF_REQUIRE_MSG((fget_ret = fcntl(fd, F_GETFD)) == exp_fget_ret, + "fcntl(.., F_GETFD) didn't FD_CLOEXEC as expected %d != %d", + exp_fget_ret, fget_ret); flags = fcntl(fd, F_GETFL); if (strchr(mode, '+')) wantedflags = O_RDWR | (*mode == 'a' ? O_APPEND : 0); @@ -74,40 +66,140 @@ runtest(const char *fname, const char *m wantedflags = O_WRONLY | O_APPEND; else wantedflags = -1; - if (wantedflags == -1) - printf("not ok %d - unrecognized mode\n", testnum++); - else if ((flags & (CORRECT_O_ACCMODE | O_APPEND)) == wantedflags) - printf("ok %d - correct access mode\n", testnum++); - else - printf("not ok %d - incorrect access mode\n", testnum++); fclose(fp); + if (wantedflags == -1) + atf_tc_fail("unrecognized mode: %s", mode); + else if ((flags & (CORRECT_O_ACCMODE | O_APPEND)) != wantedflags) + atf_tc_fail("incorrect access mode: %s", mode); } -/* - * Test program for fopen(). - */ -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(fopen_r_test); +ATF_TC_BODY(fopen_r_test, tc) +{ + + runtest(_PATH_DEVNULL, "r"); +} + +ATF_TC_WITHOUT_HEAD(fopen_r_append_test); +ATF_TC_BODY(fopen_r_append_test, tc) +{ + + runtest(_PATH_DEVNULL, "r+"); +} + +ATF_TC_WITHOUT_HEAD(fopen_w_test); +ATF_TC_BODY(fopen_w_test, tc) +{ + + runtest(_PATH_DEVNULL, "w"); +} + +ATF_TC_WITHOUT_HEAD(fopen_w_append_test); +ATF_TC_BODY(fopen_w_append_test, tc) +{ + + runtest(_PATH_DEVNULL, "w+"); +} + +ATF_TC_WITHOUT_HEAD(fopen_a_test); +ATF_TC_BODY(fopen_a_test, tc) +{ + + runtest(_PATH_DEVNULL, "a"); +} + +ATF_TC_WITHOUT_HEAD(fopen_a_append_test); +ATF_TC_BODY(fopen_a_append_test, tc) +{ + + runtest(_PATH_DEVNULL, "a+"); +} + +ATF_TC_WITHOUT_HEAD(fopen_re_test); +ATF_TC_BODY(fopen_re_test, tc) +{ + + runtest(_PATH_DEVNULL, "re"); +} + +ATF_TC_WITHOUT_HEAD(fopen_r_append_e_test); +ATF_TC_BODY(fopen_r_append_e_test, tc) +{ + + runtest(_PATH_DEVNULL, "r+e"); +} + +ATF_TC_WITHOUT_HEAD(fopen_we_test); +ATF_TC_BODY(fopen_we_test, tc) +{ + + runtest(_PATH_DEVNULL, "we"); +} + +ATF_TC_WITHOUT_HEAD(fopen_w_append_e_test); +ATF_TC_BODY(fopen_w_append_e_test, tc) +{ + + runtest(_PATH_DEVNULL, "w+e"); +} + +ATF_TC_WITHOUT_HEAD(fopen_ae_test); +ATF_TC_BODY(fopen_ae_test, tc) +{ + + runtest(_PATH_DEVNULL, "ae"); +} + +ATF_TC_WITHOUT_HEAD(fopen_a_append_e_test); +ATF_TC_BODY(fopen_a_append_e_test, tc) +{ + + runtest(_PATH_DEVNULL, "a+e"); +} + +ATF_TC_WITHOUT_HEAD(fopen_re_append_test); +ATF_TC_BODY(fopen_re_append_test, tc) +{ + + runtest(_PATH_DEVNULL, "re+"); +} + +ATF_TC_WITHOUT_HEAD(fopen_we_append_test); +ATF_TC_BODY(fopen_we_append_test, tc) +{ + + runtest(_PATH_DEVNULL, "we+"); +} + +ATF_TC_WITHOUT_HEAD(fopen_ae_append_test); +ATF_TC_BODY(fopen_ae_append_test, tc) { - printf("1..45\n"); - runtest("/dev/null", "r"); - runtest("/dev/null", "r+"); - runtest("/dev/null", "w"); - runtest("/dev/null", "w+"); - runtest("/dev/null", "a"); - runtest("/dev/null", "a+"); - runtest("/dev/null", "re"); - runtest("/dev/null", "r+e"); - runtest("/dev/null", "we"); - runtest("/dev/null", "w+e"); - runtest("/dev/null", "ae"); - runtest("/dev/null", "a+e"); - runtest("/dev/null", "re+"); - runtest("/dev/null", "we+"); - runtest("/dev/null", "ae+"); - return 0; + runtest(_PATH_DEVNULL, "ae+"); } -/* vim:ts=8:cin:sw=8 - * */ +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, fopen_r_test); + ATF_TP_ADD_TC(tp, fopen_r_append_test); + ATF_TP_ADD_TC(tp, fopen_w_test); + ATF_TP_ADD_TC(tp, fopen_w_append_test); + ATF_TP_ADD_TC(tp, fopen_a_test); + ATF_TP_ADD_TC(tp, fopen_a_append_test); + ATF_TP_ADD_TC(tp, fopen_re_test); + ATF_TP_ADD_TC(tp, fopen_r_append_e_test); + ATF_TP_ADD_TC(tp, fopen_we_test); + ATF_TP_ADD_TC(tp, fopen_w_append_e_test); + ATF_TP_ADD_TC(tp, fopen_ae_test); + ATF_TP_ADD_TC(tp, fopen_a_append_e_test); + ATF_TP_ADD_TC(tp, fopen_re_append_test); + ATF_TP_ADD_TC(tp, fopen_we_append_test); + ATF_TP_ADD_TC(tp, fopen_ae_append_test); + + return (atf_no_error()); +} + +/* + vim:ts=8:cin:sw=8 + */ Copied and modified: head/lib/libc/tests/stdio/freopen_test.c (from r290536, head/tools/regression/lib/libc/stdio/test-freopen.c) ============================================================================== --- head/tools/regression/lib/libc/stdio/test-freopen.c Sun Nov 8 04:15:52 2015 (r290536, copy source) +++ head/lib/libc/tests/stdio/freopen_test.c Sun Nov 8 06:37:50 2015 (r290537) @@ -27,11 +27,13 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include +#include +#include +#include +#include -static int testnum = 1; +#include static void runtest(const char *fname1, const char *mode1, const char *fname2, @@ -42,68 +44,181 @@ runtest(const char *fname1, const char * fname2_print = fname2 != NULL ? fname2 : ""; fp1 = fopen(fname1, mode1); - if (fp1 == NULL) { - printf("not ok %d - fopen(\"%s\", \"%s\") failed\n", - testnum++, fname1, mode1); - return; - } + ATF_REQUIRE_MSG(fp1 != NULL, + "fopen(\"%s\", \"%s\") failed; errno=%d", fname1, mode1, errno); fp2 = freopen(fname2, mode2, fp1); if (fp2 == NULL) { fclose(fp1); - if (success) - printf("not ok %d - " - "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " - "failed\n", - testnum++, fname2_print, mode2, fname1, mode1); - else - printf("ok %d - " - "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " - "failed\n", - testnum++, fname2_print, mode2, fname1, mode1); + ATF_REQUIRE_MSG(success == false, + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) succeeded " + "unexpectedly", fname2_print, mode2, fname1, mode1); return; } - if (success) - printf("ok %d - " - "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " - "succeeded\n", - testnum++, fname2_print, mode2, fname1, mode1); - else - printf("not ok %d - " - "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " - "succeeded\n", - testnum++, fname2_print, mode2, fname1, mode1); + ATF_REQUIRE_MSG(success == true, + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) failed: %d", + fname2_print, mode2, fname1, mode1, errno); fclose(fp2); } -/* - * Test program for freopen(). - */ -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(null__r__r__test); +ATF_TC_BODY(null__r__r__test, tc) +{ + + runtest(_PATH_DEVNULL, "r", NULL, "r", true); +} + +ATF_TC_WITHOUT_HEAD(null__w__r__test); +ATF_TC_BODY(null__w__r__test, tc) +{ + + runtest(_PATH_DEVNULL, "w", NULL, "r", false); +} + +ATF_TC_WITHOUT_HEAD(null__r_append__r__test); +ATF_TC_BODY(null__r_append__r__test, tc) +{ + + runtest(_PATH_DEVNULL, "r+", NULL, "r", true); +} + +ATF_TC_WITHOUT_HEAD(null__r__w__test); +ATF_TC_BODY(null__r__w__test, tc) +{ + + runtest(_PATH_DEVNULL, "r", NULL, "w", false); +} + +ATF_TC_WITHOUT_HEAD(null__w__w__test); +ATF_TC_BODY(null__w__w__test, tc) +{ + + runtest(_PATH_DEVNULL, "w", NULL, "w", true); +} + +ATF_TC_WITHOUT_HEAD(null__r_append__w__test); +ATF_TC_BODY(null__r_append__w__test, tc) +{ + + runtest(_PATH_DEVNULL, "r+", NULL, "w", true); +} + +ATF_TC_WITHOUT_HEAD(null__r__a__test); +ATF_TC_BODY(null__r__a__test, tc) +{ + + runtest(_PATH_DEVNULL, "r", NULL, "a", false); +} + +ATF_TC_WITHOUT_HEAD(null__w__a__test); +ATF_TC_BODY(null__w__a__test, tc) { - printf("1..19\n"); - runtest("/dev/null", "r", NULL, "r", true); - runtest("/dev/null", "w", NULL, "r", false); - runtest("/dev/null", "r+", NULL, "r", true); - runtest("/dev/null", "r", NULL, "w", false); - runtest("/dev/null", "w", NULL, "w", true); - runtest("/dev/null", "r+", NULL, "w", true); - runtest("/dev/null", "r", NULL, "a", false); - runtest("/dev/null", "w", NULL, "a", true); - runtest("/dev/null", "r+", NULL, "a", true); - runtest("/dev/null", "r", NULL, "r+", false); - runtest("/dev/null", "w", NULL, "r+", false); - runtest("/dev/null", "r+", NULL, "r+", true); - runtest("/dev/null", "r", NULL, "w+", false); - runtest("/dev/null", "w", NULL, "w+", false); - runtest("/dev/null", "r+", NULL, "w+", true); + + runtest(_PATH_DEVNULL, "w", NULL, "a", true); +} + +ATF_TC_WITHOUT_HEAD(null__r_append__a__test); +ATF_TC_BODY(null__r_append__a__test, tc) +{ + + runtest(_PATH_DEVNULL, "r+", NULL, "a", true); +} + +ATF_TC_WITHOUT_HEAD(null__r__r_append__test); +ATF_TC_BODY(null__r__r_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "r", NULL, "r+", false); +} + +ATF_TC_WITHOUT_HEAD(null__w__r_append__test); +ATF_TC_BODY(null__w__r_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "w", NULL, "r+", false); +} + +ATF_TC_WITHOUT_HEAD(null__r_append__r_append__test); +ATF_TC_BODY(null__r_append__r_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "r+", NULL, "r+", true); +} + +ATF_TC_WITHOUT_HEAD(null__r__w_append__test); +ATF_TC_BODY(null__r__w_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "r", NULL, "w+", false); +} + +ATF_TC_WITHOUT_HEAD(null__w__w_append__test); +ATF_TC_BODY(null__w__w_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "w", NULL, "w+", false); +} + +ATF_TC_WITHOUT_HEAD(null__r_append__w_append__test); +ATF_TC_BODY(null__r_append__w_append__test, tc) +{ + + runtest(_PATH_DEVNULL, "r+", NULL, "w+", true); +} + +ATF_TC_WITHOUT_HEAD(sh__r__r__test); +ATF_TC_BODY(sh__r__r__test, tc) +{ + runtest("/bin/sh", "r", NULL, "r", true); +} + +ATF_TC_WITHOUT_HEAD(sh__sh__r__r__test); +ATF_TC_BODY(sh__sh__r__r__test, tc) +{ + runtest("/bin/sh", "r", "/bin/sh", "r", true); - runtest("/bin/sh", "r", "/dev/null", "r", true); - runtest("/bin/sh", "r", "/dev/null", "w", true); +} + +ATF_TC_WITHOUT_HEAD(sh__null__r__r__test); +ATF_TC_BODY(sh__null__r__r__test, tc) +{ + + runtest("/bin/sh", "r", _PATH_DEVNULL, "r", true); +} + +ATF_TC_WITHOUT_HEAD(sh__null__r__w__test); +ATF_TC_BODY(sh__null__r__w__test, tc) +{ + + runtest("/bin/sh", "r", _PATH_DEVNULL, "w", true); +} - return 0; +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, null__r__r__test); + ATF_TP_ADD_TC(tp, null__w__r__test); + ATF_TP_ADD_TC(tp, null__r_append__r__test); + ATF_TP_ADD_TC(tp, null__r__w__test); + ATF_TP_ADD_TC(tp, null__w__w__test); + ATF_TP_ADD_TC(tp, null__r_append__w__test); + ATF_TP_ADD_TC(tp, null__r__a__test); + ATF_TP_ADD_TC(tp, null__w__a__test); + ATF_TP_ADD_TC(tp, null__r_append__a__test); + ATF_TP_ADD_TC(tp, null__r__r_append__test); + ATF_TP_ADD_TC(tp, null__w__r_append__test); + ATF_TP_ADD_TC(tp, null__r_append__r_append__test); + ATF_TP_ADD_TC(tp, null__r__w_append__test); + ATF_TP_ADD_TC(tp, null__w__w_append__test); + ATF_TP_ADD_TC(tp, null__r_append__w_append__test); + ATF_TP_ADD_TC(tp, sh__r__r__test); + ATF_TP_ADD_TC(tp, sh__sh__r__r__test); + ATF_TP_ADD_TC(tp, sh__null__r__r__test); + ATF_TP_ADD_TC(tp, sh__null__r__w__test); + + return (atf_no_error()); } -/* vim:ts=8:cin:sw=8 - * */ +/* + vim:ts=8:cin:sw=8 + */ Copied and modified: head/lib/libc/tests/stdio/getdelim_test.c (from r290536, head/tools/regression/lib/libc/stdio/test-getdelim.c) ============================================================================== --- head/tools/regression/lib/libc/stdio/test-getdelim.c Sun Nov 8 04:15:52 2015 (r290536, copy source) +++ head/lib/libc/tests/stdio/getdelim_test.c Sun Nov 8 06:37:50 2015 (r290537) @@ -28,12 +28,13 @@ __FBSDID("$FreeBSD$"); #define _WITH_GETLINE -#include #include #include #include #include +#include + #define CHUNK_MAX 10 /* The assertions depend on this string. */ @@ -70,18 +71,16 @@ mkfilebuf(void) return (fropen(offp, _reader)); } -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(getline_basic); +ATF_TC_BODY(getline_basic, tc) { FILE *fp; char *line; size_t linecap; - int i, n; + int i; srandom(0); - printf("1..6\n"); - /* * Test multiple times with different buffer sizes * and different _reader() return values. @@ -92,96 +91,147 @@ main(int argc, char *argv[]) linecap = i; line = malloc(i); /* First line: the full apothegm */ - assert(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); - assert(memcmp(line, apothegm, sizeof(apothegm)) == 0); - assert(linecap >= sizeof(apothegm)); + ATF_REQUIRE(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); + ATF_REQUIRE(memcmp(line, apothegm, sizeof(apothegm)) == 0); + ATF_REQUIRE(linecap >= sizeof(apothegm)); /* Second line: the NUL terminator following the newline */ - assert(getline(&line, &linecap, fp) == 1); - assert(line[0] == '\0' && line[1] == '\0'); + ATF_REQUIRE(getline(&line, &linecap, fp) == 1); + ATF_REQUIRE(line[0] == '\0' && line[1] == '\0'); /* Third line: EOF */ line[0] = 'X'; - assert(getline(&line, &linecap, fp) == -1); - assert(line[0] == '\0'); + ATF_REQUIRE(getline(&line, &linecap, fp) == -1); + ATF_REQUIRE(line[0] == '\0'); free(line); line = NULL; - assert(feof(fp)); - assert(!ferror(fp)); + ATF_REQUIRE(feof(fp)); + ATF_REQUIRE(!ferror(fp)); fclose(fp); } - assert(errno == 0); - printf("ok 1 - getline basic\n"); + ATF_REQUIRE(errno == 0); +} + +ATF_TC_WITHOUT_HEAD(stream_error); +ATF_TC_BODY(stream_error, tc) +{ + FILE *fp; + char *line; + size_t linecap; /* Make sure read errors are handled properly. */ + line = NULL; linecap = 0; errno = 0; - assert(getline(&line, &linecap, stdout) == -1); - assert(errno == EBADF); + ATF_REQUIRE(getline(&line, &linecap, stdout) == -1); + ATF_REQUIRE(errno == EBADF); errno = 0; - assert(getdelim(&line, &linecap, 'X', stdout) == -1); - assert(errno == EBADF); - assert(ferror(stdout)); - printf("ok 2 - stream error\n"); + ATF_REQUIRE(getdelim(&line, &linecap, 'X', stdout) == -1); + ATF_REQUIRE(errno == EBADF); + ATF_REQUIRE(ferror(stdout)); +} + +ATF_TC_WITHOUT_HEAD(invalid_params); +ATF_TC_BODY(invalid_params, tc) +{ + FILE *fp; + char *line; + size_t linecap; /* Make sure NULL linep or linecapp pointers are handled. */ fp = mkfilebuf(); - assert(getline(NULL, &linecap, fp) == -1); - assert(errno == EINVAL); - assert(getline(&line, NULL, fp) == -1); - assert(errno == EINVAL); - assert(ferror(fp)); + ATF_REQUIRE(getline(NULL, &linecap, fp) == -1); + ATF_REQUIRE(errno == EINVAL); + ATF_REQUIRE(getline(&line, NULL, fp) == -1); + ATF_REQUIRE(errno == EINVAL); + ATF_REQUIRE(ferror(fp)); fclose(fp); - printf("ok 3 - invalid params\n"); +} + +ATF_TC_WITHOUT_HEAD(eof); +ATF_TC_BODY(eof, tc) +{ + FILE *fp; + char *line; + size_t linecap; /* Make sure getline() allocates memory as needed if fp is at EOF. */ errno = 0; fp = mkfilebuf(); while (!feof(fp)) /* advance to EOF; can't fseek this stream */ getc(fp); - free(line); line = NULL; linecap = 0; - assert(getline(&line, &linecap, fp) == -1); - assert(line[0] == '\0'); - assert(linecap > 0); - assert(errno == 0); - assert(feof(fp)); - assert(!ferror(fp)); + printf("getline\n"); + ATF_REQUIRE(getline(&line, &linecap, fp) == -1); + ATF_REQUIRE(line[0] == '\0'); + ATF_REQUIRE(linecap > 0); + ATF_REQUIRE(errno == 0); + printf("feof\n"); + ATF_REQUIRE(feof(fp)); + ATF_REQUIRE(!ferror(fp)); fclose(fp); - printf("ok 4 - eof\n"); +} + +ATF_TC_WITHOUT_HEAD(nul); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Nov 8 07:03:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71AD3A29AB3; Sun, 8 Nov 2015 07:03:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBC111FC; Sun, 8 Nov 2015 07:03:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA873IxG058147; Sun, 8 Nov 2015 07:03:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA873H52058142; Sun, 8 Nov 2015 07:03:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080703.tA873H52058142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 07:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290538 - in head: lib/libc/tests/stdlib tools/regression/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 07:03:19 -0000 Author: ngie Date: Sun Nov 8 07:03:17 2015 New Revision: 290538 URL: https://svnweb.freebsd.org/changeset/base/290538 Log: Integrate tools/regression/lib/libc/stdlib into the FreeBSD test suite as lib/libc/tests/stdlib - Make the code a bit more style(9) compliant - Convert a sizeof(x)/sizeof(x[0]) to nitems MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/stdlib/heapsort_test.c - copied, changed from r290537, head/tools/regression/lib/libc/stdlib/test-heapsort.c head/lib/libc/tests/stdlib/mergesort_test.c - copied, changed from r290537, head/tools/regression/lib/libc/stdlib/test-mergesort.c head/lib/libc/tests/stdlib/qsort_test.c - copied, changed from r290537, head/tools/regression/lib/libc/stdlib/test-qsort.c head/lib/libc/tests/stdlib/test-sort.h - copied, changed from r290537, head/tools/regression/lib/libc/stdlib/test-sort.h Deleted: head/tools/regression/lib/libc/stdlib/ Modified: head/lib/libc/tests/stdlib/Makefile Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Sun Nov 8 06:37:50 2015 (r290537) +++ head/lib/libc/tests/stdlib/Makefile Sun Nov 8 07:03:17 2015 (r290538) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +ATF_TESTS_C+= heapsort_test +ATF_TESTS_C+= mergesort_test +ATF_TESTS_C+= qsort_test # TODO: t_getenv_thread, t_mi_vector_hash -NETBSD_ATF_TESTS_C= abs_test +NETBSD_ATF_TESTS_C+= abs_test NETBSD_ATF_TESTS_C+= atoi_test NETBSD_ATF_TESTS_C+= div_test NETBSD_ATF_TESTS_C+= getenv_test @@ -28,6 +30,8 @@ BINDIR= ${TESTSDIR} #PROGS+= h_atexit PROGS+= h_getopt h_getopt_long +CFLAGS+= -I${.CURDIR} + .for t in h_getopt h_getopt_long CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} Copied and modified: head/lib/libc/tests/stdlib/heapsort_test.c (from r290537, head/tools/regression/lib/libc/stdlib/test-heapsort.c) ============================================================================== --- head/tools/regression/lib/libc/stdlib/test-heapsort.c Sun Nov 8 06:37:50 2015 (r290537, copy source) +++ head/lib/libc/tests/stdlib/heapsort_test.c Sun Nov 8 07:03:17 2015 (r290538) @@ -37,30 +37,35 @@ __FBSDID("$FreeBSD$"); #include "test-sort.h" -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(heapsort_test); +ATF_TC_BODY(heapsort_test, tc) +{ + int sresvector[IVEC_LEN]; + int testvector[IVEC_LEN]; + int i, j; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using heapsort(3) */ + heapsort(testvector, j, sizeof(testvector[0]), sorthelp); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) { - int i, j; - int testvector[IVEC_LEN]; - int sresvector[IVEC_LEN]; - - printf("1..1\n"); - for (j = 2; j < IVEC_LEN; j++) { - /* Populate test vectors */ - for (i = 0; i < j; i++) - testvector[i] = sresvector[i] = initvector[i]; - - /* Sort using heapsort(3) */ - heapsort(testvector, j, sizeof(testvector[0]), sorthelp); - /* Sort using reference slow sorting routine */ - ssort(sresvector, j); - - /* Compare results */ - for (i = 0; i < j; i++) - assert(testvector[i] == sresvector[i]); - } - printf("ok 1 - heapsort\n"); + ATF_TP_ADD_TC(tp, heapsort_test); - return(0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/stdlib/mergesort_test.c (from r290537, head/tools/regression/lib/libc/stdlib/test-mergesort.c) ============================================================================== --- head/tools/regression/lib/libc/stdlib/test-mergesort.c Sun Nov 8 06:37:50 2015 (r290537, copy source) +++ head/lib/libc/tests/stdlib/mergesort_test.c Sun Nov 8 07:03:17 2015 (r290538) @@ -37,30 +37,35 @@ __FBSDID("$FreeBSD$"); #include "test-sort.h" -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(mergesort_test); +ATF_TC_BODY(mergesort_test, tc) +{ + int sresvector[IVEC_LEN]; + int testvector[IVEC_LEN]; + int i, j; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using mergesort(3) */ + mergesort(testvector, j, sizeof(testvector[0]), sorthelp); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) { - int i, j; - int testvector[IVEC_LEN]; - int sresvector[IVEC_LEN]; - - printf("1..1\n"); - for (j = 2; j < IVEC_LEN; j++) { - /* Populate test vectors */ - for (i = 0; i < j; i++) - testvector[i] = sresvector[i] = initvector[i]; - - /* Sort using mergesort(3) */ - mergesort(testvector, j, sizeof(testvector[0]), sorthelp); - /* Sort using reference slow sorting routine */ - ssort(sresvector, j); - - /* Compare results */ - for (i = 0; i < j; i++) - assert(testvector[i] == sresvector[i]); - } - printf("ok 1 - mergesort\n"); + ATF_TP_ADD_TC(tp, mergesort_test); - return(0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/stdlib/qsort_test.c (from r290537, head/tools/regression/lib/libc/stdlib/test-qsort.c) ============================================================================== --- head/tools/regression/lib/libc/stdlib/test-qsort.c Sun Nov 8 06:37:50 2015 (r290537, copy source) +++ head/lib/libc/tests/stdlib/qsort_test.c Sun Nov 8 07:03:17 2015 (r290538) @@ -37,30 +37,35 @@ __FBSDID("$FreeBSD$"); #include "test-sort.h" -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(qsort_test); +ATF_TC_BODY(qsort_test, tc) +{ + int testvector[IVEC_LEN]; + int sresvector[IVEC_LEN]; + int i, j; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using qsort(3) */ + qsort(testvector, j, sizeof(testvector[0]), sorthelp); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) { - int i, j; - int testvector[IVEC_LEN]; - int sresvector[IVEC_LEN]; - - printf("1..1\n"); - for (j = 2; j < IVEC_LEN; j++) { - /* Populate test vectors */ - for (i = 0; i < j; i++) - testvector[i] = sresvector[i] = initvector[i]; - - /* Sort using qsort(3) */ - qsort(testvector, j, sizeof(testvector[0]), sorthelp); - /* Sort using reference slow sorting routine */ - ssort(sresvector, j); - - /* Compare results */ - for (i = 0; i < j; i++) - assert(testvector[i] == sresvector[i]); - } - printf("ok 1 - qsort\n"); + ATF_TP_ADD_TC(tp, qsort_test); - return(0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/stdlib/test-sort.h (from r290537, head/tools/regression/lib/libc/stdlib/test-sort.h) ============================================================================== --- head/tools/regression/lib/libc/stdlib/test-sort.h Sun Nov 8 06:37:50 2015 (r290537, copy source) +++ head/lib/libc/tests/stdlib/test-sort.h Sun Nov 8 07:03:17 2015 (r290538) @@ -29,241 +29,245 @@ #ifndef _TEST_SORT_H #define _TEST_SORT_H +#include + +#include + static int sorthelp(const void *a, const void *b) { - const int *oa, *ob; + const int *oa, *ob; - oa = a; - ob = b; - /* Don't use "return *oa - *ob" since it's easy to cause overflow! */ - if (*oa > *ob) - return 1; - if (*oa < *ob) - return -1; - return 0; + oa = a; + ob = b; + /* Don't use "return *oa - *ob" since it's easy to cause overflow! */ + if (*oa > *ob) + return (1); + if (*oa < *ob) + return (-1); + return (0); } /* Reference sorting routine (slooow!) */ static void ssort(int v[], int nmemb) { - int i, j, k; + int i, j, k; - for (i = 0; i < nmemb; i++) { - for (j = i + 1; j < nmemb; j++) { - if (v[j] < v[i]) { - k = v[i]; - v[i] = v[j]; - v[j] = k; - } - } - } + for (i = 0; i < nmemb; i++) { + for (j = i + 1; j < nmemb; j++) { + if (v[j] < v[i]) { + k = v[i]; + v[i] = v[j]; + v[j] = k; + } + } + } } /* Some random data */ static int initvector[1024] = { - 599853225, 371951333, -428880425, 1450668530, 85530178, -460170550, - -270680269, 717137591, 106244401, -1138072905, -113532586, - 599690958, 464993720, 107690177, 24249019, -1151018550, 794225588, - 1494905642, -62951716, -734531757, 1197251494, 1020063925, - -634536734, -216634704, 617366508, -18840190, 481010395, - -1555785724, 128221950, -1747743676, 1119012320, -252160437, - 617137855, 1159833073, -106647920, -1570719046, -769400990, - -130308848, 1186546396, 215253591, 445832488, 160263176, 777264170, - -274636650, -696134447, 1057957088, -626175254, 188632134, - -98941793, -1602334908, -373717125, 885013862, 571258221, - -399572192, 407761463, -733249776, 12094800, -367046815, 178974501, - -452638559, -516580143, -94282073, 1411115180, -1151792797, - 1442815268, 1106583674, 515269284, -74019972, 598818901, 696848474, - -657910766, -287309335, 1538095746, 143543003, 851444033, - -947573348, 296222973, 1339592140, -947505360, 872027891, - -418844714, -583075597, -324758197, -964531573, 1016795914, - -866842580, -304084402, -286930819, 338975583, 803597943, - -452483372, 1525283506, -1185830826, -596405894, 905191340, - -1638026278, 106749913, 582771197, -730713796, 56052422, - 1498040174, 644967266, 182541575, 280483468, -1932835017, - -435546874, 940106007, 1753388509, -340355019, -231577358, - -714879035, 1051182949, 204261785, 1321346243, -895289878, - -240369893, 566608506, -350777580, -1384849829, -876816409, - 1013787299, -1408035937, -222626650, 1708168486, -645148461, - 1854654, -393012507, 179327030, -1607975548, -715202732, 730588290, - 246968517, -550975254, -101136772, -174103176, 1188941016, - 2004650834, -1501389866, -2021225998, 1219042515, -464113898, - 268565342, 126451123, -1045877126, -198918003, 310177444, - 1578314812, 1828867082, 453336898, -908485523, 749777130, - -1028565802, 61360571, 241484853, -175693399, 1816211059, - 533940889, -1496933703, 385185125, -821132413, -8923391, - -1429546239, 46190992, 449247332, -20432494, 778761611, -178782699, - -811194695, -632276211, 70196094, 890817525, -1447776908, - -323783741, -62333222, 954929503, 247668507, -1394420605, - 367913886, 1364926759, 1298781924, 357923028, -73644747, - -319744305, 61718202, -1454549286, 387493522, 2018321449, - 861026653, 289973298, 1755939093, -84772204, 43425266, -1325753781, - -679938775, 1228500370, -763816405, 548903035, 1765563727, - 425183052, 1424621863, -188287424, 554385654, 751831998, - 1377088085, 66622090, 139224450, -1305816167, 650140724, 593988868, - -444913321, 589045097, 1261428989, 101292769, -780376786, - 559307348, 1644593236, -1838606833, 53570301, -680576100, - -44969538, 268718267, -632104125, 276904628, 626299449, -11761453, - 545899086, -1027343598, -432251872, 539353494, -399575006, - -568383580, -677802882, 1296513472, 801202048, 806425805, 1983363, - 850487421, 38046173, 1535399484, 1998285544, -1301751898, - -46561973, 56545408, -1107662676, 456041145, -452923904, - -262219453, -371849200, 392524281, 1650231392, 1185585356, - 126610511, -1125389657, 1015981177, -1318481342, -213835789, - 1263484054, -654361441, 1408272041, -231555284, -1121778152, - -395512897, 332277674, -349703586, 1809474399, -223731607, - -1342224737, 736165236, 67535587, 89879082, 471445838, 423788300, - -384354470, 907475706, 154886390, -1406736539, -8558766, - -203405718, -422127884, 1048520863, 747418501, 87438975, 727668160, - -914936981, 428266976, -455742009, -949014605, 487159058, - -262526850, -309451504, -76928461, 1072951428, -1370953830, - 238231681, -1831047244, -405735199, -35941848, 469048670, - 505307987, -660553590, 876537439, -314195871, 999234339, - -1405846240, -579885695, 629067031, 863481510, -742301385, - -1723403128, -153070386, 782682839, -343111818, -877101810, - 1438467302, -319951459, -1585702508, -338381888, 484108815, - -1726935191, -749923706, 1657932127, -816151395, -566321865, - -133542331, 84961164, 598275578, 1302065347, -533098653, - -1766383037, 53169714, -464201288, 617735133, 862536123, - -141730724, -1967377125, -1023736305, -1012511106, 64484992, - -1250856831, 426409332, -355670055, -298251663, -867634978, - -776124819, 74018333, -425385214, -108004251, -1192766130, - 1294193867, -109867195, -78667637, 1164855393, -826007552, - -522528066, 1160283046, -1095276403, -1218917472, -396475366, - -77394733, -425603169, 251928357, -393559355, 1488845184, - 898455978, -773338691, -37627855, -345014717, 204298578, 209084274, - 1047080643, -414348222, 26496664, 705759824, 575149152, 604904761, - 624988690, 1446041250, 1000757225, -1354896151, 1422958189, - -1607165311, -832757521, 365074225, 1171764999, 1200795217, - -203957828, 23166236, -846818698, -547439867, -790192498, - -122123561, 914298013, 66225525, -36163174, -480698856, - -1269421818, 624641703, 254923102, 1564329013, -583609221, - -649433551, -743396069, 1182455435, 102658744, 285599336, - 692480463, -852737563, -660090184, 1374350065, 72300985, 690541659, - -1194212957, -1151816525, 157415641, 487398246, 1030153072, - 933723020, 1359181027, -1303457764, -1543773272, 774306017, - -854382652, 755485667, -864943584, -63242545, -1271480354, - 157720215, -205001173, 889984130, -581583822, -473779111, - -932136577, 735326252, 428638717, 1888884222, 561493709, - -1966427364, -1710208603, 340121869, 918894036, 927172509, - 904178436, 1476687667, 90796414, 651591731, -550913123, -42218158, - 637756529, 1091478400, 124976584, -48739309, -798898083, 393581349, - -1078624722, -789291577, 1010582542, -512317005, 1222773656, - 466454593, 1183558811, 822782663, -851624703, -850404012, - 1473672600, 852527073, 1073953362, 137635828, 936104739, -86567759, - -882563252, 1845232980, -737978404, -104703380, 149802989, - -349118325, 1479797538, 1966007488, 1254228842, 414304661, - -790805785, 31583329, -76864151, 558202855, -1447047313, 716720607, - -404224238, -54107627, 1747385914, -657407390, 202940208, - 1083067056, -532861378, 163426933, -130289277, 1301785258, - -302920320, -637947485, -644895903, -1668027530, 391890467, - -126586485, -536836984, -1154536413, -339505118, -1187229462, - -670985870, -601310813, -1350055158, -482479784, 139847714, - -253955849, 5190414, -542857077, 1175835684, -584165057, - 1132775766, -592091269, -891445655, -340995936, 736395810, - 779967964, 515095845, -1138437307, -259226729, -167820100, - -801611617, -282451622, -1313679283, -1436126694, 1258773990, - -717601098, -583559645, -1307478759, 1238647247, 1589011223, - -1029216445, -107030650, 400152690, -1349079913, 1428582247, - 21546946, 208807686, -169450574, -1086213374, -1242715198, - 669098277, 416626722, -1122525014, -1389466669, -391843085, - -56318357, 421040094, 212303518, 738666684, -1185364904, - -506192760, 646735912, -1424722633, 745226976, 1019191717, - -190891744, -310320868, -373655022, -665117060, 830760000, - 583906512, -330536027, 611092636, -321344259, -1255008904, - -777959046, -523043472, 88896910, 346062204, -163734816, 336635665, - 906060268, -128891583, 740952564, 916767203, 296514859, 198670559, - 358136672, -152253676, 12038867, -1469916749, -1020980597, - -897143313, 354240970, -97959800, 814172811, 1983363241, 264990663, - 105154676, 1060463014, 430172143, 375111946, -824526943, - -708877751, -1377442616, -236559551, 684724584, 1602131358, - -42140186, -763499840, -605167, 98575879, -376577598, 1689746083, - -777973879, -1396984691, -187780326, 281040966, 1858859521, - 158395760, 1022807978, -218458812, 811779708, 1495113833, - 1192561226, 629539535, -1365196683, -1120253162, 1091681956, - 134286445, 1172218369, -34093658, -137087343, -27869226, - -180889478, 55705436, 52362743, -1745516232, -926564477, - -513701675, -1666272054, 1457952810, 843953275, -478275722, - -1240291080, 101859661, -1606687523, 916365333, 314713310, - -22002688, 1019022641, -1171741314, -129050627, -211955813, - -1020176299, 1357865293, -609819628, 724533854, -1141449545, - 22285231, -97731145, -302329687, 191910894, -1300709885, - -644951895, 640448036, -1289009824, 1445456129, 846416471, - 1821291740, -1639640821, -712724532, -447475807, 132156847, - 258067455, 324301319, 278586969, -1544082357, 636007277, 977122066, - 127462480, 365126129, 1086276825, -432124148, 896598926, - -388550179, 273357331, -845018695, -1089465389, 384439820, - -558419772, 1476422025, 730712769, 190665059, -764968927, - -789708218, 637873581, 348429858, 1386000168, -638123594, - -842010345, -607926448, 19535163, -742771490, -18323344, 246155488, - 350409468, 1290907730, -492566468, 300358636, 501876267, 252441807, - 1233551975, -1431067042, 517177374, -1540299707, -948380761, - 1253997663, 693795998, 148707823, 152894502, 98729538, -30042824, - -563057441, 723726409, 367338961, 1395435261, 217868876, - 1220652431, 953572083, -1134905155, -734486813, -587470130, - -864647866, 1030737023, 781798521, -321076732, -460548153, - 122681678, -873728847, -1286304399, -75472885, 113390881, - -1556849198, -1070802176, 924389470, 957478910, 5974049, 709413506, - 476334647, 572869787, 776298405, -8822420, -99326499, -707855342, - -1187216303, 668038414, 262454769, -1120293198, -32011040, - 249812104, -101835410, 1082281087, -570183855, -954535179, - 1384361473, -983199686, 2017611313, 328926483, -878162849, - -1202254181, -225604951, 966898955, 247213529, -1257544612, - -197005970, -1039902730, -1947925142, 1752780907, -313410699, - -464474556, 416580338, -1063356643, -292212702, 57509168, - 1034124629, 1059212593, 468522867, 845369497, 1872717306, - -1216544764, -1419907623, 1376869956, -66585488, -1590974467, - -367070705, -1456529060, 791844031, 336217635, -1106832215, - 1476739427, -751018210, -1411671555, -1880387375, -1714242595, - 1169006474, -479442380, -892267555, -1471250266, -267888858, - 808634418, 1324777189, -585449929, 1127186951, 468768901, - -2002989138, -52352849, 186493053, 1258464606, 117157186, - 445919258, 908401949, -1112221136, 863904453, -942718649, - 796754809, -38943966, -781978872, -56814078, 1273857459, - -1781920832, 209979504, 811828269, -1150814437, 850061883, - -532968763, 252506408, -885025629, 391567580, -1295702482, - 574894420, 1462248349, 1622584325, -88443443, -1122006092, - -169758578, 456282338, -443233309, 436693483, -956563815, - -480221349, 435252860, -1114099391, 1060053979, -470893945, - -1273682879, -734596176, 639950927, -1278648701, 306274747, - -410562146, 1137869228, -1970746553, 1313830798, 1248071822, - -247297704, 1015218053, -1607348116, -261817613, -821413148, - -782942639, -628711083, 240953091, -629550668, -1584736319, - 856616893, -186759752, 197905373, 541638393, 603407919, -278480495, - 410077039, 544065371, -1509627427, 402918436, -450463799, - -131169308, 249920630, 1079548609, -927911828, 1444577689, - -353002528, -224292462, 1247795279, -790844631, -40427503, - 59829765, -332587567, 1319862109, -1261340753, 121711726, - 1342756342, -643495787, 100326201, -934436714, -69134888, - -898880561, -379524737, -577234570, -805827092, -1575493557, - -289920678, -476605057, 1235714994, -317239591, 418553949, - 410053338, -204985448, 1206503615, 202610372, -932244873, - 782207875, -288661931, -806814809, 1270953679, 2060991595, - -311412846, 327279979, 1148562672, 55239149, -610114433, - -1511688434, 87619740, -433503545, 326150519, -581293393, - -97417688, -289736140, -1543886029, -1251976119, 1585774446, - 1570011421, 432602745, 486343696, -834680922, 265004849, - -1132107706, 502627197, -815873818, 249635389, 1985714127, - -1095817653, -130743522, -645266828, -334621094, 199921747, - 1059256177, 378031303, 1519740920, 925540689, 1405957844, - 1387748290, -56138046, -770637828, -187984510, -1361735163, - 1294823206, -608941238, 451860688, -510549867, 1143516283, - -779090703, 1459305047, -600335915, -1684168049, 1516622316, - -631733335, -4360068, 499778796, 587600402, -1296000335, -37959743, - -1084203927, 1162902556, 246374600, -515103645, 341724568, - -702303954, 452229900, 485108287, 1170048553, -1510148355, - 611133912, 1997927484, -142022671, -724776653, -336090522, - 708283514, -1409637378, -2052637687, 376055110, 226628105, - -1714452033, -1776158002, 369167930, 1800807012, 710680889, - -69951947, -1223849766, -1862239787, 218536127, -656411794, - -1202269188, 609634805, -224425858, 519797951, 284223080, - 869408930, 270750206, -544967439, 2097168510, 31650971, -600985417, - -165303097, -257809088, -1043223971, 1827891621, -156827355, - 499719603 + 599853225, 371951333, -428880425, 1450668530, 85530178, -460170550, + -270680269, 717137591, 106244401, -1138072905, -113532586, + 599690958, 464993720, 107690177, 24249019, -1151018550, 794225588, + 1494905642, -62951716, -734531757, 1197251494, 1020063925, + -634536734, -216634704, 617366508, -18840190, 481010395, + -1555785724, 128221950, -1747743676, 1119012320, -252160437, + 617137855, 1159833073, -106647920, -1570719046, -769400990, + -130308848, 1186546396, 215253591, 445832488, 160263176, 777264170, + -274636650, -696134447, 1057957088, -626175254, 188632134, + -98941793, -1602334908, -373717125, 885013862, 571258221, + -399572192, 407761463, -733249776, 12094800, -367046815, 178974501, + -452638559, -516580143, -94282073, 1411115180, -1151792797, + 1442815268, 1106583674, 515269284, -74019972, 598818901, 696848474, + -657910766, -287309335, 1538095746, 143543003, 851444033, + -947573348, 296222973, 1339592140, -947505360, 872027891, + -418844714, -583075597, -324758197, -964531573, 1016795914, + -866842580, -304084402, -286930819, 338975583, 803597943, + -452483372, 1525283506, -1185830826, -596405894, 905191340, + -1638026278, 106749913, 582771197, -730713796, 56052422, + 1498040174, 644967266, 182541575, 280483468, -1932835017, + -435546874, 940106007, 1753388509, -340355019, -231577358, + -714879035, 1051182949, 204261785, 1321346243, -895289878, + -240369893, 566608506, -350777580, -1384849829, -876816409, + 1013787299, -1408035937, -222626650, 1708168486, -645148461, + 1854654, -393012507, 179327030, -1607975548, -715202732, 730588290, + 246968517, -550975254, -101136772, -174103176, 1188941016, + 2004650834, -1501389866, -2021225998, 1219042515, -464113898, + 268565342, 126451123, -1045877126, -198918003, 310177444, + 1578314812, 1828867082, 453336898, -908485523, 749777130, + -1028565802, 61360571, 241484853, -175693399, 1816211059, + 533940889, -1496933703, 385185125, -821132413, -8923391, + -1429546239, 46190992, 449247332, -20432494, 778761611, -178782699, + -811194695, -632276211, 70196094, 890817525, -1447776908, + -323783741, -62333222, 954929503, 247668507, -1394420605, + 367913886, 1364926759, 1298781924, 357923028, -73644747, + -319744305, 61718202, -1454549286, 387493522, 2018321449, + 861026653, 289973298, 1755939093, -84772204, 43425266, -1325753781, + -679938775, 1228500370, -763816405, 548903035, 1765563727, + 425183052, 1424621863, -188287424, 554385654, 751831998, + 1377088085, 66622090, 139224450, -1305816167, 650140724, 593988868, + -444913321, 589045097, 1261428989, 101292769, -780376786, + 559307348, 1644593236, -1838606833, 53570301, -680576100, + -44969538, 268718267, -632104125, 276904628, 626299449, -11761453, + 545899086, -1027343598, -432251872, 539353494, -399575006, + -568383580, -677802882, 1296513472, 801202048, 806425805, 1983363, + 850487421, 38046173, 1535399484, 1998285544, -1301751898, + -46561973, 56545408, -1107662676, 456041145, -452923904, + -262219453, -371849200, 392524281, 1650231392, 1185585356, + 126610511, -1125389657, 1015981177, -1318481342, -213835789, + 1263484054, -654361441, 1408272041, -231555284, -1121778152, + -395512897, 332277674, -349703586, 1809474399, -223731607, + -1342224737, 736165236, 67535587, 89879082, 471445838, 423788300, + -384354470, 907475706, 154886390, -1406736539, -8558766, + -203405718, -422127884, 1048520863, 747418501, 87438975, 727668160, + -914936981, 428266976, -455742009, -949014605, 487159058, + -262526850, -309451504, -76928461, 1072951428, -1370953830, + 238231681, -1831047244, -405735199, -35941848, 469048670, + 505307987, -660553590, 876537439, -314195871, 999234339, + -1405846240, -579885695, 629067031, 863481510, -742301385, + -1723403128, -153070386, 782682839, -343111818, -877101810, + 1438467302, -319951459, -1585702508, -338381888, 484108815, + -1726935191, -749923706, 1657932127, -816151395, -566321865, + -133542331, 84961164, 598275578, 1302065347, -533098653, + -1766383037, 53169714, -464201288, 617735133, 862536123, + -141730724, -1967377125, -1023736305, -1012511106, 64484992, + -1250856831, 426409332, -355670055, -298251663, -867634978, + -776124819, 74018333, -425385214, -108004251, -1192766130, + 1294193867, -109867195, -78667637, 1164855393, -826007552, + -522528066, 1160283046, -1095276403, -1218917472, -396475366, + -77394733, -425603169, 251928357, -393559355, 1488845184, + 898455978, -773338691, -37627855, -345014717, 204298578, 209084274, + 1047080643, -414348222, 26496664, 705759824, 575149152, 604904761, + 624988690, 1446041250, 1000757225, -1354896151, 1422958189, + -1607165311, -832757521, 365074225, 1171764999, 1200795217, + -203957828, 23166236, -846818698, -547439867, -790192498, + -122123561, 914298013, 66225525, -36163174, -480698856, + -1269421818, 624641703, 254923102, 1564329013, -583609221, + -649433551, -743396069, 1182455435, 102658744, 285599336, + 692480463, -852737563, -660090184, 1374350065, 72300985, 690541659, + -1194212957, -1151816525, 157415641, 487398246, 1030153072, + 933723020, 1359181027, -1303457764, -1543773272, 774306017, + -854382652, 755485667, -864943584, -63242545, -1271480354, + 157720215, -205001173, 889984130, -581583822, -473779111, + -932136577, 735326252, 428638717, 1888884222, 561493709, + -1966427364, -1710208603, 340121869, 918894036, 927172509, + 904178436, 1476687667, 90796414, 651591731, -550913123, -42218158, + 637756529, 1091478400, 124976584, -48739309, -798898083, 393581349, + -1078624722, -789291577, 1010582542, -512317005, 1222773656, + 466454593, 1183558811, 822782663, -851624703, -850404012, + 1473672600, 852527073, 1073953362, 137635828, 936104739, -86567759, + -882563252, 1845232980, -737978404, -104703380, 149802989, + -349118325, 1479797538, 1966007488, 1254228842, 414304661, + -790805785, 31583329, -76864151, 558202855, -1447047313, 716720607, + -404224238, -54107627, 1747385914, -657407390, 202940208, + 1083067056, -532861378, 163426933, -130289277, 1301785258, + -302920320, -637947485, -644895903, -1668027530, 391890467, + -126586485, -536836984, -1154536413, -339505118, -1187229462, + -670985870, -601310813, -1350055158, -482479784, 139847714, + -253955849, 5190414, -542857077, 1175835684, -584165057, + 1132775766, -592091269, -891445655, -340995936, 736395810, + 779967964, 515095845, -1138437307, -259226729, -167820100, + -801611617, -282451622, -1313679283, -1436126694, 1258773990, + -717601098, -583559645, -1307478759, 1238647247, 1589011223, + -1029216445, -107030650, 400152690, -1349079913, 1428582247, + 21546946, 208807686, -169450574, -1086213374, -1242715198, + 669098277, 416626722, -1122525014, -1389466669, -391843085, + -56318357, 421040094, 212303518, 738666684, -1185364904, + -506192760, 646735912, -1424722633, 745226976, 1019191717, + -190891744, -310320868, -373655022, -665117060, 830760000, + 583906512, -330536027, 611092636, -321344259, -1255008904, + -777959046, -523043472, 88896910, 346062204, -163734816, 336635665, + 906060268, -128891583, 740952564, 916767203, 296514859, 198670559, + 358136672, -152253676, 12038867, -1469916749, -1020980597, + -897143313, 354240970, -97959800, 814172811, 1983363241, 264990663, + 105154676, 1060463014, 430172143, 375111946, -824526943, + -708877751, -1377442616, -236559551, 684724584, 1602131358, + -42140186, -763499840, -605167, 98575879, -376577598, 1689746083, + -777973879, -1396984691, -187780326, 281040966, 1858859521, + 158395760, 1022807978, -218458812, 811779708, 1495113833, + 1192561226, 629539535, -1365196683, -1120253162, 1091681956, + 134286445, 1172218369, -34093658, -137087343, -27869226, + -180889478, 55705436, 52362743, -1745516232, -926564477, + -513701675, -1666272054, 1457952810, 843953275, -478275722, + -1240291080, 101859661, -1606687523, 916365333, 314713310, + -22002688, 1019022641, -1171741314, -129050627, -211955813, + -1020176299, 1357865293, -609819628, 724533854, -1141449545, + 22285231, -97731145, -302329687, 191910894, -1300709885, + -644951895, 640448036, -1289009824, 1445456129, 846416471, + 1821291740, -1639640821, -712724532, -447475807, 132156847, + 258067455, 324301319, 278586969, -1544082357, 636007277, 977122066, + 127462480, 365126129, 1086276825, -432124148, 896598926, + -388550179, 273357331, -845018695, -1089465389, 384439820, + -558419772, 1476422025, 730712769, 190665059, -764968927, + -789708218, 637873581, 348429858, 1386000168, -638123594, + -842010345, -607926448, 19535163, -742771490, -18323344, 246155488, + 350409468, 1290907730, -492566468, 300358636, 501876267, 252441807, + 1233551975, -1431067042, 517177374, -1540299707, -948380761, + 1253997663, 693795998, 148707823, 152894502, 98729538, -30042824, + -563057441, 723726409, 367338961, 1395435261, 217868876, + 1220652431, 953572083, -1134905155, -734486813, -587470130, + -864647866, 1030737023, 781798521, -321076732, -460548153, + 122681678, -873728847, -1286304399, -75472885, 113390881, + -1556849198, -1070802176, 924389470, 957478910, 5974049, 709413506, + 476334647, 572869787, 776298405, -8822420, -99326499, -707855342, + -1187216303, 668038414, 262454769, -1120293198, -32011040, + 249812104, -101835410, 1082281087, -570183855, -954535179, + 1384361473, -983199686, 2017611313, 328926483, -878162849, + -1202254181, -225604951, 966898955, 247213529, -1257544612, + -197005970, -1039902730, -1947925142, 1752780907, -313410699, + -464474556, 416580338, -1063356643, -292212702, 57509168, + 1034124629, 1059212593, 468522867, 845369497, 1872717306, + -1216544764, -1419907623, 1376869956, -66585488, -1590974467, + -367070705, -1456529060, 791844031, 336217635, -1106832215, + 1476739427, -751018210, -1411671555, -1880387375, -1714242595, + 1169006474, -479442380, -892267555, -1471250266, -267888858, + 808634418, 1324777189, -585449929, 1127186951, 468768901, + -2002989138, -52352849, 186493053, 1258464606, 117157186, + 445919258, 908401949, -1112221136, 863904453, -942718649, + 796754809, -38943966, -781978872, -56814078, 1273857459, + -1781920832, 209979504, 811828269, -1150814437, 850061883, + -532968763, 252506408, -885025629, 391567580, -1295702482, + 574894420, 1462248349, 1622584325, -88443443, -1122006092, + -169758578, 456282338, -443233309, 436693483, -956563815, + -480221349, 435252860, -1114099391, 1060053979, -470893945, + -1273682879, -734596176, 639950927, -1278648701, 306274747, + -410562146, 1137869228, -1970746553, 1313830798, 1248071822, + -247297704, 1015218053, -1607348116, -261817613, -821413148, + -782942639, -628711083, 240953091, -629550668, -1584736319, + 856616893, -186759752, 197905373, 541638393, 603407919, -278480495, + 410077039, 544065371, -1509627427, 402918436, -450463799, + -131169308, 249920630, 1079548609, -927911828, 1444577689, + -353002528, -224292462, 1247795279, -790844631, -40427503, + 59829765, -332587567, 1319862109, -1261340753, 121711726, + 1342756342, -643495787, 100326201, -934436714, -69134888, + -898880561, -379524737, -577234570, -805827092, -1575493557, + -289920678, -476605057, 1235714994, -317239591, 418553949, + 410053338, -204985448, 1206503615, 202610372, -932244873, + 782207875, -288661931, -806814809, 1270953679, 2060991595, + -311412846, 327279979, 1148562672, 55239149, -610114433, + -1511688434, 87619740, -433503545, 326150519, -581293393, + -97417688, -289736140, -1543886029, -1251976119, 1585774446, + 1570011421, 432602745, 486343696, -834680922, 265004849, + -1132107706, 502627197, -815873818, 249635389, 1985714127, + -1095817653, -130743522, -645266828, -334621094, 199921747, + 1059256177, 378031303, 1519740920, 925540689, 1405957844, + 1387748290, -56138046, -770637828, -187984510, -1361735163, + 1294823206, -608941238, 451860688, -510549867, 1143516283, + -779090703, 1459305047, -600335915, -1684168049, 1516622316, + -631733335, -4360068, 499778796, 587600402, -1296000335, -37959743, + -1084203927, 1162902556, 246374600, -515103645, 341724568, + -702303954, 452229900, 485108287, 1170048553, -1510148355, + 611133912, 1997927484, -142022671, -724776653, -336090522, + 708283514, -1409637378, -2052637687, 376055110, 226628105, + -1714452033, -1776158002, 369167930, 1800807012, 710680889, + -69951947, -1223849766, -1862239787, 218536127, -656411794, + -1202269188, 609634805, -224425858, 519797951, 284223080, + 869408930, 270750206, -544967439, 2097168510, 31650971, -600985417, + -165303097, -257809088, -1043223971, 1827891621, -156827355, + 499719603 }; -#define IVEC_LEN (sizeof(initvector) / sizeof(initvector[0])) +#define IVEC_LEN (nitems(initvector)) #endif From owner-svn-src-all@freebsd.org Sun Nov 8 07:53:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D24C3A29230; Sun, 8 Nov 2015 07:53:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89750181B; Sun, 8 Nov 2015 07:53:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA87rV7H072800; Sun, 8 Nov 2015 07:53:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA87rVa4072795; Sun, 8 Nov 2015 07:53:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080753.tA87rVa4072795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 07:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290539 - in head: lib/libc/tests/string tools/regression/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 07:53:33 -0000 Author: ngie Date: Sun Nov 8 07:53:31 2015 New Revision: 290539 URL: https://svnweb.freebsd.org/changeset/base/290539 Log: Integrate tools/regression/lib/libc/string into the FreeBSD test suite as lib/libc/tests/string MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/string/stpncpy_test.c - copied, changed from r290538, head/tools/regression/lib/libc/string/test-stpncpy.c head/lib/libc/tests/string/strerror_test.c - copied, changed from r290538, head/tools/regression/lib/libc/string/test-strerror.c head/lib/libc/tests/string/wcscasecmp_test.c - copied, changed from r290538, head/tools/regression/lib/libc/string/test-wcscasecmp.c head/lib/libc/tests/string/wcsnlen_test.c - copied, changed from r290538, head/tools/regression/lib/libc/string/test-wcsnlen.c Deleted: head/tools/regression/lib/libc/string/ Modified: head/lib/libc/tests/string/Makefile Modified: head/lib/libc/tests/string/Makefile ============================================================================== --- head/lib/libc/tests/string/Makefile Sun Nov 8 07:03:17 2015 (r290538) +++ head/lib/libc/tests/string/Makefile Sun Nov 8 07:53:31 2015 (r290539) @@ -1,6 +1,9 @@ # $FreeBSD$ -.include +ATF_TESTS_C+= stpncpy_test +ATF_TESTS_C+= strerror2_test +ATF_TESTS_C+= wcscasecmp_test +ATF_TESTS_C+= wcsnlen_test # TODO: popcount, stresep @@ -20,6 +23,8 @@ NETBSD_ATF_TESTS_C+= strrchr_test NETBSD_ATF_TESTS_C+= strspn_test NETBSD_ATF_TESTS_C+= swab_test +SRCS.strerror2_test= strerror_test.c + .include "../Makefile.netbsd-tests" LDADD.memchr_test+= -lmd Copied and modified: head/lib/libc/tests/string/stpncpy_test.c (from r290538, head/tools/regression/lib/libc/string/test-stpncpy.c) ============================================================================== --- head/tools/regression/lib/libc/string/test-stpncpy.c Sun Nov 8 07:03:17 2015 (r290538, copy source) +++ head/lib/libc/tests/string/stpncpy_test.c Sun Nov 8 07:53:31 2015 (r290539) @@ -27,13 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include #include #include +#include + static char * makebuf(size_t len, int guard_at_end) { @@ -76,18 +78,33 @@ test_stpncpy(const char *s) } } -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(nul); +ATF_TC_BODY(nul, tc) { - printf("1..3\n"); - test_stpncpy(""); - printf("ok 1 - stpncpy\n"); +} + +ATF_TC_WITHOUT_HEAD(foo); +ATF_TC_BODY(foo, tc) +{ + test_stpncpy("foo"); - printf("ok 2 - stpncpy\n"); +} + +ATF_TC_WITHOUT_HEAD(glorp); +ATF_TC_BODY(glorp, tc) +{ + test_stpncpy("glorp"); - printf("ok 3 - stpncpy\n"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, nul); + ATF_TP_ADD_TC(tp, foo); + ATF_TP_ADD_TC(tp, glorp); - exit(0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/string/strerror_test.c (from r290538, head/tools/regression/lib/libc/string/test-strerror.c) ============================================================================== --- head/tools/regression/lib/libc/string/test-strerror.c Sun Nov 8 07:03:17 2015 (r290538, copy source) +++ head/lib/libc/tests/string/strerror_test.c Sun Nov 8 07:53:31 2015 (r290539) @@ -33,115 +33,174 @@ #include #include -static int test_count = 1; -static int exit_status = EXIT_SUCCESS; +#include + +static char buf[64]; +static char *sret; +static int iret; + +ATF_TC_WITHOUT_HEAD(strerror_unknown_error); +ATF_TC_BODY(strerror_unknown_error, tc) +{ -#define CHECK(x) \ - do { \ - if (x) { \ - printf("ok %d\n", test_count); \ - } else { \ - printf("not ok %d # %s\n", test_count, #x); \ - exit_status = EXIT_FAILURE; \ - } \ - ++test_count; \ - } while (0) - -int -main(void) -{ - char buf[64]; - char *sret; - int iret; - - printf("1..27\n"); - - /* - * strerror() failure tests. - */ errno = 0; sret = strerror(INT_MAX); snprintf(buf, sizeof(buf), "Unknown error: %d", INT_MAX); - CHECK(strcmp(sret, buf) == 0); - CHECK(errno == EINVAL); + ATF_CHECK(strcmp(sret, buf) == 0); + ATF_CHECK(errno == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_no_error); +ATF_TC_BODY(strerror_no_error, tc) +{ - /* - * strerror() success tests. - */ errno = 0; sret = strerror(0); - CHECK(strcmp(sret, "No error: 0") == 0); - CHECK(errno == 0); + ATF_CHECK(strcmp(sret, "No error: 0") == 0); + ATF_CHECK(errno == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_EPERM_test); +ATF_TC_BODY(strerror_EPERM_test, tc) +{ errno = 0; sret = strerror(EPERM); - CHECK(strcmp(sret, "Operation not permitted") == 0); - CHECK(errno == 0); + ATF_CHECK(strcmp(sret, "Operation not permitted") == 0); + ATF_CHECK(errno == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_EPFNOSUPPORT_test); +ATF_TC_BODY(strerror_EPFNOSUPPORT_test, tc) +{ errno = 0; sret = strerror(EPFNOSUPPORT); - CHECK(strcmp(sret, "Protocol family not supported") == 0); - CHECK(errno == 0); + ATF_CHECK(strcmp(sret, "Protocol family not supported") == 0); + ATF_CHECK(errno == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_ELAST_test); +ATF_TC_BODY(strerror_ELAST_test, tc) +{ errno = 0; sret = strerror(ELAST); - CHECK(errno == 0); + ATF_CHECK(errno == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__unknown_error); +ATF_TC_BODY(strerror_r__unknown_error, tc) +{ - /* - * strerror_r() failure tests. - */ memset(buf, '*', sizeof(buf)); iret = strerror_r(-1, buf, sizeof(buf)); - CHECK(strcmp(buf, "Unknown error: -1") == 0); - CHECK(iret == EINVAL); + ATF_CHECK(strcmp(buf, "Unknown error: -1") == 0); + ATF_CHECK(iret == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPERM_one_byte_short); +ATF_TC_BODY(strerror_r__EPERM_one_byte_short, tc) +{ memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(EPERM, buf, strlen("Operation not permitted")); - CHECK(strcmp(buf, "Operation not permitte") == 0); - CHECK(iret == ERANGE); + ATF_CHECK(strcmp(buf, "Operation not permitte") == 0); + ATF_CHECK(iret == ERANGE); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPERM_unknown_error_one_byte_short); +ATF_TC_BODY(strerror_r__EPERM_unknown_error_one_byte_short, tc) +{ memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(-1, buf, strlen("Unknown error: -1")); - CHECK(strcmp(buf, "Unknown error: -") == 0); - CHECK(iret == EINVAL); + ATF_CHECK(strcmp(buf, "Unknown error: -") == 0); + ATF_CHECK(iret == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPERM_unknown_error_two_bytes_short); +ATF_TC_BODY(strerror_r__EPERM_unknown_error_two_bytes_short, tc) +{ memset(buf, '*', sizeof(buf)); /* Two bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 1); - CHECK(strcmp(buf, "Unknown error: ") == 0); - CHECK(iret == EINVAL); + ATF_CHECK(strcmp(buf, "Unknown error: ") == 0); + ATF_CHECK(iret == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPERM_unknown_error_three_bytes_short); +ATF_TC_BODY(strerror_r__EPERM_unknown_error_three_bytes_short, tc) +{ memset(buf, '*', sizeof(buf)); /* Three bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 2); - CHECK(strcmp(buf, "Unknown error:") == 0); - CHECK(iret == EINVAL); + ATF_CHECK(strcmp(buf, "Unknown error:") == 0); + ATF_CHECK(iret == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPERM_unknown_error_12345_one_byte_short); +ATF_TC_BODY(strerror_r__EPERM_unknown_error_12345_one_byte_short, tc) +{ memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(12345, buf, strlen("Unknown error: 12345")); - CHECK(strcmp(buf, "Unknown error: 1234") == 0); - CHECK(iret == EINVAL); + ATF_CHECK(strcmp(buf, "Unknown error: 1234") == 0); + ATF_CHECK(iret == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__no_error); +ATF_TC_BODY(strerror_r__no_error, tc) +{ - /* - * strerror_r() success tests. - */ memset(buf, '*', sizeof(buf)); iret = strerror_r(0, buf, sizeof(buf)); - CHECK(strcmp(buf, "No error: 0") == 0); - CHECK(iret == 0); + ATF_CHECK(strcmp(buf, "No error: 0") == 0); + ATF_CHECK(iret == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EDEADLK); +ATF_TC_BODY(strerror_r__EDEADLK, tc) +{ memset(buf, '*', sizeof(buf)); iret = strerror_r(EDEADLK, buf, sizeof(buf)); - CHECK(strcmp(buf, "Resource deadlock avoided") == 0); - CHECK(iret == 0); + ATF_CHECK(strcmp(buf, "Resource deadlock avoided") == 0); + ATF_CHECK(iret == 0); +} + +ATF_TC_WITHOUT_HEAD(strerror_r__EPROCLIM); +ATF_TC_BODY(strerror_r__EPROCLIM, tc) +{ memset(buf, '*', sizeof(buf)); iret = strerror_r(EPROCLIM, buf, sizeof(buf)); - CHECK(strcmp(buf, "Too many processes") == 0); - CHECK(iret == 0); + ATF_CHECK(strcmp(buf, "Too many processes") == 0); + ATF_CHECK(iret == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, strerror_unknown_error); + ATF_TP_ADD_TC(tp, strerror_no_error); + ATF_TP_ADD_TC(tp, strerror_EPERM_test); + ATF_TP_ADD_TC(tp, strerror_EPFNOSUPPORT_test); + ATF_TP_ADD_TC(tp, strerror_ELAST_test); + ATF_TP_ADD_TC(tp, strerror_r__unknown_error); + ATF_TP_ADD_TC(tp, strerror_r__EPERM_one_byte_short); + ATF_TP_ADD_TC(tp, strerror_r__EPERM_unknown_error_one_byte_short); + ATF_TP_ADD_TC(tp, strerror_r__EPERM_unknown_error_two_bytes_short); + ATF_TP_ADD_TC(tp, strerror_r__EPERM_unknown_error_three_bytes_short); + ATF_TP_ADD_TC(tp, strerror_r__EPERM_unknown_error_12345_one_byte_short); + ATF_TP_ADD_TC(tp, strerror_r__no_error); + ATF_TP_ADD_TC(tp, strerror_r__EDEADLK); + ATF_TP_ADD_TC(tp, strerror_r__EPROCLIM); - return exit_status; + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/string/wcscasecmp_test.c (from r290538, head/tools/regression/lib/libc/string/test-wcscasecmp.c) ============================================================================== --- head/tools/regression/lib/libc/string/test-wcscasecmp.c Sun Nov 8 07:03:17 2015 (r290538, copy source) +++ head/lib/libc/tests/string/wcscasecmp_test.c Sun Nov 8 07:53:31 2015 (r290539) @@ -34,55 +34,95 @@ __FBSDID("$FreeBSD$"); #include #include -int -main(int argc, char *argv[]) +#include + +ATF_TC_WITHOUT_HEAD(nul); +ATF_TC_BODY(nul, tc) +{ + + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcscasecmp(L"", L"") == 0); + ATF_CHECK(wcsncasecmp(L"", L"", 50) == 0); + ATF_CHECK(wcsncasecmp(L"", L"", 0) == 0); +} + +ATF_TC_WITHOUT_HEAD(wcscasecmp_equal); +ATF_TC_BODY(wcscasecmp_equal, tc) { - printf("1..6\n"); + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcscasecmp(L"abc", L"abc") == 0); + ATF_CHECK(wcscasecmp(L"ABC", L"ABC") == 0); + ATF_CHECK(wcscasecmp(L"abc", L"ABC") == 0); + ATF_CHECK(wcscasecmp(L"ABC", L"abc") == 0); +} + +ATF_TC_WITHOUT_HEAD(wcscasecmp_same_len_buffers); +ATF_TC_BODY(wcscasecmp_same_len_buffers, tc) +{ + + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcscasecmp(L"abc", L"xyz") < 0); + ATF_CHECK(wcscasecmp(L"ABC", L"xyz") < 0); + ATF_CHECK(wcscasecmp(L"abc", L"XYZ") < 0); + ATF_CHECK(wcscasecmp(L"ABC", L"XYZ") < 0); + ATF_CHECK(wcscasecmp(L"xyz", L"abc") > 0); + ATF_CHECK(wcscasecmp(L"XYZ", L"abc") > 0); + ATF_CHECK(wcscasecmp(L"xyz", L"ABC") > 0); + ATF_CHECK(wcscasecmp(L"XYZ", L"ABC") > 0); +} + +ATF_TC_WITHOUT_HEAD(wcscasecmp_mismatched_len_buffers); +ATF_TC_BODY(wcscasecmp_mismatched_len_buffers, tc) +{ - setlocale(LC_CTYPE, "C"); + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcscasecmp(L"abc", L"ABCD") < 0); + ATF_CHECK(wcscasecmp(L"ABC", L"abcd") < 0); + ATF_CHECK(wcscasecmp(L"abcd", L"ABC") > 0); + ATF_CHECK(wcscasecmp(L"ABCD", L"abc") > 0); +} + +ATF_TC_WITHOUT_HEAD(wcsncasecmp); +ATF_TC_BODY(wcsncasecmp, tc) +{ + + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcsncasecmp(L"abc", L"ABCD", 4) < 0); + ATF_CHECK(wcsncasecmp(L"ABC", L"abcd", 4) < 0); + ATF_CHECK(wcsncasecmp(L"abcd", L"ABC", 4) > 0); + ATF_CHECK(wcsncasecmp(L"ABCD", L"abc", 4) > 0); + ATF_CHECK(wcsncasecmp(L"abc", L"ABCD", 3) == 0); + ATF_CHECK(wcsncasecmp(L"ABC", L"abcd", 3) == 0); +} + +ATF_TC_WITHOUT_HEAD(wcscasecmp_greek); +ATF_TC_BODY(wcscasecmp_greek, tc) +{ + + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + + ATF_CHECK(wcscasecmp(L"λ", L"Λ") != 0); + ATF_REQUIRE(setlocale(LC_CTYPE, "el_GR.UTF-8") != NULL); + ATF_CHECK(wcscasecmp(L"λ", L"Λ") == 0); + ATF_CHECK(wcscasecmp(L"λ", L"Ω") < 0); + ATF_CHECK(wcscasecmp(L"Ω", L"λ") > 0); +} + +ATF_TP_ADD_TCS(tp) +{ - assert(wcscasecmp(L"", L"") == 0); - assert(wcsncasecmp(L"", L"", 50) == 0); - assert(wcsncasecmp(L"", L"", 0) == 0); - printf("ok 1 - wcscasecmp\n"); - - assert(wcscasecmp(L"abc", L"abc") == 0); - assert(wcscasecmp(L"ABC", L"ABC") == 0); - assert(wcscasecmp(L"abc", L"ABC") == 0); - assert(wcscasecmp(L"ABC", L"abc") == 0); - printf("ok 2 - wcscasecmp\n"); - - assert(wcscasecmp(L"abc", L"xyz") < 0); - assert(wcscasecmp(L"ABC", L"xyz") < 0); - assert(wcscasecmp(L"abc", L"XYZ") < 0); - assert(wcscasecmp(L"ABC", L"XYZ") < 0); - assert(wcscasecmp(L"xyz", L"abc") > 0); - assert(wcscasecmp(L"XYZ", L"abc") > 0); - assert(wcscasecmp(L"xyz", L"ABC") > 0); - assert(wcscasecmp(L"XYZ", L"ABC") > 0); - printf("ok 3 - wcscasecmp\n"); - - assert(wcscasecmp(L"abc", L"ABCD") < 0); - assert(wcscasecmp(L"ABC", L"abcd") < 0); - assert(wcscasecmp(L"abcd", L"ABC") > 0); - assert(wcscasecmp(L"ABCD", L"abc") > 0); - printf("ok 4 - wcscasecmp\n"); - - assert(wcsncasecmp(L"abc", L"ABCD", 4) < 0); - assert(wcsncasecmp(L"ABC", L"abcd", 4) < 0); - assert(wcsncasecmp(L"abcd", L"ABC", 4) > 0); - assert(wcsncasecmp(L"ABCD", L"abc", 4) > 0); - assert(wcsncasecmp(L"abc", L"ABCD", 3) == 0); - assert(wcsncasecmp(L"ABC", L"abcd", 3) == 0); - printf("ok 5 - wcsncasecmp\n"); - - assert(wcscasecmp(L"λ", L"Λ") != 0); - setlocale(LC_CTYPE, "el_GR.UTF-8"); - assert(wcscasecmp(L"λ", L"Λ") == 0); - assert(wcscasecmp(L"λ", L"Ω") < 0); - assert(wcscasecmp(L"Ω", L"λ") > 0); - printf("ok 6 - greek\n"); + ATF_TP_ADD_TC(tp, nul); + ATF_TP_ADD_TC(tp, wcscasecmp_equal); + ATF_TP_ADD_TC(tp, wcscasecmp_same_len_buffers); + ATF_TP_ADD_TC(tp, wcscasecmp_mismatched_len_buffers); + ATF_TP_ADD_TC(tp, wcsncasecmp); + ATF_TP_ADD_TC(tp, wcscasecmp_greek); - exit(0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/string/wcsnlen_test.c (from r290538, head/tools/regression/lib/libc/string/test-wcsnlen.c) ============================================================================== --- head/tools/regression/lib/libc/string/test-wcsnlen.c Sun Nov 8 07:03:17 2015 (r290538, copy source) +++ head/lib/libc/tests/string/wcsnlen_test.c Sun Nov 8 07:53:31 2015 (r290539) @@ -27,14 +27,16 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include #include #include #include +#include + static void * makebuf(size_t len, int guard_at_end) { @@ -42,12 +44,12 @@ makebuf(size_t len, int guard_at_end) size_t alloc_size = roundup2(len, PAGE_SIZE) + PAGE_SIZE; buf = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); - assert(buf); + ATF_CHECK(buf); if (guard_at_end) { - assert(munmap(buf + alloc_size - PAGE_SIZE, PAGE_SIZE) == 0); + ATF_CHECK(munmap(buf + alloc_size - PAGE_SIZE, PAGE_SIZE) == 0); return (buf + alloc_size - PAGE_SIZE - len); } else { - assert(munmap(buf, PAGE_SIZE) == 0); + ATF_CHECK(munmap(buf, PAGE_SIZE) == 0); return (buf + PAGE_SIZE); } } @@ -61,27 +63,42 @@ test_wcsnlen(const wchar_t *s) size = wcslen(s) + 1; for (i = 0; i <= 1; i++) { - for (bufsize = 0; bufsize <= size + 10; bufsize++) { - s1 = makebuf(bufsize * sizeof(wchar_t), i); - wmemcpy(s1, s, bufsize); - len = (size > bufsize) ? bufsize : size - 1; - assert(wcsnlen(s1, bufsize) == len); - } + for (bufsize = 0; bufsize <= size + 10; bufsize++) { + s1 = makebuf(bufsize * sizeof(wchar_t), i); + wmemcpy(s1, s, bufsize); + len = (size > bufsize) ? bufsize : size - 1; + ATF_CHECK(wcsnlen(s1, bufsize) == len); + } } } -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(nul); +ATF_TC_BODY(nul, tc) { - printf("1..3\n"); - test_wcsnlen(L""); - printf("ok 1 - wcsnlen\n"); +} + +ATF_TC_WITHOUT_HEAD(foo); +ATF_TC_BODY(foo, tc) +{ + test_wcsnlen(L"foo"); - printf("ok 2 - wcsnlen\n"); +} + +ATF_TC_WITHOUT_HEAD(glorp); +ATF_TC_BODY(glorp, tc) +{ + test_wcsnlen(L"glorp"); - printf("ok 3 - wcsnlen\n"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, nul); + ATF_TP_ADD_TC(tp, foo); + ATF_TP_ADD_TC(tp, glorp); - exit(0); + return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Nov 8 08:27:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E62A29954; Sun, 8 Nov 2015 08:27:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F76E1885; Sun, 8 Nov 2015 08:27:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA88RpEu081965; Sun, 8 Nov 2015 08:27:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA88RpCp081964; Sun, 8 Nov 2015 08:27:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080827.tA88RpCp081964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 08:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290540 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 08:27:52 -0000 Author: ngie Date: Sun Nov 8 08:27:51 2015 New Revision: 290540 URL: https://svnweb.freebsd.org/changeset/base/290540 Log: printfloat_test and scanfloat_test need symbols from msun; these are automatically provided on amd64, but not i386. Add libm to DPADD/LDADD to unbreak the i386 tinderbox Pointyhat to: ngie MFC after: 1 week X-MFC with: r290538 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/Makefile Modified: head/lib/libc/tests/stdio/Makefile ============================================================================== --- head/lib/libc/tests/stdio/Makefile Sun Nov 8 07:53:31 2015 (r290539) +++ head/lib/libc/tests/stdio/Makefile Sun Nov 8 08:27:51 2015 (r290540) @@ -26,6 +26,12 @@ NETBSD_ATF_TESTS_C+= popen_test NETBSD_ATF_TESTS_C+= printf_test NETBSD_ATF_TESTS_C+= scanf_test +DPADD.printfloat_test+= ${LIBM} +LDADD.printfloat_test+= -lm + +DPADD.scanfloat_test+= ${LIBM} +LDADD.scanfloat_test+= -lm + .include "../Makefile.netbsd-tests" .include From owner-svn-src-all@freebsd.org Sun Nov 8 08:31:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5144DA29A5C; Sun, 8 Nov 2015 08:31:36 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8701C0F; Sun, 8 Nov 2015 08:31:35 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA88VZUx084197; Sun, 8 Nov 2015 08:31:35 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA88VYZF084194; Sun, 8 Nov 2015 08:31:34 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201511080831.tA88VYZF084194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 8 Nov 2015 08:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290541 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 08:31:36 -0000 Author: skra Date: Sun Nov 8 08:31:34 2015 New Revision: 290541 URL: https://svnweb.freebsd.org/changeset/base/290541 Log: Make usermode variable the bool type. It's already used that way. Suggested by: kib Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/trap-v6.c head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Sun Nov 8 08:27:51 2015 (r290540) +++ head/sys/arm/arm/pmap-v6-new.c Sun Nov 8 08:31:34 2015 (r290541) @@ -6133,7 +6133,7 @@ CTASSERT(powerof2(PT2MAP_SIZE)); * Handle access and R/W emulation faults. */ int -pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, int usermode) +pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode) { pt1_entry_t *pte1p, pte1; pt2_entry_t *pte2p, pte2; Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Sun Nov 8 08:27:51 2015 (r290540) +++ head/sys/arm/arm/trap-v6.c Sun Nov 8 08:31:34 2015 (r290541) @@ -211,7 +211,7 @@ call_trapsignal(struct thread *td, int s * FAULT_IS_NOT_MINE value, then the abort is fatal. */ static __inline void -abort_imprecise(struct trapframe *tf, u_int fsr, u_int prefetch, u_int usermode) +abort_imprecise(struct trapframe *tf, u_int fsr, u_int prefetch, bool usermode) { /* @@ -243,7 +243,7 @@ out: * */ static __inline void -abort_debug(struct trapframe *tf, u_int fsr, u_int prefetch, u_int usermode, +abort_debug(struct trapframe *tf, u_int fsr, u_int prefetch, bool usermode, u_int far) { @@ -277,7 +277,7 @@ abort_handler(struct trapframe *tf, int { struct thread *td; vm_offset_t far, va; - int idx, usermode; + int idx, rv; uint32_t fsr; struct ksig ksig; struct proc *p; @@ -285,7 +285,7 @@ abort_handler(struct trapframe *tf, int struct vm_map *map; struct vmspace *vm; vm_prot_t ftype; - int rv; + bool usermode; #ifdef INVARIANTS void *onfault; #endif @@ -556,7 +556,7 @@ static int abort_fatal(struct trapframe *tf, u_int idx, u_int fsr, u_int far, u_int prefetch, struct thread *td, struct ksig *ksig) { - u_int usermode; + bool usermode; const char *mode; const char *rw_mode; @@ -617,7 +617,7 @@ static int abort_align(struct trapframe *tf, u_int idx, u_int fsr, u_int far, u_int prefetch, struct thread *td, struct ksig *ksig) { - u_int usermode; + bool usermode; usermode = TRAPF_USERMODE(tf); if (!usermode) { Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Sun Nov 8 08:27:51 2015 (r290540) +++ head/sys/arm/include/pmap-v6.h Sun Nov 8 08:31:34 2015 (r290541) @@ -201,7 +201,7 @@ void pmap_tlb_flush_ng(pmap_t ); void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t ); vm_paddr_t pmap_kextract(vm_offset_t ); -int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , int ); +int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) void pmap_set_tex(void); From owner-svn-src-all@freebsd.org Sun Nov 8 09:37:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C865A26E8F; Sun, 8 Nov 2015 09:37:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A078161E; Sun, 8 Nov 2015 09:37:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA89bR4K002563; Sun, 8 Nov 2015 09:37:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA89bRlZ002561; Sun, 8 Nov 2015 09:37:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511080937.tA89bRlZ002561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 8 Nov 2015 09:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290542 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 09:37:28 -0000 Author: hselasky Date: Sun Nov 8 09:37:26 2015 New Revision: 290542 URL: https://svnweb.freebsd.org/changeset/base/290542 Log: Avoid using the bounce buffer when the source or destination buffer is 32-bits aligned. Merge the two bounce buffers into a single one. Some rough tests showed that the DWC OTG throughput on RPI2 increased by 10% after this patch. MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sun Nov 8 08:31:34 2015 (r290541) +++ head/sys/dev/usb/controller/dwc_otg.c Sun Nov 8 09:37:26 2015 (r290542) @@ -181,6 +181,110 @@ dwc_otg_get_hw_ep_profile(struct usb_dev } static void +dwc_otg_write_fifo(struct dwc_otg_softc *sc, struct usb_page_cache *pc, + uint32_t offset, uint32_t fifo, uint32_t count) +{ + uint32_t temp; + + /* round down length to nearest 4-bytes */ + temp = count & ~3; + + /* check if we can write the data directly */ + if (temp != 0 && usb_pc_buffer_is_aligned(pc, offset, temp, 3)) { + struct usb_page_search buf_res; + + /* pre-subtract length */ + count -= temp; + + /* iterate buffer list */ + do { + /* get current buffer pointer */ + usbd_get_page(pc, offset, &buf_res); + + if (buf_res.length > temp) + buf_res.length = temp; + + /* transfer data into FIFO */ + bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, + fifo, buf_res.buffer, buf_res.length / 4); + + offset += buf_res.length; + fifo += buf_res.length; + temp -= buf_res.length; + } while (temp != 0); + } + + /* check for remainder */ + if (count != 0) { + /* clear topmost word before copy */ + sc->sc_bounce_buffer[(count - 1) / 4] = 0; + + /* copy out data */ + usbd_copy_out(pc, offset, + sc->sc_bounce_buffer, count); + + /* transfer data into FIFO */ + bus_space_write_region_4(sc->sc_io_tag, + sc->sc_io_hdl, fifo, sc->sc_bounce_buffer, + (count + 3) / 4); + } +} + +static void +dwc_otg_read_fifo(struct dwc_otg_softc *sc, struct usb_page_cache *pc, + uint32_t offset, uint32_t count) +{ + uint32_t temp; + + /* round down length to nearest 4-bytes */ + temp = count & ~3; + + /* check if we can read the data directly */ + if (temp != 0 && usb_pc_buffer_is_aligned(pc, offset, temp, 3)) { + struct usb_page_search buf_res; + + /* pre-subtract length */ + count -= temp; + + /* iterate buffer list */ + do { + /* get current buffer pointer */ + usbd_get_page(pc, offset, &buf_res); + + if (buf_res.length > temp) + buf_res.length = temp; + + /* transfer data from FIFO */ + bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, + sc->sc_current_rx_fifo, buf_res.buffer, buf_res.length / 4); + + offset += buf_res.length; + sc->sc_current_rx_fifo += buf_res.length; + sc->sc_current_rx_bytes -= buf_res.length; + temp -= buf_res.length; + } while (temp != 0); + } + + /* check for remainder */ + if (count != 0) { + /* read data into bounce buffer */ + bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, + sc->sc_current_rx_fifo, + sc->sc_bounce_buffer, (count + 3) / 4); + + /* store data into proper buffer */ + usbd_copy_in(pc, offset, sc->sc_bounce_buffer, count); + + /* round length up to nearest 4 bytes */ + count = (count + 3) & ~3; + + /* update counters */ + sc->sc_current_rx_bytes -= count; + sc->sc_current_rx_fifo += count; + } +} + +static void dwc_otg_tx_fifo_reset(struct dwc_otg_softc *sc, uint32_t value) { uint32_t temp; @@ -579,6 +683,14 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + if (sc->sc_current_rx_bytes != 0) { + /* need to dump remaining data */ + bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, + sc->sc_current_rx_fifo, sc->sc_bounce_buffer, + sc->sc_current_rx_bytes / 4); + /* clear number of active bytes to receive */ + sc->sc_current_rx_bytes = 0; + } /* clear cached status */ sc->sc_last_rx_status = 0; } @@ -761,6 +873,7 @@ dwc_otg_host_dump_rx(struct dwc_otg_soft td->channel[x] != GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status)) continue; dwc_otg_common_rx_ack(sc); + break; } } @@ -898,6 +1011,7 @@ send_pkt: td->state = DWC_CHAN_ST_WAIT_ANE; } + /* copy out control request */ usbd_copy_out(td->pc, 0, &req, sizeof(req)); DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), @@ -1024,11 +1138,11 @@ dwc_otg_setup_rx(struct dwc_otg_softc *s goto not_complete; } - /* copy in control request */ - memcpy(&req, sc->sc_rx_bounce_buffer, sizeof(req)); + /* read FIFO */ + dwc_otg_read_fifo(sc, td->pc, 0, sizeof(req)); - /* copy data into real buffer */ - usbd_copy_in(td->pc, 0, &req, sizeof(req)); + /* copy out control request */ + usbd_copy_out(td->pc, 0, &req, sizeof(req)); td->offset = sizeof(req); td->remainder = 0; @@ -1212,8 +1326,8 @@ dwc_otg_host_data_rx_sub(struct dwc_otg_ goto complete; } - usbd_copy_in(td->pc, td->offset, - sc->sc_rx_bounce_buffer, count); + /* read data from FIFO */ + dwc_otg_read_fifo(sc, td->pc, td->offset, count); td->remainder -= count; td->offset += count; @@ -1583,7 +1697,9 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc return (0); /* we are complete */ } - usbd_copy_in(td->pc, td->offset, sc->sc_rx_bounce_buffer, count); + /* read data from FIFO */ + dwc_otg_read_fifo(sc, td->pc, td->offset, count); + td->remainder -= count; td->offset += count; @@ -1904,17 +2020,9 @@ send_pkt: DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); if (count != 0) { - /* clear topmost word before copy */ - sc->sc_tx_bounce_buffer[(count - 1) / 4] = 0; - - /* copy out data */ - usbd_copy_out(td->pc, td->offset + td->tx_bytes, - sc->sc_tx_bounce_buffer, count); - - /* transfer data into FIFO */ - bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(channel), - sc->sc_tx_bounce_buffer, (count + 3) / 4); + /* write data into FIFO */ + dwc_otg_write_fifo(sc, td->pc, td->offset + + td->tx_bytes, DOTG_DFIFO(channel), count); } /* store number of bytes transmitted */ @@ -2054,18 +2162,9 @@ repeat: count = fifo_left; if (count != 0) { - - /* clear topmost word before copy */ - sc->sc_tx_bounce_buffer[(count - 1) / 4] = 0; - - /* copy out data */ - usbd_copy_out(td->pc, td->offset, - sc->sc_tx_bounce_buffer, count); - - /* transfer data into FIFO */ - bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(td->ep_no), - sc->sc_tx_bounce_buffer, (count + 3) / 4); + /* write data into FIFO */ + dwc_otg_write_fifo(sc, td->pc, td->offset, + DOTG_DFIFO(td->ep_no), count); td->tx_bytes -= count; td->remainder -= count; @@ -2616,6 +2715,11 @@ repeat: sc->sc_chan_state[ep_no].wait_halted = 0; DPRINTFN(5, "channel halt complete ch=%u\n", ep_no); } + /* store bytes and FIFO offset */ + sc->sc_current_rx_bytes = 0; + sc->sc_current_rx_fifo = 0; + + /* acknowledge status */ dwc_otg_common_rx_ack(sc); goto repeat; } @@ -2625,13 +2729,11 @@ repeat: ep_no = GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); - /* receive data, if any */ - if (temp != 0) { - DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); - bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(ep_no), - sc->sc_rx_bounce_buffer, (temp + 3) / 4); - } + /* store bytes and FIFO offset */ + sc->sc_current_rx_bytes = (temp + 3) & ~3; + sc->sc_current_rx_fifo = DOTG_DFIFO(ep_no); + + DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); /* check if we should dump the data */ if (!(sc->sc_active_rx_ep & (1U << ep_no))) { Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Sun Nov 8 08:31:34 2015 (r290541) +++ head/sys/dev/usb/controller/dwc_otg.h Sun Nov 8 09:37:26 2015 (r290542) @@ -173,8 +173,7 @@ struct dwc_otg_softc { bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; - uint32_t sc_rx_bounce_buffer[1024 / 4]; - uint32_t sc_tx_bounce_buffer[MAX(512 * DWC_OTG_MAX_TXP, 1024) / 4]; + uint32_t sc_bounce_buffer[MAX(512 * DWC_OTG_MAX_TXP, 1024) / 4]; uint32_t sc_fifo_size; uint32_t sc_irq_mask; @@ -186,6 +185,9 @@ struct dwc_otg_softc { uint32_t sc_hprt_val; uint32_t sc_xfer_complete; + uint16_t sc_current_rx_bytes; + uint16_t sc_current_rx_fifo; + uint16_t sc_active_rx_ep; uint16_t sc_last_frame_num; From owner-svn-src-all@freebsd.org Sun Nov 8 09:45:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C592A220C3; Sun, 8 Nov 2015 09:45:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4067E1B4F; Sun, 8 Nov 2015 09:45:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 649391FE023; Sun, 8 Nov 2015 10:45:37 +0100 (CET) Subject: Re: svn commit: r290475 - in head: share/man/man9 sys/kern sys/sys To: cem@FreeBSD.org References: <201511070143.tA71h13k038232@repo.freebsd.org> <563DDE73.6030307@selasky.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <563F1A27.6030002@selasky.org> Date: Sun, 8 Nov 2015 10:47:19 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 09:45:39 -0000 On 11/07/15 19:26, Conrad Meyer wrote: > Can do — fixed in r290505. > > Thanks, > Conrad Thank you. Looks good! --HPS From owner-svn-src-all@freebsd.org Sun Nov 8 11:50:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF05A29396; Sun, 8 Nov 2015 11:50:13 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E6D2D1DFF; Sun, 8 Nov 2015 11:50:11 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from vsuiko.mahoroba.org (vsuiko.mahoroba.org [IPv6:2001:2f0:104:8010:a00:27ff:feb0:c2e]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.15.2/8.15.2) with ESMTPSA/inet6 id tA8Bo0jm019319 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Sun, 8 Nov 2015 20:50:04 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 08 Nov 2015 20:49:42 +0900 Message-ID: From: Hajimu UMEMOTO To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290522 - head/share/timedef In-Reply-To: <20151108000818.GE31396@ivaldir.etoilebsd.net> References: <201511072354.tA7NsEPs032069@repo.freebsd.org> <20151108000818.GE31396@ivaldir.etoilebsd.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.5 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 10.2-STABLE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Sun_Nov__8_20:49:42_2015-1" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sun, 08 Nov 2015 20:50:04 +0900 (JST) X-Virus-Scanned: clamav-milter 0.98.7 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on asuka.mahoroba.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 11:50:13 -0000 --Multipart_Sun_Nov__8_20:49:42_2015-1 Content-Type: text/plain; charset=US-ASCII Hi, >>>>> On Sun, 8 Nov 2015 01:08:18 +0100 >>>>> Baptiste Daroussin said: bapt> They are auto generated, I will try to have a look to fix the generation tool so bapt> we won't get hit by it next time. Oops, I dodn't notice that. It seems that Linux does similar way. I think it should be fixed by the origin data rather than by the generation tool. I don't test it, but perhaps the attached change should fix it: bapt> Thanks for the fix! You are welcome. Sincerely, --Multipart_Sun_Nov__8_20:49:42_2015-1 Content-Type: text/x-patch; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="ja_JP.UTF-8.src-space.diff" Content-Transfer-Encoding: 7bit Index: ja_JP.UTF-8.src diff -u ja_JP.UTF-8.src.orig ja_JP.UTF-8.src --- ja_JP.UTF-8.src.orig 2015-11-08 20:26:46.948186000 +0900 +++ ja_JP.UTF-8.src 2015-11-08 20:29:37.892220775 +0900 @@ -68015,15 +68015,15 @@ "";/ "" -abmon "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ - "";/ +abmon "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ "";/ "";/ "" --Multipart_Sun_Nov__8_20:49:42_2015-1 Content-Type: text/plain; charset=US-ASCII -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ --Multipart_Sun_Nov__8_20:49:42_2015-1-- From owner-svn-src-all@freebsd.org Sun Nov 8 12:24:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9B6A2746C; Sun, 8 Nov 2015 12:24:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34D2F15FE; Sun, 8 Nov 2015 12:24:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8COKTB051844; Sun, 8 Nov 2015 12:24:20 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8COK66051842; Sun, 8 Nov 2015 12:24:20 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511081224.tA8COK66051842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2015 12:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290543 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 12:24:21 -0000 Author: melifaro Date: Sun Nov 8 12:24:19 2015 New Revision: 290543 URL: https://svnweb.freebsd.org/changeset/base/290543 Log: Fix setfib target. Problem was introduced in r272840 when converting tablearg value to 0. Submitted by: Denis Schneider Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sun Nov 8 09:37:26 2015 (r290542) +++ head/sys/netpfil/ipfw/ip_fw2.c Sun Nov 8 12:24:19 2015 (r290543) @@ -2476,7 +2476,7 @@ do { \ uint32_t fib; IPFW_INC_RULE_COUNTER(f, pktlen); - fib = TARG(cmd->arg1, fib) & 0x7FFFF; + fib = TARG(cmd->arg1, fib) & 0x7FFF; if (fib >= rt_numfibs) fib = 0; M_SETFIB(m, fib); Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Nov 8 09:37:26 2015 (r290542) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Nov 8 12:24:19 2015 (r290543) @@ -1497,9 +1497,9 @@ check_ipfw_rule_body(ipfw_insn *cmd, int if (cmdlen != F_INSN_SIZE(ipfw_insn)) goto bad_size; if ((cmd->arg1 != IP_FW_TARG) && - ((cmd->arg1 & 0x7FFFF) >= rt_numfibs)) { + ((cmd->arg1 & 0x7FFF) >= rt_numfibs)) { printf("ipfw: invalid fib number %d\n", - cmd->arg1 & 0x7FFFF); + cmd->arg1 & 0x7FFF); return EINVAL; } goto check_action; From owner-svn-src-all@freebsd.org Sun Nov 8 13:37:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D79A296E4; Sun, 8 Nov 2015 13:37:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127FE108B; Sun, 8 Nov 2015 13:37:17 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8DbHcT072204; Sun, 8 Nov 2015 13:37:17 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8DbGEL072196; Sun, 8 Nov 2015 13:37:16 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511081337.tA8DbGEL072196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 8 Nov 2015 13:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290544 - in stable/10: include lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 13:37:18 -0000 Author: ache Date: Sun Nov 8 13:37:16 2015 New Revision: 290544 URL: https://svnweb.freebsd.org/changeset/base/290544 Log: MFC: r289863,r289931,r290110,r290230,r290231,r290232 r290232: Microoptimize. r290231: Addition to prev. commit. In some edge cases fp->_p can be changed in _sseek(), recalculate. r290230: Don't seek to the end if write buffer is empty (in append modes). PR: 204156 r290110: Add _flags2 per jhb@ suggestion since no room left in _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. r289931: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). r289863: Since no room left in the _flags, reuse __SALC for O_APPEND. It helps to remove _fcntl() call from _ftello() and optimize seek position calculation in _swrite(). Modified: stable/10/include/stdio.h stable/10/lib/libc/stdio/fdopen.c stable/10/lib/libc/stdio/findfp.c stable/10/lib/libc/stdio/fmemopen.c stable/10/lib/libc/stdio/fopen.c stable/10/lib/libc/stdio/freopen.c stable/10/lib/libc/stdio/ftell.c stable/10/lib/libc/stdio/stdio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/stdio.h ============================================================================== --- stable/10/include/stdio.h Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/include/stdio.h Sun Nov 8 13:37:16 2015 (r290544) @@ -144,6 +144,7 @@ struct __sFILE { int _fl_count; /* recursive lock count */ int _orientation; /* orientation for fwide() */ __mbstate_t _mbstate; /* multibyte conversion state */ + int _flags2; /* additional flags */ }; #ifndef _STDFILE_DECLARED #define _STDFILE_DECLARED @@ -176,6 +177,8 @@ __END_DECLS #define __SALC 0x4000 /* allocate string space dynamically */ #define __SIGN 0x8000 /* ignore this file in _fwalk */ +#define __S2OAP 0x0001 /* O_APPEND mode is set */ + /* * The following three definitions are for ANSI C, which took them * from System V, which brilliantly took internal interface macros and Modified: stable/10/lib/libc/stdio/fdopen.c ============================================================================== --- stable/10/lib/libc/stdio/fdopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fdopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -90,7 +90,9 @@ fdopen(int fd, const char *mode) * O_APPEND bit set, assert __SAPP so that __swrite() caller * will _sseek() to the end before write. */ - if ((oflags & O_APPEND) && !(fdflags & O_APPEND)) + if (fdflags & O_APPEND) + fp->_flags2 |= __S2OAP; + else if (oflags & O_APPEND) fp->_flags |= __SAPP; fp->_file = fd; fp->_cookie = fp; Modified: stable/10/lib/libc/stdio/findfp.c ============================================================================== --- stable/10/lib/libc/stdio/findfp.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/findfp.c Sun Nov 8 13:37:16 2015 (r290544) @@ -155,6 +155,7 @@ found: /* fp->_fl_mutex = NULL; */ /* once set always set (reused) */ fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + fp->_flags2 = 0; return (fp); } Modified: stable/10/lib/libc/stdio/fmemopen.c ============================================================================== --- stable/10/lib/libc/stdio/fmemopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fmemopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -149,6 +149,9 @@ fmemopen(void * __restrict buf, size_t s return (NULL); } + if (mode[0] == 'a') + f->_flags |= __SAPP; + /* * Turn off buffering, so a write past the end of the buffer * correctly returns a short object count. Modified: stable/10/lib/libc/stdio/fopen.c ============================================================================== --- stable/10/lib/libc/stdio/fopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -91,7 +91,9 @@ fopen(const char * __restrict file, cons * we can do about this. (We could set __SAPP and check in * fseek and ftell.) */ - if (oflags & O_APPEND) + if (oflags & O_APPEND) { + fp->_flags2 |= __S2OAP; (void)_sseek(fp, (fpos_t)0, SEEK_END); + } return (fp); } Modified: stable/10/lib/libc/stdio/freopen.c ============================================================================== --- stable/10/lib/libc/stdio/freopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/freopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -186,6 +186,7 @@ finish: fp->_lb._size = 0; fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + fp->_flags2 = 0; if (f < 0) { /* did not get it after all */ if (isopen) @@ -239,8 +240,10 @@ finish: * we can do about this. (We could set __SAPP and check in * fseek and ftell.) */ - if (oflags & O_APPEND) + if (oflags & O_APPEND) { + fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); + } FUNLOCKFILE(fp); return (fp); } Modified: stable/10/lib/libc/stdio/ftell.c ============================================================================== --- stable/10/lib/libc/stdio/ftell.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/ftell.c Sun Nov 8 13:37:16 2015 (r290544) @@ -88,7 +88,6 @@ _ftello(FILE *fp, fpos_t *offset) { fpos_t pos; size_t n; - int dflags; if (fp->_seek == NULL) { errno = ESPIPE; /* historic practice */ @@ -119,29 +118,33 @@ _ftello(FILE *fp, fpos_t *offset) } if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ - } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - dflags = 0; - if (fp->_flags & __SAPP) - dflags = O_APPEND; - else if (fp->_file != -1 && - (dflags = _fcntl(fp->_file, F_GETFL)) < 0) - return (1); - if ((dflags & O_APPEND) && - (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { - if ((fp->_flags & __SOPT) || __sflush(fp) || - (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) - return (1); - else { - *offset = pos; - return (0); - } - } + } else if ((fp->_flags & __SWR) && fp->_p != NULL && + (n = fp->_p - fp->_bf._base) > 0) { /* * Writing. Any buffered characters cause the * position to be greater than that in the * underlying object. */ - n = fp->_p - fp->_bf._base; + if ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP)) { + int serrno = errno; + + errno = 0; + if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { + if (errno == ESPIPE || + (fp->_flags & __SOPT) || __sflush(fp) || + (pos = + _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) + return (1); + else { + errno = serrno; + *offset = pos; + return (0); + } + } + errno = serrno; + /* fp->_p can be changed in _sseek(), recalculate. */ + n = fp->_p - fp->_bf._base; + } if (pos > OFF_MAX - n) { errno = EOVERFLOW; return (1); Modified: stable/10/lib/libc/stdio/stdio.c ============================================================================== --- stable/10/lib/libc/stdio/stdio.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/stdio.c Sun Nov 8 13:37:16 2015 (r290544) @@ -117,7 +117,7 @@ _swrite(FILE *fp, char const *buf, int n ret = (*fp->_write)(fp->_cookie, buf, n); /* __SOFF removed even on success in case O_APPEND mode is set. */ if (ret >= 0) { - if ((fp->_flags & (__SAPP|__SOFF)) == (__SAPP|__SOFF) && + if ((fp->_flags & __SOFF) && !(fp->_flags2 & __S2OAP) && fp->_offset <= OFF_MAX - ret) fp->_offset += ret; else From owner-svn-src-all@freebsd.org Sun Nov 8 13:44:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25B15A29923; Sun, 8 Nov 2015 13:44:23 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E38D014A2; Sun, 8 Nov 2015 13:44:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8DiLtl074913; Sun, 8 Nov 2015 13:44:21 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8DiL42074911; Sun, 8 Nov 2015 13:44:21 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511081344.tA8DiL42074911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2015 13:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290545 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 13:44:23 -0000 Author: melifaro Date: Sun Nov 8 13:44:21 2015 New Revision: 290545 URL: https://svnweb.freebsd.org/changeset/base/290545 Log: Print proper setfib values in ipfw log. Submitted by: Denis Schneider Modified: head/sys/netpfil/ipfw/ip_fw_log.c Modified: head/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_log.c Sun Nov 8 13:37:16 2015 (r290544) +++ head/sys/netpfil/ipfw/ip_fw_log.c Sun Nov 8 13:44:21 2015 (r290545) @@ -352,7 +352,7 @@ ipfw_log(struct ip_fw_chain *chain, stru break; case O_SETFIB: snprintf(SNPARGS(action2, 0), "SetFib %d", - TARG(cmd->arg1, fib)); + TARG(cmd->arg1, fib) & 0x7FFF); break; case O_SKIPTO: snprintf(SNPARGS(action2, 0), "SkipTo %d", From owner-svn-src-all@freebsd.org Sun Nov 8 14:22:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A92A29286; Sun, 8 Nov 2015 14:22:59 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB7F2151A; Sun, 8 Nov 2015 14:22:58 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8EMvdD086376; Sun, 8 Nov 2015 14:22:57 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8EMvpj086375; Sun, 8 Nov 2015 14:22:57 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511081422.tA8EMvpj086375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 8 Nov 2015 14:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290546 - stable/10/usr.bin/bsdiff/bsdiff X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 14:22:59 -0000 Author: ache Date: Sun Nov 8 14:22:57 2015 New Revision: 290546 URL: https://svnweb.freebsd.org/changeset/base/290546 Log: MFC: r290329,r290336 PR: 204230 r290329: Use meaningful errno for ssize_t overflow in read(). Catch size_t overflow in malloc(). r290336: Check for (old|new)size + 1 overflows off_t. Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Sun Nov 8 13:44:21 2015 (r290545) +++ stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Sun Nov 8 14:22:57 2015 (r290546) @@ -31,7 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include #include @@ -221,8 +224,17 @@ int main(int argc,char *argv[]) /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) || - ((oldsize=lseek(fd,0,SEEK_END))==-1) || - ((old=malloc(oldsize+1))==NULL) || + ((oldsize=lseek(fd,0,SEEK_END))==-1)) + err(1, "%s", argv[1]); + + if (oldsize > SSIZE_MAX || + (uintmax_t)oldsize >= SIZE_T_MAX / sizeof(off_t) || + oldsize == OFF_MAX) { + errno = EFBIG; + err(1, "%s", argv[1]); + } + + if (((old=malloc(oldsize+1))==NULL) || (lseek(fd,0,SEEK_SET)!=0) || (read(fd,old,oldsize)!=oldsize) || (close(fd)==-1)) err(1,"%s",argv[1]); @@ -237,8 +249,16 @@ int main(int argc,char *argv[]) /* Allocate newsize+1 bytes instead of newsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) || - ((newsize=lseek(fd,0,SEEK_END))==-1) || - ((new=malloc(newsize+1))==NULL) || + ((newsize=lseek(fd,0,SEEK_END))==-1)) + err(1, "%s", argv[2]); + + if (newsize > SSIZE_MAX || (uintmax_t)newsize >= SIZE_T_MAX || + newsize == OFF_MAX) { + errno = EFBIG; + err(1, "%s", argv[2]); + } + + if (((new=malloc(newsize+1))==NULL) || (lseek(fd,0,SEEK_SET)!=0) || (read(fd,new,newsize)!=newsize) || (close(fd)==-1)) err(1,"%s",argv[2]); From owner-svn-src-all@freebsd.org Sun Nov 8 14:26:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAC08A29359; Sun, 8 Nov 2015 14:26:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 787B01825; Sun, 8 Nov 2015 14:26:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8EQpci086559; Sun, 8 Nov 2015 14:26:51 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8EQopT086552; Sun, 8 Nov 2015 14:26:50 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201511081426.tA8EQopT086552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 8 Nov 2015 14:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290547 - in head/sys: arm/annapurna/alpine arm/mv/armadaxp arm/qemu arm/ti/omap4 arm/xilinx kern 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 14:26:52 -0000 Author: tijl Date: Sun Nov 8 14:26:50 2015 New Revision: 290547 URL: https://svnweb.freebsd.org/changeset/base/290547 Log: Since r289279 bufinit() uses mp_ncpus, but some architectures set this variable during mp_start() which is too late. Move this to mp_setmaxid() where other architectures set it and move x86 assertions to MI code. Reviewed by: kib (x86 part) Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/qemu/virt_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c head/sys/kern/subr_smp.c head/sys/x86/x86/mp_x86.c Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -128,16 +128,14 @@ platform_mp_init_secondary(void) void platform_mp_setmaxid(void) { - int core_cnt; - core_cnt = platform_mp_get_core_cnt(); - mp_maxid = core_cnt - 1; + mp_ncpus = platform_mp_get_core_cnt(); + mp_maxid = mp_ncpus - 1; } int platform_mp_probe(void) { - mp_ncpus = platform_mp_get_core_cnt(); return (1); } Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -82,15 +82,14 @@ void platform_mp_setmaxid(void) { - mp_maxid = 3; + mp_ncpus = platform_get_ncpus(); + mp_maxid = mp_ncpus - 1; } int platform_mp_probe(void) { - mp_ncpus = platform_get_ncpus(); - return (mp_ncpus > 1); } Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/qemu/virt_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -49,17 +49,8 @@ static int running_cpus; int platform_mp_probe(void) { - int ncpus; - ncpus = ofw_cpu_early_foreach(NULL, true); - if (ncpus <= 1) { - mp_ncpus = 1; - return (0); - } - - mp_ncpus = MIN(ncpus, MAXCPU); - - return (1); + return (mp_ncpus > 1); } static boolean_t @@ -77,7 +68,10 @@ platform_mp_setmaxid(void) { mp_maxid = PCPU_GET(cpuid); - ofw_cpu_early_foreach(virt_maxid, true); + mp_ncpus = ofw_cpu_early_foreach(virt_maxid, true); + if (mp_ncpus < 1) + mp_ncpus = 1; + mp_ncpus = MIN(ncpus, MAXCPU); } static boolean_t Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/ti/omap4/omap4_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -51,14 +51,14 @@ void platform_mp_setmaxid(void) { - mp_maxid = 1; + mp_maxid = 1; + mp_ncpus = 2; } int platform_mp_probe(void) { - mp_ncpus = 2; return (1); } Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/xilinx/zy7_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -57,13 +57,13 @@ platform_mp_setmaxid(void) { mp_maxid = 1; + mp_ncpus = 2; } int platform_mp_probe(void) { - mp_ncpus = 2; return (1); } Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/kern/subr_smp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -125,7 +125,15 @@ struct mtx smp_ipi_mtx; static void mp_setmaxid(void *dummy) { + cpu_mp_setmaxid(); + + KASSERT(mp_ncpus >= 1, ("%s: CPU count < 1", __func__)); + KASSERT(mp_ncpus > 1 || mp_maxid == 0, + ("%s: one CPU but mp_maxid is not zero", __func__)); + KASSERT(mp_maxid >= mp_ncpus - 1, + ("%s: counters out of sync: max %d, count %d", __func__, + mp_maxid, mp_ncpus)); } SYSINIT(cpu_mp_setmaxid, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_setmaxid, NULL); Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/x86/x86/mp_x86.c Sun Nov 8 14:26:50 2015 (r290547) @@ -425,18 +425,11 @@ cpu_mp_setmaxid(void) { /* - * mp_maxid should be already set by calls to cpu_add(). - * Just sanity check its value here. + * mp_ncpus and mp_maxid should be already set by calls to cpu_add(). + * If there were no calls to cpu_add() assume this is a UP system. */ if (mp_ncpus == 0) - KASSERT(mp_maxid == 0, - ("%s: mp_ncpus is zero, but mp_maxid is not", __func__)); - else if (mp_ncpus == 1) - mp_maxid = 0; - else - KASSERT(mp_maxid >= mp_ncpus - 1, - ("%s: counters out of sync: max %d, count %d", __func__, - mp_maxid, mp_ncpus)); + mp_ncpus = 1; } int @@ -448,28 +441,7 @@ cpu_mp_probe(void) * correctly. */ CPU_SETOF(0, &all_cpus); - if (mp_ncpus == 0) { - /* - * No CPUs were found, so this must be a UP system. Setup - * the variables to represent a system with a single CPU - * with an id of 0. - */ - mp_ncpus = 1; - return (0); - } - - /* At least one CPU was found. */ - if (mp_ncpus == 1) { - /* - * One CPU was found, so this must be a UP system with - * an I/O APIC. - */ - mp_maxid = 0; - return (0); - } - - /* At least two CPUs were found. */ - return (1); + return (mp_ncpus > 1); } /* From owner-svn-src-all@freebsd.org Sun Nov 8 17:33:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D724DA29414; Sun, 8 Nov 2015 17:33:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A156F1B33; Sun, 8 Nov 2015 17:33:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8HXmGg041368; Sun, 8 Nov 2015 17:33:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8HXm26041362; Sun, 8 Nov 2015 17:33:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511081733.tA8HXm26041362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Nov 2015 17:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290548 - in head/sbin: init reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 17:33:49 -0000 Author: trasz Date: Sun Nov 8 17:33:48 2015 New Revision: 290548 URL: https://svnweb.freebsd.org/changeset/base/290548 Log: Userspace part of reroot support. This makes it possible to change the root filesystem without full reboot, using "reboot -r". This can be used to to eg. boot from a temporary md_image preloaded by loader(8), setup an iSCSI session, and continue booting from rootfs mounted over iSCSI. Reviewed by: kib@, bapt@ MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3693 Modified: head/sbin/init/Makefile head/sbin/init/init.c head/sbin/init/pathnames.h head/sbin/reboot/reboot.8 head/sbin/reboot/reboot.c Modified: head/sbin/init/Makefile ============================================================================== --- head/sbin/init/Makefile Sun Nov 8 14:26:50 2015 (r290547) +++ head/sbin/init/Makefile Sun Nov 8 17:33:48 2015 (r290548) @@ -2,12 +2,18 @@ # $FreeBSD$ PROG= init +SRCS= init.c getmntopts.c MAN= init.8 PRECIOUSPROG= INSTALLFLAGS=-b -B.bak CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT LIBADD= util crypt +# Needed for getmntopts.c +MOUNT= ${.CURDIR}/../../sbin/mount +CFLAGS+=-I${MOUNT} +.PATH: ${MOUNT} + NO_SHARED?= YES .include Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sun Nov 8 14:26:50 2015 (r290547) +++ head/sbin/init/init.c Sun Nov 8 17:33:48 2015 (r290548) @@ -46,6 +46,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -79,6 +80,7 @@ static const char rcsid[] = #include #endif +#include "mntopts.h" #include "pathnames.h" /* @@ -103,6 +105,7 @@ static void warning(const char *, ...) _ static void emergency(const char *, ...) __printflike(1, 2); static void disaster(int); static void badsys(int); +static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); @@ -122,6 +125,8 @@ static state_func_t clean_ttys(void); static state_func_t catatonia(void); static state_func_t death(void); static state_func_t death_single(void); +static state_func_t reroot(void); +static state_func_t reroot_phase_two(void); static state_func_t run_script(const char *); @@ -193,7 +198,7 @@ main(int argc, char *argv[]) { state_t initial_transition = runcom; char kenv_value[PATH_MAX]; - int c; + int c, error; struct sigaction sa; sigset_t mask; @@ -226,6 +231,9 @@ main(int argc, char *argv[]) case 'q': /* rescan /etc/ttys */ sig = SIGHUP; break; + case 'r': /* remount root */ + sig = SIGEMT; + break; default: goto invalid; } @@ -247,7 +255,7 @@ invalid: /* * Create an initial session. */ - if (setsid() < 0) + if (setsid() < 0 && (errno != EPERM || getsid(0) != 1)) warning("initial setsid() failed: %m"); /* @@ -261,7 +269,7 @@ invalid: * This code assumes that we always get arguments through flags, * never through bits set in some random machine register. */ - while ((c = getopt(argc, argv, "dsf")) != -1) + while ((c = getopt(argc, argv, "dsfr")) != -1) switch (c) { case 'd': devfs = 1; @@ -272,6 +280,9 @@ invalid: case 'f': runcom_mode = FASTBOOT; break; + case 'r': + initial_transition = reroot_phase_two; + break; default: warning("unrecognized flag '-%c'", c); break; @@ -287,13 +298,13 @@ invalid: handle(badsys, SIGSYS, 0); handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, SIGXFSZ, 0); - handle(transition_handler, SIGHUP, SIGINT, SIGTERM, SIGTSTP, SIGUSR1, - SIGUSR2, 0); + handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, + SIGUSR1, SIGUSR2, 0); handle(alrm_handler, SIGALRM, 0); sigfillset(&mask); delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, - SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGTERM, SIGTSTP, SIGALRM, - SIGUSR1, SIGUSR2, 0); + SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, + SIGALRM, SIGUSR1, SIGUSR2, 0); sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; @@ -373,6 +384,16 @@ invalid: free(s); } + if (initial_transition != reroot_phase_two) { + /* + * Unmount reroot leftovers. This runs after init(8) + * gets reexecuted after reroot_phase_two() is done. + */ + error = unmount(_PATH_REROOT, MNT_FORCE); + if (error != 0 && errno != EINVAL) + warning("Cannot unmount %s: %m", _PATH_REROOT); + } + /* * Start the state machine. */ @@ -620,6 +641,228 @@ write_stderr(const char *message) write(STDERR_FILENO, message, strlen(message)); } +static int +read_file(const char *path, void **bufp, size_t *bufsizep) +{ + struct stat sb; + size_t bufsize; + void *buf; + ssize_t nbytes; + int error, fd; + + fd = open(path, O_RDONLY); + if (fd < 0) { + emergency("%s: %s", path, strerror(errno)); + return (-1); + } + + error = fstat(fd, &sb); + if (error != 0) { + emergency("fstat: %s", strerror(errno)); + return (error); + } + + bufsize = sb.st_size; + buf = malloc(bufsize); + if (buf == NULL) { + emergency("malloc: %s", strerror(errno)); + return (error); + } + + nbytes = read(fd, buf, bufsize); + if (nbytes != (ssize_t)bufsize) { + emergency("read: %s", strerror(errno)); + free(buf); + return (error); + } + + error = close(fd); + if (error != 0) { + emergency("close: %s", strerror(errno)); + free(buf); + return (error); + } + + *bufp = buf; + *bufsizep = bufsize; + + return (0); +} + +static int +create_file(const char *path, void *buf, size_t bufsize) +{ + ssize_t nbytes; + int error, fd; + + fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0700); + if (fd < 0) { + emergency("%s: %s", path, strerror(errno)); + return (-1); + } + + nbytes = write(fd, buf, bufsize); + if (nbytes != (ssize_t)bufsize) { + emergency("write: %s", strerror(errno)); + return (-1); + } + + error = close(fd); + if (error != 0) { + emergency("close: %s", strerror(errno)); + free(buf); + return (-1); + } + + return (0); +} + +static int +mount_tmpfs(const char *fspath) +{ + struct iovec *iov; + char errmsg[255]; + int error, iovlen; + + iov = NULL; + iovlen = 0; + memset(errmsg, 0, sizeof(errmsg)); + build_iovec(&iov, &iovlen, "fstype", + __DECONST(void *, "tmpfs"), (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", + __DECONST(void *, fspath), (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", + errmsg, sizeof(errmsg)); + + error = nmount(iov, iovlen, 0); + if (error != 0) { + if (*errmsg != '\0') { + emergency("cannot mount tmpfs on %s: %s: %s", + fspath, errmsg, strerror(errno)); + } else { + emergency("cannot mount tmpfs on %s: %s", + fspath, strerror(errno)); + } + return (error); + } + return (0); +} + +static state_func_t +reroot(void) +{ + void *buf; + char init_path[PATH_MAX]; + size_t bufsize, init_path_len; + int error, name[4]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = -1; + init_path_len = sizeof(init_path); + error = sysctl(name, 4, init_path, &init_path_len, NULL, 0); + if (error != 0) { + emergency("failed to get kern.proc.pathname: %s", + strerror(errno)); + goto out; + } + + revoke_ttys(); + runshutdown(); + + /* + * Make sure nobody can interfere with our scheme. + */ + error = kill(-1, SIGKILL); + if (error != 0) { + emergency("kill(2) failed: %s", strerror(errno)); + goto out; + } + + /* + * Pacify GCC. + */ + buf = NULL; + bufsize = 0; + + /* + * Copy the init binary into tmpfs, so that we can unmount + * the old rootfs without committing suicide. + */ + error = read_file(init_path, &buf, &bufsize); + if (error != 0) + goto out; + error = mount_tmpfs(_PATH_REROOT); + if (error != 0) + goto out; + error = create_file(_PATH_REROOT_INIT, buf, bufsize); + if (error != 0) + goto out; + + /* + * Execute the temporary init. + */ + execl(_PATH_REROOT_INIT, _PATH_REROOT_INIT, "-r", NULL); + emergency("cannot exec %s: %s", _PATH_REROOT_INIT, strerror(errno)); + +out: + emergency("reroot failed; going to single user mode"); + return (state_func_t) single_user; +} + +static state_func_t +reroot_phase_two(void) +{ + char init_path[PATH_MAX], *path, *path_component; + size_t init_path_len; + int nbytes, error; + + /* + * Ask the kernel to mount the new rootfs. + */ + error = reboot(RB_REROOT); + if (error != 0) { + emergency("RB_REBOOT failed: %s", strerror(errno)); + goto out; + } + + /* + * Figure out where the destination init(8) binary is. Note that + * the path could be different than what we've started with. Use + * the value from kenv, if set, or the one from sysctl otherwise. + * The latter defaults to a hardcoded value, but can be overridden + * by a build time option. + */ + nbytes = kenv(KENV_GET, "init_path", init_path, sizeof(init_path)); + if (nbytes <= 0) { + init_path_len = sizeof(init_path); + error = sysctlbyname("kern.init_path", + init_path, &init_path_len, NULL, 0); + if (error != 0) { + emergency("failed to retrieve kern.init_path: %s", + strerror(errno)); + goto out; + } + } + + /* + * Repeat the init search logic from sys/kern/init_path.c + */ + path_component = init_path; + while ((path = strsep(&path_component, ":")) != NULL) { + /* + * Execute init(8) from the new rootfs. + */ + execl(path, path, NULL); + } + emergency("cannot exec init from %s: %s", init_path, strerror(errno)); + +out: + emergency("reroot failed; going to single user mode"); + return (state_func_t) single_user; +} + /* * Bring the system up single user. */ @@ -851,8 +1094,9 @@ run_script(const char *script) if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1) collect_child(wpid); if (wpid == -1) { - if (requested_transition == death_single) - return (state_func_t) death_single; + if (requested_transition == death_single || + requested_transition == reroot) + return (state_func_t) requested_transition; if (errno == EINTR) continue; warning("wait for %s on %s failed: %m; going to " @@ -1323,6 +1567,9 @@ transition_handler(int sig) current_state == multi_user || current_state == catatonia) requested_transition = catatonia; break; + case SIGEMT: + requested_transition = reroot; + break; default: requested_transition = 0; break; @@ -1486,7 +1733,6 @@ alrm_handler(int sig) static state_func_t death(void) { - session_t *sp; int block, blocked; size_t len; @@ -1503,11 +1749,7 @@ death(void) * runshutdown() will perform the initial open() call, causing * the terminal attributes to be misconfigured. */ - for (sp = sessions; sp; sp = sp->se_next) { - sp->se_flags |= SE_SHUTDOWN; - kill(sp->se_process, SIGHUP); - revoke(sp->se_device); - } + revoke_ttys(); /* Try to run the rc.shutdown script within a period of time */ runshutdown(); @@ -1553,6 +1795,18 @@ death_single(void) return (state_func_t) single_user; } +static void +revoke_ttys(void) +{ + session_t *sp; + + for (sp = sessions; sp; sp = sp->se_next) { + sp->se_flags |= SE_SHUTDOWN; + kill(sp->se_process, SIGHUP); + revoke(sp->se_device); + } +} + /* * Run the system shutdown script. * Modified: head/sbin/init/pathnames.h ============================================================================== --- head/sbin/init/pathnames.h Sun Nov 8 14:26:50 2015 (r290547) +++ head/sbin/init/pathnames.h Sun Nov 8 17:33:48 2015 (r290548) @@ -35,7 +35,9 @@ #include -#define _PATH_INITLOG "/var/log/init.log" -#define _PATH_SLOGGER "/sbin/session_logger" -#define _PATH_RUNCOM "/etc/rc" -#define _PATH_RUNDOWN "/etc/rc.shutdown" +#define _PATH_INITLOG "/var/log/init.log" +#define _PATH_SLOGGER "/sbin/session_logger" +#define _PATH_RUNCOM "/etc/rc" +#define _PATH_RUNDOWN "/etc/rc.shutdown" +#define _PATH_REROOT "/dev/reroot" +#define _PATH_REROOT_INIT _PATH_REROOT "/init" Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Sun Nov 8 14:26:50 2015 (r290547) +++ head/sbin/reboot/reboot.8 Sun Nov 8 17:33:48 2015 (r290548) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 11, 2010 +.Dd May 22, 2015 .Dt REBOOT 8 .Os .Sh NAME @@ -42,7 +42,7 @@ .Op Fl lnpq .Op Fl k Ar kernel .Nm -.Op Fl dlnpq +.Op Fl dlnpqr .Op Fl k Ar kernel .Nm fasthalt .Op Fl lnpq @@ -111,6 +111,13 @@ the flushing of the file system cache is .Fl n option is not specified). This option should probably not be used. +.It Fl r +The system kills all processes, unmounts all filesystems, mounts the new +root filesystem, and begins the usual startup sequence. +After changing vfs.root.mountfrom with +.Xr kenv 8 , +.Nm Fl r +can be used to change the root filesystem while preserving kernel state. .El .Pp The @@ -128,6 +135,13 @@ Normally, the utility is used when the system needs to be halted or restarted, giving users advance warning of their impending doom and cleanly terminating specific programs. +.Sh EXAMPLES +Replace current root filesystem with UFS mounted from +.Pa /dev/ada0s1a : +.Bd -literal -offset indent +kenv vfs.root.mountfrom=ufs:/dev/ada0s1a +reboot -r +.Ed .Sh SEE ALSO .Xr getutxent 3 , .Xr boot 8 , Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Sun Nov 8 14:26:50 2015 (r290547) +++ head/sbin/reboot/reboot.c Sun Nov 8 17:33:48 2015 (r290548) @@ -77,7 +77,7 @@ main(int argc, char *argv[]) } else howto = 0; lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "dk:lnpq")) != -1) + while ((ch = getopt(argc, argv, "dk:lnpqr")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; @@ -98,6 +98,9 @@ main(int argc, char *argv[]) case 'q': qflag = 1; break; + case 'r': + howto |= RB_REROOT; + break; case '?': default: usage(); @@ -107,6 +110,8 @@ main(int argc, char *argv[]) if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); + if ((howto & RB_REROOT) != 0 && howto != RB_REROOT) + errx(1, "-r cannot be used with -d, -n, or -p"); if (geteuid()) { errno = EPERM; err(1, NULL); @@ -137,6 +142,9 @@ main(int argc, char *argv[]) if (dohalt) { openlog("halt", 0, LOG_AUTH | LOG_CONS); syslog(LOG_CRIT, "halted by %s", user); + } else if (howto & RB_REROOT) { + openlog("reroot", 0, LOG_AUTH | LOG_CONS); + syslog(LOG_CRIT, "rerooted by %s", user); } else { openlog("reboot", 0, LOG_AUTH | LOG_CONS); syslog(LOG_CRIT, "rebooted by %s", user); @@ -170,6 +178,16 @@ main(int argc, char *argv[]) */ (void)signal(SIGPIPE, SIG_IGN); + /* + * Only init(8) can perform rerooting. + */ + if (howto & RB_REROOT) { + if (kill(1, SIGEMT) == -1) + err(1, "SIGEMT init"); + + return (0); + } + /* Just stop init -- if we fail, we'll restart it. */ if (kill(1, SIGTSTP) == -1) err(1, "SIGTSTP init"); From owner-svn-src-all@freebsd.org Sun Nov 8 17:57:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E25A29998; Sun, 8 Nov 2015 17:57:13 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7629C1503; Sun, 8 Nov 2015 17:57:13 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmec201 with SMTP id c201so52147713wme.1; Sun, 08 Nov 2015 09:57:11 -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=ywc0iYVdOpF3kLlxG32PwqU16SVtuzc8HcMV0KLvQ2s=; b=yD5YF8KqD+dmUulxjgG+6ygaGRLfhx+ozkVSMu1sEP1jlvDaMK6Lf/LduNxdtA7c7C tDSL72ro4IrGjW1oUWYMJ4HfO4AYsaFf1mQaZvRpcHzl0l83Yz3GoRprN0plB3AtbNZC tfPt6S0wkr15lHKUwXBApSou7I+otIV2GDR2lc74jcHgkrxa5VLKhXUIw9p+YUNpHqQO ZxrfpmGgHJcW9BkA5ymxJUpUQkc/t3myXbxDe+vrPMHQU9ghXKDVHXC9nYzS/pf+hfbt bkI7vUbjLDPDq6sOUgfUHOJMBtTDOnzx41HsQ33QopMUSr5MjHAJKS2k4k9+jStsOIHW 1fJg== X-Received: by 10.28.87.21 with SMTP id l21mr21787953wmb.6.1447005431032; Sun, 08 Nov 2015 09:57:11 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id l1sm12483787wmb.1.2015.11.08.09.57.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 09:57:10 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 8 Nov 2015 18:57:07 +0100 From: Baptiste Daroussin To: Hajimu UMEMOTO Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r290522 - head/share/timedef Message-ID: <20151108175707.GF31396@ivaldir.etoilebsd.net> References: <201511072354.tA7NsEPs032069@repo.freebsd.org> <20151108000818.GE31396@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RE3pQJLXZi4fr8Xo" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 17:57:14 -0000 --RE3pQJLXZi4fr8Xo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2015 at 08:49:42PM +0900, Hajimu UMEMOTO wrote: > Hi, >=20 > >>>>> On Sun, 8 Nov 2015 01:08:18 +0100 > >>>>> Baptiste Daroussin said: >=20 > bapt> They are auto generated, I will try to have a look to fix the gener= ation tool so > bapt> we won't get hit by it next time. >=20 > Oops, I dodn't notice that. > It seems that Linux does similar way. > I think it should be fixed by the origin data rather than by the > generation tool. > I don't test it, but perhaps the attached change should fix it: >=20 > bapt> Thanks for the fix! >=20 > You are welcome. >=20 > Sincerely, >=20 The origin data are available there http://cldr.unicode.org/ they have a tr= ac (sorry I do not remember the link :)) to report issues. We are right now at= v27 the tools to generate our sources are in tools/tools/locale/*. In the meantime marino@ has modified the tools to generate CJK correctly I = will bring that to freebsd soon. http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fb572e12d4eae3f415c= a6a464aecbd14bdbde4ce Best regards, Bapt --RE3pQJLXZi4fr8Xo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlY/jPMACgkQ8kTtMUmk6EzRogCeL6FU+paZ0kLB4raBhQaMubrB H/IAoLmpcKtTmzlmbAbzUuFf2SlM+R4a =jxUL -----END PGP SIGNATURE----- --RE3pQJLXZi4fr8Xo-- From owner-svn-src-all@freebsd.org Sun Nov 8 17:59:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72BEFA29A47; Sun, 8 Nov 2015 17:59:02 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1836417E1; Sun, 8 Nov 2015 17:59:02 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmdw130 with SMTP id w130so13317544wmd.0; Sun, 08 Nov 2015 09:59:00 -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=3PsR+BBBaqqQwjdIVBLB3IQMQZorcFNtrs8LHFbUajc=; b=X5kBnFxooH/RPtC//yrWEu0XWyEJiPyB4KB2CJa/P+R8eQp6d4aTX7Ce9l6i1DVJpU gdeh6WgCqO01z1SFXH/wnqTMJ5pBvc600Uyk5/TUV5nLiUp91C9rREhXsAvf1H5nFfEK CHR9k4ooceLuz8yStnCH4uaozcAOvvLsdh2x3PQV3ZOq0xnGYLtY+phk3QZPX3aG2JGw /mCgU098FFuxEtXsXxojU0s4ORPuObNsGwOZptCNE8e7kt/mp6TQPt3Gys3JDuCEuYvZ OWsXz5LhQIQu9lxRViX4J9knBwJRnXQtCZJU6NHHjmYInoTLkMQpl57rnpN6e5D+gwJ+ waoA== X-Received: by 10.28.94.208 with SMTP id s199mr21832290wmb.10.1447005540568; Sun, 08 Nov 2015 09:59:00 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id v9sm10986045wjv.45.2015.11.08.09.58.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 09:59:00 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 8 Nov 2015 18:58:58 +0100 From: Baptiste Daroussin To: Bryan Drewery Cc: Hajimu UMEMOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290522 - head/share/timedef Message-ID: <20151108175858.GG31396@ivaldir.etoilebsd.net> References: <201511072354.tA7NsEPs032069@repo.freebsd.org> <20151108000818.GE31396@ivaldir.etoilebsd.net> <563E940C.5080708@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xs+9IvWevLaxKUtW" Content-Disposition: inline In-Reply-To: <563E940C.5080708@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 17:59:02 -0000 --xs+9IvWevLaxKUtW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 07, 2015 at 04:15:08PM -0800, Bryan Drewery wrote: > On 11/7/2015 4:08 PM, Baptiste Daroussin wrote: > > On Sat, Nov 07, 2015 at 11:54:14PM +0000, Hajimu UMEMOTO wrote: > >> Author: ume > >> Date: Sat Nov 7 23:54:14 2015 > >> New Revision: 290522 > >> URL: https://svnweb.freebsd.org/changeset/base/290522 > >> > >> Log: > >> Fix alignment of the short month names for CJK locales, > >> as far as I could edit them. > >> > >=20 > > They are auto generated, I will try to have a look to fix the generatio= n tool so > > we won't get hit by it next time. > >=20 > > Thanks for the fix! > >=20 >=20 > How much effort is involved to generate them? Should the build generate > them instead? >=20 The effort is really easy now, all the work was to get the proper tools whi= ch we now have on tools/tools/locales this work was already done by edwin@ there = is a wiki page about it (forgot the link) and extended by marino@ on dfly. Best regards, Bapt --xs+9IvWevLaxKUtW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlY/jWIACgkQ8kTtMUmk6Ey/jQCgipqmqf/+ecu4AWDv4kqW6LiK HvAAnA+8GrNSAOPu+lC3BJTaw4B95Mm3 =cmRz -----END PGP SIGNATURE----- --xs+9IvWevLaxKUtW-- From owner-svn-src-all@freebsd.org Sun Nov 8 18:00:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB9DA29AAA; Sun, 8 Nov 2015 18:00:46 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC10E19A3; Sun, 8 Nov 2015 18:00:45 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8I0iev047889; Sun, 8 Nov 2015 18:00:44 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8I0iUe047888; Sun, 8 Nov 2015 18:00:44 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511081800.tA8I0iUe047888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 8 Nov 2015 18:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290549 - head/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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:00:46 -0000 Author: ache Date: Sun Nov 8 18:00:44 2015 New Revision: 290549 URL: https://svnweb.freebsd.org/changeset/base/290549 Log: Reorganize code to elimitate one _sseek() call for append modes. MFC after: 1 week Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Sun Nov 8 17:33:48 2015 (r290548) +++ head/lib/libc/stdio/ftell.c Sun Nov 8 18:00:44 2015 (r290549) @@ -98,7 +98,20 @@ _ftello(FILE *fp, fpos_t *offset) * Find offset of underlying I/O object, then * adjust for buffered bytes. */ - if (fp->_flags & __SOFF) + if (!(fp->_flags & __SRD) && (fp->_flags & __SWR) && + fp->_p != NULL && fp->_p - fp->_bf._base > 0 && + ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP))) { + if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { + if (errno == ESPIPE || + (fp->_flags & __SOPT) || __sflush(fp) || + (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) + return (1); + else { + *offset = pos; + return (0); + } + } + } else if (fp->_flags & __SOFF) pos = fp->_offset; else { pos = _sseek(fp, (fpos_t)0, SEEK_CUR); @@ -125,26 +138,6 @@ _ftello(FILE *fp, fpos_t *offset) * position to be greater than that in the * underlying object. */ - if ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP)) { - int serrno = errno; - - errno = 0; - if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { - if (errno == ESPIPE || - (fp->_flags & __SOPT) || __sflush(fp) || - (pos = - _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) - return (1); - else { - errno = serrno; - *offset = pos; - return (0); - } - } - errno = serrno; - /* fp->_p can be changed in _sseek(), recalculate. */ - n = fp->_p - fp->_bf._base; - } if (pos > OFF_MAX - n) { errno = EOVERFLOW; return (1); From owner-svn-src-all@freebsd.org Sun Nov 8 18:02:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56116A29C4A; Sun, 8 Nov 2015 18:02:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ED031D44; Sun, 8 Nov 2015 18:02:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8I2eq6049913; Sun, 8 Nov 2015 18:02:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8I2eBQ049912; Sun, 8 Nov 2015 18:02:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201511081802.tA8I2eBQ049912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 8 Nov 2015 18:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290550 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:02:41 -0000 Author: gjb Date: Sun Nov 8 18:02:39 2015 New Revision: 290550 URL: https://svnweb.freebsd.org/changeset/base/290550 Log: Use tmpfs(5) instead of md(4) for '/tmp' mount. Submitted by: Nikolai Lifanov Differential Revision: D3506 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Sun Nov 8 18:00:44 2015 (r290549) +++ head/release/tools/arm.subr Sun Nov 8 18:02:39 2015 (r290550) @@ -110,7 +110,7 @@ arm_install_base() { >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "md /tmp mfs rw,noatime,-s30m 0 0" \ + echo "tmpfs /tmp tmpfs rw,noatime,mode=1777,size=30m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname From owner-svn-src-all@freebsd.org Sun Nov 8 18:08:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B58A29D64; Sun, 8 Nov 2015 18:08:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB571F8B; Sun, 8 Nov 2015 18:08:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8I8VJf050170; Sun, 8 Nov 2015 18:08:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8I8VjR050168; Sun, 8 Nov 2015 18:08:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511081808.tA8I8VjR050168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Nov 2015 18:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290551 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:08:32 -0000 Author: trasz Date: Sun Nov 8 18:08:31 2015 New Revision: 290551 URL: https://svnweb.freebsd.org/changeset/base/290551 Log: Speed up rctl(8) rule retrieval; the difference shows mostly in "rctl -n", as otherwise most of the time is spent resolving UIDs to names. Reviewed by: mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4059 Modified: head/sys/kern/kern_rctl.c head/sys/sys/racct.h Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sun Nov 8 18:02:39 2015 (r290550) +++ head/sys/kern/kern_rctl.c Sun Nov 8 18:08:31 2015 (r290551) @@ -71,13 +71,18 @@ FEATURE(rctl, "Resource Limits"); #define HRF_DONT_INHERIT 1 #define HRF_DONT_ACCUMULATE 2 -/* Default buffer size for rctl_get_rules(2). */ -#define RCTL_DEFAULT_BUFSIZE 4096 -#define RCTL_MAX_INBUFLEN 4096 +#define RCTL_MAX_INBUFLEN 4 * 1024 +#define RCTL_MAX_OUTBUFLEN 16 * 1024 * 1024 #define RCTL_LOG_BUFSIZE 128 #define RCTL_PCPU_SHIFT (10 * 1000000) +unsigned int rctl_maxbufsize = RCTL_MAX_OUTBUFLEN; + +SYSCTL_NODE(_kern_racct, OID_AUTO, rctl, CTLFLAG_RW, 0, "Resource Limits"); +SYSCTL_UINT(_kern_racct_rctl, OID_AUTO, maxbufsize, CTLFLAG_RWTUN, + &rctl_maxbufsize, 0, "Maximum output buffer size"); + /* * 'rctl_rule_link' connects a rule with every racct it's related to. * For example, rule 'user:X:openfiles:deny=N/process' is linked @@ -1435,7 +1440,7 @@ int sys_rctl_get_rules(struct thread *td, struct rctl_get_rules_args *uap) { int error; - size_t bufsize = RCTL_DEFAULT_BUFSIZE; + size_t bufsize; char *inputstr, *buf; struct sbuf *sb; struct rctl_rule *filter; @@ -1461,12 +1466,16 @@ sys_rctl_get_rules(struct thread *td, st return (error); } -again: + bufsize = uap->outbuflen; + if (bufsize > rctl_maxbufsize) { + sx_sunlock(&allproc_lock); + return (E2BIG); + } + buf = malloc(bufsize, M_RCTL, M_WAITOK); sb = sbuf_new(NULL, buf, bufsize, SBUF_FIXEDLEN); KASSERT(sb != NULL, ("sbuf_new failed")); - sx_assert(&allproc_lock, SA_LOCKED); FOREACH_PROC_IN_SYSTEM(p) { rw_rlock(&rctl_lock); LIST_FOREACH(link, &p->p_racct->r_rule_links, rrl_next) { @@ -1489,10 +1498,8 @@ again: ui_racct_foreach(rctl_get_rules_callback, filter, sb); prison_racct_foreach(rctl_get_rules_callback, filter, sb); if (sbuf_error(sb) == ENOMEM) { - sbuf_delete(sb); - free(buf, M_RCTL); - bufsize *= 4; - goto again; + error = ERANGE; + goto out; } /* @@ -1502,7 +1509,7 @@ again: sbuf_setpos(sb, sbuf_len(sb) - 1); error = rctl_write_outbuf(sb, uap->outbufp, uap->outbuflen); - +out: rctl_rule_release(filter); sx_sunlock(&allproc_lock); free(buf, M_RCTL); @@ -1513,7 +1520,7 @@ int sys_rctl_get_limits(struct thread *td, struct rctl_get_limits_args *uap) { int error; - size_t bufsize = RCTL_DEFAULT_BUFSIZE; + size_t bufsize; char *inputstr, *buf; struct sbuf *sb; struct rctl_rule *filter; @@ -1554,7 +1561,13 @@ sys_rctl_get_limits(struct thread *td, s return (EINVAL); } -again: + bufsize = uap->outbuflen; + if (bufsize > rctl_maxbufsize) { + rctl_rule_release(filter); + sx_sunlock(&allproc_lock); + return (E2BIG); + } + buf = malloc(bufsize, M_RCTL, M_WAITOK); sb = sbuf_new(NULL, buf, bufsize, SBUF_FIXEDLEN); KASSERT(sb != NULL, ("sbuf_new failed")); @@ -1567,10 +1580,8 @@ again: } rw_runlock(&rctl_lock); if (sbuf_error(sb) == ENOMEM) { - sbuf_delete(sb); - free(buf, M_RCTL); - bufsize *= 4; - goto again; + error = ERANGE; + goto out; } /* @@ -1580,6 +1591,7 @@ again: sbuf_setpos(sb, sbuf_len(sb) - 1); error = rctl_write_outbuf(sb, uap->outbufp, uap->outbuflen); +out: rctl_rule_release(filter); sx_sunlock(&allproc_lock); free(buf, M_RCTL); Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Sun Nov 8 18:02:39 2015 (r290550) +++ head/sys/sys/racct.h Sun Nov 8 18:08:31 2015 (r290551) @@ -37,9 +37,10 @@ #define _RACCT_H_ #include -#include -#include #include +#include +#include +#include struct proc; struct rctl_rule_link; @@ -146,6 +147,8 @@ struct racct { LIST_HEAD(, rctl_rule_link) r_rule_links; }; +SYSCTL_DECL(_kern_racct); + #ifdef RACCT int racct_add(struct proc *p, int resource, uint64_t amount); From owner-svn-src-all@freebsd.org Sun Nov 8 18:11:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A89FA29F1C; Sun, 8 Nov 2015 18:11:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2092F1259; Sun, 8 Nov 2015 18:11:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8IBPmQ050340; Sun, 8 Nov 2015 18:11:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8IBP1s050339; Sun, 8 Nov 2015 18:11:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511081811.tA8IBP1s050339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Nov 2015 18:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290552 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:11:26 -0000 Author: trasz Date: Sun Nov 8 18:11:24 2015 New Revision: 290552 URL: https://svnweb.freebsd.org/changeset/base/290552 Log: Make naming more consistent; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sun Nov 8 18:08:31 2015 (r290551) +++ head/sys/kern/kern_rctl.c Sun Nov 8 18:11:24 2015 (r290552) @@ -71,13 +71,13 @@ FEATURE(rctl, "Resource Limits"); #define HRF_DONT_INHERIT 1 #define HRF_DONT_ACCUMULATE 2 -#define RCTL_MAX_INBUFLEN 4 * 1024 -#define RCTL_MAX_OUTBUFLEN 16 * 1024 * 1024 +#define RCTL_MAX_INBUFSIZE 4 * 1024 +#define RCTL_MAX_OUTBUFSIZE 16 * 1024 * 1024 #define RCTL_LOG_BUFSIZE 128 #define RCTL_PCPU_SHIFT (10 * 1000000) -unsigned int rctl_maxbufsize = RCTL_MAX_OUTBUFLEN; +unsigned int rctl_maxbufsize = RCTL_MAX_OUTBUFSIZE; SYSCTL_NODE(_kern_racct, OID_AUTO, rctl, CTLFLAG_RW, 0, "Resource Limits"); SYSCTL_UINT(_kern_racct_rctl, OID_AUTO, maxbufsize, CTLFLAG_RWTUN, @@ -1278,7 +1278,7 @@ rctl_read_inbuf(char **inputstr, const c if (inbuflen <= 0) return (EINVAL); - if (inbuflen > RCTL_MAX_INBUFLEN) + if (inbuflen > RCTL_MAX_INBUFSIZE) return (E2BIG); str = malloc(inbuflen + 1, M_RCTL, M_WAITOK); From owner-svn-src-all@freebsd.org Sun Nov 8 18:48:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9ECA2975C; Sun, 8 Nov 2015 18:48:36 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6D7109D; Sun, 8 Nov 2015 18:48:36 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8ImZbI061625; Sun, 8 Nov 2015 18:48:35 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8ImZan061624; Sun, 8 Nov 2015 18:48:35 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201511081848.tA8ImZan061624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 8 Nov 2015 18:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290553 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:48:36 -0000 Author: skra Date: Sun Nov 8 18:48:35 2015 New Revision: 290553 URL: https://svnweb.freebsd.org/changeset/base/290553 Log: Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocated by bus_dmamem_alloc() which creates associated bus_dmamap_t map for us. When this memory is freed by bus_dmamem_free(), the map is freed as well. Thus there is no need to free it explicitly by bus_dmamap_destroy(), which leads to double freeing. Discussed with: gonzo Approved by: kib (mentor) Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Sun Nov 8 18:11:24 2015 (r290552) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Sun Nov 8 18:48:35 2015 (r290553) @@ -542,9 +542,8 @@ create_pagelist(char __user *buf, size_t return 0; failed_load: - bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map); + bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map); failed_alloc: - bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dma_tag_destroy(bi->pagelist_dma_tag); return err; @@ -613,7 +612,6 @@ free_pagelist(BULKINFO_T *bi, int actual bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map); - bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dma_tag_destroy(bi->pagelist_dma_tag); free(bi, M_VCPAGELIST); From owner-svn-src-all@freebsd.org Sun Nov 8 18:49:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06243A297D8 for ; Sun, 8 Nov 2015 18:49:45 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2001126C for ; Sun, 8 Nov 2015 18:49:44 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmww144 with SMTP id w144so15331160wmw.0 for ; Sun, 08 Nov 2015 10:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=p4JNopSxvGnZP5LT/g6NsS4SUdVB07+q64DbmhwOGaY=; b=A2FxcNA0hCYOaDhywPbvwaZ0qZUX5IzUe0oC3fBU1V6XFd4oMtzqEp0Pv2Ubvdy8cZ HrosJ3Raz9MHbrPqWKWOD3pRv9SD9X9EBCfPhNeALhPMwI4NhpYXBkeLPt0B57sk3/qG MpZHdeDBMQUkpz7ILeux3CCSFEZNZN1mA+ltnwTqMyHU7M0Tujdn7e4rOXVI+Sjz1Geo 7t7pObz2H628klwbIlftXkx/382ZhrTaJDX2IvnlnB2pG85VSILhpOU7wf1ujDvDi6hh 9ekvemlAIdFnKBiQ+hAgwhIpjGXCrq+cepMoym2R2cd2GiDiCBjjduCuQAMi9PoJ4eGU dczA== 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=p4JNopSxvGnZP5LT/g6NsS4SUdVB07+q64DbmhwOGaY=; b=AJWfQCgSikafjUXaOQefEbCzUzb1gn+LfKViqX1xKG5/qNJ7iDRMut06VdwVfeKnpq Wx5XalA4lXGdgBRoq+iJTHRw+yZJ6i9eCdaXCw+sn6EsuVmoLW+IGyxcbna4u0lh5qCd RduuYjzr6ahvT6J2c9e/N/1tTRWlWwbyI5C6G7FsgRcpDbLkGvk+8Q+fVN8r0D0CPRfZ fBf+cHTU0uYuxLqc1QR6AUEE9sRzg8lrNG834bfF0nIkctulSOOqCOFxqOlA9yd0eY+4 vjDA4xnSWcuAIhLIIhKvUlXhZMK6cT+cUIofLjDBix4/8gfYmegLQRBYcEtzjURo7bgx Vk4Q== X-Gm-Message-State: ALoCoQmmacgqbb0YQx0dS4uCPinsoIX6thdxUUALrb6KtTk7YZJKrPh/xYdJztZD1u4kOUTRsxE/ MIME-Version: 1.0 X-Received: by 10.28.23.211 with SMTP id 202mr20951870wmx.81.1447008582889; Sun, 08 Nov 2015 10:49:42 -0800 (PST) Received: by 10.194.158.225 with HTTP; Sun, 8 Nov 2015 10:49:42 -0800 (PST) In-Reply-To: <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> Date: Sun, 8 Nov 2015 19:49:42 +0100 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: Renato Botelho Cc: Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?UTF-8?Q?Ermal_Lu=C3=A7i?= Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 18:49:45 -0000 On 8/19/15, Renato Botelho wrote: >> On Aug 19, 2015, at 18:31, Adrian Chadd wrote: >> >> jim asked me again to do the MFC, so once I've finished doing some >> more tidying up of bits and pieces I'll do the MFC. What's the status of this MFC? You need a tester or you have a patch? > > Thank you very much! > > -- > Renato Botelho > > From owner-svn-src-all@freebsd.org Sun Nov 8 19:08:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E588A29CEE; Sun, 8 Nov 2015 19:08:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5BE81F32; Sun, 8 Nov 2015 19:08:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8J8crO067525; Sun, 8 Nov 2015 19:08:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8J8cs4067524; Sun, 8 Nov 2015 19:08:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511081908.tA8J8cs4067524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Nov 2015 19:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290554 - head/tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 19:08:40 -0000 Author: bapt Date: Sun Nov 8 19:08:38 2015 New Revision: 290554 URL: https://svnweb.freebsd.org/changeset/base/290554 Log: Modify the tool that generates the locales so that the generated CJK locales are padded as expected by the users Submitted by: marino Obtained from: DragonflyBSD Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sun Nov 8 18:48:35 2015 (r290553) +++ head/tools/tools/locale/tools/cldr2def.pl Sun Nov 8 19:08:38 2015 (r290554) @@ -1,4 +1,5 @@ #!/usr/local/bin/perl -wC +# $FreeBSD$ use strict; use File::Copy; @@ -66,6 +67,7 @@ my %callback = ( mdorder => \&callback_mdorder, altmon => \&callback_altmon, cformat => \&callback_cformat, + cbabmon => \&callback_abmon, data => undef, ); @@ -173,7 +175,7 @@ if ($TYPE eq "msgdef") { if ($TYPE eq "timedef") { %keys = ( - "abmon" => "as", + "abmon" => " "as", "abday" => "as", "day" => "as", @@ -226,6 +228,30 @@ sub callback_altmon { return $s; } +sub callback_abmon { + # for specified CJK locales, pad result with a space to enable + # columns to line up (style established in FreeBSD in 2001) + my $s = shift; + my $nl = $callback{data}{l} . "_" . $callback{data}{c}; + + if ($nl eq 'ja_JP' || $nl eq 'ko_KR' || $nl eq 'zh_CN' || + $nl eq 'zh_HK' || $nl eq 'zh_TW') { + my @monthnames = split(";", $s); + my @cleaned; + foreach (@monthnames) + { + if ($_ =~ /^"<(two|three|four|five|six|seven|eight|nine)>/ || + ($_ =~ /^"/ && $_ !~ /^"(||)/)) + { + $_ =~ s/^"/"/; + } + push @cleaned, $_; + } + return join(";",@cleaned); + } + return $s; +} + ############################ sub get_unidata { From owner-svn-src-all@freebsd.org Sun Nov 8 19:24:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB4AA291B6; Sun, 8 Nov 2015 19:24:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C13A1A93; Sun, 8 Nov 2015 19:24:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by ioc74 with SMTP id 74so101608588ioc.2; Sun, 08 Nov 2015 11:24:32 -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=QHKgtGOw/fKUen1s/XTRXe6Jkto7EHnOvRvZvxV7KkA=; b=i37pl4ljHSApsjbp/tgSYM9tXmwJjCfinYOHbN1rj5JRHkhcwRvoRLwlIEWRdTrxfx XN2AsNFlZVMWTJof9t5T8WXCOw636rKoz2tmgViMGpkYTrLxIaRYT3pwHUOJnTI5n6mg tHOncLAJPekqtkxmCBFsQ+mjkY7oMjlkSPrzjROWrH8m8+Wm94uElA2fGlTn7QZMBfLJ 2WLVitaP/3w6ejgDEt9wodISma0oycwbj9fJb55P3T/9KU49iQMIyL9DjhVQg8cC8k74 GFFOn43Wr6Kh7GGOAFdoKMYzg13UVteO0tnAOZJ+UeiSDRVIKqdn/y67JD17fjPOZPFB XXqw== MIME-Version: 1.0 X-Received: by 10.107.152.2 with SMTP id a2mr22352565ioe.123.1447010671934; Sun, 08 Nov 2015 11:24:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.217.196 with HTTP; Sun, 8 Nov 2015 11:24:31 -0800 (PST) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> Date: Sun, 8 Nov 2015 11:24:31 -0800 X-Google-Sender-Auth: 3gSjo7mZjI12d43fFcwDXdcGKIg Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: Oliver Pinter Cc: Renato Botelho , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?UTF-8?Q?Ermal_Lu=C3=A7i?= Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 19:24:32 -0000 i'm burnt out and still too busy fixing issues introduced into -head (both wifi and low-memory platform support.) Someone else at this stage has to MFC things :( Sorry, -a On 8 November 2015 at 10:49, Oliver Pinter wrote: > On 8/19/15, Renato Botelho wrote: >>> On Aug 19, 2015, at 18:31, Adrian Chadd wrote: >>> >>> jim asked me again to do the MFC, so once I've finished doing some >>> more tidying up of bits and pieces I'll do the MFC. > > What's the status of this MFC? You need a tester or you have a patch? > >> >> Thank you very much! >> >> -- >> Renato Botelho >> >> From owner-svn-src-all@freebsd.org Sun Nov 8 19:26:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36668A29268 for ; Sun, 8 Nov 2015 19:26:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0821C29 for ; Sun, 8 Nov 2015 19:26:57 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wiby19 with SMTP id y19so4138746wib.0 for ; Sun, 08 Nov 2015 11:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=R9mY/iF4Z57BuqXKvy/HWzWDYVCi0YKbNLh3gF8U79Q=; b=MM89GW4SiehjHFk1D2nii4J+sCRJsXQjFxHjDRqYJHk5S3mgnxvllxXdxKyYczdpCt UUrVvjs/ujWYWBoxU6LyVCubNqCpDm2QpKZwr2eceSnDHtFqhI4isAYn0o9exCFxjZWu GDmrwNbvYwD06SvGrbxPsEgwEUNiaBtf53fOxBrD/igklOrU+IMQ05fVdUvibiGJ6+fn qUu6p3GtpFv0PZ+l/Ijzsr0jzl2UICCSdpfRzt6llxFVFnz+M7YK4OJh6peGikE7sNGZ zOC1FH0D4gA9pc+UO3+h+TfLqKe10ulxz+xH7apKWC+BYMx3OBEzhLtf5zs2sPH3UOAH 5/DQ== 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=R9mY/iF4Z57BuqXKvy/HWzWDYVCi0YKbNLh3gF8U79Q=; b=HzOK1UNx7oUYkQp9FowknAN44GlyBGzScny+ZLO110JG7FkkYpb8VxvMD2RbaEymlq G2EO92QSuDOwg9pStm295HyF1AY/9lujJhA79NwT3Kay1ZaNZMWFP5V5w3OXAdjgU8x+ RLPe95o3Sl23S6gv25yAWQq3G3fSGdXdQTnVtYfebd3Ip+6u88NMsxGdOLdVcaKpQTSd gn0e+DEyKKH+gbgKBSvFUW0IMyAlBrjZXuCm3Fy3Z3d7doo32BkJl8IcdlDIf6RiLTj+ 7jQSSR3NthBHpPXKB5XO4NzRzvudZIJk2D7Vu6aSqfe9QexIvWrpTP7lijXAKBjJzj9Q Bwpw== X-Gm-Message-State: ALoCoQlHv5J3YY5Elv0oZMzDerN1yFnmKjMTa9vuy0aE0aBwsO8YdEbfemJs5LcgKf9TQWHl9fx4 MIME-Version: 1.0 X-Received: by 10.194.116.100 with SMTP id jv4mr24978277wjb.67.1447010815923; Sun, 08 Nov 2015 11:26:55 -0800 (PST) Received: by 10.194.158.225 with HTTP; Sun, 8 Nov 2015 11:26:55 -0800 (PST) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> Date: Sun, 8 Nov 2015 20:26:55 +0100 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: Adrian Chadd Cc: Renato Botelho , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?UTF-8?Q?Ermal_Lu=C3=A7i?= , avos@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 19:26:58 -0000 On Sun, Nov 8, 2015 at 8:24 PM, Adrian Chadd wrote: > i'm burnt out and still too busy fixing issues introduced into -head > (both wifi and low-memory platform support.) That's bad to read. :( > > Someone else at this stage has to MFC things :( Renator, Avos anyone else? > > Sorry, > > > -a > > > On 8 November 2015 at 10:49, Oliver Pinter > wrote: >> On 8/19/15, Renato Botelho wrote: >>>> On Aug 19, 2015, at 18:31, Adrian Chadd wrote: >>>> >>>> jim asked me again to do the MFC, so once I've finished doing some >>>> more tidying up of bits and pieces I'll do the MFC. >> >> What's the status of this MFC? You need a tester or you have a patch? >> >>> >>> Thank you very much! >>> >>> -- >>> Renato Botelho >>> >>> From owner-svn-src-all@freebsd.org Sun Nov 8 19:27:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E2CA292AD for ; Sun, 8 Nov 2015 19:27:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 713731D7F for ; Sun, 8 Nov 2015 19:27:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmdw130 with SMTP id w130so14115931wmd.0 for ; Sun, 08 Nov 2015 11:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JjJGcg3uQObVcn4IsUE7I0wNNH07/5wn9rU9GB0cqdY=; b=ahv2DnaDHYbt35MfRnqEpbvEb4MMYcDAG7X9hgvgMrluZ/mh/YzBbeuBVlFiyKGYpZ kNWt3csFJMahrcu9lw3ZHTai2Sod8WGhZ8tR1sT7KGSQEkEZscMPTzRZe8+JLePdJq3G CpLo4774YlGpq8Gwlq5PP4FHbjzTiaB+kcBe1+hw6z7ST3kB4AH/5ng9anz7XXyTi+4M 1lJ/QMicfD9+TDWUb9luA/0QfFzxFtiem+ixC/mT2q8wIHUkoGnpt9AiYquR/gsNQTSo x3OWEJOaxl4sB2ca8G5G2K/YWpd5AI69AFzpxvHsV33Og/aqx6BaQrD9YVKcwXC5gvM2 CHXw== 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=JjJGcg3uQObVcn4IsUE7I0wNNH07/5wn9rU9GB0cqdY=; b=cdQRq9bPOlKOeTsS1QPvFkr25JsId30Lk5TgV0xpCpGfQdPomSQJdARDtnEdyuoOEf FB0gBT/anRzqtGLimQqQ4ti6WZG+TXxz/PdbaaJrM0O2zrj1wUmvHPAuM7s9RFPes4lO cSHKxtGt63U5ised/vTxjLuomfxQr9oprfwH0+uf9+q3zXKQ44uWmFgsRRZqitUJNyEU jV3fE3/KoS0kcJEJalcB+5DThfjGrVLw5wmDTEy6Vv64y3IEtW4DcWBBiqIqvTzrHeFb 8GeHAtKoLCZXWor5QCTqq5SpKQs/KOTePjkZLtJsBuIp9lEF+ZCliRjM2iPIrmj7ThX7 Vy+g== X-Gm-Message-State: ALoCoQmssgpkFExpJHFsQfV8oUIgJEtzFzx0VJP/O684Wz7c4DRrOhq0bTsv1Ris/8XH6KB4jx08 MIME-Version: 1.0 X-Received: by 10.28.23.211 with SMTP id 202mr21073702wmx.81.1447010854063; Sun, 08 Nov 2015 11:27:34 -0800 (PST) Received: by 10.194.158.225 with HTTP; Sun, 8 Nov 2015 11:27:33 -0800 (PST) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> Date: Sun, 8 Nov 2015 20:27:33 +0100 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: Adrian Chadd Cc: Renato Botelho , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?UTF-8?Q?Ermal_Lu=C3=A7i?= , avos@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 19:27:36 -0000 On Sun, Nov 8, 2015 at 8:26 PM, Oliver Pinter wrote: > On Sun, Nov 8, 2015 at 8:24 PM, Adrian Chadd wrote: >> i'm burnt out and still too busy fixing issues introduced into -head >> (both wifi and low-memory platform support.) > > That's bad to read. :( > >> >> Someone else at this stage has to MFC things :( > > Renator, Avos anyone else? Sorry, Renato > >> >> Sorry, >> >> >> -a >> >> >> On 8 November 2015 at 10:49, Oliver Pinter >> wrote: >>> On 8/19/15, Renato Botelho wrote: >>>>> On Aug 19, 2015, at 18:31, Adrian Chadd wrote: >>>>> >>>>> jim asked me again to do the MFC, so once I've finished doing some >>>>> more tidying up of bits and pieces I'll do the MFC. >>> >>> What's the status of this MFC? You need a tester or you have a patch? >>> >>>> >>>> Thank you very much! >>>> >>>> -- >>>> Renato Botelho >>>> >>>> From owner-svn-src-all@freebsd.org Sun Nov 8 19:29:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18D61A2932E; Sun, 8 Nov 2015 19:29:36 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE2891F26; Sun, 8 Nov 2015 19:29:35 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8JTY21073545; Sun, 8 Nov 2015 19:29:34 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8JTY0P073544; Sun, 8 Nov 2015 19:29:34 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201511081929.tA8JTY0P073544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sun, 8 Nov 2015 19:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290555 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 19:29:36 -0000 Author: dumbbell Date: Sun Nov 8 19:29:34 2015 New Revision: 290555 URL: https://svnweb.freebsd.org/changeset/base/290555 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 months Modified: head/sys/dev/drm2/i915/intel_fb.c Modified: head/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- head/sys/dev/drm2/i915/intel_fb.c Sun Nov 8 19:08:38 2015 (r290554) +++ head/sys/dev/drm2/i915/intel_fb.c Sun Nov 8 19:29:34 2015 (r290555) @@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include static int intelfb_create(struct intel_fbdev *ifbdev, struct drm_fb_helper_surface_size *sizes) @@ -45,7 +45,7 @@ static int intelfb_create(struct intel_f #endif struct fb_info *info; struct drm_framebuffer *fb; - struct drm_mode_fb_cmd2 mode_cmd; + struct drm_mode_fb_cmd2 mode_cmd = {}; struct drm_i915_gem_object *obj; int size, ret; @@ -57,7 +57,7 @@ static int intelfb_create(struct intel_f mode_cmd.height = sizes->surface_height; mode_cmd.pitches[0] = roundup2(mode_cmd.width * ((sizes->surface_bpp + 7) / - 8), 64); + 8), 64); mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth); @@ -143,6 +143,7 @@ static int intelfb_create(struct intel_f drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ + DRM_DEBUG_KMS("allocated %dx%d (s %dbits) fb: 0x%08x, bo %p\n", fb->width, fb->height, fb->depth, obj->gtt_offset, obj); @@ -222,8 +223,7 @@ int intel_fbdev_init(struct drm_device * drm_i915_private_t *dev_priv = dev->dev_private; int ret; - ifbdev = malloc(sizeof(struct intel_fbdev), DRM_MEM_KMS, - M_WAITOK | M_ZERO); + ifbdev = malloc(sizeof(struct intel_fbdev), DRM_MEM_KMS, M_WAITOK | M_ZERO); dev_priv->fbdev = ifbdev; ifbdev->helper.funcs = &intel_fb_helper_funcs; From owner-svn-src-all@freebsd.org Sun Nov 8 20:09:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 123A9A29D4C; Sun, 8 Nov 2015 20:09:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 D2B5411E9; Sun, 8 Nov 2015 20:09:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodd200 with SMTP id d200so168016382iod.0; Sun, 08 Nov 2015 12:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3teD431DYmONPCZCcP+tfWPe+H6aTa3qYcjktDzZjAU=; b=o+48pHfvf+z+P85z1d2jEevo/Dca8ZWPHwX/Cp48xvNqmdkcUL8xor9v++NlEr1USM EN+46/4Gx+gfnYxEtOb2HMrTqRxbur18NbxDyu7Qr9eMsMU37YUsbC4vw2XgKOYffQLc 6zkv4ueT9nna2L3sisQ0FPY9wxi48lN7+SyuffsKBFtCfMfRBAm1XU5XyYWR4tM1xTXc 7xdf3Sy0l06mx7oR2OFTjswwoUwNHSDtrybVWd0suLu3Eb0583BiB/nQH4ifGtTB1k+u Y25AWqopJgYRqUWE/C8RAP+mHtKjic1vDIhl2PsbzHqHzFbbG7lG3pHfFjI27xkDjLT7 3I5Q== MIME-Version: 1.0 X-Received: by 10.107.46.142 with SMTP id u14mr22921217iou.165.1447013385171; Sun, 08 Nov 2015 12:09:45 -0800 (PST) Received: by 10.36.217.196 with HTTP; Sun, 8 Nov 2015 12:09:45 -0800 (PST) In-Reply-To: <201511072031.tA7KVOYe071747@repo.freebsd.org> References: <201511072031.tA7KVOYe071747@repo.freebsd.org> Date: Sun, 8 Nov 2015 12:09:45 -0800 Message-ID: Subject: Re: svn commit: r290512 - head/usr.bin/localedef From: Adrian Chadd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 20:09:46 -0000 hiya, not enough! On 7 November 2015 at 12:31, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Nov 7 20:31:23 2015 > New Revision: 290512 > URL: https://svnweb.freebsd.org/changeset/base/290512 > > Log: > Bump warning level > > Modified: > head/usr.bin/localedef/Makefile > > Modified: head/usr.bin/localedef/Makefile > ============================================================================== > --- head/usr.bin/localedef/Makefile Sat Nov 7 20:29:23 2015 (r290511) > +++ head/usr.bin/localedef/Makefile Sat Nov 7 20:31:23 2015 (r290512) > @@ -13,7 +13,7 @@ SRCS= charmap.c \ > time.c \ > wide.c > > -WARNS= 3 > +WARNS= 5 > ${SRCS:M*.c}: parser.h > parser.h: parser.y > > From owner-svn-src-all@freebsd.org Sun Nov 8 20:56:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7467A298E5; Sun, 8 Nov 2015 20:56:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88C9F1AFA; Sun, 8 Nov 2015 20:56:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8Ku4cd099357; Sun, 8 Nov 2015 20:56:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8Ku4QW099356; Sun, 8 Nov 2015 20:56:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201511082056.tA8Ku4QW099356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Nov 2015 20:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290556 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 20:56:05 -0000 Author: emaste Date: Sun Nov 8 20:56:04 2015 New Revision: 290556 URL: https://svnweb.freebsd.org/changeset/base/290556 Log: arm64: build usr.sbin/acpi subdirectory The arm64 platform will in general use ACPI so we want these tools built there. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/Makefile.arm64 Modified: head/usr.sbin/Makefile.arm64 ============================================================================== --- head/usr.sbin/Makefile.arm64 Sun Nov 8 19:29:34 2015 (r290555) +++ head/usr.sbin/Makefile.arm64 Sun Nov 8 20:56:04 2015 (r290556) @@ -1,3 +1,6 @@ # $FreeBSD$ +.if ${MK_ACPI} != "no" +SUBDIR+= acpi +.endif SUBDIR+= ofwdump From owner-svn-src-all@freebsd.org Sun Nov 8 21:06:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA41A29B86; Sun, 8 Nov 2015 21:06:52 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D35D1FE2; Sun, 8 Nov 2015 21:06:52 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8L6pR6002498; Sun, 8 Nov 2015 21:06:51 GMT (envelope-from andreast@FreeBSD.org) Received: (from andreast@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8L6pYw002497; Sun, 8 Nov 2015 21:06:51 GMT (envelope-from andreast@FreeBSD.org) Message-Id: <201511082106.tA8L6pYw002497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andreast set sender to andreast@FreeBSD.org using -f From: Andreas Tobler Date: Sun, 8 Nov 2015 21:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290557 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:06:53 -0000 Author: andreast Date: Sun Nov 8 21:06:51 2015 New Revision: 290557 URL: https://svnweb.freebsd.org/changeset/base/290557 Log: Improve r290373, do a runtime check rather than a compile time switch. I learned that the Power8 and the PS3 have a mix of OFW and FDT. Both have AIM defined. But currently they are not affected. They have no I2C devices under OFW. This version was tested on a Quad G5 and build tested for armv6*. Discussed with nwhitehorn@ Reviewed by: ian@ Modified: head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Sun Nov 8 20:56:04 2015 (r290556) +++ head/sys/dev/ofw/ofw_iicbus.c Sun Nov 8 21:06:51 2015 (r290557) @@ -101,9 +101,13 @@ ofw_iicbus_attach(device_t dev) { struct iicbus_softc *sc = IICBUS_SOFTC(dev); struct ofw_iicbus_devinfo *dinfo; - phandle_t child, node; + phandle_t child, node, root; pcell_t freq, paddr; device_t childdev; + ssize_t compatlen; + char compat[255]; + char *curstr; + u_int iic_addr_8bit = 0; sc->dev = dev; mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); @@ -125,6 +129,21 @@ ofw_iicbus_attach(device_t dev) bus_enumerate_hinted_children(dev); /* + * Check if we're running on a PowerMac, needed for the I2C + * address below. + */ + root = OF_peer(0); + compatlen = OF_getprop(root, "compatible", compat, + sizeof(compat)); + if (compatlen != -1) { + for (curstr = compat; curstr < compat + compatlen; + curstr += strlen(curstr) + 1) { + if (strncmp(curstr, "MacRISC", 7) == 0) + iic_addr_8bit = 1; + } + } + + /* * Attach those children represented in the device tree. */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { @@ -153,11 +172,11 @@ ofw_iicbus_attach(device_t dev) * Linux FDT data contains 7-bit values, so shift them up to * 8-bit format. */ -#ifdef AIM - dinfo->opd_dinfo.addr = paddr; -#else - dinfo->opd_dinfo.addr = paddr << 1; -#endif + if (iic_addr_8bit) + dinfo->opd_dinfo.addr = paddr; + else + dinfo->opd_dinfo.addr = paddr << 1; + if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != 0) { free(dinfo, M_DEVBUF); From owner-svn-src-all@freebsd.org Sun Nov 8 21:08:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62CBAA29C1D; Sun, 8 Nov 2015 21:08:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAC51191; Sun, 8 Nov 2015 21:08:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8L8VCt002593; Sun, 8 Nov 2015 21:08:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8L8VAf002592; Sun, 8 Nov 2015 21:08:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201511082108.tA8L8VAf002592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Nov 2015 21:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290558 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:08:32 -0000 Author: emaste Date: Sun Nov 8 21:08:31 2015 New Revision: 290558 URL: https://svnweb.freebsd.org/changeset/base/290558 Log: Sync arm64 GENERIC whitespace/comments with amd64 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Nov 8 21:06:51 2015 (r290557) +++ head/sys/arm64/conf/GENERIC Sun Nov 8 21:08:31 2015 (r290558) @@ -28,7 +28,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -options IPSEC # IP (v4/v6) security +options IPSEC # IP (v4/v6) security options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem @@ -38,8 +38,8 @@ options UFS_DIRHASH # Improve performa options UFS_GJOURNAL # Enable gjournal-based UFS journaling options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device -options NFSCL # New Network Filesystem Client -options NFSD # New Network Filesystem Server +options NFSCL # Network Filesystem Client +options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem @@ -95,8 +95,8 @@ device virtio_blk device vtnet # Bus drivers -options PCI_IOV device pci +options PCI_IOV # PCI SR-IOV support # Ethernet NICs device vnic # Cavium ThunderX NIC From owner-svn-src-all@freebsd.org Sun Nov 8 21:22:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14373A29139; Sun, 8 Nov 2015 21:22:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE28D1D10; Sun, 8 Nov 2015 21:22:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8LMOMq007938; Sun, 8 Nov 2015 21:22:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8LMOnF007936; Sun, 8 Nov 2015 21:22:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511082122.tA8LMOnF007936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Nov 2015 21:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290559 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:22:26 -0000 Author: bapt Date: Sun Nov 8 21:22:24 2015 New Revision: 290559 URL: https://svnweb.freebsd.org/changeset/base/290559 Log: Eliminate some gcc pragmas Modified: head/usr.bin/localedef/collate.c head/usr.bin/localedef/wide.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Sun Nov 8 21:08:31 2015 (r290558) +++ head/usr.bin/localedef/collate.c Sun Nov 8 21:22:24 2015 (r290559) @@ -435,24 +435,19 @@ subst_compare(const void *n1, const void RB_GENERATE_STATIC(substs, subst, entry, subst_compare); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - static int subst_compare_ref(const void *n1, const void *n2) { - int32_t *c1 = ((subst_t *)n1)->ref; - int32_t *c2 = ((subst_t *)n2)->ref; + const wchar_t *c1 = ((const subst_t *)n1)->ref; + const wchar_t *c2 = ((const subst_t *)n2)->ref; int rv; - rv = wcscmp((wchar_t *)c1, (wchar_t *)c2); + rv = wcscmp(c1, c2); return ((rv < 0) ? -1 : (rv > 0) ? 1 : 0); } RB_GENERATE_STATIC(substs_ref, subst, entry_ref, subst_compare_ref); -#pragma GCC diagnostic pop - void init_collate(void) { Modified: head/usr.bin/localedef/wide.c ============================================================================== --- head/usr.bin/localedef/wide.c Sun Nov 8 21:08:31 2015 (r290558) +++ head/usr.bin/localedef/wide.c Sun Nov 8 21:22:24 2015 (r290559) @@ -310,15 +310,12 @@ tomb_utf8(char *mb, wchar_t wc) * 0x8000 - 0xffff - 2 byte encoding */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - static int towide_dbcs(wchar_t *wc, const char *mb, unsigned n) { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c & 0x80) == 0) { /* 7-bit */ @@ -408,7 +405,7 @@ towide_gb18030(wchar_t *wc, const char * { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c & 0x80) == 0) { /* 7-bit */ @@ -451,7 +448,7 @@ towide_mskanji(wchar_t *wc, const char * { wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; if ((c < 0x80) || ((c > 0xa0) && (c < 0xe0))) { /* 7-bit */ @@ -487,7 +484,7 @@ towide_euc_impl(wchar_t *wc, const char int width = 2; wchar_t c; - c = *(uint8_t *)mb; + c = *(const uint8_t *)mb; /* * All variations of EUC encode 7-bit ASCII as one byte, and use @@ -528,8 +525,6 @@ towide_euc_impl(wchar_t *wc, const char return (width); } -#pragma GCC diagnostic pop - /* * EUC-CN encodes as follows: * From owner-svn-src-all@freebsd.org Sun Nov 8 21:38:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23FC5A29549; Sun, 8 Nov 2015 21:38:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6AA714E2; Sun, 8 Nov 2015 21:38:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8LckqW011016; Sun, 8 Nov 2015 21:38:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8Lck5m011015; Sun, 8 Nov 2015 21:38:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511082138.tA8Lck5m011015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 21:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290560 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:38:48 -0000 Author: ngie Date: Sun Nov 8 21:38:46 2015 New Revision: 290560 URL: https://svnweb.freebsd.org/changeset/base/290560 Log: Convert print_positional_test over to ATF Somehow missed in r290537 X-MFC with: r290537 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/print_positional_test.c Modified: head/lib/libc/tests/stdio/print_positional_test.c ============================================================================== --- head/lib/libc/tests/stdio/print_positional_test.c Sun Nov 8 21:22:24 2015 (r290559) +++ head/lib/libc/tests/stdio/print_positional_test.c Sun Nov 8 21:38:46 2015 (r290560) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + const char correct[] = "|xx 01 02 03 04\n" "|xx 05 06 07 08\n" @@ -53,15 +55,13 @@ const char correct[] = const char correct2[] = "b bs BSD"; +static char buf[1024]; +static wchar_t wbuf1[1024], wbuf2[1024]; +static const char *temp; -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(positional_normal); +ATF_TC_BODY(positional_normal, tc) { - char buf[1024]; - wchar_t wbuf1[1024], wbuf2[1024]; - const char *temp; - - printf("1..4\n"); /* Test positional arguments */ snprintf(buf, sizeof buf, @@ -86,8 +86,13 @@ main(int argc, char *argv[]) "37", "38", "39", "40", "41", "42", "43", "44", 45, -1L, 1LL, -1, 1LL ); - printf("%sok 1 - print-positional normal\n", - strcmp(buf, correct) == 0 ? "" : "not "); + ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, + "buffers didn't match"); +} + +ATF_TC_WITHOUT_HEAD(positional_wide); +ATF_TC_BODY(positional_wide, tc) +{ swprintf(wbuf1, sizeof wbuf1, L"|xx %1$s %2$s %3$s %4$s\n" @@ -113,20 +118,39 @@ main(int argc, char *argv[]) ); temp = correct; mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); - printf("%sok 2 - print-positional wide\n", - wcscmp(wbuf1, wbuf2) == 0 ? "" : "not "); + ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, + "buffers didn't match"); +} + +ATF_TC_WITHOUT_HEAD(positional_precision); +ATF_TC_BODY(positional_precision, tc) +{ snprintf(buf, sizeof buf, "%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); - printf("%sok 3 - print-positional precision\n", - strcmp(buf, correct2) == 0 ? "" : "not "); + ATF_REQUIRE_MSG(strcmp(buf, correct2) == 0, + "buffers didn't match"); +} + +ATF_TC_WITHOUT_HEAD(positional_precision_wide); +ATF_TC_BODY(positional_precision_wide, tc) +{ swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); - printf("%sok 4 - print-positional precision wide\n", - wcscmp(wbuf1, wbuf2) == 0 ? "" : "not "); + ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, + "buffers didn't match"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, positional_normal); + ATF_TP_ADD_TC(tp, positional_wide); + ATF_TP_ADD_TC(tp, positional_precision); + ATF_TP_ADD_TC(tp, positional_precision_wide); - exit(0); + return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Nov 8 21:41:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6926A2976E; Sun, 8 Nov 2015 21:41:35 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADA51891; Sun, 8 Nov 2015 21:41:35 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmww144 with SMTP id w144so62009676wmw.1; Sun, 08 Nov 2015 13:41:33 -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=530yDF425yp21tDD+2Auw4B8Qs2TUp1FGoi4nJBNQ90=; b=LpR0XL6x3i8scERKN/aZOHKuFEphzSE4sxNDaQFgV7vWm0YcIK+A6Ns6UAeUPfgXu2 kiCWqTQlVwobuENVDwG8RD+Cotkc1Bevt2fhO0s/r0mVo5hViemD+X3hbYmbjYpRFpzu xFcr2MKi0srLFdsjs6yY4Sj7kUGh8RSGrfFQVp3VivXG/T1aeSdP3FT2DxiODWXw2FoM BETjxMD9O36Tx/bmUPNWD5RBG3ROWBTIwmd6O77rYf8REDXYLWl9CZj633f/UHA9dcLP WhXX6YZrP8WxASYWu3r14X/PI1iw9cJuBWWAw87vmWDNYtnWvdjYouWvhWUsodi4th5V G9cQ== X-Received: by 10.28.12.11 with SMTP id 11mr20625420wmm.99.1447018893860; Sun, 08 Nov 2015 13:41:33 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id lf10sm11848792wjb.23.2015.11.08.13.41.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 13:41:33 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 8 Nov 2015 22:41:31 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290494 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter contrib/netbsd-tests/l... Message-ID: <20151108214131.GB10134@ivaldir.etoilebsd.net> References: <201511071243.tA7Chaai034980@repo.freebsd.org> <563FAAD4.4070403@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <563FAAD4.4070403@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:41:35 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2015 at 11:04:36PM +0300, Andrey Chernov wrote: > On 07.11.2015 15:43, Baptiste Daroussin wrote: > > Log: > > Improve collation string and locales support > ... > > Deleted: > > head/lib/libc/locale/ascii.c >=20 > BTW, why this one is deleted (along with ASCII locales)? It serves its > job as "strict ASCII checker" right. >=20 The ASCII locales are still there, just using the same rules for everything= as their unicode counter part except of course for LC_CTYPE. There was no left usage for that code so I removed it. If there are strong opinions for bringing it back, I can do it. Best regards, Bapt --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlY/wYsACgkQ8kTtMUmk6EzDbQCgwRIwWlI8HZ3P4dr5wQVEYV7B 6JMAnisVzFqKxEYgOQ32+yoIX2Tgk9eG =64yo -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip-- From owner-svn-src-all@freebsd.org Sun Nov 8 21:57:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 644DFA29D38; Sun, 8 Nov 2015 21:57:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12963126E; Sun, 8 Nov 2015 21:57:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8Lva1k016767; Sun, 8 Nov 2015 21:57:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8LvZNQ016763; Sun, 8 Nov 2015 21:57:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511082157.tA8LvZNQ016763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 21:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290561 - head/lib/libc/tests/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 21:57:37 -0000 Author: ngie Date: Sun Nov 8 21:57:35 2015 New Revision: 290561 URL: https://svnweb.freebsd.org/changeset/base/290561 Log: Delete leftover printfs from when these were TAP tests MFC after: 1 week X-MFC with: r290532 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/locale/mblen_test.c head/lib/libc/tests/locale/mbrtoc16_test.c head/lib/libc/tests/locale/mbrtowc_test.c head/lib/libc/tests/locale/mbsrtowcs_test.c Modified: head/lib/libc/tests/locale/mblen_test.c ============================================================================== --- head/lib/libc/tests/locale/mblen_test.c Sun Nov 8 21:38:46 2015 (r290560) +++ head/lib/libc/tests/locale/mblen_test.c Sun Nov 8 21:57:35 2015 (r290561) @@ -53,8 +53,6 @@ ATF_TC_BODY(mblen_test, tc) * C/POSIX locale. */ - printf("1..1\n"); - ATF_REQUIRE(MB_CUR_MAX == 1); /* No shift states in C locale. */ Modified: head/lib/libc/tests/locale/mbrtoc16_test.c ============================================================================== --- head/lib/libc/tests/locale/mbrtoc16_test.c Sun Nov 8 21:38:46 2015 (r290560) +++ head/lib/libc/tests/locale/mbrtoc16_test.c Sun Nov 8 21:57:35 2015 (r290561) @@ -53,8 +53,6 @@ ATF_TC_BODY(mbrtoc16_test, tc) * C/POSIX locale. */ - printf("1..1\n"); - /* Null wide character, internal state. */ ATF_REQUIRE(mbrtoc16(&c16, "", 1, NULL) == 0); ATF_REQUIRE(c16 == 0); Modified: head/lib/libc/tests/locale/mbrtowc_test.c ============================================================================== --- head/lib/libc/tests/locale/mbrtowc_test.c Sun Nov 8 21:38:46 2015 (r290560) +++ head/lib/libc/tests/locale/mbrtowc_test.c Sun Nov 8 21:57:35 2015 (r290561) @@ -57,8 +57,6 @@ ATF_TC_BODY(mbrtowc_test, tc) * C/POSIX locale. */ - printf("1..1\n"); - ATF_REQUIRE(MB_CUR_MAX == 1); /* Null wide character, internal state. */ Modified: head/lib/libc/tests/locale/mbsrtowcs_test.c ============================================================================== --- head/lib/libc/tests/locale/mbsrtowcs_test.c Sun Nov 8 21:38:46 2015 (r290560) +++ head/lib/libc/tests/locale/mbsrtowcs_test.c Sun Nov 8 21:57:35 2015 (r290561) @@ -57,8 +57,6 @@ ATF_TC_BODY(mbsrtowcs_test, tc) * C/POSIX locale. */ - printf("1..1\n"); - /* Simple null terminated string. */ memset(srcbuf, 0xcc, sizeof(srcbuf)); strcpy(srcbuf, "hello"); From owner-svn-src-all@freebsd.org Sun Nov 8 22:01:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1FA7A29EE7 for ; Sun, 8 Nov 2015 22:01:17 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (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 2F593160C for ; Sun, 8 Nov 2015 22:01:16 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfdo63 with SMTP id o63so485424lfd.2 for ; Sun, 08 Nov 2015 14:01:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=01ej0/aTOZaM0VCguIBjyH8KMPTl3VSTcwGrMS5ZYM0=; b=hMSPha8LWFDJbLeieW7P2gxoGywDvRIeSlSi3DRZidSKE28h6z3r+QZrNuiUU5ly1L 87/pEWhPrq4TbA8ZeTPDtU06+U1laQEmYcFR08mmeW1OI22GvKS34PQ1yohFMpUSaAP6 DdMSZI2VLOWPgo/XXYBOss8lDe1st5jefH7pF7wGucsaAoPg5MMHHoRccqLwJ4FhyyOW M2TW9qJ69NfEgciI5nv7HX0Cakqb+XuoBpGJyeQ+qGG76cwlPpB31Lyn+nrzuR2FteU7 YPuGo598sYucP2LeCKQjKaWouHyPOJaapu108MEzHMk/wGiy/5YSlqaUGnktUYL/F1+b ffsA== X-Gm-Message-State: ALoCoQlWiKWF9s/XzmW0GcWjAw6cLzR5Z+jHIyIv33CcLgDDIXJ69jCjWxLmIL60qPU8ntrQJbHf X-Received: by 10.25.24.193 with SMTP id 62mr5538884lfy.84.1447013077853; Sun, 08 Nov 2015 12:04:37 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id qh2sm1768095lbb.42.2015.11.08.12.04.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 12:04:36 -0800 (PST) Subject: Re: svn commit: r290494 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter contrib/netbsd-tests/l... To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511071243.tA7Chaai034980@repo.freebsd.org> From: Andrey Chernov Message-ID: <563FAAD4.4070403@freebsd.org> Date: Sun, 8 Nov 2015 23:04:36 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511071243.tA7Chaai034980@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 22:01:17 -0000 On 07.11.2015 15:43, Baptiste Daroussin wrote: > Log: > Improve collation string and locales support ... > Deleted: > head/lib/libc/locale/ascii.c BTW, why this one is deleted (along with ASCII locales)? It serves its job as "strict ASCII checker" right. -- http://ache.vniz.net/ From owner-svn-src-all@freebsd.org Sun Nov 8 22:23:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91E54A2962F; Sun, 8 Nov 2015 22:23:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41C3A141E; Sun, 8 Nov 2015 22:23:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8MNMAQ025263; Sun, 8 Nov 2015 22:23:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8MNMKd025259; Sun, 8 Nov 2015 22:23:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511082223.tA8MNMKd025259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Nov 2015 22:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290562 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 22:23:23 -0000 Author: bapt Date: Sun Nov 8 22:23:21 2015 New Revision: 290562 URL: https://svnweb.freebsd.org/changeset/base/290562 Log: lower again the warnings and remove the pragmas unsupported by gcc 4.2.1 Modified: head/usr.bin/localedef/Makefile head/usr.bin/localedef/monetary.c head/usr.bin/localedef/numeric.c head/usr.bin/localedef/time.c Modified: head/usr.bin/localedef/Makefile ============================================================================== --- head/usr.bin/localedef/Makefile Sun Nov 8 21:57:35 2015 (r290561) +++ head/usr.bin/localedef/Makefile Sun Nov 8 22:23:21 2015 (r290562) @@ -13,7 +13,7 @@ SRCS= charmap.c \ time.c \ wide.c -WARNS= 5 +WARNS= 3 ${SRCS:M*.c}: parser.h parser.h: parser.y Modified: head/usr.bin/localedef/monetary.c ============================================================================== --- head/usr.bin/localedef/monetary.c Sun Nov 8 21:57:35 2015 (r290561) +++ head/usr.bin/localedef/monetary.c Sun Nov 8 22:23:21 2015 (r290562) @@ -151,9 +151,6 @@ add_monetary_num(int n) } } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - void reset_monetary_group(void) { @@ -178,8 +175,6 @@ add_monetary_group(int n) mon.mon_grouping = s; } -#pragma GCC diagnostic pop - void dump_monetary(void) { Modified: head/usr.bin/localedef/numeric.c ============================================================================== --- head/usr.bin/localedef/numeric.c Sun Nov 8 21:57:35 2015 (r290561) +++ head/usr.bin/localedef/numeric.c Sun Nov 8 22:23:21 2015 (r290562) @@ -77,9 +77,6 @@ add_numeric_str(wchar_t *wcs) } } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - void reset_numeric_group(void) { @@ -104,8 +101,6 @@ add_numeric_group(int n) numeric.grouping = s; } -#pragma GCC diagnostic pop - void dump_numeric(void) { Modified: head/usr.bin/localedef/time.c ============================================================================== --- head/usr.bin/localedef/time.c Sun Nov 8 21:57:35 2015 (r290561) +++ head/usr.bin/localedef/time.c Sun Nov 8 22:23:21 2015 (r290562) @@ -187,9 +187,6 @@ check_time_list(void) fprintf(stderr,"too few items in list (%d)", last_kw); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - void reset_time_list(void) { @@ -228,8 +225,6 @@ reset_time_list(void) } } -#pragma GCC diagnostic pop - void dump_time(void) { From owner-svn-src-all@freebsd.org Sun Nov 8 22:23:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973FCA29639 for ; Sun, 8 Nov 2015 22:23:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4620E142B for ; Sun, 8 Nov 2015 22:23:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbblt2 with SMTP id lt2so68313562lbb.3 for ; Sun, 08 Nov 2015 14:23:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=RAxARwVRqvdoebVuuB4oUylw5j1de1HqnnZNwoVSaqY=; b=BUbbNuMnK/rsDBf1W83bK4MP3/mT+/j+XZAm15d8hDEnqjhaIRSE0J6h0GcVF6ZeNv fzOG3Vbgpe4UT8btQAWTvyZ7BzQz8LrjSj1CEY2+DCI2Xewz79tg/HF7OrmIeJpdxgpv IMh4kfNUoZV6txQ7HsGQkr7K9u7dnMQgFZepTVkEu2kA9X2qio2IL47Bl6gtU7PAXpKO 5Jrp5bfVqfnP1a6J4tUaIEpFSiEN9cMDi4Hpv+27m/JeoY1xlDQiJUpvgqSrmKhVaqWk f/Va5ZQPQjFsdidwKmiulfSo7CXQey3mebllWVP2gKmu/NnwSya9st1+iCAbzXBYoYJZ Z6HA== X-Gm-Message-State: ALoCoQkTUrEOr5zkStazdB7a7weL1GBVybYxw0lM1aeHlDk2ZMqlxoWGF5lysA378TxAnskf1i+M X-Received: by 10.112.219.197 with SMTP id pq5mr5605663lbc.73.1447021403018; Sun, 08 Nov 2015 14:23:23 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id k6sm1847110lbd.22.2015.11.08.14.23.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 14:23:22 -0800 (PST) Subject: Re: svn commit: r290494 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter contrib/netbsd-tests/l... To: Baptiste Daroussin References: <201511071243.tA7Chaai034980@repo.freebsd.org> <563FAAD4.4070403@freebsd.org> <20151108214131.GB10134@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <563FCB59.5030505@freebsd.org> Date: Mon, 9 Nov 2015 01:23:21 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151108214131.GB10134@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 22:23:25 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09.11.2015 0:41, Baptiste Daroussin wrote: >>> Deleted: head/lib/libc/locale/ascii.c >> >> BTW, why this one is deleted (along with ASCII locales)? It >> serves its job as "strict ASCII checker" right. >> > The ASCII locales are still there, just using the same rules for > everything as their unicode counter part except of course for > LC_CTYPE. > > There was no left usage for that code so I removed it. If there are > strong opinions for bringing it back, I can do it. ascii.c specifically test for bit8 and sets EILSEQ (unlike, say, ISO-8859-1 Unicode subset or C locale). IMHO it should be restored. - -- http://ache.vniz.net/ -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWP8tZAAoJEKUckv0MjfbK7KIIAMWRvRbZAA2hHAV2FBOoW5uh HmKI76M3drrx+em0gtreA3VaZ+kmNDax4u6yS9Wdfz3Ajhotyu0AGzvagX1e6bF4 TjCatprbXZZY/iAMqgvjXtsPCv6Mc62jHXfch+bG2alDhJRFChvNj6Dhg3tMvF5b WesMy+lKuna3cs5lmV6TbOmBWGivKcNwT+0S4Go3OMcuYxsVYKFwZZKABtpe9HQo VRdwU8cSwionUnQPgdrf6kLBlT+Ou6NGc6C4eV6TGxlHyDY/MdqgS0qzMEa5BoS4 rBtXYmeZEQ19vp6gJ4x4va6/4bZ3AUFXn6xFAKVEjeKMjLfOTUz0E5jr9WovRj4= =Hy7z -----END PGP SIGNATURE----- From owner-svn-src-all@freebsd.org Sun Nov 8 22:28:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F4BA297CF; Sun, 8 Nov 2015 22:28:14 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84E341873; Sun, 8 Nov 2015 22:28:14 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wiva10 with SMTP id a10so23564125wiv.0; Sun, 08 Nov 2015 14:28:13 -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=7OzlP3Sg+fWWFgezXN/VBokJW8xCocbC6AcCmmtLjeI=; b=ICMbyGx4wJbGeL/lGd2jkYLWOoyqbwTa4lCyNUCzm3zewcuGiqd/fkrCWzaYY3rcen piz0gnlHd4qWXwFnJPba8qMJbe7prO9gEhLeBciClN6GuoKn0JmbASFVO7U3IBXgpmrx bFjJ2S+aODFoPFOTLCeeIoxiw0QzQIn07zU+uL+a4+En5Hf3qS34TBCyIFwZMMW6rRkk MD6AXKxeHkHHYjiEHRrzHqU4AR/zgr71mHNYAmaaGpM8eZC7zTE6mGWOkjnhxAGMpByt Rn7d8ZliSyjV9H/wsZm2Drz8dhK4Dwc1i6bPGYQgaJjp4UURsrbVTpZt/rXLPIBZjWOn F73w== X-Received: by 10.194.239.104 with SMTP id vr8mr25350159wjc.64.1447021693105; Sun, 08 Nov 2015 14:28:13 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id jh4sm11975649wjb.33.2015.11.08.14.28.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 14:28:12 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 8 Nov 2015 23:28:10 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r290494 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter contrib/netbsd-tests/l... Message-ID: <20151108222810.GE10134@ivaldir.etoilebsd.net> References: <201511071243.tA7Chaai034980@repo.freebsd.org> <563FAAD4.4070403@freebsd.org> <20151108214131.GB10134@ivaldir.etoilebsd.net> <563FCB59.5030505@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5xSkJheCpeK0RUEJ" Content-Disposition: inline In-Reply-To: <563FCB59.5030505@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 22:28:15 -0000 --5xSkJheCpeK0RUEJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 09, 2015 at 01:23:21AM +0300, Andrey Chernov wrote: > On 09.11.2015 0:41, Baptiste Daroussin wrote: > >>> Deleted: head/lib/libc/locale/ascii.c > >>=20 > >> BTW, why this one is deleted (along with ASCII locales)? It > >> serves its job as "strict ASCII checker" right. > >>=20 > > The ASCII locales are still there, just using the same rules for > > everything as their unicode counter part except of course for > > LC_CTYPE. > >=20 > > There was no left usage for that code so I removed it. If there are > > strong opinions for bringing it back, I can do it. >=20 > ascii.c specifically test for bit8 and sets EILSEQ (unlike, say, > ISO-8859-1 Unicode subset or C locale). IMHO it should be restored. >=20 hum, ok make sense. I'll make some regression tests and bring it back as so= on as I can. Best regards, Bapt --5xSkJheCpeK0RUEJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlY/zHoACgkQ8kTtMUmk6Ez4XACcD3yYTrayuX5ahCXLh7K/FlkJ OfMAnil7tqNLGFm3revdyVvHUl0vcL9x =Ud4s -----END PGP SIGNATURE----- --5xSkJheCpeK0RUEJ-- From owner-svn-src-all@freebsd.org Sun Nov 8 22:28:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0D39A29811; Sun, 8 Nov 2015 22:28:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE8818AC; Sun, 8 Nov 2015 22:28:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacdm15 with SMTP id dm15so153432722pac.3; Sun, 08 Nov 2015 14:28:18 -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 :content-transfer-encoding:message-id:references:to; bh=wMRmOXK3VgIuXywo22b7HYMZMjRvLrPIkhv0nf0UTpQ=; b=nk3Teq505Nm/b+Ocd57IN7J1dRWTeHCSrtUx/GDo17altrvMnxPzBEcLL1/yaKY/BN wIZOOJ10kXHwwIXRvCt7Pl+/7zNBLc4UtolTq8LCL+ihGELtd+s/DmPfrZriFmH7BRRc vlQkWa0RtxYkmD4dvI4j7/XU8hVg5lT1qEPKT7SDqQvpeddnzYBR19ZlHHAEX5Vq9Atr JxzmwlBWC+RIvB1qo6wd37Ttgm5UZh+xra+jZK1CMpHwYeh0iPwDNH0bbd+j+l+Mn2MS e3tIMiwMa1mhXq6YHwRfjbprCe5KdJ1XSABE84uJ2XJEFMFjAtv7T11rrcY1PAs9T937 pG8Q== X-Received: by 10.68.230.103 with SMTP id sx7mr35871862pbc.146.1447021698011; Sun, 08 Nov 2015 14:28:18 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id d2sm12396374pat.24.2015.11.08.14.28.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Nov 2015 14:28:17 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290562 - head/usr.bin/localedef From: NGie Cooper In-Reply-To: <201511082223.tA8MNMKd025259@repo.freebsd.org> Date: Sun, 8 Nov 2015 14:28:16 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4EF2AE26-DF25-43D0-8CE2-720975546CD3@gmail.com> References: <201511082223.tA8MNMKd025259@repo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 22:28:18 -0000 > On Nov 8, 2015, at 14:23, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sun Nov 8 22:23:21 2015 > New Revision: 290562 > URL: https://svnweb.freebsd.org/changeset/base/290562 >=20 > Log: > lower again the warnings and remove the pragmas unsupported by gcc = 4.2.1 Thank you. Hopefully this will unbreak mips and partially unbreak = sparc64 (sparc64 is still hung up on a mismatched definition between = strsignal in string.h and contrib/gcc).= From owner-svn-src-all@freebsd.org Sun Nov 8 23:06:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB841A2A0F4; Sun, 8 Nov 2015 23:06:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB381D38; Sun, 8 Nov 2015 23:06:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8N6eG5036893; Sun, 8 Nov 2015 23:06:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8N6eF6036888; Sun, 8 Nov 2015 23:06:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511082306.tA8N6eF6036888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 23:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290563 - in head: lib/libc/tests/net tools/regression/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 23:06:42 -0000 Author: ngie Date: Sun Nov 8 23:06:40 2015 New Revision: 290563 URL: https://svnweb.freebsd.org/changeset/base/290563 Log: Integrate tools/regression/lib/libc/net into the FreeBSD test suite as lib/libc/tests/net Also, fix eui64_aton_test:test_str(..). The test was comparing the result of eui64_aton to a pointer of the expected result. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/net/ether_test.c - copied, changed from r290562, head/tools/regression/lib/libc/net/test-ether.c head/lib/libc/tests/net/eui64_aton_test.c - copied, changed from r290562, head/tools/regression/lib/libc/net/test-eui64_aton.c head/lib/libc/tests/net/eui64_ntoa_test.c - copied, changed from r290562, head/tools/regression/lib/libc/net/test-eui64_ntoa.c head/lib/libc/tests/net/test-eui64.h - copied unchanged from r290562, head/tools/regression/lib/libc/net/test-eui64.h Deleted: head/tools/regression/lib/libc/net/ Modified: head/lib/libc/tests/net/Makefile Modified: head/lib/libc/tests/net/Makefile ============================================================================== --- head/lib/libc/tests/net/Makefile Sun Nov 8 22:23:21 2015 (r290562) +++ head/lib/libc/tests/net/Makefile Sun Nov 8 23:06:40 2015 (r290563) @@ -1,22 +1,23 @@ # $FreeBSD$ -.include +ATF_TESTS_C+= ether_test +ATF_TESTS_C+= eui64_aton_test +ATF_TESTS_C+= eui64_ntoa_test -BINDIR= ${TESTSDIR} +CFLAGS+= -I${.CURDIR} -NETBSD_ATF_TESTS_C= getprotoent_test +NETBSD_ATF_TESTS_C+= getprotoent_test NETBSD_ATF_TESTS_C+= ether_aton_test -SRCS.t_ether_aton= aton_ether_subr.c t_ether_aton.c - -aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c - ${HOST_SH} ${.ALLSRC} ${.TARGET} +SRCS.ether_aton_test= aton_ether_subr.c t_ether_aton.c # TODO: hostent_test NETBSD_ATF_TESTS_SH= nsdispatch_test NETBSD_ATF_TESTS_SH+= protoent_test NETBSD_ATF_TESTS_SH+= servent_test +BINDIR= ${TESTSDIR} + PROGS= h_nsd_recurse PROGS+= h_protoent PROGS+= h_servent @@ -26,12 +27,14 @@ DPADD.h_nsd_recurse+= ${LIBPTHREAD} LDADD.h_nsd_recurse+= -lpthread CLEANFILES+= aton_ether_subr.c +aton_ether_subr.c: gen_ether_subr ${SRCTOP}/sys/net/if_ethersubr.c + ${HOST_SH} ${.ALLSRC} ${.TARGET} .include "../Makefile.netbsd-tests" # TODO: the testcases needs to be ported to FreeBSD #TESTS_SUBDIRS= getaddrinfo -FILES= hosts +FILES+= hosts FILES+= resolv.conf .include Copied and modified: head/lib/libc/tests/net/ether_test.c (from r290562, head/tools/regression/lib/libc/net/test-ether.c) ============================================================================== --- head/tools/regression/lib/libc/net/test-ether.c Sun Nov 8 22:23:21 2015 (r290562, copy source) +++ head/lib/libc/tests/net/ether_test.c Sun Nov 8 23:06:40 2015 (r290563) @@ -30,206 +30,163 @@ #include +#include #include #include -static int testnum; +#include -#define OK() do { \ - printf("ok %d %s\n", testnum, __func__); \ - return; \ -} while (0) - -#define NOTOK(why) do { \ - printf("not ok %d %s # %s\n", testnum, __func__, why); \ - return; \ -} while (0) - -#define TODO() NOTOK("TODO") - -static const char *ether_line_string = - "01:23:45:67:89:ab ether_line_hostname"; -static const char *ether_line_hostname = "ether_line_hostname"; +static const char *ether_line_string = "01:23:45:67:89:ab ether_line_hostname"; +static const char *ether_line_hostname = "ether_line_hostname"; static const struct ether_addr ether_line_addr = { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } }; -static void -test_ether_line(void) +ATF_TC_WITHOUT_HEAD(ether_line); +ATF_TC_BODY(ether_line, tc) { struct ether_addr e; char hostname[256]; - testnum++; - if (ether_line(ether_line_string, &e, hostname) != 0) - NOTOK("returned error"); - if (bcmp(&e, ðer_line_addr, ETHER_ADDR_LEN) != 0) - NOTOK("bad address"); - if (strcmp(hostname, ether_line_hostname) != 0) { - printf("hostname: %s\n", hostname); - NOTOK("bad hostname"); - } - OK(); + ATF_REQUIRE_MSG(ether_line(ether_line_string, &e, hostname) == 0, + "ether_line failed; errno=%d", errno); + ATF_REQUIRE_MSG(bcmp(&e, ðer_line_addr, ETHER_ADDR_LEN) == 0, + "bad address"); + ATF_REQUIRE_MSG(strcmp(hostname, ether_line_hostname) == 0, + "bad hostname"); } -static const char *ether_line_bad_1_string = "x"; +static const char *ether_line_bad_1_string = "x"; -static void -test_ether_line_bad_1(void) +ATF_TC_WITHOUT_HEAD(ether_line_bad_1); +ATF_TC_BODY(ether_line_bad_1, tc) { struct ether_addr e; char hostname[256]; - testnum++; - if (ether_line(ether_line_bad_1_string, &e, hostname) == 0) - NOTOK("returned success"); - OK(); + ATF_REQUIRE_MSG(ether_line(ether_line_bad_1_string, &e, hostname) != 0, + "ether_line succeeded unexpectedly", errno); } -static const char *ether_line_bad_2_string = "x x"; +static const char *ether_line_bad_2_string = "x x"; -static void -test_ether_line_bad_2(void) +ATF_TC_WITHOUT_HEAD(ether_line_bad_2); +ATF_TC_BODY(ether_line_bad_2, tc) { struct ether_addr e; char hostname[256]; - testnum++; - if (ether_line(ether_line_bad_2_string, &e, hostname) == 0) - NOTOK("returned success"); - OK(); + ATF_REQUIRE_MSG(ether_line(ether_line_bad_2_string, &e, hostname) != 0, + "ether_line succeeded unexpectedly", errno); } -static const char *ether_aton_string = "01:23:45:67:89:ab"; +static const char *ether_aton_string = "01:23:45:67:89:ab"; static const struct ether_addr ether_aton_addr = { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } }; -static void -test_ether_aton_r(void) +ATF_TC_WITHOUT_HEAD(ether_aton_r); +ATF_TC_BODY(ether_aton_r, tc) { struct ether_addr e, *ep; - testnum++; ep = ether_aton_r(ether_aton_string, &e); - if (ep == NULL) - NOTOK("returned NULL"); - if (ep != &e) - NOTOK("returned different pointer"); - if (bcmp(&e, ðer_aton_addr, ETHER_ADDR_LEN) != 0) - NOTOK("bad address"); - OK(); + + ATF_REQUIRE_MSG(ep != NULL, "ether_aton_r failed", errno); + ATF_REQUIRE_MSG(ep == &e, + "ether_aton_r returned different pointers; %p != %p", ep, &e); } static const char *ether_aton_bad_string = "x"; -static void -test_ether_aton_r_bad(void) +ATF_TC_WITHOUT_HEAD(ether_aton_r_bad); +ATF_TC_BODY(ether_aton_r_bad, tc) { struct ether_addr e, *ep; - testnum++; ep = ether_aton_r(ether_aton_bad_string, &e); - if (ep == &e) - NOTOK("returned success"); - if (ep != NULL) - NOTOK("returned different pointer"); - OK(); + ATF_REQUIRE_MSG(ep == NULL, "ether_aton_r succeeded unexpectedly"); } -static void -test_ether_aton(void) +ATF_TC_WITHOUT_HEAD(ether_aton); +ATF_TC_BODY(ether_aton, tc) { struct ether_addr *ep; - testnum++; ep = ether_aton(ether_aton_string); - if (ep == NULL) - NOTOK("returned NULL"); - if (bcmp(ep, ðer_aton_addr, ETHER_ADDR_LEN) != 0) - NOTOK("bad address"); - OK(); + ATF_REQUIRE_MSG(ep != NULL, "ether_aton failed"); + ATF_REQUIRE_MSG(bcmp(ep, ðer_aton_addr, ETHER_ADDR_LEN) == 0, + "bad address"); } -static void -test_ether_aton_bad(void) +ATF_TC_WITHOUT_HEAD(ether_aton_bad); +ATF_TC_BODY(ether_aton_bad, tc) { struct ether_addr *ep; - testnum++; ep = ether_aton(ether_aton_bad_string); - if (ep != NULL) - NOTOK("returned success"); - OK(); + ATF_REQUIRE_MSG(ep == NULL, "ether_aton succeeded unexpectedly"); } -static const char *ether_ntoa_string = "01:23:45:67:89:ab"; +static const char *ether_ntoa_string = "01:23:45:67:89:ab"; static const struct ether_addr ether_ntoa_addr = { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } }; -static void -test_ether_ntoa_r(void) +ATF_TC_WITHOUT_HEAD(ether_ntoa_r); +ATF_TC_BODY(ether_ntoa_r, tc) { char buf[256], *cp; - testnum++; cp = ether_ntoa_r(ðer_ntoa_addr, buf); - if (cp == NULL) - NOTOK("returned NULL"); - if (cp != buf) - NOTOK("returned different pointer"); - if (strcmp(cp, ether_ntoa_string) != 0) - NOTOK("bad string"); - OK(); + ATF_REQUIRE_MSG(cp != NULL, "ether_ntoa_r failed"); + ATF_REQUIRE_MSG(cp == buf, + "ether_ntoa_r returned a different pointer; %p != %p", cp, buf); + ATF_REQUIRE_MSG(strcmp(cp, ether_ntoa_string) == 0, + "strings did not match (`%s` != `%s`)", cp, ether_ntoa_string); } -static void -test_ether_ntoa(void) +ATF_TC_WITHOUT_HEAD(ether_ntoa); +ATF_TC_BODY(ether_ntoa, tc) { char *cp; - testnum++; cp = ether_ntoa(ðer_ntoa_addr); - if (cp == NULL) - NOTOK("returned NULL"); - if (strcmp(cp, ether_ntoa_string) != 0) - NOTOK("bad string"); - OK(); + ATF_REQUIRE_MSG(cp != NULL, "ether_ntoa failed"); + ATF_REQUIRE_MSG(strcmp(cp, ether_ntoa_string) == 0, + "strings did not match (`%s` != `%s`)", cp, ether_ntoa_string); } -static void -test_ether_ntohost(void) +#if 0 +ATF_TC_WITHOUT_HEAD(ether_ntohost); +ATF_TC_BODY(ether_ntohost, tc) { - testnum++; - TODO(); } -static void -test_ether_hostton(void) +ATF_TC_WITHOUT_HEAD(ether_hostton); +ATF_TC_BODY(ether_hostton, tc) { - testnum++; - TODO(); } +#endif -int -main(int argc, char *argv[]) +ATF_TP_ADD_TCS(tp) { - printf("1..11\n"); + ATF_TP_ADD_TC(tp, ether_line); + ATF_TP_ADD_TC(tp, ether_line_bad_1); + ATF_TP_ADD_TC(tp, ether_line_bad_2); + ATF_TP_ADD_TC(tp, ether_aton_r); + ATF_TP_ADD_TC(tp, ether_aton_r_bad); + ATF_TP_ADD_TC(tp, ether_aton); + ATF_TP_ADD_TC(tp, ether_aton_bad); + ATF_TP_ADD_TC(tp, ether_ntoa_r); + ATF_TP_ADD_TC(tp, ether_ntoa); +#if 0 + ATF_TP_ADD_TC(tp, ether_ntohost); + ATF_TP_ADD_TC(tp, ether_hostton); +#endif - test_ether_line(); - test_ether_line_bad_1(); - test_ether_line_bad_2(); - test_ether_aton_r(); - test_ether_aton_r_bad(); - test_ether_aton(); - test_ether_aton_bad(); - test_ether_ntoa_r(); - test_ether_ntoa(); - test_ether_ntohost(); - test_ether_hostton(); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/net/eui64_aton_test.c (from r290562, head/tools/regression/lib/libc/net/test-eui64_aton.c) ============================================================================== --- head/tools/regression/lib/libc/net/test-eui64_aton.c Sun Nov 8 22:23:21 2015 (r290562, copy source) +++ head/lib/libc/tests/net/eui64_aton_test.c Sun Nov 8 23:06:40 2015 (r290563) @@ -30,44 +30,75 @@ #include #include +#include #include #include +#include + #include "test-eui64.h" -static int -test_str( const char *str, const struct eui64 *eui) +static void +test_str(const char *str, const struct eui64 *eui) { - struct eui64 e; - char buf[EUI64_SIZ]; - static int test = 0; - - test++; - - if (eui64_aton(str, &e) != 0 && - memcmp(&e, &eui, sizeof(struct eui64)) != 0) { - printf("not ok %d - : eui64_aton(%s)\n", test, str); + struct eui64 e; + char buf[EUI64_SIZ]; + int rc; + + ATF_REQUIRE_MSG(eui64_aton(str, &e) == 0, "eui64_aton failed"); + rc = memcmp(&e, eui, sizeof(e)); + if (rc != 0) { eui64_ntoa(&e, buf, sizeof(buf)); - printf("# got: %s\n", buf); - return (0); - } else { - printf("ok %d - eui64_aton(%s)\n", test, str); - return (1); + atf_tc_fail( + "eui64_aton(\"%s\", ..) failed; memcmp returned %d. " + "String obtained form eui64_ntoa was: `%s`", + str, rc, buf); } - } -int -main(int argc, char **argv) +ATF_TC_WITHOUT_HEAD(id_ascii); +ATF_TC_BODY(id_ascii, tc) { - printf("1..5\n"); - test_str(test_eui64_id_ascii, &test_eui64_id); +} + +ATF_TC_WITHOUT_HEAD(id_colon_ascii); +ATF_TC_BODY(id_colon_ascii, tc) +{ + test_str(test_eui64_id_colon_ascii, &test_eui64_id); +} + +ATF_TC_WITHOUT_HEAD(mac_ascii); +ATF_TC_BODY(mac_ascii, tc) +{ + test_str(test_eui64_mac_ascii, &test_eui64_eui48); +} + +ATF_TC_WITHOUT_HEAD(mac_colon_ascii); +ATF_TC_BODY(mac_colon_ascii, tc) +{ + test_str(test_eui64_mac_colon_ascii, &test_eui64_eui48); +} + +ATF_TC_WITHOUT_HEAD(hex_ascii); +ATF_TC_BODY(hex_ascii, tc) +{ + test_str(test_eui64_hex_ascii, &test_eui64_id); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, id_ascii); + ATF_TP_ADD_TC(tp, id_colon_ascii); + ATF_TP_ADD_TC(tp, mac_ascii); + ATF_TP_ADD_TC(tp, mac_colon_ascii); + ATF_TP_ADD_TC(tp, hex_ascii); - return (0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/net/eui64_ntoa_test.c (from r290562, head/tools/regression/lib/libc/net/test-eui64_ntoa.c) ============================================================================== --- head/tools/regression/lib/libc/net/test-eui64_ntoa.c Sun Nov 8 22:23:21 2015 (r290562, copy source) +++ head/lib/libc/tests/net/eui64_ntoa_test.c Sun Nov 8 23:06:40 2015 (r290563) @@ -33,22 +33,32 @@ #include #include +#include + #include "test-eui64.h" -int -main(int argc, char **argv) +static void +test_str(const char *str, const struct eui64 *eui) { char a[EUI64_SIZ]; - printf("1..1\n"); + ATF_REQUIRE_MSG(eui64_ntoa(&test_eui64_id, a, sizeof(a)) == 0, + "eui64_ntoa failed"); + ATF_REQUIRE_MSG(strcmp(a, test_eui64_id_ascii) == 0, + "the strings mismatched: `%s` != `%s`", a, test_eui64_id_ascii); +} + +ATF_TC_WITHOUT_HEAD(id_ascii); +ATF_TC_BODY(id_ascii, tc) +{ + + test_str(test_eui64_id_ascii, &test_eui64_id); +} + +ATF_TP_ADD_TCS(tp) +{ - if (eui64_ntoa(&test_eui64_id, a, sizeof(a)) == 0 && - strcmp(a, test_eui64_id_ascii) == 0) { - printf("ok 1 - eui64_ntoa\n"); - return (0); - } - printf("# a = '%s'\n", a); + ATF_TP_ADD_TC(tp, id_ascii); - printf("not ok 1 - eui64_ntoa\n"); - return (0); + return (atf_no_error()); } Copied: head/lib/libc/tests/net/test-eui64.h (from r290562, head/tools/regression/lib/libc/net/test-eui64.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/net/test-eui64.h Sun Nov 8 23:06:40 2015 (r290563, copy of r290562, head/tools/regression/lib/libc/net/test-eui64.h) @@ -0,0 +1,55 @@ +/* + * Copyright 2004 The Aerospace Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions, and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of The Aerospace Corporation may not be used to endorse or + * promote products derived from this software. + * + * THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION "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 AEROSPACE CORPORATION 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 _TEST_EUI64_H +#define _TEST_EUI64_H + +struct eui64 test_eui64_id = {{0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77}}; +struct eui64 test_eui64_eui48 = {{0x00,0x11,0x22,0xFF,0xFE,0x33,0x44,0x55}}; +struct eui64 test_eui64_mac48 = {{0x00,0x11,0x22,0xFF,0xFF,0x33,0x44,0x55}}; + +#define test_eui64_id_ascii "00-11-22-33-44-55-66-77" +#define test_eui64_id_colon_ascii "00:11:22:33:44:55:66:77" +#define test_eui64_hex_ascii "0x0011223344556677" +#define test_eui64_eui48_ascii "00-11-22-ff-fe-33-44-55" +#define test_eui64_mac48_ascii "00-11-22-ff-fe-33-44-55" +#define test_eui64_mac_ascii "00-11-22-33-44-55" +#define test_eui64_mac_colon_ascii "00:11:22:33:44:55" +#define test_eui64_id_host "id" +#define test_eui64_eui48_host "eui-48" +#define test_eui64_mac48_host "mac-48" + +#define test_eui64_line_id "00-11-22-33-44-55-66-77 id" +#define test_eui64_line_id_colon "00:11:22:33:44:55:66:77 id" +#define test_eui64_line_eui48 "00-11-22-FF-fe-33-44-55 eui-48" +#define test_eui64_line_mac48 "00-11-22-FF-ff-33-44-55 mac-48" +#define test_eui64_line_eui48_6byte "00-11-22-33-44-55 eui-48" +#define test_eui64_line_eui48_6byte_c "00:11:22:33:44:55 eui-48" + +#endif /* !_TEST_EUI64_H */ From owner-svn-src-all@freebsd.org Sun Nov 8 23:21:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B5E2A2A419; Sun, 8 Nov 2015 23:21:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EBB14BD; Sun, 8 Nov 2015 23:21:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8NLthB042007; Sun, 8 Nov 2015 23:21:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8NLsHq042005; Sun, 8 Nov 2015 23:21:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201511082321.tA8NLsHq042005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 8 Nov 2015 23:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290564 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 23:21:56 -0000 Author: avos Date: Sun Nov 8 23:21:54 2015 New Revision: 290564 URL: https://svnweb.freebsd.org/changeset/base/290564 Log: urtwn(4): improve RX filter. - Filter out unneeded frames in STA mode. - Implement ic_promisc() call. Tested with RTL8188EU, STA and MONITOR modes. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3999 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Nov 8 23:06:40 2015 (r290563) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Nov 8 23:21:54 2015 (r290564) @@ -269,6 +269,8 @@ static void urtwn_set_gain(struct urtwn static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); static void urtwn_set_channel(struct ieee80211com *); +static void urtwn_set_promisc(struct urtwn_softc *); +static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); static void urtwn_set_chan(struct urtwn_softc *, struct ieee80211_channel *, @@ -457,6 +459,7 @@ urtwn_attach(device_t self) ic->ic_parent = urtwn_parent; ic->ic_vap_create = urtwn_vap_create; ic->ic_vap_delete = urtwn_vap_delete; + ic->ic_update_promisc = urtwn_update_promisc; ic->ic_update_mcast = urtwn_update_mcast; ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, @@ -1574,22 +1577,6 @@ urtwn_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_RUN: if (vap->iv_opmode == IEEE80211_M_MONITOR) { - /* Enable Rx of data frames. */ - urtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff); - - /* Enable Rx of ctrl frames. */ - urtwn_write_2(sc, R92C_RXFLTMAP1, 0xffff); - - /* - * Accept data/control/management frames - * from any BSSID. - */ - urtwn_write_4(sc, R92C_RCR, - (urtwn_read_4(sc, R92C_RCR) & ~(R92C_RCR_APM | - R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN)) | - R92C_RCR_ADF | R92C_RCR_ACF | R92C_RCR_AMF | - R92C_RCR_AAP); - /* Turn link LED on. */ urtwn_set_led(sc, URTWN_LED_LINK, 1); break; @@ -1618,9 +1605,11 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_write_2(sc, R92C_BCN_INTERVAL, ni->ni_intval); /* Allow Rx from our BSSID only. */ - urtwn_write_4(sc, R92C_RCR, - urtwn_read_4(sc, R92C_RCR) | - R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN); + if (ic->ic_promisc == 0) { + urtwn_write_4(sc, R92C_RCR, + urtwn_read_4(sc, R92C_RCR) | + R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN); + } /* Enable TSF synchronization. */ urtwn_tsf_sync_enable(sc); @@ -2755,21 +2744,50 @@ urtwn_pa_bias_init(struct urtwn_softc *s static void urtwn_rxfilter_init(struct urtwn_softc *sc) { - /* Initialize Rx filter. */ - /* TODO: use better filter for monitor mode. */ - urtwn_write_4(sc, R92C_RCR, - R92C_RCR_AAP | R92C_RCR_APM | R92C_RCR_AM | R92C_RCR_AB | - R92C_RCR_APP_ICV | R92C_RCR_AMF | R92C_RCR_HTC_LOC_CTRL | - R92C_RCR_APP_MIC | R92C_RCR_APP_PHYSTS); + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + uint32_t rcr; + uint16_t filter; + + URTWN_ASSERT_LOCKED(sc); + /* Accept all multicast frames. */ urtwn_write_4(sc, R92C_MAR + 0, 0xffffffff); urtwn_write_4(sc, R92C_MAR + 4, 0xffffffff); - /* Accept all management frames. */ - urtwn_write_2(sc, R92C_RXFLTMAP0, 0xffff); + + /* Filter for management frames. */ + filter = 0x7f3f; + if (vap->iv_opmode == IEEE80211_M_STA) { + filter &= ~( + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_ASSOC_REQ) | + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_REASSOC_REQ) | + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_PROBE_REQ)); + } + urtwn_write_2(sc, R92C_RXFLTMAP0, filter); + /* Reject all control frames. */ urtwn_write_2(sc, R92C_RXFLTMAP1, 0x0000); - /* Accept all data frames. */ - urtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff); + + /* Reject all data frames. */ + urtwn_write_2(sc, R92C_RXFLTMAP2, 0x0000); + + rcr = R92C_RCR_AM | R92C_RCR_AB | R92C_RCR_APM | + R92C_RCR_HTC_LOC_CTRL | R92C_RCR_APP_PHYSTS | + R92C_RCR_APP_ICV | R92C_RCR_APP_MIC; + + if (vap->iv_opmode == IEEE80211_M_MONITOR) { + /* Accept all frames. */ + rcr |= R92C_RCR_ACF | R92C_RCR_ADF | R92C_RCR_AMF | + R92C_RCR_AAP; + } + + /* Set Rx filter. */ + urtwn_write_4(sc, R92C_RCR, rcr); + + if (ic->ic_promisc != 0) { + /* Update Rx filter. */ + urtwn_set_promisc(sc); + } } static void @@ -3080,7 +3098,8 @@ urtwn_scan_end(struct ieee80211com *ic) URTWN_LOCK(sc); /* Restore limitations. */ - urtwn_set_rx_bssid_all(sc, 0); + if (ic->ic_promisc == 0) + urtwn_set_rx_bssid_all(sc, 0); /* Set gain under link. */ urtwn_set_gain(sc, 0x32); URTWN_UNLOCK(sc); @@ -3102,6 +3121,52 @@ urtwn_set_channel(struct ieee80211com *i } static void +urtwn_set_promisc(struct urtwn_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + uint32_t rcr, mask1, mask2; + + URTWN_ASSERT_LOCKED(sc); + + if (vap->iv_opmode == IEEE80211_M_MONITOR) + return; + + mask1 = R92C_RCR_ACF | R92C_RCR_ADF | R92C_RCR_AMF | R92C_RCR_AAP; + mask2 = R92C_RCR_APM; + + if (vap->iv_state == IEEE80211_S_RUN) { + switch (vap->iv_opmode) { + case IEEE80211_M_STA: + mask2 |= R92C_RCR_CBSSID_BCN | R92C_RCR_CBSSID_DATA; + break; + default: + device_printf(sc->sc_dev, "%s: undefined opmode %d\n", + __func__, vap->iv_opmode); + return; + } + } + + rcr = urtwn_read_4(sc, R92C_RCR); + if (ic->ic_promisc == 0) + rcr = (rcr & ~mask1) | mask2; + else + rcr = (rcr & ~mask2) | mask1; + urtwn_write_4(sc, R92C_RCR, rcr); +} + +static void +urtwn_update_promisc(struct ieee80211com *ic) +{ + struct urtwn_softc *sc = ic->ic_softc; + + URTWN_LOCK(sc); + if (sc->sc_flags & URTWN_RUNNING) + urtwn_set_promisc(sc); + URTWN_UNLOCK(sc); +} + +static void urtwn_update_mcast(struct ieee80211com *ic) { /* XXX do nothing? */ @@ -3302,6 +3367,7 @@ urtwn_init(struct urtwn_softc *sc) /* Set initial network type. */ urtwn_set_mode(sc, R92C_MSR_INFRA); + /* Initialize Rx filter. */ urtwn_rxfilter_init(sc); /* Set response rate. */ @@ -3375,6 +3441,9 @@ urtwn_init(struct urtwn_softc *sc) urtwn_bb_init(sc); urtwn_rf_init(sc); + /* Reinitialize Rx filter (D3845 is not committed yet). */ + urtwn_rxfilter_init(sc); + if (sc->chip & URTWN_CHIP_88E) { urtwn_write_2(sc, R92C_CR, urtwn_read_2(sc, R92C_CR) | R92C_CR_MACTXEN | Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Sun Nov 8 23:06:40 2015 (r290563) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Sun Nov 8 23:21:54 2015 (r290564) @@ -535,6 +535,10 @@ #define R92C_CAMCMD_CLR 0x40000000 #define R92C_CAMCMD_POLLING 0x80000000 +/* Bits for R92C_RXFLTMAP*. */ +#define R92C_RXFLTMAP_SUBTYPE(subtype) \ + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) + /* * Baseband registers. From owner-svn-src-all@freebsd.org Sun Nov 8 23:46:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E833A2A832; Sun, 8 Nov 2015 23:46:07 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F461107; Sun, 8 Nov 2015 23:46:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA8Nk5sq048389; Sun, 8 Nov 2015 23:46:05 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8Nk5Dv048388; Sun, 8 Nov 2015 23:46:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201511082346.tA8Nk5Dv048388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 8 Nov 2015 23:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290565 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 23:46:07 -0000 Author: sjg Date: Sun Nov 8 23:46:05 2015 New Revision: 290565 URL: https://svnweb.freebsd.org/changeset/base/290565 Log: Ensure TEMPROOT is unique, to guard against multiple builds on same machine. Differential Revision: D3002 Reviewed by: gjb Modified: head/release/scripts/mm-mtree.sh Modified: head/release/scripts/mm-mtree.sh ============================================================================== --- head/release/scripts/mm-mtree.sh Sun Nov 8 23:21:54 2015 (r290564) +++ head/release/scripts/mm-mtree.sh Sun Nov 8 23:46:05 2015 (r290565) @@ -30,7 +30,7 @@ display_usage () { # Set the default path for the temporary root environment # -TEMPROOT='/var/tmp/temproot' +TEMPROOT=`TMPDIR=/var/tmp mktemp -d -t temproot` # Assign the location of the mtree database # From owner-svn-src-all@freebsd.org Sun Nov 8 23:52:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2FCA2AA3B; Sun, 8 Nov 2015 23:52:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 48126175C; Sun, 8 Nov 2015 23:52:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id CF7801BE2; Sun, 8 Nov 2015 23:52:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 8 Nov 2015 23:52:28 +0000 From: Glen Barber To: "Simon J. Gerraty" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290565 - head/release/scripts Message-ID: <20151108235228.GA1586@FreeBSD.org> References: <201511082346.tA8Nk5Dv048388@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <201511082346.tA8Nk5Dv048388@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 23:52:33 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2015 at 11:46:05PM +0000, Simon J. Gerraty wrote: > Author: sjg > Date: Sun Nov 8 23:46:05 2015 > New Revision: 290565 > URL: https://svnweb.freebsd.org/changeset/base/290565 >=20 > Log: > Ensure TEMPROOT is unique, to guard against multiple builds on same mac= hine. > =20 > Differential Revision: D3002 > Reviewed by: gjb Technically, I did not review the change, I just did not object to your proposal. :) Glen --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWP+A3AAoJEAMUWKVHj+KToxEP/jdPMUbgzOpaAJ9H/2OetiXU eiuPpGiaezGEsfu/LcuAyMfjUsCpn7S1v4h9zORZO89HW0L8WOfediiNdVOsfzNN RLcxvUR1GEaQmMseJKmKxnp+oSWKF19+a5xIRQU837J3x+nq8cBqLsXpC3wLHEQd ddo+vy5MKRyJ7E8jSra7FFZJrYz9exPon0hSTz6uP003I/mQAc7J405ct6gH4Zpa 0NZy3hVBJTTv+k9D/nvTiugLfg0uZGQIE+5mu+I9eaqZfyongh5CP3nS5nPhncm4 ugOO4c4s+lRKJLlSAxKsg6bv8r7VqJ2+I9uHLGMgsC9ukPot1HVFbPO7Lh6Qciug CvIVgC6fuqvd4f2Of2IqcpnmRW+aYg2TZIQJbmqAKG8D1FddLzcr7T54Ck4DbR4k QwgN/OPcJ2on0YIsc6lM6Ggd3URCp5Dt1wCyPhx6NlhjKy0UpngZ45W4OSYHTw4H 9AEcfucXAhdPhCDuLL/jKE+dc49bYW0dKbUevCs0tCZmwUDSjccnlhcHyZUvezXK LPP/+8Iugk0LEc1FAmoHvT/1oFo3RrqTzOUT21hBHUYAEI+kxeWqdyw4eJUhfCl2 TiqWwkGptnHIX9IGRQKEZtUABlKR8UucqU38P6ql5n2v6YwqDoXzZjMGooptffOP OPssV3SveIvJPOPzDvCL =U6T7 -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- From owner-svn-src-all@freebsd.org Mon Nov 9 00:19:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82526A2300C; Mon, 9 Nov 2015 00:19:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F6E1FF4; Mon, 9 Nov 2015 00:19:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA90J4O1057081; Mon, 9 Nov 2015 00:19:04 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA90J4qC057079; Mon, 9 Nov 2015 00:19:04 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201511090019.tA90J4qC057079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 9 Nov 2015 00:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290566 - in head/sys/dev: re rl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 00:19:05 -0000 Author: marius Date: Mon Nov 9 00:19:04 2015 New Revision: 290566 URL: https://svnweb.freebsd.org/changeset/base/290566 Log: - Although it doesn't make a whole lot of sense to enable RX and TX before their initial configuration is done, it turns out that r281337 has the inverse effect on some older chips. Moreover, as with newer chips before, two chips seemingly identical according to their MAC revisions may behave differently in this regard, with most working but a few not, making changes extremely hard to test. Closer inspection of the corresponding Linux code suggests that RX and TX should only be enabled after their initial configuration with RTL8168G and later chips, i. e. RTL8106E{,US}, RTL8107E, as well as RTL8168{EP,G,GU,H}, so limit the new code path to these. [1] - Distinguish between RTL8168H and RTL8107E, with the latter being the 10/100-Mbit/s-only variant of the former. - For MAC variants that can only do Fast Ethernet at a maximum, ensure that we don't advertise Gigabit Ethernet speed. - In re_stop(), do the inverse of re_init_locked() and enable RXDV gate on RTL8168G and later chips again, matching what Linux does. PR: 203422 [1] MFC after: 1 week Modified: head/sys/dev/re/if_re.c head/sys/dev/rl/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Sun Nov 8 23:46:05 2015 (r290565) +++ head/sys/dev/re/if_re.c Mon Nov 9 00:19:04 2015 (r290566) @@ -636,9 +636,8 @@ re_miibus_statchg(device_t dev) } } /* - * RealTek controllers does not provide any interface to - * Tx/Rx MACs for resolved speed, duplex and flow-control - * parameters. + * RealTek controllers do not provide any interface to the RX/TX + * MACs for resolved speed, duplex and flow-control parameters. */ } @@ -660,7 +659,7 @@ re_set_rxmode(struct rl_softc *sc) rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; if ((sc->rl_flags & RL_FLAG_EARLYOFF) != 0) rxfilt |= RL_RXCFG_EARLYOFF; - else if ((sc->rl_flags & RL_FLAG_EARLYOFFV2) != 0) + else if ((sc->rl_flags & RL_FLAG_8168G_PLUS) != 0) rxfilt |= RL_RXCFG_EARLYOFFV2; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { @@ -1207,11 +1206,10 @@ re_attach(device_t dev) struct rl_softc *sc; struct ifnet *ifp; const struct rl_hwrev *hw_rev; + int capmask, error = 0, hwrev, i, msic, msixc, + phy, reg, rid; u_int32_t cap, ctl; - int hwrev; u_int16_t devid, re_did = 0; - int error = 0, i, phy, rid; - int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1486,17 +1484,17 @@ re_attach(device_t dev) break; case RL_HWREV_8168EP: case RL_HWREV_8168G: - case RL_HWREV_8168H: case RL_HWREV_8411B: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK | - RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; + RL_FLAG_8168G_PLUS; break; case RL_HWREV_8168GU: + case RL_HWREV_8168H: if (pci_get_device(dev) == RT_DEVICEID_8101E) { - /* RTL8106EUS */ + /* RTL8106E(US), RTL8107E */ sc->rl_flags |= RL_FLAG_FASTETHER; } else sc->rl_flags |= RL_FLAG_JUMBOV2 | RL_FLAG_WOL_MANLINK; @@ -1504,7 +1502,7 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ | - RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; + RL_FLAG_8168G_PLUS; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -1654,8 +1652,11 @@ re_attach(device_t dev) phy = RE_PHYAD_INTERNAL; if (sc->rl_type == RL_8169) phy = 1; + capmask = BMSR_DEFCAPMASK; + if ((sc->rl_flags & RL_FLAG_FASTETHER) != 0) + capmask &= ~BMSR_EXTSTAT; error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd, - re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); + re_ifmedia_sts, capmask, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -1733,7 +1734,6 @@ re_attach(device_t dev) } fail: - if (error) re_detach(dev); @@ -3194,9 +3194,18 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXLIST_ADDR_LO, RL_ADDR_LO(sc->rl_ldata.rl_tx_list_addr)); - if ((sc->rl_flags & RL_FLAG_RXDV_GATED) != 0) + if ((sc->rl_flags & RL_FLAG_8168G_PLUS) != 0) { + /* Disable RXDV gate. */ CSR_WRITE_4(sc, RL_MISC, CSR_READ_4(sc, RL_MISC) & ~0x00080000); + } + + /* + * Enable transmit and receive for pre-RTL8168G controllers. + * RX/TX MACs should be enabled before RX/TX configuration. + */ + if ((sc->rl_flags & RL_FLAG_8168G_PLUS) == 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); /* * Set the initial TX configuration. @@ -3225,9 +3234,11 @@ re_init_locked(struct rl_softc *sc) } /* - * Enable transmit and receive. + * Enable transmit and receive for RTL8168G and later controllers. + * RX/TX MACs should be enabled after RX/TX configuration. */ - CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); + if ((sc->rl_flags & RL_FLAG_8168G_PLUS) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); #ifdef DEVICE_POLLING /* @@ -3583,6 +3594,12 @@ re_stop(struct rl_softc *sc) ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_MULTI | RL_RXCFG_RX_BROAD)); + if ((sc->rl_flags & RL_FLAG_8168G_PLUS) != 0) { + /* Enable RXDV gate. */ + CSR_WRITE_4(sc, RL_MISC, CSR_READ_4(sc, RL_MISC) | + 0x00080000); + } + if ((sc->rl_flags & RL_FLAG_WAIT_TXPOLL) != 0) { for (i = RL_TIMEOUT; i > 0; i--) { if ((CSR_READ_1(sc, sc->rl_txstart) & @@ -3946,7 +3963,6 @@ re_add_sysctls(struct rl_softc *sc) sc->rl_int_rx_mod = RL_TIMER_DEFAULT; } } - } static int Modified: head/sys/dev/rl/if_rlreg.h ============================================================================== --- head/sys/dev/rl/if_rlreg.h Sun Nov 8 23:46:05 2015 (r290565) +++ head/sys/dev/rl/if_rlreg.h Mon Nov 9 00:19:04 2015 (r290566) @@ -931,8 +931,7 @@ struct rl_softc { #define RL_FLAG_CMDSTOP_WAIT_TXQ 0x00008000 #define RL_FLAG_WOL_MANLINK 0x00010000 #define RL_FLAG_EARLYOFF 0x00020000 -#define RL_FLAG_EARLYOFFV2 0x00040000 -#define RL_FLAG_RXDV_GATED 0x00080000 +#define RL_FLAG_8168G_PLUS 0x00040000 #define RL_FLAG_PCIE 0x40000000 #define RL_FLAG_LINK 0x80000000 }; From owner-svn-src-all@freebsd.org Mon Nov 9 01:05:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E292A23B61; Mon, 9 Nov 2015 01:05:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 265B015D6; Mon, 9 Nov 2015 01:05:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA915Wwu072323; Mon, 9 Nov 2015 01:05:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA915Vs7072319; Mon, 9 Nov 2015 01:05:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090105.tA915Vs7072319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 01:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290567 - in head: etc/mtree usr.bin/limits usr.bin/limits/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 01:05:33 -0000 Author: ngie Date: Mon Nov 9 01:05:31 2015 New Revision: 290567 URL: https://svnweb.freebsd.org/changeset/base/290567 Log: Add some basic tests that exercise cputime limits with limits(1) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/usr.bin/limits/tests/ head/usr.bin/limits/tests/Makefile (contents, props changed) head/usr.bin/limits/tests/limits_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/limits/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 9 00:19:04 2015 (r290566) +++ head/etc/mtree/BSD.tests.dist Mon Nov 9 01:05:31 2015 (r290567) @@ -554,6 +554,8 @@ .. lastcomm .. + limits + .. m4 .. mkimg Modified: head/usr.bin/limits/Makefile ============================================================================== --- head/usr.bin/limits/Makefile Mon Nov 9 00:19:04 2015 (r290566) +++ head/usr.bin/limits/Makefile Mon Nov 9 01:05:31 2015 (r290567) @@ -1,6 +1,12 @@ # $FreeBSD$ +.include + PROG= limits LIBADD= util +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/limits/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/limits/tests/Makefile Mon Nov 9 01:05:31 2015 (r290567) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= limits_test + +.include Added: head/usr.bin/limits/tests/limits_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/limits/tests/limits_test.sh Mon Nov 9 01:05:31 2015 (r290567) @@ -0,0 +1,65 @@ +# +# Copyright 2015 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Make sure time(1) is consistent with the FreeBSD time command and not the +# shell interpretation of time(1) +TIME=/usr/bin/time + +atf_test_case cputime_hard_flag +cputime_hard_flag_body() +{ + + atf_check -e empty -o match:'cputime[[:space:]]+3 secs' -s exit:0 \ + limits -H -t 3 limits -H + atf_check -e empty -o match:'cputime[[:space:]]+3 secs' -s exit:0 \ + limits -H -t 3 limits -S + atf_check -e match:'real[[:space:]]+[34]\.[0-9][0-9]' -o empty -s signal:sigkill \ + limits -H -t 3 $TIME -p sh -c 'while : ; do : ; done' +} + +SIGXCPU=24 # atf_check doesn't know sigxcpu + +atf_test_case cputime_soft_flag +cputime_soft_flag_body() +{ + + atf_check -e empty -o match:'cputime-max[[:space:]]+infinity secs' -s exit:0 \ + limits -S -t 3 limits -H + atf_check -e empty -o match:'cputime-cur[[:space:]]+3 secs' -s exit:0 \ + limits -S -t 3 limits -S + atf_check -e match:'real[[:space:]]+[34]\.[0-9][0-9]' -o empty -s signal:$SIGXCPU \ + limits -S -t 3 $TIME -p sh -c 'while : ; do : ; done' +} + +atf_init_test_cases() +{ + + atf_add_test_case cputime_hard_flag + atf_add_test_case cputime_soft_flag +} From owner-svn-src-all@freebsd.org Mon Nov 9 01:49:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69FC4A24699; Mon, 9 Nov 2015 01:49:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 373071AFD; Mon, 9 Nov 2015 01:49:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA91nP4s083655; Mon, 9 Nov 2015 01:49:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA91nPWB083654; Mon, 9 Nov 2015 01:49:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201511090149.tA91nPWB083654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Nov 2015 01:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290568 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 01:49:26 -0000 Author: emaste Date: Mon Nov 9 01:49:25 2015 New Revision: 290568 URL: https://svnweb.freebsd.org/changeset/base/290568 Log: Fix typo in message from arm64 ITS workaround Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Mon Nov 9 01:05:31 2015 (r290567) +++ head/sys/arm64/arm64/gic_v3_its.c Mon Nov 9 01:49:25 2015 (r290568) @@ -189,7 +189,7 @@ gic_v3_its_attach(device_t dev) */ if (device_get_unit(dev) != 0) { device_printf(dev, - "Only single instance of ITS is supported, exitting...\n"); + "Only single instance of ITS is supported, exiting...\n"); return (ENXIO); } sc->its_socket = 0; From owner-svn-src-all@freebsd.org Mon Nov 9 01:53:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE7FA2486D; Mon, 9 Nov 2015 01:53:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E07D1E6E; Mon, 9 Nov 2015 01:53:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA91rtrH086377; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA91rt5P086375; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201511090153.tA91rt5P086375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2015 01:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290569 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 01:53:56 -0000 Author: delphij Date: Mon Nov 9 01:53:54 2015 New Revision: 290569 URL: https://svnweb.freebsd.org/changeset/base/290569 Log: MFC r290024,290073: In gunzip(1), treat trailing garbage as a warning and not an error. This allows scripts to distinguish it between real fatal errors, for instance a CRC mismatch. Update manual page for the behavior change. PR: bin/203873 Submitted by: Eugene Grosbein Modified: stable/10/usr.bin/gzip/gzip.1 stable/10/usr.bin/gzip/gzip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/gzip.1 ============================================================================== --- stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:53:54 2015 (r290569) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $ +.\" $NetBSD: gzip.1,v 1.26 2015/10/27 07:36:18 mrg Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 6, 2015 +.Dd October 26, 2015 .Dt GZIP 1 .Os .Sh NAME @@ -136,7 +136,7 @@ option, allowing non-compressed data to .It Fl h , -help This option prints a usage summary and exits. .It Fl k , -keep -Keep (don't delete) input files during compression +Keep (do not delete) input files during compression or decompression. .It Fl L , -license This option prints @@ -183,6 +183,12 @@ is set, it is parsed as a white-space se handled before any options on the command line. Options on the command line will override anything in .Ev GZIP . +.Sh EXIT STATUS +The +.Nm +utility exits 0 on success, +1 on errors, +and 2 if a warning occurs. .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , @@ -220,7 +226,7 @@ with unpack support written by .An Xin LI Aq delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer, therefore, it can not represent files larger than 4GB. +integer, therefore, it cannot represent files larger than 4GB. This limitation also applies to .Fl l option of Modified: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:53:54 2015 (r290569) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */ +/* $NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -810,6 +810,7 @@ gz_uncompress(int in, int out, char *pre if (in_tot > 0) { maybe_warnx("%s: trailing garbage " "ignored", filename); + exit_value = 2; goto stop; } maybe_warnx("input not gziped (MAGIC0)"); From owner-svn-src-all@freebsd.org Mon Nov 9 02:29:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27379A29206; Mon, 9 Nov 2015 02:29:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F601FAA; Mon, 9 Nov 2015 02:29:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA92Tck5095308; Mon, 9 Nov 2015 02:29:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA92TcmX095307; Mon, 9 Nov 2015 02:29:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090229.tA92TcmX095307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 02:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290570 - head/cddl/usr.sbin/dtrace/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 02:29:40 -0000 Author: ngie Date: Mon Nov 9 02:29:38 2015 New Revision: 290570 URL: https://svnweb.freebsd.org/changeset/base/290570 Log: Reduce the Makefile snippet complexity a bit - Set BINDIR to TESTSDIR globally (and subsequently, remove all `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`) - Set MAN to "" globally, instead of per-PROG MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Modified: head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Mon Nov 9 01:53:54 2015 (r290569) +++ head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Mon Nov 9 02:29:38 2015 (r290570) @@ -10,9 +10,6 @@ ${TESTGROUP}= ${TESTFILES} ${TESTGROUP}EXE= ${TESTEXES} ${TESTGROUP}EXEMODE= 0555 -${TESTGROUP}DIR= ${TESTSDIR} -${TESTGROUP}EXEDIR= ${TESTSDIR} - TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh" @@ -30,14 +27,15 @@ CLEANFILES+= ${TESTWRAPPER}.sh PROGS= ${CFILES:T:S/.c$/.exe/g} .for prog in ${PROGS} SRCS.${prog}+= ${prog:S/.exe$/.c/} -BINDIR.${prog}= ${TESTSDIR} -MAN.${prog}= .if exists(${prog:S/^tst.//:S/.exe$/.d/}) SRCS.${prog}+= ${prog:S/^tst.//:S/.exe$/.d/} .endif .endfor +BINDIR= ${TESTSDIR} +MAN= + # Some tests depend on the internals of their corresponding test programs, # so make sure the optimizer doesn't interfere with them. CFLAGS+= -O0 From owner-svn-src-all@freebsd.org Mon Nov 9 05:49:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0463CA22F32; Mon, 9 Nov 2015 05:49:31 +0000 (UTC) (envelope-from howard0su@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::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 C4A1F1E89; Mon, 9 Nov 2015 05:49:30 +0000 (UTC) (envelope-from howard0su@gmail.com) Received: by ioc74 with SMTP id 74so110039041ioc.2; Sun, 08 Nov 2015 21:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JCo1GF+ogm9jZJM0IwFk/b8eoRggxQ4FzLtth1c+/WA=; b=i4Ng+QWvz9ivB81OCFuWRFgpdHa9FnUGHCSo7qQPxyZoW42WlqDqsaQdN9zxVr9h5U QIVRf/MMfEBKvQEqc6DOLek8JYDpNSJL43/IwPWR0jJseDhOsaQg7iisvgkDkcVH0SM+ Nkj5OkUOMfaF/a4ZdaE1LHS0A0Zlxo/hJFTEdO6SS2PUtSh44NaanYlTQo00YUaDKeAZ xp8DBE3bpn8fbjB/xL126ns73Hpz35XNKV0Ncdtc4aO0jVeEWuQ5/Wrkv7Xwa6bs4vcW 1w488d9JuymeX4EozKxsxk5acce2PwVVELWcOfLU1nRGyAHGdjFS3dLTvEFyP48k7CYC j7Zg== MIME-Version: 1.0 X-Received: by 10.107.164.24 with SMTP id n24mr3096208ioe.21.1447048169886; Sun, 08 Nov 2015 21:49:29 -0800 (PST) Received: by 10.107.164.167 with HTTP; Sun, 8 Nov 2015 21:49:29 -0800 (PST) In-Reply-To: <201511081802.tA8I2eBQ049912@repo.freebsd.org> References: <201511081802.tA8I2eBQ049912@repo.freebsd.org> Date: Mon, 9 Nov 2015 13:49:29 +0800 Message-ID: Subject: Re: svn commit: r290550 - head/release/tools From: Howard Su To: Glen Barber Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 05:49:31 -0000 tmpfs doesn't support noatime option. please remove it. On Mon, Nov 9, 2015 at 2:02 AM, Glen Barber wrote: > Author: gjb > Date: Sun Nov 8 18:02:39 2015 > New Revision: 290550 > URL: https://svnweb.freebsd.org/changeset/base/290550 > > Log: > Use tmpfs(5) instead of md(4) for '/tmp' mount. > > Submitted by: Nikolai Lifanov > Differential Revision: D3506 > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > > Modified: > head/release/tools/arm.subr > > Modified: head/release/tools/arm.subr > > ============================================================================== > --- head/release/tools/arm.subr Sun Nov 8 18:00:44 2015 (r290549) > +++ head/release/tools/arm.subr Sun Nov 8 18:02:39 2015 (r290550) > @@ -110,7 +110,7 @@ arm_install_base() { > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > - echo "md /tmp mfs rw,noatime,-s30m 0 0" \ > + echo "tmpfs /tmp tmpfs rw,noatime,mode=1777,size=30m 0 0" \ > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > > local hostname > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > -- -Howard From owner-svn-src-all@freebsd.org Mon Nov 9 06:16:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D26E6A2975B; Mon, 9 Nov 2015 06:16:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9441A47; Mon, 9 Nov 2015 06:16:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA96GcaE060850; Mon, 9 Nov 2015 06:16:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96Gcm2060849; Mon, 9 Nov 2015 06:16:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090616.tA96Gcm2060849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290571 - head/lib/libc/tests/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:16:39 -0000 Author: ngie Date: Mon Nov 9 06:16:38 2015 New Revision: 290571 URL: https://svnweb.freebsd.org/changeset/base/290571 Log: Fix some TAP -> ATF conversion errors - Remove a leftover printf from when this was a TAP based testcase - Catch mmap failures properly MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/gen/arc4random_test.c Modified: head/lib/libc/tests/gen/arc4random_test.c ============================================================================== --- head/lib/libc/tests/gen/arc4random_test.c Mon Nov 9 02:29:38 2015 (r290570) +++ head/lib/libc/tests/gen/arc4random_test.c Mon Nov 9 06:16:38 2015 (r290571) @@ -30,10 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include + #include /* @@ -56,14 +58,9 @@ ATF_TC_BODY(test_arc4random, tc) pid_t pid; char c; - printf("1..1\n"); - page = mmap(NULL, sizeof(struct shared_page), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); - if (page == MAP_FAILED) { - printf("fail 1 - mmap\n"); - exit(1); - } + ATF_REQUIRE_MSG(page != MAP_FAILED, "mmap failed; errno=%d", errno); arc4random_buf(&c, 1); From owner-svn-src-all@freebsd.org Mon Nov 9 06:24:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34366A29943; Mon, 9 Nov 2015 06:24:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0291DEB; Mon, 9 Nov 2015 06:24:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA96OCMo063670; Mon, 9 Nov 2015 06:24:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96OBQG063661; Mon, 9 Nov 2015 06:24:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090624.tA96OBQG063661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290572 - in head: lib/libc/tests/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:24:13 -0000 Author: ngie Date: Mon Nov 9 06:24:11 2015 New Revision: 290572 URL: https://svnweb.freebsd.org/changeset/base/290572 Log: Integrate tools/regression/lib/libc/gen into the FreeBSD test suite as lib/libc/tests/gen The code in test-fnmatch that was used for generating: - bin/sh/tests/builtins/case2.0 - bin/sh/tests/builtins/case3.0 has been left undisturbed. The target `make sh-tests` has been moved over from tools/regression/lib/libc/gen/Makefile to lib/libc/tests/gen/Makefile and made into a PHONY target case2.0 and case3.0 test input generation isn't being done automatically. This needs additional discussion. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/gen/fmtcheck_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-fmtcheck.c head/lib/libc/tests/gen/fmtmsg_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-fmtmsg.c head/lib/libc/tests/gen/fnmatch_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-fnmatch.c head/lib/libc/tests/gen/fnmatch_testcases.h (contents, props changed) head/lib/libc/tests/gen/ftw_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-ftw.c head/lib/libc/tests/gen/popen_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-popen.c head/lib/libc/tests/gen/posix_spawn_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-posix_spawn.c head/lib/libc/tests/gen/test-fnmatch.c (contents, props changed) head/lib/libc/tests/gen/wordexp_test.c - copied, changed from r290571, head/tools/regression/lib/libc/gen/test-wordexp.c Deleted: head/tools/regression/lib/libc/gen/ Modified: head/lib/libc/tests/gen/Makefile Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Mon Nov 9 06:16:38 2015 (r290571) +++ head/lib/libc/tests/gen/Makefile Mon Nov 9 06:24:11 2015 (r290572) @@ -2,8 +2,15 @@ .include -ATF_TESTS_C= arc4random_test +ATF_TESTS_C+= arc4random_test +ATF_TESTS_C+= fmtcheck2_test +ATF_TESTS_C+= fmtmsg_test +ATF_TESTS_C+= fnmatch2_test ATF_TESTS_C+= fpclassify2_test +ATF_TESTS_C+= ftw_test +ATF_TESTS_C+= popen_test +ATF_TESTS_C+= posix_spawn_test +ATF_TESTS_C+= wordexp_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep # TODO: t_siginfo (fixes require further inspection) @@ -53,7 +60,25 @@ DPADD.nice_test+= ${LIBPTHREAD} LDADD.syslog_test+= -lpthread DPADD.syslog_test+= ${LIBPTHREAD} +CFLAGS+= -I${.CURDIR} + +SRCS.fmtcheck2_test= fmtcheck_test.c +SRCS.fnmatch2_test= fnmatch_test.c + TESTS_SUBDIRS= execve TESTS_SUBDIRS+= posix_spawn +# The old testcase name +TEST_FNMATCH= test-fnmatch +CLEANFILES+= ${GEN_SH_CASE_TESTCASES} +sh-tests: .PHONY +.for target in clean obj depend all + @cd ${.CURDIR} && ${MAKE} PROG=${TEST_FNMATCH} \ + -DNO_SUBDIR ${target} +.endfor + @cd ${.OBJDIR} && ./${TEST_FNMATCH} -s 1 > \ + ${SRCTOP}/bin/sh/tests/builtins/case2.0 + @cd ${.OBJDIR} && ./${TEST_FNMATCH} -s 2 > \ + ${SRCTOP}/bin/sh/tests/builtins/case3.0 + .include Copied and modified: head/lib/libc/tests/gen/fmtcheck_test.c (from r290571, head/tools/regression/lib/libc/gen/test-fmtcheck.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-fmtcheck.c Mon Nov 9 06:16:38 2015 (r290571, copy source) +++ head/lib/libc/tests/gen/fmtcheck_test.c Mon Nov 9 06:24:11 2015 (r290572) @@ -31,10 +31,13 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include +#include + struct test_fmt { char *fmt1; char *fmt2; @@ -72,31 +75,31 @@ struct test_fmt { { "%p %30s %#llx %-10.*e", "This number %lu%% and string %s has %qd numbers and %.*g floats", 1 }, }; -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(fmtcheck_test); +ATF_TC_BODY(fmtcheck_test, tc) { - int i, n, r; - const char *f, *cf, *f1, *f2; + int i; + const char *f, *cf, *f1, *f2; - printf("1..1\n"); - r = 0; - n = sizeof(test_fmts) / sizeof(test_fmts[0]); - for (i=0 ; i __FBSDID("$FreeBSD$"); +#include #include - #include #include #include @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static char *run_test(long classification, const char *label, int severity, const char *text, const char *action, const char *tag); @@ -217,18 +219,14 @@ run_test(long classification, const char return (result); } -int -main(void) +ATF_TC_WITHOUT_HEAD(fmtmsg_test); +ATF_TC_BODY(fmtmsg_test, tc) { - size_t i, n; - int errors; char *result; struct testcase *t; + int i; - n = sizeof(testcases) / sizeof(testcases[0]); - errors = 0; - printf("1..%zu\n", n); - for (i = 0; i < n; i++) { + for (i = 0; i < nitems(testcases); i++) { t = &testcases[i]; if (t->msgverb != NULL) setenv("MSGVERB", t->msgverb, 1); @@ -236,16 +234,19 @@ main(void) unsetenv("MSGVERB"); result = run_test(t->classification, t->label, t->severity, t->text, t->action, t->tag); - if (result != NULL && strcmp(result, t->result) == 0) - printf("ok %zu - correct\n", - i + 1); - else { - printf("not ok %zu - %s\n", - i + 1, result != NULL ? "incorrect" : "failed"); - errors = 1; - } + ATF_CHECK_MSG(result != NULL, "testcase %d failed", i + 1); + if (result != NULL) + ATF_CHECK_MSG(strcmp(result, t->result) == 0, + "results for testcase %d didn't match; " + "`%s` != `%s`", i + 1, result, t->result); free(result); } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, fmtmsg_test); - return (errors); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/gen/fnmatch_test.c (from r290571, head/tools/regression/lib/libc/gen/test-fnmatch.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-fnmatch.c Mon Nov 9 06:16:38 2015 (r290571, copy source) +++ head/lib/libc/tests/gen/fnmatch_test.c Mon Nov 9 06:24:11 2015 (r290572) @@ -27,158 +27,16 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include -#include -struct testcase { - const char *pattern; - const char *string; - int flags; - int result; -} testcases[] = { - "", "", 0, 0, - "a", "a", 0, 0, - "a", "b", 0, FNM_NOMATCH, - "a", "A", 0, FNM_NOMATCH, - "*", "a", 0, 0, - "*", "aa", 0, 0, - "*a", "a", 0, 0, - "*a", "b", 0, FNM_NOMATCH, - "*a*", "b", 0, FNM_NOMATCH, - "*a*b*", "ab", 0, 0, - "*a*b*", "qaqbq", 0, 0, - "*a*bb*", "qaqbqbbq", 0, 0, - "*a*bc*", "qaqbqbcq", 0, 0, - "*a*bb*", "qaqbqbb", 0, 0, - "*a*bc*", "qaqbqbc", 0, 0, - "*a*bb", "qaqbqbb", 0, 0, - "*a*bc", "qaqbqbc", 0, 0, - "*a*bb", "qaqbqbbq", 0, FNM_NOMATCH, - "*a*bc", "qaqbqbcq", 0, FNM_NOMATCH, - "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH, - "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0, - "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0, - ".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH, - ".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0, - ".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0, - "*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH, - "??????????*", "123456789", 0, FNM_NOMATCH, - "*??????????", "123456789", 0, FNM_NOMATCH, - "*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0, - "??????????*", "1234567890", 0, 0, - "*??????????", "1234567890", 0, 0, - "*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0, - "??????????*", "12345678901", 0, 0, - "*??????????", "12345678901", 0, 0, - "[x]", "x", 0, 0, - "[*]", "*", 0, 0, - "[?]", "?", 0, 0, - "[", "[", 0, 0, - "[[]", "[", 0, 0, - "[[]", "x", 0, FNM_NOMATCH, - "[*]", "", 0, FNM_NOMATCH, - "[*]", "x", 0, FNM_NOMATCH, - "[?]", "x", 0, FNM_NOMATCH, - "*[*]*", "foo*foo", 0, 0, - "*[*]*", "foo", 0, FNM_NOMATCH, - "[0-9]", "0", 0, 0, - "[0-9]", "5", 0, 0, - "[0-9]", "9", 0, 0, - "[0-9]", "/", 0, FNM_NOMATCH, - "[0-9]", ":", 0, FNM_NOMATCH, - "[0-9]", "*", 0, FNM_NOMATCH, - "[!0-9]", "0", 0, FNM_NOMATCH, - "[!0-9]", "5", 0, FNM_NOMATCH, - "[!0-9]", "9", 0, FNM_NOMATCH, - "[!0-9]", "/", 0, 0, - "[!0-9]", ":", 0, 0, - "[!0-9]", "*", 0, 0, - "*[0-9]", "a0", 0, 0, - "*[0-9]", "a5", 0, 0, - "*[0-9]", "a9", 0, 0, - "*[0-9]", "a/", 0, FNM_NOMATCH, - "*[0-9]", "a:", 0, FNM_NOMATCH, - "*[0-9]", "a*", 0, FNM_NOMATCH, - "*[!0-9]", "a0", 0, FNM_NOMATCH, - "*[!0-9]", "a5", 0, FNM_NOMATCH, - "*[!0-9]", "a9", 0, FNM_NOMATCH, - "*[!0-9]", "a/", 0, 0, - "*[!0-9]", "a:", 0, 0, - "*[!0-9]", "a*", 0, 0, - "*[0-9]", "a00", 0, 0, - "*[0-9]", "a55", 0, 0, - "*[0-9]", "a99", 0, 0, - "*[0-9]", "a0a0", 0, 0, - "*[0-9]", "a5a5", 0, 0, - "*[0-9]", "a9a9", 0, 0, - "\\*", "*", 0, 0, - "\\?", "?", 0, 0, - "\\[x]", "[x]", 0, 0, - "\\[", "[", 0, 0, - "\\\\", "\\", 0, 0, - "*\\**", "foo*foo", 0, 0, - "*\\**", "foo", 0, FNM_NOMATCH, - "*\\\\*", "foo\\foo", 0, 0, - "*\\\\*", "foo", 0, FNM_NOMATCH, - "\\(", "(", 0, 0, - "\\a", "a", 0, 0, - "\\*", "a", 0, FNM_NOMATCH, - "\\?", "a", 0, FNM_NOMATCH, - "\\*", "\\*", 0, FNM_NOMATCH, - "\\?", "\\?", 0, FNM_NOMATCH, - "\\[x]", "\\[x]", 0, FNM_NOMATCH, - "\\[x]", "\\x", 0, FNM_NOMATCH, - "\\[", "\\[", 0, FNM_NOMATCH, - "\\(", "\\(", 0, FNM_NOMATCH, - "\\a", "\\a", 0, FNM_NOMATCH, - "\\", "\\", 0, FNM_NOMATCH, - "\\", "", 0, 0, - "\\*", "\\*", FNM_NOESCAPE, 0, - "\\?", "\\?", FNM_NOESCAPE, 0, - "\\", "\\", FNM_NOESCAPE, 0, - "\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH, - "\\\\", "\\\\", FNM_NOESCAPE, 0, - "*\\*", "foo\\foo", FNM_NOESCAPE, 0, - "*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH, - "*", ".", FNM_PERIOD, FNM_NOMATCH, - "?", ".", FNM_PERIOD, FNM_NOMATCH, - ".*", ".", 0, 0, - ".*", "..", 0, 0, - ".*", ".a", 0, 0, - "[0-9]", ".", FNM_PERIOD, FNM_NOMATCH, - "a*", "a.", 0, 0, - "a/a", "a/a", FNM_PATHNAME, 0, - "a/*", "a/a", FNM_PATHNAME, 0, - "*/a", "a/a", FNM_PATHNAME, 0, - "*/*", "a/a", FNM_PATHNAME, 0, - "a*b/*", "abbb/x", FNM_PATHNAME, 0, - "a*b/*", "abbb/.x", FNM_PATHNAME, 0, - "*", "a/a", FNM_PATHNAME, FNM_NOMATCH, - "*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH, - "b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, - "b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, - "b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, - "b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, - "a", "A", FNM_CASEFOLD, 0, - "A", "a", FNM_CASEFOLD, 0, - "[a]", "A", FNM_CASEFOLD, 0, - "[A]", "a", FNM_CASEFOLD, 0, - "a", "b", FNM_CASEFOLD, FNM_NOMATCH, - "a", "a/b", FNM_PATHNAME, FNM_NOMATCH, - "*", "a/b", FNM_PATHNAME, FNM_NOMATCH, - "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH, - "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, - "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, - "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, - "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, - "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, - "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, - "a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, -}; +#include + +#include "fnmatch_testcases.h" static const char * flags_to_string(int flags) @@ -213,71 +71,16 @@ flags_to_string(int flags) return result; } -static int -write_sh_tests(const char *progname, int num) -{ - size_t i, n; - struct testcase *t; - - printf("# Generated by %s -s %d, do not edit.\n", progname, num); - printf("# $" "FreeBSD$\n"); - printf("failures=\n"); - printf("failed() { printf '%%s\\n' \"Failed: $1 '$2' '$3'\"; failures=x$failures; }\n"); - if (num == 1) { - printf("testmatch() { eval \"case \\$2 in ''$1) ;; *) failed testmatch \\\"\\$@\\\";; esac\"; }\n"); - printf("testnomatch() { eval \"case \\$2 in ''$1) failed testnomatch \\\"\\$@\\\";; esac\"; }\n"); - } else if (num == 2) { - printf("# We do not treat a backslash specially in this case,\n"); - printf("# but this is not the case in all shells.\n"); - printf("netestmatch() { case $2 in $1) ;; *) failed netestmatch \"$@\";; esac; }\n"); - printf("netestnomatch() { case $2 in $1) failed netestnomatch \"$@\";; esac; }\n"); - } - n = sizeof(testcases) / sizeof(testcases[0]); - for (i = 0; i < n; i++) { - t = &testcases[i]; - if (strchr(t->pattern, '\'') != NULL || - strchr(t->string, '\'') != NULL) - continue; - if (t->flags == 0 && strcmp(t->pattern, "\\") == 0) - continue; - if (num == 1 && t->flags == 0) - printf("test%smatch '%s' '%s'\n", - t->result == FNM_NOMATCH ? "no" : "", - t->pattern, t->string); - if (num == 2 && (t->flags == FNM_NOESCAPE || - (t->flags == 0 && strchr(t->pattern, '\\') == NULL))) - printf("netest%smatch '%s' '%s'\n", - t->result == FNM_NOMATCH ? "no" : "", - t->pattern, t->string); - } - printf("[ -z \"$failures\" ]\n"); - return 0; -} - -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(fnmatch_test); +ATF_TC_BODY(fnmatch_test, tc) { - size_t i, n; - int opt, flags, result, extra, errors; + size_t i; + int flags, result; struct testcase *t; - while ((opt = getopt(argc, argv, "s:")) != -1) { - switch (opt) { - case 's': - return (write_sh_tests(argv[0], atoi(optarg))); - default: - fprintf(stderr, "usage: %s [-s num]\n", argv[0]); - fprintf(stderr, "-s option writes tests for sh(1), num is 1 or 2\n"); - exit(1); - } - } - n = sizeof(testcases) / sizeof(testcases[0]); - errors = 0; - printf("1..%zu\n", n); - for (i = 0; i < n; i++) { + for (i = 0; i < nitems(testcases); i++) { t = &testcases[i]; flags = t->flags; - extra = 0; do { result = fnmatch(t->pattern, t->string, flags); if (result != t->result) @@ -289,7 +92,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if (strchr(t->pattern, '\\') != NULL && strchr(t->string, '\\') == NULL && @@ -300,7 +102,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if ((t->string[0] != '.' || t->pattern[0] == '.' || t->result == FNM_NOMATCH) && @@ -310,7 +111,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if ((strchr(t->string, '/') == NULL || t->result == FNM_NOMATCH) && @@ -320,7 +120,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if ((((t->string[0] != '.' || t->pattern[0] == '.') && strstr(t->string, "/.") == NULL) || @@ -331,7 +130,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if ((((t->string[0] != '.' || t->pattern[0] == '.') && strchr(t->string, '/') == NULL) || @@ -342,7 +140,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if ((strchr(t->string, '/') == NULL || t->result == 0) && !(flags & FNM_LEADING_DIR)) { @@ -351,7 +148,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if (t->result == 0 && !(flags & FNM_CASEFOLD)) { flags |= FNM_CASEFOLD; @@ -359,7 +155,6 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } if (strchr(t->pattern, '\\') == NULL && t->result == 0 && @@ -369,22 +164,25 @@ main(int argc, char *argv[]) if (result != t->result) break; flags = t->flags; - extra++; } } while (0); + + ATF_CHECK(result == t->result); if (result == t->result) - printf("ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d (+%d)\n", - i + 1, t->pattern, t->string, - flags_to_string(flags), - result, extra); - else { - printf("not ok %zu - fnmatch(\"%s\", \"%s\", %s) = %d != %d\n", - i + 1, t->pattern, t->string, - flags_to_string(flags), - result, t->result); - errors = 1; - } + printf("fnmatch(\"%s\", \"%s\", %s) == %d\n", + t->pattern, t->string, flags_to_string(flags), result); + else + printf("fnmatch(\"%s\", \"%s\", %s) != %d (was %d)\n", + t->pattern, t->string, flags_to_string(flags), + t->result, result); } - return (errors); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, fnmatch_test); + + return (atf_no_error()); } Added: head/lib/libc/tests/gen/fnmatch_testcases.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/fnmatch_testcases.h Mon Nov 9 06:24:11 2015 (r290572) @@ -0,0 +1,176 @@ +/*- + * Copyright (c) 2010 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 + +struct testcase { + const char *pattern; + const char *string; + int flags; + int result; +} testcases[] = { + "", "", 0, 0, + "a", "a", 0, 0, + "a", "b", 0, FNM_NOMATCH, + "a", "A", 0, FNM_NOMATCH, + "*", "a", 0, 0, + "*", "aa", 0, 0, + "*a", "a", 0, 0, + "*a", "b", 0, FNM_NOMATCH, + "*a*", "b", 0, FNM_NOMATCH, + "*a*b*", "ab", 0, 0, + "*a*b*", "qaqbq", 0, 0, + "*a*bb*", "qaqbqbbq", 0, 0, + "*a*bc*", "qaqbqbcq", 0, 0, + "*a*bb*", "qaqbqbb", 0, 0, + "*a*bc*", "qaqbqbc", 0, 0, + "*a*bb", "qaqbqbb", 0, 0, + "*a*bc", "qaqbqbc", 0, 0, + "*a*bb", "qaqbqbbq", 0, FNM_NOMATCH, + "*a*bc", "qaqbqbcq", 0, FNM_NOMATCH, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0, + "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0, + ".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH, + ".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0, + ".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0, + "*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH, + "??????????*", "123456789", 0, FNM_NOMATCH, + "*??????????", "123456789", 0, FNM_NOMATCH, + "*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0, + "??????????*", "1234567890", 0, 0, + "*??????????", "1234567890", 0, 0, + "*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0, + "??????????*", "12345678901", 0, 0, + "*??????????", "12345678901", 0, 0, + "[x]", "x", 0, 0, + "[*]", "*", 0, 0, + "[?]", "?", 0, 0, + "[", "[", 0, 0, + "[[]", "[", 0, 0, + "[[]", "x", 0, FNM_NOMATCH, + "[*]", "", 0, FNM_NOMATCH, + "[*]", "x", 0, FNM_NOMATCH, + "[?]", "x", 0, FNM_NOMATCH, + "*[*]*", "foo*foo", 0, 0, + "*[*]*", "foo", 0, FNM_NOMATCH, + "[0-9]", "0", 0, 0, + "[0-9]", "5", 0, 0, + "[0-9]", "9", 0, 0, + "[0-9]", "/", 0, FNM_NOMATCH, + "[0-9]", ":", 0, FNM_NOMATCH, + "[0-9]", "*", 0, FNM_NOMATCH, + "[!0-9]", "0", 0, FNM_NOMATCH, + "[!0-9]", "5", 0, FNM_NOMATCH, + "[!0-9]", "9", 0, FNM_NOMATCH, + "[!0-9]", "/", 0, 0, + "[!0-9]", ":", 0, 0, + "[!0-9]", "*", 0, 0, + "*[0-9]", "a0", 0, 0, + "*[0-9]", "a5", 0, 0, + "*[0-9]", "a9", 0, 0, + "*[0-9]", "a/", 0, FNM_NOMATCH, + "*[0-9]", "a:", 0, FNM_NOMATCH, + "*[0-9]", "a*", 0, FNM_NOMATCH, + "*[!0-9]", "a0", 0, FNM_NOMATCH, + "*[!0-9]", "a5", 0, FNM_NOMATCH, + "*[!0-9]", "a9", 0, FNM_NOMATCH, + "*[!0-9]", "a/", 0, 0, + "*[!0-9]", "a:", 0, 0, + "*[!0-9]", "a*", 0, 0, + "*[0-9]", "a00", 0, 0, + "*[0-9]", "a55", 0, 0, + "*[0-9]", "a99", 0, 0, + "*[0-9]", "a0a0", 0, 0, + "*[0-9]", "a5a5", 0, 0, + "*[0-9]", "a9a9", 0, 0, + "\\*", "*", 0, 0, + "\\?", "?", 0, 0, + "\\[x]", "[x]", 0, 0, + "\\[", "[", 0, 0, + "\\\\", "\\", 0, 0, + "*\\**", "foo*foo", 0, 0, + "*\\**", "foo", 0, FNM_NOMATCH, + "*\\\\*", "foo\\foo", 0, 0, + "*\\\\*", "foo", 0, FNM_NOMATCH, + "\\(", "(", 0, 0, + "\\a", "a", 0, 0, + "\\*", "a", 0, FNM_NOMATCH, + "\\?", "a", 0, FNM_NOMATCH, + "\\*", "\\*", 0, FNM_NOMATCH, + "\\?", "\\?", 0, FNM_NOMATCH, + "\\[x]", "\\[x]", 0, FNM_NOMATCH, + "\\[x]", "\\x", 0, FNM_NOMATCH, + "\\[", "\\[", 0, FNM_NOMATCH, + "\\(", "\\(", 0, FNM_NOMATCH, + "\\a", "\\a", 0, FNM_NOMATCH, + "\\", "\\", 0, FNM_NOMATCH, + "\\", "", 0, 0, + "\\*", "\\*", FNM_NOESCAPE, 0, + "\\?", "\\?", FNM_NOESCAPE, 0, + "\\", "\\", FNM_NOESCAPE, 0, + "\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH, + "\\\\", "\\\\", FNM_NOESCAPE, 0, + "*\\*", "foo\\foo", FNM_NOESCAPE, 0, + "*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH, + "*", ".", FNM_PERIOD, FNM_NOMATCH, + "?", ".", FNM_PERIOD, FNM_NOMATCH, + ".*", ".", 0, 0, + ".*", "..", 0, 0, + ".*", ".a", 0, 0, + "[0-9]", ".", FNM_PERIOD, FNM_NOMATCH, + "a*", "a.", 0, 0, + "a/a", "a/a", FNM_PATHNAME, 0, + "a/*", "a/a", FNM_PATHNAME, 0, + "*/a", "a/a", FNM_PATHNAME, 0, + "*/*", "a/a", FNM_PATHNAME, 0, + "a*b/*", "abbb/x", FNM_PATHNAME, 0, + "a*b/*", "abbb/.x", FNM_PATHNAME, 0, + "*", "a/a", FNM_PATHNAME, FNM_NOMATCH, + "*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH, + "b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, + "b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, + "b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, + "b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0, + "a", "A", FNM_CASEFOLD, 0, + "A", "a", FNM_CASEFOLD, 0, + "[a]", "A", FNM_CASEFOLD, 0, + "[A]", "a", FNM_CASEFOLD, 0, + "a", "b", FNM_CASEFOLD, FNM_NOMATCH, + "a", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "*", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH, + "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, + "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, + "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, + "a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, +}; Copied and modified: head/lib/libc/tests/gen/ftw_test.c (from r290571, head/tools/regression/lib/libc/gen/test-ftw.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-ftw.c Mon Nov 9 06:16:38 2015 (r290571, copy source) +++ head/lib/libc/tests/gen/ftw_test.c Mon Nov 9 06:24:11 2015 (r290572) @@ -32,50 +32,26 @@ __FBSDID("$FreeBSD$"); #include - -#include #include #include #include #include +#include #include #include #include #include #include +#include + extern char **environ; -static char dir[] = "/tmp/testftw.XXXXXXXXXX"; +static char template[] = "testftw.XXXXXXXXXX"; +static char dir[PATH_MAX]; static int failures; static int ftwflags; -static void -cleanup(int ustatus __unused) -{ - int error, status; - pid_t pid, waitres; - const char *myargs[5]; - - err_set_exit(NULL); - myargs[0] = "rm"; - myargs[1] = "-rf"; - myargs[2] = "--"; - myargs[3] = dir; - myargs[4] = NULL; - error = posix_spawnp(&pid, myargs[0], NULL, NULL, - __DECONST(char **, myargs), environ); - if (error != 0) - warn("posix_spawnp rm"); - else { - waitres = waitpid(pid, &status, 0); - if (waitres != pid) - warnx("waitpid rm failed"); - else if (status != 0) - warnx("rm failed"); - } -} - static int cb(const char *path, const struct stat *st, int type, struct FTW *f) { @@ -94,50 +70,59 @@ cb(const char *path, const struct stat * return (0); break; } - warnx("unexpected path=%s type=%d f.level=%d\n", + ATF_CHECK_MSG(false, + "unexpected path=%s type=%d f.level=%d\n", path, type, f->level); - failures++; return (0); } -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(ftw_test); +ATF_TC_BODY(ftw_test, tc) { int fd; - if (!mkdtemp(dir)) - err(2, "mkdtemp"); + ATF_REQUIRE_MSG(mkdtemp(template) != NULL, "mkdtemp failed"); - err_set_exit(cleanup); + /* XXX: the path needs to be absolute for the 0/FTW_DEPTH testcases */ + ATF_REQUIRE_MSG(realpath(template, dir) != NULL, + "realpath failed; errno=%d", errno); - fd = open(dir, O_DIRECTORY | O_RDONLY); - if (fd == -1) - err(2, "open %s", dir); + fd = open(dir, O_DIRECTORY|O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed; errno=%d", errno); - if (mkdirat(fd, "d1", 0777) == -1) - err(2, "mkdirat d1"); + ATF_REQUIRE_MSG(mkdirat(fd, "d1", 0777) == 0, + "mkdirat failed; errno=%d", errno); - if (symlinkat(dir, fd, "d1/looper") == -1) - err(2, "symlinkat looper"); + ATF_REQUIRE_MSG(symlinkat(dir, fd, "d1/looper") == 0, + "symlinkat failed; errno=%d", errno); + printf("ftwflags=FTW_PHYS\n"); ftwflags = FTW_PHYS; - if (nftw(dir, cb, 10, ftwflags) == -1) - err(2, "nftw FTW_PHYS"); - ftwflags = FTW_PHYS | FTW_DEPTH; - if (nftw(dir, cb, 10, ftwflags) == -1) - err(2, "nftw FTW_PHYS | FTW_DEPTH"); + ATF_REQUIRE_MSG(nftw(dir, cb, 10, ftwflags) != -1, + "nftw FTW_PHYS failed; errno=%d", errno); + + printf("ftwflags=FTW_PHYS|FTW_DEPTH\n"); + ftwflags = FTW_PHYS|FTW_DEPTH; + ATF_REQUIRE_MSG(nftw(dir, cb, 10, ftwflags) != -1, + "nftw FTW_PHYS|FTW_DEPTH failed; errno=%d", errno); + + printf("ftwflags=0\n"); ftwflags = 0; - if (nftw(dir, cb, 10, ftwflags) == -1) - err(2, "nftw 0"); + ATF_REQUIRE_MSG(nftw(dir, cb, 10, ftwflags) != -1, + "nftw 0 failed; errno=%d", errno); + + printf("ftwflags=FTW_DEPTH\n"); ftwflags = FTW_DEPTH; - if (nftw(dir, cb, 10, ftwflags) == -1) - err(2, "nftw FTW_DEPTH"); + ATF_REQUIRE_MSG(nftw(dir, cb, 10, ftwflags) != -1, + "nftw FTW_DEPTH failed; errno=%d", errno); close(fd); +} - printf("PASS nftw()\n"); +ATF_TP_ADD_TCS(tp) +{ - cleanup(failures != 0); + ATF_TP_ADD_TC(tp, ftw_test); - return (failures != 0); + return (atf_no_error()); } Copied and modified: head/lib/libc/tests/gen/popen_test.c (from r290571, head/tools/regression/lib/libc/gen/test-popen.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-popen.c Mon Nov 9 06:16:38 2015 (r290571, copy source) +++ head/lib/libc/tests/gen/popen_test.c Mon Nov 9 06:24:11 2015 (r290572) @@ -32,9 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include #include - -#include #include #include #include @@ -42,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include -static int failures; +#include + static volatile sig_atomic_t got_sigpipe; static void @@ -54,174 +54,198 @@ sigpipe_handler(int sig __unused) static void check_cloexec(FILE *fp, const char *mode) { - int flags; + int exp_flags, flags; flags = fcntl(fileno(fp), F_GETFD); + ATF_CHECK_MSG(flags != -1, "fcntl(F_GETFD) failed; errno=%d", errno); if (flags == -1) - fprintf(stderr, "fcntl(F_GETFD) failed\n"), failures++; - else if ((flags & FD_CLOEXEC) != - (strchr(mode, 'e') != NULL ? FD_CLOEXEC : 0)) - fprintf(stderr, "Bad cloexec flag\n"), failures++; + return; + if (strchr(mode, 'e') != NULL) + exp_flags = FD_CLOEXEC; + else + exp_flags = 0; + ATF_CHECK_MSG((flags & FD_CLOEXEC) == exp_flags, + "bad cloexec flag; %d != %d", flags, exp_flags); } -int -main(int argc, char *argv[]) +ATF_TC_WITHOUT_HEAD(popen_all_modes_test); +ATF_TC_BODY(popen_all_modes_test, tc) { FILE *fp, *fp2; - int i, j, status; + int i, status; const char *mode; const char *allmodes[] = { "r", "w", "r+", "re", "we", "r+e", "re+" }; - const char *rmodes[] = { "r", "r+", "re", "r+e", "re+" }; - const char *wmodes[] = { "w", "r+", "we", "r+e", "re+" }; - const char *rwmodes[] = { "r+", "r+e", "re+" }; - char buf[80]; - struct sigaction act, oact; - for (i = 0; i < sizeof(allmodes) / sizeof(allmodes[0]); i++) { + for (i = 0; i < nitems(allmodes); i++) { mode = allmodes[i]; fp = popen("exit 7", mode); - if (fp == NULL) { - fprintf(stderr, "popen(, \"%s\") failed", mode); - failures++; + ATF_CHECK_MSG(fp != NULL, "popen(, \"%s\") failed", mode); + if (fp == NULL) continue; - } check_cloexec(fp, mode); status = pclose(fp); - if (!WIFEXITED(status) || WEXITSTATUS(status) != 7) - fprintf(stderr, "Bad exit status (no I/O)\n"), failures++; + ATF_CHECK_MSG(WIFEXITED(status) && WEXITSTATUS(status) == 7, + "bad exit status (no I/O)"); } +} - for (i = 0; i < sizeof(rmodes) / sizeof(rmodes[0]); i++) { +ATF_TC_WITHOUT_HEAD(popen_rmodes_test); +ATF_TC_BODY(popen_rmodes_test, tc) +{ + FILE *fp, *fp2; + const char *rmodes[] = { "r", "r+", "re", "r+e", "re+" }; + const char *mode; + char buf[80]; + int i, status; + + for (i = 0; i < nitems(rmodes); i++) { mode = rmodes[i]; fp = popen("exit 9", mode); - if (fp == NULL) { - fprintf(stderr, "popen(, \"%s\") failed", mode); - failures++; + ATF_CHECK_MSG(fp != NULL, "popen(, \"%s\") failed", mode); + if (fp == NULL) continue; - } check_cloexec(fp, mode); - if (fgetc(fp) != EOF || !feof(fp) || ferror(fp)) - fprintf(stderr, "Input error 1\n"), failures++; + bool input_error_1 = !(fgetc(fp) != EOF || !feof(fp) || !ferror(fp)); + ATF_CHECK_MSG(!input_error_1, "input error 1"); + if (input_error_1) + continue; status = pclose(fp); - if (!WIFEXITED(status) || WEXITSTATUS(status) != 9) - fprintf(stderr, "Bad exit status (input)\n"), failures++; + ATF_CHECK_MSG(WIFEXITED(status) && WEXITSTATUS(status) == 9, + "bad exit status (input)"); } - for (i = 0; i < sizeof(rmodes) / sizeof(rmodes[0]); i++) { + for (i = 0; i < nitems(rmodes); i++) { + char *sres; mode = rmodes[i]; fp = popen("echo hi there", mode); - if (fp == NULL) { - fprintf(stderr, "popen(, \"%s\") failed", mode); - failures++; + ATF_CHECK_MSG(fp != NULL, "popen(, \"%s\") failed", mode); + if (fp == NULL) continue; - } check_cloexec(fp, mode); - if (fgets(buf, sizeof(buf), fp) == NULL) - fprintf(stderr, "Input error 2\n"), failures++; - else if (strcmp(buf, "hi there\n") != 0) - fprintf(stderr, "Bad input 1\n"), failures++; + ATF_CHECK_MSG((sres = fgets(buf, sizeof(buf), fp)) != NULL, + "Input error 2"); + if (sres != NULL) + ATF_CHECK_MSG(strcmp(buf, "hi there\n") == 0, + "Bad input 1"); status = pclose(fp); - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) - fprintf(stderr, "Bad exit status (input)\n"), failures++; + ATF_CHECK_MSG(WIFEXITED(status) && WEXITSTATUS(status) == 0, + "Bad exit status (input)"); } +} + +ATF_TC_WITHOUT_HEAD(popen_wmodes_test); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Nov 9 06:30:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ABBDA29A38; Mon, 9 Nov 2015 06:30:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED2A31FA4; Mon, 9 Nov 2015 06:30:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA96UQTb063913; Mon, 9 Nov 2015 06:30:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96UQCJ063912; Mon, 9 Nov 2015 06:30:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201511090630.tA96UQCJ063912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Nov 2015 06:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290573 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:30:28 -0000 Author: gjb Date: Mon Nov 9 06:30:26 2015 New Revision: 290573 URL: https://svnweb.freebsd.org/changeset/base/290573 Log: Remove noatime from tmpfs(5) fstab(5) entry. Submitted by: Howard Su MFC after: 3 days X-MFC-With: r290550 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Nov 9 06:24:11 2015 (r290572) +++ head/release/tools/arm.subr Mon Nov 9 06:30:26 2015 (r290573) @@ -110,7 +110,7 @@ arm_install_base() { >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "tmpfs /tmp tmpfs rw,noatime,mode=1777,size=30m 0 0" \ + echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname From owner-svn-src-all@freebsd.org Mon Nov 9 06:31:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2020A29BA4; Mon, 9 Nov 2015 06:31:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C860111D4; Mon, 9 Nov 2015 06:31:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 20B721011; Mon, 9 Nov 2015 06:31:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Nov 2015 06:31:25 +0000 From: Glen Barber To: Howard Su Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r290550 - head/release/tools Message-ID: <20151109063125.GD2832@FreeBSD.org> References: <201511081802.tA8I2eBQ049912@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n/aVsWSeQ4JHkrmm" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:31:28 -0000 --n/aVsWSeQ4JHkrmm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable You are correct, thank you for noticing. I've committed the fix as r290573, which will be merged to stable/10 along with r290550. Glen On Mon, Nov 09, 2015 at 01:49:29PM +0800, Howard Su wrote: > tmpfs doesn't support noatime option. please remove it. >=20 > On Mon, Nov 9, 2015 at 2:02 AM, Glen Barber wrote: >=20 > > Author: gjb > > Date: Sun Nov 8 18:02:39 2015 > > New Revision: 290550 > > URL: https://svnweb.freebsd.org/changeset/base/290550 > > > > Log: > > Use tmpfs(5) instead of md(4) for '/tmp' mount. > > > > Submitted by: Nikolai Lifanov > > Differential Revision: D3506 > > MFC after: 3 days > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/release/tools/arm.subr > > > > Modified: head/release/tools/arm.subr > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/tools/arm.subr Sun Nov 8 18:00:44 2015 (r29054= 9) > > +++ head/release/tools/arm.subr Sun Nov 8 18:02:39 2015 (r29055= 0) > > @@ -110,7 +110,7 @@ arm_install_base() { > > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > > echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0= " \ > > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > > - echo "md /tmp mfs rw,noatime,-s30m 0 0" \ > > + echo "tmpfs /tmp tmpfs rw,noatime,mode=3D1777,size=3D30m 0 0" \ > > >> ${CHROOTDIR}/${DESTDIR}/etc/fstab > > > > local hostname > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > >=20 >=20 >=20 > --=20 > -Howard --n/aVsWSeQ4JHkrmm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWQD23AAoJEAMUWKVHj+KTQdQQAIbIPx8QXcEse8oj2XUzm86l OID+yOmdQaiyj3mh4Za+dzNEqfu6ligNWZfgpt/H07P5XjdNAGXzqC2B7ZiGba4E nUtHbgvcdoSqaGZBV2hdfZcvsUMsCnrKBZjouhxHPvHW+jZNpp3UdIiEH8ubhADs cFOE4Ytz0Be7Tva0z2cuYUxnMsDcy/WK5pogAnre2z/fnCOyenfSvvlVFAWGtY7z oBkvi+Bor33ewvoHbFekIAyfCx2e6MtEZEytdmsnGEjarnfL77r80509+RwWZqXJ 6LPbooKaJK3plANdLVa4Tw0C4Q2/+KEEs40vvwnWFiA5/bbF1BRwLp0wOV83UzI4 lfkrGzH41jis9eX4BCbwfbm4KkXUMpA1nqGnXAJEl6qoLu0+FRQt7I//wMQ4QzYg obK306KhwqeYL7EKxd5ws37/xGjIJX2MbIWmWYf4Rd7kL8lZKxpwXXfNGf7rZnXQ 8/NMmMtmLbQCJwCvNturRh6Uj272nOS7muzmZepT3P2Z1O3nsCooEKxmMPgpUfNv 0wPlnBPLzPql2ml/RY1dvI943iLW0fpRy2tY9uZo9VlZjxTCoz5pifqKUo3336WC zEnmBRXsd+PaHyt5PE76b+1/UQxvVxWGF2YurYOb3hSsrTF1EvJKD+mA0SEsqWh5 9GECKuekWCE0GitxM900 =lfK9 -----END PGP SIGNATURE----- --n/aVsWSeQ4JHkrmm-- From owner-svn-src-all@freebsd.org Mon Nov 9 06:50:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A21EDA2A12F; Mon, 9 Nov 2015 06:50:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 614501BE9; Mon, 9 Nov 2015 06:50:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA96oh1Y069728; Mon, 9 Nov 2015 06:50:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96ohTg069724; Mon, 9 Nov 2015 06:50:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090650.tA96ohTg069724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290574 - in stable/10: bin/dd bin/dd/tests contrib/netbsd-tests/bin/dd etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:50:44 -0000 Author: ngie Date: Mon Nov 9 06:50:42 2015 New Revision: 290574 URL: https://svnweb.freebsd.org/changeset/base/290574 Log: MFC r289487: Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as bin/dd/tests Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero Sponsored by: EMC / Isilon Storage Division Added: stable/10/bin/dd/tests/ - copied from r289487, head/bin/dd/tests/ Modified: stable/10/bin/dd/Makefile stable/10/bin/dd/tests/Makefile stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/Makefile ============================================================================== --- stable/10/bin/dd/Makefile Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/bin/dd/Makefile Mon Nov 9 06:50:42 2015 (r290574) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= dd SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c @@ -24,4 +26,8 @@ test: ${PROG} gen .endfor @rm -f gen +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/dd/tests/Makefile ============================================================================== --- head/bin/dd/tests/Makefile Sun Oct 18 05:49:58 2015 (r289487) +++ stable/10/bin/dd/tests/Makefile Mon Nov 9 06:50:42 2015 (r290574) @@ -1,5 +1,10 @@ # $FreeBSD$ +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/dd +TESTSDIR= ${TESTSBASE}/bin/dd + NETBSD_ATF_TESTS_SH= dd_test .include Modified: stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh ============================================================================== --- stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh Mon Nov 9 06:50:42 2015 (r290574) @@ -44,6 +44,12 @@ length_head() { "the one expected to fail. (NetBSD PR bin/8521)" } length_body() { + # Begin FreeBSD + if ! df /dev/fd | grep -q '^fdescfs'; then + atf_skip "fdescfs is not mounted on /dev/fd" + fi + # End FreeBSD + test_dd_length 512 \ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >/dev/null 2>/dev/null" test_dd_length 512 \ Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 06:50:42 2015 (r290574) @@ -10,6 +10,8 @@ .. date .. + dd + .. expr .. ls From owner-svn-src-all@freebsd.org Mon Nov 9 06:55:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A20A2A235; Mon, 9 Nov 2015 06:55:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9B3C1334; Mon, 9 Nov 2015 06:55:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA96t5t0072465; Mon, 9 Nov 2015 06:55:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96t5nx072464; Mon, 9 Nov 2015 06:55:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090655.tA96t5nx072464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290575 - stable/10/secure/lib/libcrypto/engines/libgost X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:55:06 -0000 Author: ngie Date: Mon Nov 9 06:55:04 2015 New Revision: 290575 URL: https://svnweb.freebsd.org/changeset/base/290575 Log: MFC r290178: Fix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it picks up undefined symbols, like "ERR_load_GOST_strings" PR: 184805 Submitted by: Ivan IvanZhdanov Sponsored by: EMC / Isilon Storage Division Modified: stable/10/secure/lib/libcrypto/engines/libgost/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/secure/lib/libcrypto/engines/libgost/Makefile ============================================================================== --- stable/10/secure/lib/libcrypto/engines/libgost/Makefile Mon Nov 9 06:50:42 2015 (r290574) +++ stable/10/secure/lib/libcrypto/engines/libgost/Makefile Mon Nov 9 06:55:04 2015 (r290575) @@ -3,6 +3,7 @@ SHLIB_NAME?= libgost.so SRCS= gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c gost_ameth.c \ gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c gost_keywrap.c \ - gost_md.c gost_params.c gost_pmeth.c gost_sign.c gosthash.c + gost_md.c gost_params.c gost_pmeth.c gost_sign.c gosthash.c \ + e_gost_err.c .include From owner-svn-src-all@freebsd.org Mon Nov 9 07:07:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD0EA2A472; Mon, 9 Nov 2015 07:07:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBD71992; Mon, 9 Nov 2015 07:07:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA977PfD075279; Mon, 9 Nov 2015 07:07:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA977Pxt075278; Mon, 9 Nov 2015 07:07:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090707.tA977Pxt075278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290576 - stable/10/usr.sbin/rtsold X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:07:26 -0000 Author: ngie Date: Mon Nov 9 07:07:25 2015 New Revision: 290576 URL: https://svnweb.freebsd.org/changeset/base/290576 Log: MFC r290182: Fix rtsold's usage message - Remove -a from the usage message example dealing with specific interfaces. -a only makes sense when not specifying an interface, such that it's to be run on all interfaces - Fix the pidfile option (it's -p, not -P) - Change `interfaces` to `interface` to match the manpage PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/rtsold/rtsold.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/10/usr.sbin/rtsold/rtsold.c Mon Nov 9 06:55:04 2015 (r290575) +++ stable/10/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:07:25 2015 (r290576) @@ -834,15 +834,15 @@ static void usage(void) { #ifndef SMALL - fprintf(stderr, "usage: rtsold [-adDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] interface ...\n"); + fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + "[-p pidfile] [-R script-name] -a\n"); #else fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); + "[-p pidfile] [-R script-name] interface ...\n"); fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] -a\n"); #endif } From owner-svn-src-all@freebsd.org Mon Nov 9 07:10:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948A2A2A4D5; Mon, 9 Nov 2015 07:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CE51AFB; Mon, 9 Nov 2015 07:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97AW36075465; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97AWbC075464; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090710.tA97AWbC075464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290577 - stable/9/usr.sbin/rtsold X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:10:33 -0000 Author: ngie Date: Mon Nov 9 07:10:32 2015 New Revision: 290577 URL: https://svnweb.freebsd.org/changeset/base/290577 Log: MFstable/10 r290576: MFC r290182: Fix rtsold's usage message - Remove -a from the usage message example dealing with specific interfaces. -a only makes sense when not specifying an interface, such that it's to be run on all interfaces - Fix the pidfile option (it's -p, not -P) - Change `interfaces` to `interface` to match the manpage PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/rtsold/rtsold.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtsold/ (props changed) Modified: stable/9/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:07:25 2015 (r290576) +++ stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:10:32 2015 (r290577) @@ -839,15 +839,15 @@ static void usage(void) { #ifndef SMALL - fprintf(stderr, "usage: rtsold [-adDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] interface ...\n"); + fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + "[-p pidfile] [-R script-name] -a\n"); #else fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); + "[-p pidfile] [-R script-name] interface ...\n"); fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] -a\n"); #endif } From owner-svn-src-all@freebsd.org Mon Nov 9 07:16:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E691A2A64D; Mon, 9 Nov 2015 07:16:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E0DB1EAB; Mon, 9 Nov 2015 07:16:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97GHB8078267; Mon, 9 Nov 2015 07:16:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97GHdI078266; Mon, 9 Nov 2015 07:16:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090716.tA97GHdI078266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290578 - stable/10/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:16:18 -0000 Author: ngie Date: Mon Nov 9 07:16:17 2015 New Revision: 290578 URL: https://svnweb.freebsd.org/changeset/base/290578 Log: MFC r290184: Fix a set but not used variable warning flagged by gcc 4.9 with lib/libc/ssp/h_readlink Sponsored by: EMC / Isilon Storage Division Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 9 07:10:32 2015 (r290577) +++ stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 9 07:16:17 2015 (r290578) @@ -46,7 +46,6 @@ main(int argc, char *argv[]) { #ifdef __FreeBSD__ char b[512], *sl; - int n; size_t len = atoi(argv[1]); sl = malloc(len); memset(sl, 'a', len); @@ -54,7 +53,7 @@ main(int argc, char *argv[]) unlink("symlink"); if (symlink(sl, "symlink") == -1) err(1, "symlink()"); - n = readlink("symlink", b, len); + (void)readlink("symlink", b, len); unlink("symlink"); #else char b[MAXPATHLEN]; From owner-svn-src-all@freebsd.org Mon Nov 9 07:18:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE616A2A6C8; Mon, 9 Nov 2015 07:18:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98EA61018; Mon, 9 Nov 2015 07:18:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97I96m078386; Mon, 9 Nov 2015 07:18:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97I9wN078385; Mon, 9 Nov 2015 07:18:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090718.tA97I9wN078385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290579 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:18:10 -0000 Author: ngie Date: Mon Nov 9 07:18:09 2015 New Revision: 290579 URL: https://svnweb.freebsd.org/changeset/base/290579 Log: MFC r289903: Add libvmmapi to OptionalObsoleteFiles.inc when MK_BHYVE == no Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 9 07:16:17 2015 (r290578) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 9 07:18:09 2015 (r290579) @@ -172,6 +172,10 @@ OLD_DIRS+=etc/autofs .endif .if ${MK_BHYVE} == no +OLD_FILES+=usr/lib/libvmmapi.a +OLD_FILES+=usr/lib/libvmmapi.so +OLD_LIBS+=usr/lib/libvmmapi.so.5 +OLD_FILES+=usr/include/vmmapi.h OLD_FILES+=usr/sbin/bhyve OLD_FILES+=usr/sbin/bhyvectl OLD_FILES+=usr/sbin/bhyveload From owner-svn-src-all@freebsd.org Mon Nov 9 07:26:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F9DA2A885; Mon, 9 Nov 2015 07:26:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2F5E1468; Mon, 9 Nov 2015 07:26:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97QYqK081313; Mon, 9 Nov 2015 07:26:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97QYh6081311; Mon, 9 Nov 2015 07:26:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090726.tA97QYh6081311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290580 - stable/10/tools/regression/security/open_to_operation X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:26:36 -0000 Author: ngie Date: Mon Nov 9 07:26:34 2015 New Revision: 290580 URL: https://svnweb.freebsd.org/changeset/base/290580 Log: MFC r290190,r290251: r290190: Fix compiler warnings with open_to_operation.c Other sidenotes: - Remove unused variables with main(..) - Convert errx/exit with -1 to errx/exit with 1 - Fix a bogus test in try_directory_open (expected_errno == expected_errno -> errno == expected_errno) [*] - Fix some warnings related to discarded qualifiers - Remove a bogus else-statement at the end of check_mmap_exec(..) in the successful case. mmap(2), POSIX, Linux, etc all don't state what the behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to get the test program to pass again. PR: 201286 [*] Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division r290251: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/security/open_to_operation/Makefile stable/10/tools/regression/security/open_to_operation/open_to_operation.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/security/open_to_operation/Makefile ============================================================================== --- stable/10/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:18:09 2015 (r290579) +++ stable/10/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:26:34 2015 (r290580) @@ -2,6 +2,6 @@ PROG= open_to_operation MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: stable/10/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- stable/10/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:18:09 2015 (r290579) +++ stable/10/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:26:34 2015 (r290580) @@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$"); */ static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR, O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC }; -static const int file_modes_count = sizeof(file_modes) / sizeof(int); +static const int file_modes_count = nitems(file_modes); static const int dir_modes[] = { O_RDONLY }; -static const int dir_modes_count = sizeof(dir_modes) / sizeof(int); +static const int dir_modes_count = nitems(dir_modes); static int testnum; static int aio_present; @@ -169,9 +169,9 @@ try_directory_open(const char *testname, ok_mode(testname, NULL, mode); close(dfd); } else { - if (expected_errno && expected_errno == expected_errno) + if (expected_errno && expected_errno == errno) ok_mode(testname, NULL, mode); - else if (expected_errno) + else if (expected_errno != 0) notok_mode(testname, "wrong errno", mode); else notok_mode(testname, "failed", mode); @@ -753,7 +753,8 @@ pwritev_wrapper(int d, const void *buf, static ssize_t aio_write_wrapper(int d, const void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -839,7 +840,8 @@ preadv_wrapper(int d, void *buf, size_t static ssize_t aio_read_wrapper(int d, void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -847,7 +849,6 @@ aio_read_wrapper(int d, void *buf, size_ aiocb.aio_nbytes = nbytes; if (aio_read(&aiocb) < 0) return (-1); - aiocb_array[0] = &aiocb; if (aio_suspend(aiocb_array, 1, NULL) < 0) return (-1); return (aio_return(&aiocb)); @@ -1009,12 +1010,8 @@ check_mmap_exec(const char *testname, co if (isdir) notok_mode(testname, "mmap dir succeeded", mode); - else if ((mode & O_ACCMODE) == O_RDONLY || - (mode & O_ACCMODE) == O_RDWR) - ok_mode(testname, "mmap file succeeded", - mode); else - notok_mode(testname, "mmap file succeeded", + ok_mode(testname, "mmap file succeeded", mode); (void)munmap(addr, getpagesize()); } @@ -1069,7 +1066,7 @@ check_mmap_write_private(const char *tes } int -main(int argc, char *argv[]) +main(void) { char dir_path[PATH_MAX], file_path[PATH_MAX]; int dummy, fd; @@ -1084,25 +1081,25 @@ main(int argc, char *argv[]) strlcpy(dir_path, "/tmp/open-dir.XXXXXXXXXXX", sizeof(dir_path)); if (mkdtemp(dir_path) == NULL) - err(-1, "mkdtemp"); + err(1, "mkdtemp"); if (chmod(dir_path, PERM_DIR) < 0) { warn("chmod %s", dir_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } strlcpy(file_path, "/tmp/open-file.XXXXXXXXXXX", sizeof(file_path)); fd = mkstemp(file_path); if (fd < 0) { warn("mkstemp"); (void)rmdir(dir_path); - exit(-1); + exit(1); } close(fd); if (chmod(file_path, PERM_FILE) < 0) { warn("chmod %s", file_path); (void)unlink(file_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } check_directory_open_modes(dir_path, file_modes, file_modes_count); From owner-svn-src-all@freebsd.org Mon Nov 9 07:28:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA7EA2A8E4; Mon, 9 Nov 2015 07:28:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B71D161E; Mon, 9 Nov 2015 07:28:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97SH6j081445; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97SHLv081443; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090728.tA97SHLv081443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290581 - stable/9/tools/regression/security/open_to_operation X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:28:18 -0000 Author: ngie Date: Mon Nov 9 07:28:17 2015 New Revision: 290581 URL: https://svnweb.freebsd.org/changeset/base/290581 Log: MFstable/10 r290580: MFC r290190,r290251: r290190: Fix compiler warnings with open_to_operation.c Other sidenotes: - Remove unused variables with main(..) - Convert errx/exit with -1 to errx/exit with 1 - Fix a bogus test in try_directory_open (expected_errno == expected_errno -> errno == expected_errno) [*] - Fix some warnings related to discarded qualifiers - Remove a bogus else-statement at the end of check_mmap_exec(..) in the successful case. mmap(2), POSIX, Linux, etc all don't state what the behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to get the test program to pass again. PR: 201286 [*] Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division r290251: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/security/open_to_operation/Makefile stable/9/tools/regression/security/open_to_operation/open_to_operation.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/security/open_to_operation/Makefile ============================================================================== --- stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:28:17 2015 (r290581) @@ -2,6 +2,6 @@ PROG= open_to_operation NO_MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: stable/9/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:28:17 2015 (r290581) @@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$"); */ static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR, O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC }; -static const int file_modes_count = sizeof(file_modes) / sizeof(int); +static const int file_modes_count = nitems(file_modes); static const int dir_modes[] = { O_RDONLY }; -static const int dir_modes_count = sizeof(dir_modes) / sizeof(int); +static const int dir_modes_count = nitems(dir_modes); static int testnum; static int aio_present; @@ -169,9 +169,9 @@ try_directory_open(const char *testname, ok_mode(testname, NULL, mode); close(dfd); } else { - if (expected_errno && expected_errno == expected_errno) + if (expected_errno && expected_errno == errno) ok_mode(testname, NULL, mode); - else if (expected_errno) + else if (expected_errno != 0) notok_mode(testname, "wrong errno", mode); else notok_mode(testname, "failed", mode); @@ -753,7 +753,8 @@ pwritev_wrapper(int d, const void *buf, static ssize_t aio_write_wrapper(int d, const void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -839,7 +840,8 @@ preadv_wrapper(int d, void *buf, size_t static ssize_t aio_read_wrapper(int d, void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -847,7 +849,6 @@ aio_read_wrapper(int d, void *buf, size_ aiocb.aio_nbytes = nbytes; if (aio_read(&aiocb) < 0) return (-1); - aiocb_array[0] = &aiocb; if (aio_suspend(aiocb_array, 1, NULL) < 0) return (-1); return (aio_return(&aiocb)); @@ -1009,12 +1010,8 @@ check_mmap_exec(const char *testname, co if (isdir) notok_mode(testname, "mmap dir succeeded", mode); - else if ((mode & O_ACCMODE) == O_RDONLY || - (mode & O_ACCMODE) == O_RDWR) - ok_mode(testname, "mmap file succeeded", - mode); else - notok_mode(testname, "mmap file succeeded", + ok_mode(testname, "mmap file succeeded", mode); (void)munmap(addr, getpagesize()); } @@ -1069,7 +1066,7 @@ check_mmap_write_private(const char *tes } int -main(int argc, char *argv[]) +main(void) { char dir_path[PATH_MAX], file_path[PATH_MAX]; int dummy, fd; @@ -1084,25 +1081,25 @@ main(int argc, char *argv[]) strlcpy(dir_path, "/tmp/open-dir.XXXXXXXXXXX", sizeof(dir_path)); if (mkdtemp(dir_path) == NULL) - err(-1, "mkdtemp"); + err(1, "mkdtemp"); if (chmod(dir_path, PERM_DIR) < 0) { warn("chmod %s", dir_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } strlcpy(file_path, "/tmp/open-file.XXXXXXXXXXX", sizeof(file_path)); fd = mkstemp(file_path); if (fd < 0) { warn("mkstemp"); (void)rmdir(dir_path); - exit(-1); + exit(1); } close(fd); if (chmod(file_path, PERM_FILE) < 0) { warn("chmod %s", file_path); (void)unlink(file_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } check_directory_open_modes(dir_path, file_modes, file_modes_count); From owner-svn-src-all@freebsd.org Mon Nov 9 07:34:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490CAA2AAD9; Mon, 9 Nov 2015 07:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 158B41C1C; Mon, 9 Nov 2015 07:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97YVPX084159; Mon, 9 Nov 2015 07:34:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97YVk9084158; Mon, 9 Nov 2015 07:34:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090734.tA97YVk9084158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290582 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:34:32 -0000 Author: ngie Date: Mon Nov 9 07:34:30 2015 New Revision: 290582 URL: https://svnweb.freebsd.org/changeset/base/290582 Log: MFC r290179: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/gen/getgrent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getgrent.c ============================================================================== --- stable/10/lib/libc/gen/getgrent.c Mon Nov 9 07:28:17 2015 (r290581) +++ stable/10/lib/libc/gen/getgrent.c Mon Nov 9 07:34:30 2015 (r290582) @@ -659,14 +659,13 @@ __getgroupmembership(const char *uname, NS_FALLBACK_CB(getgroupmembership_fallback) { NULL, NULL, NULL } }; - int rv; assert(uname != NULL); /* groups may be NULL if just sizing when invoked with maxgrp = 0 */ assert(grpcnt != NULL); *grpcnt = 0; - rv = _nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", + (void)_nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", defaultsrc, uname, agroup, groups, maxgrp, grpcnt); /* too many groups found? */ From owner-svn-src-all@freebsd.org Mon Nov 9 07:36:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4F2A2ABB2; Mon, 9 Nov 2015 07:36:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8AF1DAB; Mon, 9 Nov 2015 07:36:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97atjC084298; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97at7T084297; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090736.tA97at7T084297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290583 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:36:56 -0000 Author: ngie Date: Mon Nov 9 07:36:55 2015 New Revision: 290583 URL: https://svnweb.freebsd.org/changeset/base/290583 Log: MFstable/10 r290582: MFC r290179: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/gen/getgrent.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getgrent.c ============================================================================== --- stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:34:30 2015 (r290582) +++ stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:36:55 2015 (r290583) @@ -659,14 +659,13 @@ __getgroupmembership(const char *uname, NS_FALLBACK_CB(getgroupmembership_fallback) { NULL, NULL, NULL } }; - int rv; assert(uname != NULL); /* groups may be NULL if just sizing when invoked with maxgrp = 0 */ assert(grpcnt != NULL); *grpcnt = 0; - rv = _nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", + (void)_nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", defaultsrc, uname, agroup, groups, maxgrp, grpcnt); /* too many groups found? */ From owner-svn-src-all@freebsd.org Mon Nov 9 07:41:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D86FA2ACF4; Mon, 9 Nov 2015 07:41:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05B681FBD; Mon, 9 Nov 2015 07:41:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97fT6i085416; Mon, 9 Nov 2015 07:41:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97fS7b085252; Mon, 9 Nov 2015 07:41:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090741.tA97fS7b085252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290584 - in stable/10: etc/mtree lib/libc/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:41:30 -0000 Author: ngie Date: Mon Nov 9 07:41:28 2015 New Revision: 290584 URL: https://svnweb.freebsd.org/changeset/base/290584 Log: MFC r290177: Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite as lib/libc/rpc This testcase requires rpcbind be up in running; otherwise the testcases will time out and be skipped Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libc/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:36:55 2015 (r290583) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:41:28 2015 (r290584) @@ -109,6 +109,8 @@ data .. .. + rpc + .. ssp .. stdio Modified: stable/10/lib/libc/tests/Makefile ============================================================================== --- stable/10/lib/libc/tests/Makefile Mon Nov 9 07:36:55 2015 (r290583) +++ stable/10/lib/libc/tests/Makefile Mon Nov 9 07:41:28 2015 (r290584) @@ -13,6 +13,7 @@ TESTS_SUBDIRS+= hash TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= regex +TESTS_SUBDIRS+= rpc TESTS_SUBDIRS+= stdio TESTS_SUBDIRS+= stdlib TESTS_SUBDIRS+= string From owner-svn-src-all@freebsd.org Mon Nov 9 07:49:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6861A2AFFD; Mon, 9 Nov 2015 07:49:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F53B1532; Mon, 9 Nov 2015 07:49:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97nd0N087455; Mon, 9 Nov 2015 07:49:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97nd3C087453; Mon, 9 Nov 2015 07:49:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090749.tA97nd3C087453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290585 - in stable/10: etc/mtree tests/sys tests/sys/posixshm tools/regression/posixshm tools/test/posixshm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:49:40 -0000 Author: ngie Date: Mon Nov 9 07:49:39 2015 New Revision: 290585 URL: https://svnweb.freebsd.org/changeset/base/290585 Log: MFC r289441: Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD test suite as tests/sys/posixshm Some other highlights: - Convert the testcases over to ATF - Don't use hardcoded paths to /tmp (which violate the ATF/kyua samdbox); use mkstemp to generate temporary paths for non-SHM_ANON shm objects. Sponsored by: EMC / Isilon Storage Division Added: stable/10/tests/sys/posixshm/ - copied from r289441, head/tests/sys/posixshm/ Deleted: stable/10/tools/regression/posixshm/ stable/10/tools/test/posixshm/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:41:28 2015 (r290584) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:49:39 2015 (r290585) @@ -234,6 +234,8 @@ unlink .. .. + posixshm + .. vfs .. vm Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Mon Nov 9 07:41:28 2015 (r290584) +++ stable/10/tests/sys/Makefile Mon Nov 9 07:49:39 2015 (r290585) @@ -11,6 +11,7 @@ TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet +TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm From owner-svn-src-all@freebsd.org Mon Nov 9 07:56:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58331A29359; Mon, 9 Nov 2015 07:56:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FFC91A85; Mon, 9 Nov 2015 07:56:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA97u7wx090304; Mon, 9 Nov 2015 07:56:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97u6ic090298; Mon, 9 Nov 2015 07:56:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090756.tA97u6ic090298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290586 - in stable/10: etc/mtree usr.sbin/makefs usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:56:08 -0000 Author: ngie Date: Mon Nov 9 07:56:06 2015 New Revision: 290586 URL: https://svnweb.freebsd.org/changeset/base/290586 Log: MFC r289739,r289743,r289897,r289901: r289739: Correctly reintroduce the rudimentary smoke tests I botched up in r289684 Sponsored by: EMC / Isilon Storage Division r289743: Revise "create_test_inputs" to simplify the file structure as these testcases don't need to be nested as much as bin/ls/ls_tests.sh do when verifying ls -a, ls -A, etc. This allows the tests to make all paths relative to the top of the temporary directory instead of always tacking on $ATF_TMPDIR, thus complicating things unnecessarily Create non-empty files in create_test_inputs as well now, similar to create_test_inputs2 in bin/ls/ls_tests.sh Compare the input files to the output file contents using diff where possible: - Skip over the fifo comparison for now because it always fails - Skip over the symlink comparison on cd9660 because it always fails today Sponsored by: EMC / Isilon Storage Division r289897: Add more cd9660/FFS makefs testcases General changes: - Parameterize out the mount command. - Use mtree to verify the contents of an image (check_image_contents) instead of using diff (diff verifies content, but not file metadata). - Move common logic out to functions (common_cleanup, mount_image, check_image_contents) - Add stub testcases for makefs -D (crashes with SIGBUS, similar to bug # 192839) - Add a note about the ISO-9660 and rockridge specs - Add testcases that exercise: -- Creating disk images from an mtree and multiple directories. -- -F flag use (not really an extensive testcase right now) cd9660-specific test changes: - Remove an XXX comment about symlinks; I forgot that non-rockridge images turn symlinks into hardlinks. - Add testcases that exercise: -- -o allow-deep-trees -- -o allow-max-name stub testcase (doesn't seem to be implemented in makefs) -- -o preparer (existence in image; not conformance to spec) -- -o publisher (existence in image; not conformance to spec) -- -o rockridge (basic) Sponsored by: EMC / Isilon Storage Division r289901: Remove an ls -l I was using for debugging Sponsored by: EMC / Isilon Storage Division Added: stable/10/usr.sbin/makefs/tests/ - copied from r289739, head/usr.sbin/makefs/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.sbin/makefs/Makefile stable/10/usr.sbin/makefs/tests/Makefile stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:49:39 2015 (r290585) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:56:06 2015 (r290586) @@ -402,6 +402,8 @@ .. fstyp .. + makefs + .. newsyslog .. nmtree Modified: stable/10/usr.sbin/makefs/Makefile ============================================================================== --- stable/10/usr.sbin/makefs/Makefile Mon Nov 9 07:49:39 2015 (r290585) +++ stable/10/usr.sbin/makefs/Makefile Mon Nov 9 07:56:06 2015 (r290586) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= makefs CFLAGS+=-I${.CURDIR} @@ -38,4 +40,8 @@ LDADD+= ${LIBNETBSD} DPADD+= ${LIBSBUF} ${LIBUTIL} LDADD+= -lsbuf -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.sbin/makefs/tests/Makefile ============================================================================== --- head/usr.sbin/makefs/tests/Makefile Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/Makefile Mon Nov 9 07:56:06 2015 (r290586) @@ -1,5 +1,7 @@ # $FreeBSD$ +TESTSDIR= ${TESTSBASE}/usr.sbin/makefs + ATF_TESTS_SH+= makefs_cd9660_tests ATF_TESTS_SH+= makefs_ffs_tests Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,36 +27,262 @@ # $FreeBSD$ # -. "$(dirname "$0")/makefs_tests_common.sh" +# A note on specs: +# - A copy of the ISO-9660 spec can be found here: +# http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf +# - Any references to `rockridge` are referring to the `Rock Ridge` extensions +# of the ISO-9660 spec. A copy of the draft `IEEE-P1282` spec can be found +# here: +# http://www.ymi.com/ymi/sites/default/files/pdf/Rockridge.pdf MAKEFS="makefs -t cd9660" -TEST_IMAGE="test.iso" +MOUNT="mount_cd9660" + +. "$(dirname "$0")/makefs_tests_common.sh" + +common_cleanup() +{ + if ! test_md_device=$(cat $TEST_MD_DEVICE_FILE); then + echo "$TEST_MD_DEVICE_FILE could not be opened; has an md(4) device been attached?" + return + fi + + umount -f /dev/$test_md_device || : + mdconfig -d -u $test_md_device || : +} + +check_base_iso9660_image_contents() +{ + # Symlinks are treated like files when rockridge support isn't + # specified + check_image_contents "$@" -X c + + atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c + atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c +} + +atf_test_case D_flag cleanup +D_flag_body() +{ + atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" + + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + atf_check -e empty -o empty -s exit:0 \ + cp $TEST_SPEC_FILE spec2.mtree + atf_check -e empty -o save:dupe_$TEST_SPEC_FILE -s exit:0 \ + cat $TEST_SPEC_FILE spec2.mtree + + atf_check -e empty -o not-empty -s not-exit:0 \ + $MAKEFS -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -D -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR +} +D_flag_cleanup() +{ + common_cleanup +} + +atf_test_case F_flag cleanup +F_flag_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +F_flag_cleanup() +{ + common_cleanup +} + +atf_test_case from_mtree_spec_file cleanup +from_mtree_spec_file_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k type,link,size -p $TEST_INPUTS_DIR + cd $TEST_INPUTS_DIR + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + cd - + + mount_image + check_base_iso9660_image_contents +} +from_mtree_spec_file_cleanup() +{ + common_cleanup +} + +atf_test_case from_multiple_dirs cleanup +from_multiple_dirs_body() +{ + test_inputs_dir2=$TMPDIR/inputs2 + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 + atf_check -e empty -o empty -s exit:0 \ + touch $test_inputs_dir2/multiple_dirs_test_file + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 + + mount_image + check_base_iso9660_image_contents -d $test_inputs_dir2 +} +from_multiple_dirs_cleanup() +{ + common_cleanup +} -atf_test_case basic_cd9660 cleanup -basic_cd9660_body() +atf_test_case from_single_dir cleanup +from_single_dir_body() { create_test_inputs atf_check -e empty -o empty -s exit:0 \ $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE + + mount_image + check_base_iso9660_image_contents +} +from_single_dir_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_allow_deep_trees cleanup +o_flag_allow_deep_trees_body() +{ + create_test_inputs + + # Make sure the "more than 8 levels deep" requirement is met. + atf_check -e empty -o empty -s exit:0 \ + mkdir -p $TEST_INPUTS_DIR/a/b/c/d/e/f/g/h/i/j + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o allow-deep-trees $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_allow_deep_trees_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_allow_max_name cleanup +o_flag_allow_max_name_body() +{ + atf_expect_fail "-o allow-max-name doesn't appear to be implemented on FreeBSD's copy of makefs [yet]" + + create_test_inputs + + long_path=$TEST_INPUTS_DIR/$(jot -s '' -b 0 37) + + # Make sure the "37 char name" limit requirement is met. + atf_check -e empty -o empty -s exit:0 touch $long_path + atf_check -e empty -o empty -s exit:0 \ - mount_cd9660 /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR + $MAKEFS -o allow-max-name $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_allow_max_name_cleanup() +{ + common_cleanup } -basic_cd9660_cleanup() + +atf_test_case o_flag_preparer +o_flag_preparer_body() { - ls -a + create_test_dirs - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return + preparer='My Very First ISO' + preparer_uppercase="$(echo $preparer | tr '[[:lower:]]' '[[:upper:]]')" - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device + atf_check -e empty -o empty -s exit:0 touch $TEST_INPUTS_DIR/dummy_file + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o preparer="$preparer" $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o match:"$preparer_uppercase" -s exit:0 \ + strings $TEST_IMAGE +} + +atf_test_case o_flag_publisher +o_flag_publisher_body() +{ + create_test_dirs + + publisher='My Super Awesome Publishing Company LTD' + publisher_uppercase="$(echo $publisher | tr '[[:lower:]]' '[[:upper:]]')" + + atf_check -e empty -o empty -s exit:0 touch $TEST_INPUTS_DIR/dummy_file + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o publisher="$publisher" $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o match:"$publisher_uppercase" -s exit:0 \ + strings $TEST_IMAGE +} + +atf_test_case o_flag_rockridge cleanup +o_flag_rockridge_body() +{ + create_test_dirs + + # Make sure the "more than 8 levels deep" requirement is met. + atf_check -e empty -o empty -s exit:0 \ + mkdir -p $TEST_INPUTS_DIR/a/b/c/d/e/f/g/h/i/j + + # Make sure the "pathname larger than 255 chars" requirement is met. + # + # $long_path's needs to be nested in a directory, as creating it + # outright as a 256 char filename via touch will fail with ENAMETOOLONG + long_path=$TEST_INPUTS_DIR/$(jot -s '/' -b "$(jot -s '' -b 0 64)" 4) + atf_check -e empty -o empty -s exit:0 mkdir -p "$(dirname $long_path)" + atf_check -e empty -o empty -s exit:0 touch "$long_path" + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_image_contents -X .rr_moved + + # .rr_moved is a special directory created when you have deep directory + # trees with rock ridge extensions on + atf_check -e empty -o empty -s exit:0 \ + test -d $TEST_MOUNT_DIR/.rr_moved +} +o_flag_rockridge_cleanup() +{ + common_cleanup } atf_init_test_cases() { + atf_add_test_case D_flag + atf_add_test_case F_flag + + atf_add_test_case from_mtree_spec_file + atf_add_test_case from_multiple_dirs + atf_add_test_case from_single_dir - atf_add_test_case basic_cd9660 + atf_add_test_case o_flag_allow_deep_trees + atf_add_test_case o_flag_allow_max_name + atf_add_test_case o_flag_preparer + atf_add_test_case o_flag_publisher + atf_add_test_case o_flag_rockridge } Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_ffs_tests.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,38 +27,146 @@ # $FreeBSD$ # +MAKEFS="makefs -t ffs" +MOUNT="mount" + . "$(dirname "$0")/makefs_tests_common.sh" -MAKEFS="makefs -t ffs" -TEST_IMAGE="test.img" +TEST_TUNEFS_OUTPUT=$TMPDIR/tunefs.output + +common_cleanup() +{ + if ! test_md_device=$(cat $TEST_MD_DEVICE_FILE); then + echo "$TEST_MD_DEVICE_FILE could not be opened; has an md(4) device been attached?" + return + fi + + umount -f /dev/$test_md_device || : + mdconfig -d -u $test_md_device || : +} + +check_ffs_image_contents() +{ + atf_check -e save:$TEST_TUNEFS_OUTPUT -o empty -s exit:0 \ + tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE) + + check_image_contents "$@" +} -atf_test_case basic_ffs cleanup -basic_ffs_body() +atf_test_case D_flag cleanup +D_flag_body() { + atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" + create_test_inputs + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR atf_check -e empty -o not-empty -s exit:0 \ - $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE - atf_check -e save:$ATF_TMPDIR/tunefs.output -o empty -s exit:0 \ - tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE) + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o empty -s exit:0 \ - mount /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR + cp $TEST_SPEC_FILE spec2.mtree + atf_check -e empty -o save:dupe_$TEST_SPEC_FILE -s exit:0 \ + cat $TEST_SPEC_FILE spec2.mtree + + atf_check -e empty -o not-empty -s not-exit:0 \ + $MAKEFS -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -D -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR +} +D_flag_cleanup() +{ + common_cleanup } -basic_ffs_cleanup() + +atf_test_case F_flag cleanup +F_flag_body() { - ls -a + create_test_inputs - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device + mount_image + check_ffs_image_contents +} +F_flag_cleanup() +{ + common_cleanup +} + +atf_test_case from_mtree_spec_file cleanup +from_mtree_spec_file_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k type,link,size -p $TEST_INPUTS_DIR + + cd $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + cd - + + mount_image + check_ffs_image_contents +} +from_mtree_spec_file_cleanup() +{ + common_cleanup +} + +atf_test_case from_multiple_dirs cleanup +from_multiple_dirs_body() +{ + test_inputs_dir2=$TMPDIR/inputs2 + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 + atf_check -e empty -o empty -s exit:0 \ + touch $test_inputs_dir2/multiple_dirs_test_file + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 + + mount_image + check_image_contents -d $test_inputs_dir2 +} +from_multiple_dirs_cleanup() +{ + common_cleanup +} + +atf_test_case from_single_dir cleanup +from_single_dir_body() +{ + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_ffs_image_contents +} +from_single_dir_cleanup() +{ + common_cleanup } atf_init_test_cases() { - atf_add_test_case basic_ffs + atf_add_test_case D_flag + atf_add_test_case F_flag + + atf_add_test_case from_mtree_spec_file + atf_add_test_case from_multiple_dirs + atf_add_test_case from_single_dir + + } Modified: stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_tests_common.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,30 +27,73 @@ # $FreeBSD$ # -TEST_MD_DEVICE_FILE="md.output" -TEST_MOUNT_DIR="mnt" +KB=1024 +: ${TMPDIR=/tmp} +TEST_IMAGE="$TMPDIR/test.img" +TEST_INPUTS_DIR="$TMPDIR/inputs" +TEST_MD_DEVICE_FILE="$TMPDIR/md.output" +TEST_MOUNT_DIR="$TMPDIR/mnt" +TEST_SPEC_FILE="$TMPDIR/mtree.spec" -create_test_dir() +check_image_contents() { - [ -z "$ATF_TMPDIR" ] || return 0 - - export ATF_TMPDIR=$(pwd) - - TEST_MD_DEVICE_FILE="${ATF_TMPDIR}/${TEST_MD_DEVICE_FILE}" - TEST_MOUNT_DIR="${ATF_TMPDIR}/${TEST_MOUNT_DIR}" - - # XXX: need to nest this because of how kyua creates $TMPDIR; otherwise - # it will run into EPERM issues later - TEST_INPUTS_DIR="${ATF_TMPDIR}/test/inputs" + local directories=$TEST_INPUTS_DIR + local excludes mtree_excludes_arg mtree_file + local mtree_keywords="type,link,size" + + while getopts "d:f:m:X:" flag; do + case "$flag" in + d) + directories="$directories $OPTARG" + ;; + f) + mtree_file=$OPTARG + ;; + m) + mtree_keywords=$OPTARG + ;; + X) + excludes="$excludes $OPTARG" + ;; + *) + echo "usage: check_image_contents [-d directory ...] [-f mtree-file] [-m mtree-keywords] [-X exclude]" + atf_fail "unhandled option: $flag" + ;; + esac + done + + if [ -n "$excludes" ]; then + echo "$excludes" | tr ' ' '\n' > excludes.txt + mtree_excludes_arg="-X excludes.txt" + fi + + if [ -z "$mtree_file" ]; then + mtree_file=input_spec.mtree + for directory in $directories; do + mtree -c -k $mtree_keywords -p $directory $mtree_excludes_arg + done > $mtree_file + fi + + echo "<---- Input spec BEGIN ---->" + cat $mtree_file + echo "<---- Input spec END ---->" + atf_check -e empty -o empty -s exit:0 \ + mtree -UW -f $mtree_file \ + -p $TEST_MOUNT_DIR \ + $mtree_excludes_arg +} +create_test_dirs() +{ atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_MOUNT_DIR atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_INPUTS_DIR - cd $TEST_INPUTS_DIR } create_test_inputs() { - create_test_dir + create_test_dirs + + cd $TEST_INPUTS_DIR atf_check -e empty -s exit:0 mkdir -m 0755 -p a/b/1 atf_check -e empty -s exit:0 ln -s a/b c @@ -58,7 +101,9 @@ create_test_inputs() atf_check -e empty -s exit:0 ln d e atf_check -e empty -s exit:0 touch .f atf_check -e empty -s exit:0 mkdir .g - atf_check -e empty -s exit:0 mkfifo h + # XXX: fifos on the filesystem don't match fifos created by makefs for + # some odd reason. + #atf_check -e empty -s exit:0 mkfifo h atf_check -e ignore -s exit:0 dd if=/dev/zero of=i count=1000 bs=1 atf_check -e empty -s exit:0 touch klmn atf_check -e empty -s exit:0 touch opqr @@ -78,4 +123,23 @@ create_test_inputs() atf_check -e empty -s exit:0 touch 0b00001100 atf_check -e empty -s exit:0 touch 0b00001101 atf_check -e empty -s exit:0 touch 0b00001110 + + for filesize in 1 512 $(( 2 * $KB )) $(( 10 * $KB )) $(( 512 * $KB )); \ + do + atf_check -e ignore -o empty -s exit:0 \ + dd if=/dev/zero of=${filesize}.file bs=1 \ + count=1 oseek=${filesize} conv=sparse + files="${files} ${filesize}.file" + done + + cd - } + +mount_image() +{ + atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ + mdconfig -a -f $TEST_IMAGE + atf_check -e empty -o empty -s exit:0 \ + $MOUNT /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR +} + From owner-svn-src-all@freebsd.org Mon Nov 9 08:03:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F90A29AAF; Mon, 9 Nov 2015 08:03:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 885C21EB8; Mon, 9 Nov 2015 08:03:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA983Fns093167; Mon, 9 Nov 2015 08:03:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA983FTI093166; Mon, 9 Nov 2015 08:03:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090803.tA983FTI093166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290587 - stable/10/usr.sbin/makefs/cd9660 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:03:16 -0000 Author: ngie Date: Mon Nov 9 08:03:15 2015 New Revision: 290587 URL: https://svnweb.freebsd.org/changeset/base/290587 Log: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 07:56:06 2015 (r290586) +++ stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; } From owner-svn-src-all@freebsd.org Mon Nov 9 08:05:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2850A29B47; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F14B1072; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA985F5N093319; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA985FnO093318; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090805.tA985FnO093318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290588 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:05:16 -0000 Author: ngie Date: Mon Nov 9 08:05:15 2015 New Revision: 290588 URL: https://svnweb.freebsd.org/changeset/base/290588 Log: MFstable/10 r290587: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) +++ stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:05:15 2015 (r290588) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; } From owner-svn-src-all@freebsd.org Mon Nov 9 08:59:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 750BFA268D1; Mon, 9 Nov 2015 08:59:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E601823; Mon, 9 Nov 2015 08:59:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA98xurk008165; Mon, 9 Nov 2015 08:59:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA98xtWb008161; Mon, 9 Nov 2015 08:59:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090859.tA98xtWb008161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290589 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:59:57 -0000 Author: ngie Date: Mon Nov 9 08:59:55 2015 New Revision: 290589 URL: https://svnweb.freebsd.org/changeset/base/290589 Log: MFC r289203,r290180: r289203 (by adrian): makefs: introduce a new option to specify what to round the resulting image up to. From ticket: While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem. geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label. This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress. The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine. With the patch applied, one can use following commands: $ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img PR: bin/203707 Submitted by: r290180: Follow up to roundup feature addition in r289203 - Rename -r to -R to avoid the clash with makefs -r in NetBSD - Note that -R is an FFS-specific option because it's not implemented in cd9660 today - Rename the roundup variable to "roundup-size" in the manpage and help text for consistency with other variables. - Bump .Dd (missed in r289203) PR: 203707 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/ffs.c stable/10/usr.sbin/makefs/makefs.8 stable/10/usr.sbin/makefs/makefs.c stable/10/usr.sbin/makefs/makefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs.c Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/ffs.c Mon Nov 9 08:59:55 2015 (r290589) @@ -410,6 +410,10 @@ ffs_validate(const char *dir, fsnode *ro /* round up to the next block */ fsopts->size = roundup(fsopts->size, ffs_opts->bsize); + /* round up to requested block size, if any */ + if (fsopts->roundup > 0) + fsopts->size = roundup(fsopts->size, fsopts->roundup); + /* calculate density if necessary */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; Modified: stable/10/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/10/usr.sbin/makefs/makefs.8 Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.8 Mon Nov 9 08:59:55 2015 (r290589) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,6 +53,7 @@ .Op Fl m Ar maximum-size .Op Fl N Ar userdb-dir .Op Fl o Ar fs-options +.Op Fl R Ar roundup-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -195,6 +196,14 @@ Deprecated. See the .Fl Z flag. +.It Fl R Ar roundup-size +Round the image up to +.Ar roundup-size . +.Ar roundup-size +should be a multiple of the file system block size. +This option only applies to the +.Sy ffs +file system type. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: stable/10/usr.sbin/makefs/makefs.c ============================================================================== --- stable/10/usr.sbin/makefs/makefs.c Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.c Mon Nov 9 08:59:55 2015 (r290589) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pr:s:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -209,6 +209,12 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; + case 'R': + /* Round image size up to specified block size */ + fsoptions.roundup = + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + break; + case 's': fsoptions.minsize = fsoptions.maxsize = strsuftoll("size", optarg, 1LL, LLONG_MAX); @@ -359,9 +365,9 @@ usage(void) prog = getprogname(); fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" -"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" -"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", +"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" +"\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" +"\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); } Modified: stable/10/usr.sbin/makefs/makefs.h ============================================================================== --- stable/10/usr.sbin/makefs/makefs.h Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.h Mon Nov 9 08:59:55 2015 (r290589) @@ -130,6 +130,7 @@ typedef struct { int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ + off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-all@freebsd.org Mon Nov 9 09:02:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EFAA26CFF; Mon, 9 Nov 2015 09:02:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D27761C5F; Mon, 9 Nov 2015 09:02:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA992Un0010905; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA992Ugh010901; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090902.tA992Ugh010901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290590 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:02:32 -0000 Author: ngie Date: Mon Nov 9 09:02:30 2015 New Revision: 290590 URL: https://svnweb.freebsd.org/changeset/base/290590 Log: MFstable/10 r290589: MFC r289203,r290180: r289203 (by adrian): makefs: introduce a new option to specify what to round the resulting image up to. From ticket: While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem. geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label. This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress. The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine. With the patch applied, one can use following commands: $ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img PR: bin/203707 Submitted by: r290180: Follow up to roundup feature addition in r289203 - Rename -r to -R to avoid the clash with makefs -r in NetBSD - Note that -R is an FFS-specific option because it's not implemented in cd9660 today - Rename the roundup variable to "roundup-size" in the manpage and help text for consistency with other variables. - Bump .Dd (missed in r289203) PR: 203707 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs.c stable/9/usr.sbin/makefs/makefs.8 stable/9/usr.sbin/makefs/makefs.c stable/9/usr.sbin/makefs/makefs.h Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -410,6 +410,10 @@ ffs_validate(const char *dir, fsnode *ro /* round up to the next block */ fsopts->size = roundup(fsopts->size, ffs_opts->bsize); + /* round up to requested block size, if any */ + if (fsopts->roundup > 0) + fsopts->size = roundup(fsopts->size, fsopts->roundup); + /* calculate density if necessary */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; Modified: stable/9/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 09:02:30 2015 (r290590) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,6 +53,7 @@ .Op Fl m Ar maximum-size .Op Fl N Ar userdb-dir .Op Fl o Ar fs-options +.Op Fl R Ar roundup-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -195,6 +196,14 @@ Deprecated. See the .Fl Z flag. +.It Fl R Ar roundup-size +Round the image up to +.Ar roundup-size . +.Ar roundup-size +should be a multiple of the file system block size. +This option only applies to the +.Sy ffs +file system type. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: stable/9/usr.sbin/makefs/makefs.c ============================================================================== --- stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pr:s:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -209,6 +209,12 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; + case 'R': + /* Round image size up to specified block size */ + fsoptions.roundup = + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + break; + case 's': fsoptions.minsize = fsoptions.maxsize = strsuftoll("size", optarg, 1LL, LLONG_MAX); @@ -359,9 +365,9 @@ usage(void) prog = getprogname(); fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" -"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" -"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", +"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" +"\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" +"\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); } Modified: stable/9/usr.sbin/makefs/makefs.h ============================================================================== --- stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 09:02:30 2015 (r290590) @@ -130,6 +130,7 @@ typedef struct { int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ + off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-all@freebsd.org Mon Nov 9 09:03:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCF9A26DC4; Mon, 9 Nov 2015 09:03:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547641DF4; Mon, 9 Nov 2015 09:03:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA993OMo011021; Mon, 9 Nov 2015 09:03:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA993OX7011020; Mon, 9 Nov 2015 09:03:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090903.tA993OX7011020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290591 - stable/10/usr.sbin/makefs/cd9660 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:03:25 -0000 Author: ngie Date: Mon Nov 9 09:03:24 2015 New Revision: 290591 URL: https://svnweb.freebsd.org/changeset/base/290591 Log: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:02:30 2015 (r290590) +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:03:24 2015 (r290591) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } From owner-svn-src-all@freebsd.org Mon Nov 9 09:04:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FADA26E7E; Mon, 9 Nov 2015 09:04:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F091F4A; Mon, 9 Nov 2015 09:04:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA994Ccb011111; Mon, 9 Nov 2015 09:04:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA994C1n011110; Mon, 9 Nov 2015 09:04:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090904.tA994C1n011110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290592 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:04:13 -0000 Author: ngie Date: Mon Nov 9 09:04:11 2015 New Revision: 290592 URL: https://svnweb.freebsd.org/changeset/base/290592 Log: MFC r289902: Add a regression test for r289899 to validate rockridge encoding of device types Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:03:24 2015 (r290591) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:04:11 2015 (r290592) @@ -271,6 +271,32 @@ o_flag_rockridge_cleanup() common_cleanup } +atf_test_case o_flag_rockridge_dev_nodes cleanup +o_flag_rockridge_dev_nodes_head() +{ + atf_set "descr" "Functional tests to ensure that dev nodes are handled properly with rockridge extensions (NetBSD kern/48852; FreeBSD bug 203648)" +} +o_flag_rockridge_dev_nodes_body() +{ + create_test_dirs + + (tar -cvf - -C /dev null && touch .tar_ok) | \ + atf_check -e not-empty -o empty -s exit:0 tar -xvf - -C "$TEST_INPUTS_DIR" + + atf_check -e empty -o empty -s exit:0 test -c $TEST_INPUTS_DIR/null + atf_check -e empty -o empty -s exit:0 test -f .tar_ok + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_image_contents +} +o_flag_rockridge_dev_nodes_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { atf_add_test_case D_flag @@ -285,4 +311,5 @@ atf_init_test_cases() atf_add_test_case o_flag_preparer atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge + atf_add_test_case o_flag_rockridge_dev_nodes } From owner-svn-src-all@freebsd.org Mon Nov 9 09:05:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28787A26F13; Mon, 9 Nov 2015 09:05:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE16D1114; Mon, 9 Nov 2015 09:05:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9959c2011220; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9959Xv011219; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090905.tA9959Xv011219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290593 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:05:11 -0000 Author: ngie Date: Mon Nov 9 09:05:09 2015 New Revision: 290593 URL: https://svnweb.freebsd.org/changeset/base/290593 Log: MFstable/10 r290591: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:04:11 2015 (r290592) +++ stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:05:09 2015 (r290593) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } From owner-svn-src-all@freebsd.org Mon Nov 9 09:20:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB28A2955D; Mon, 9 Nov 2015 09:20:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C33761A37; Mon, 9 Nov 2015 09:20:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99K10b014455; Mon, 9 Nov 2015 09:20:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99K17Y014452; Mon, 9 Nov 2015 09:20:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090920.tA99K17Y014452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290594 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:20:03 -0000 Author: ngie Date: Mon Nov 9 09:20:01 2015 New Revision: 290594 URL: https://svnweb.freebsd.org/changeset/base/290594 Log: MFC r290265,r290267,r290270: r290265: Add testcases for -t cd9660 -o isolevel=[1-3] -- -o isolevel=1 currently fails because of path comparison issues, so mark it as an expected failure. -- -o isolevel=3 is not implemented, so expect it to fail as an out of bounds value [*]. PR: 203645 Sponsored by: EMC / Isilon Storage Division r290267: Clean up mtree keyword support a slight bit and add a few more default keywords - Parameterize the mtree keywords as $DEFAULT_MTREE_KEYWORDS - Test with the extra mtree keywords, `mode,gid,uid`. - Add a note about mtrees with time support not working with makefs right now Sponsored by: EMC / Isilon Storage Division r290270: Add testcases for -t ffs -o version=[12] Verify the filesystem type using dumpfs. Add preliminary support for NetBSD (needs to be validated) Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -113,7 +113,7 @@ from_mtree_spec_file_body() create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ - mtree -c -k type,link,size -p $TEST_INPUTS_DIR + mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR cd $TEST_INPUTS_DIR atf_check -e empty -o empty -s exit:0 \ $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE @@ -208,6 +208,61 @@ o_flag_allow_max_name_cleanup() common_cleanup } +atf_test_case o_flag_isolevel_1 cleanup +o_flag_isolevel_1_body() +{ + atf_expect_fail "this testcase needs work; the filenames generated seem incorrect/corrupt" + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=1 $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_isolevel_1_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_isolevel_2 cleanup +o_flag_isolevel_2_body() +{ + create_test_inputs + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=2 $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_isolevel_2_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_isolevel_3 cleanup +o_flag_isolevel_3_body() +{ + create_test_inputs + + # XXX: isolevel=3 isn't implemented yet. See FreeBSD bug # 203645 + if true; then + atf_check -e match:'makefs: ISO Level 3 is greater than 2\.' -o empty -s not-exit:0 \ + $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR + else + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR + mount_image + check_base_iso9660_image_contents + fi +} +o_flag_isolevel_3_cleanup() +{ + common_cleanup +} + atf_test_case o_flag_preparer o_flag_preparer_body() { @@ -308,6 +363,9 @@ atf_init_test_cases() atf_add_test_case o_flag_allow_deep_trees atf_add_test_case o_flag_allow_max_name + atf_add_test_case o_flag_isolevel_1 + atf_add_test_case o_flag_isolevel_2 + atf_add_test_case o_flag_isolevel_3 atf_add_test_case o_flag_preparer atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -105,7 +105,7 @@ from_mtree_spec_file_body() create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ - mtree -c -k type,link,size -p $TEST_INPUTS_DIR + mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR cd $TEST_INPUTS_DIR atf_check -e empty -o not-empty -s exit:0 \ @@ -158,6 +158,70 @@ from_single_dir_cleanup() common_cleanup } +atf_test_case o_flag_version_1 cleanup +o_flag_version_1_body() +{ + ffs_version=1 + + platform=$(uname) + case "$platform" in + FreeBSD) + ffs_label=UFS${ffs_version} + ;; + NetBSD) + ffs_label=FFSv${ffs_version} + ;; + *) + atf_skip "Unsupported platform" + ;; + esac + + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + check_ffs_image_contents +} +o_flag_version_1_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_version_2 cleanup +o_flag_version_2_body() +{ + ffs_version=2 + + platform=$(uname) + case "$platform" in + FreeBSD) + ffs_label=UFS${ffs_version} + ;; + NetBSD) + ffs_label=FFSv${ffs_version} + ;; + *) + atf_skip "Unsupported platform" + ;; + esac + + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + check_ffs_image_contents +} +o_flag_version_2_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { @@ -168,5 +232,6 @@ atf_init_test_cases() atf_add_test_case from_multiple_dirs atf_add_test_case from_single_dir - + atf_add_test_case o_flag_version_1 + atf_add_test_case o_flag_version_2 } Modified: stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -29,6 +29,13 @@ KB=1024 : ${TMPDIR=/tmp} +# TODO: add mtree `time` support; get a lot of errors like this right now when +# passing generating disk images with keyword mtree support, like: +# +# `[...]/mtree.spec:8: error: time: invalid value '1446458503'` +# +#DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" +DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link" TEST_IMAGE="$TMPDIR/test.img" TEST_INPUTS_DIR="$TMPDIR/inputs" TEST_MD_DEVICE_FILE="$TMPDIR/md.output" @@ -39,7 +46,7 @@ check_image_contents() { local directories=$TEST_INPUTS_DIR local excludes mtree_excludes_arg mtree_file - local mtree_keywords="type,link,size" + local mtree_keywords="$DEFAULT_MTREE_KEYWORDS" while getopts "d:f:m:X:" flag; do case "$flag" in From owner-svn-src-all@freebsd.org Mon Nov 9 09:22:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 660CAA297E6; Mon, 9 Nov 2015 09:22:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D4D1DE6; Mon, 9 Nov 2015 09:22:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99MCjT017160; Mon, 9 Nov 2015 09:22:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99MC9n017159; Mon, 9 Nov 2015 09:22:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090922.tA99MC9n017159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290595 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:22:13 -0000 Author: ngie Date: Mon Nov 9 09:22:11 2015 New Revision: 290595 URL: https://svnweb.freebsd.org/changeset/base/290595 Log: MFC r290264: Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by dereferencing a NULL function pointer Add some asserts to ensure that isolevel is always either 1 or 2. PR: 203645 Reported by: Thomas Schmitt Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660.c Mon Nov 9 09:20:01 2015 (r290594) +++ stable/10/usr.sbin/makefs/cd9660.c Mon Nov 9 09:22:11 2015 (r290595) @@ -296,8 +296,8 @@ cd9660_parse_opts(const char *option, fs int rv; /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, { "verbose", &diskStructure.verbose_level, 0, 2, "Turns on verbose output" }, { "v", &diskStructure.verbose_level, 0 , 2, @@ -1055,6 +1055,7 @@ cd9660_rename_filename(cd9660node *iter, if (diskStructure.verbose_level > 0) printf("Rename_filename called\n"); + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure.isoLevel == 1) maxlength = 8; @@ -1730,6 +1731,7 @@ cd9660_joliet_convert_filename(const cha static int cd9660_convert_filename(const char *oldname, char *newname, int is_file) { + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ cd9660_filename_conversion_functor conversion_function = 0; if (diskStructure.isoLevel == 1) From owner-svn-src-all@freebsd.org Mon Nov 9 09:23:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D618FA2993A; Mon, 9 Nov 2015 09:23:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F2E1F9F; Mon, 9 Nov 2015 09:23:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99NDxs017288; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99NDxe017287; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090923.tA99NDxe017287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290596 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:23:14 -0000 Author: ngie Date: Mon Nov 9 09:23:13 2015 New Revision: 290596 URL: https://svnweb.freebsd.org/changeset/base/290596 Log: MFstable/10 r290595: MFC r290264: Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by dereferencing a NULL function pointer Add some asserts to ensure that isolevel is always either 1 or 2. PR: 203645 Reported by: Thomas Schmitt Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:22:11 2015 (r290595) +++ stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:23:13 2015 (r290596) @@ -296,8 +296,8 @@ cd9660_parse_opts(const char *option, fs int rv; /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, { "verbose", &diskStructure.verbose_level, 0, 2, "Turns on verbose output" }, { "v", &diskStructure.verbose_level, 0 , 2, @@ -1055,6 +1055,7 @@ cd9660_rename_filename(cd9660node *iter, if (diskStructure.verbose_level > 0) printf("Rename_filename called\n"); + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure.isoLevel == 1) maxlength = 8; @@ -1730,6 +1731,7 @@ cd9660_joliet_convert_filename(const cha static int cd9660_convert_filename(const char *oldname, char *newname, int is_file) { + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ cd9660_filename_conversion_functor conversion_function = 0; if (diskStructure.isoLevel == 1) From owner-svn-src-all@freebsd.org Mon Nov 9 09:23:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF91A2999A; Mon, 9 Nov 2015 09:23:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579F0117D; Mon, 9 Nov 2015 09:23:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99NZMO017355; Mon, 9 Nov 2015 09:23:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99NZS1017354; Mon, 9 Nov 2015 09:23:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090923.tA99NZS1017354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290597 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:23:36 -0000 Author: ngie Date: Mon Nov 9 09:23:35 2015 New Revision: 290597 URL: https://svnweb.freebsd.org/changeset/base/290597 Log: MFC r290268: Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with src/sys/ufs/ffs/ffs_bswap.c@1.39 Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:13 2015 (r290596) +++ stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:35 2015 (r290597) @@ -67,7 +67,7 @@ void ffs_csumtotal_swap(struct csum_tota void ffs_sb_swap(struct fs *o, struct fs *n) { - int i; + size_t i; u_int32_t *o32, *n32; /* @@ -97,7 +97,7 @@ ffs_sb_swap(struct fs *o, struct fs *n) n->fs_csaddr = bswap64(o->fs_csaddr); n->fs_pendingblocks = bswap64(o->fs_pendingblocks); n->fs_pendinginodes = bswap32(o->fs_pendinginodes); - + /* These fields overlap with the second half of the * historic FS_42POSTBLFMT postbl table */ @@ -171,9 +171,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, void ffs_csum_swap(struct csum *o, struct csum *n, int size) { - int i; + size_t i; u_int32_t *oint, *nint; - + oint = (u_int32_t*)o; nint = (u_int32_t*)n; From owner-svn-src-all@freebsd.org Mon Nov 9 09:24:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD64A29A3C; Mon, 9 Nov 2015 09:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 071291308; Mon, 9 Nov 2015 09:24:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99OT5H017446; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99OTIY017445; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090924.tA99OTIY017445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290598 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:24:30 -0000 Author: ngie Date: Mon Nov 9 09:24:28 2015 New Revision: 290598 URL: https://svnweb.freebsd.org/changeset/base/290598 Log: MFstable/10 r290597: MFC r290268: Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with src/sys/ufs/ffs/ffs_bswap.c@1.39 Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:35 2015 (r290597) +++ stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:24:28 2015 (r290598) @@ -67,7 +67,7 @@ void ffs_csumtotal_swap(struct csum_tota void ffs_sb_swap(struct fs *o, struct fs *n) { - int i; + size_t i; u_int32_t *o32, *n32; /* @@ -97,7 +97,7 @@ ffs_sb_swap(struct fs *o, struct fs *n) n->fs_csaddr = bswap64(o->fs_csaddr); n->fs_pendingblocks = bswap64(o->fs_pendingblocks); n->fs_pendinginodes = bswap32(o->fs_pendinginodes); - + /* These fields overlap with the second half of the * historic FS_42POSTBLFMT postbl table */ @@ -171,9 +171,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, void ffs_csum_swap(struct csum *o, struct csum *n, int size) { - int i; + size_t i; u_int32_t *oint, *nint; - + oint = (u_int32_t*)o; nint = (u_int32_t*)n; From owner-svn-src-all@freebsd.org Mon Nov 9 09:28:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6E8A29B35; Mon, 9 Nov 2015 09:28:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087F41597; Mon, 9 Nov 2015 09:28:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99SZbK017673; Mon, 9 Nov 2015 09:28:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99SZVp017672; Mon, 9 Nov 2015 09:28:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090928.tA99SZVp017672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290599 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:28:36 -0000 Author: ngie Date: Mon Nov 9 09:28:34 2015 New Revision: 290599 URL: https://svnweb.freebsd.org/changeset/base/290599 Log: MFC r266930,r289225: r266930 (by jmg): convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. r289225 (by sbruno): makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize). PR: 203704 Submitted by: eugen@grosbein.net Reviewed by: marcel Modified: stable/10/usr.sbin/makefs/ffs/mkfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:24:28 2015 (r290598) +++ stable/10/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599) @@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_ exit(21); } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); - sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_size = sblock.fs_providersize = fssize = + dbtofsb(&sblock, fssize); if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-all@freebsd.org Mon Nov 9 09:29:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E09A29BF8; Mon, 9 Nov 2015 09:29:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E6E1900; Mon, 9 Nov 2015 09:29:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99Tdkb017925; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99TdqI017924; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090929.tA99TdqI017924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290600 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:29:40 -0000 Author: ngie Date: Mon Nov 9 09:29:38 2015 New Revision: 290600 URL: https://svnweb.freebsd.org/changeset/base/290600 Log: MFstable/10 r290599: MFC r266930,r289225: r266930 (by jmg): convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. r289225 (by sbruno): makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize). PR: 203704 Submitted by: eugen@grosbein.net Reviewed by: marcel Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599) +++ stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:29:38 2015 (r290600) @@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_ exit(21); } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); - sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_size = sblock.fs_providersize = fssize = + dbtofsb(&sblock, fssize); if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-all@freebsd.org Mon Nov 9 09:39:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37070A2A20C; Mon, 9 Nov 2015 09:39:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 005DB118F; Mon, 9 Nov 2015 09:39:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99d8Mx020742; Mon, 9 Nov 2015 09:39:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99d8UT020741; Mon, 9 Nov 2015 09:39:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090939.tA99d8UT020741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290601 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:39:09 -0000 Author: ngie Date: Mon Nov 9 09:39:07 2015 New Revision: 290601 URL: https://svnweb.freebsd.org/changeset/base/290601 Log: Follow up to r290259 dealing with makefs(8) - Don't use contractions (don't -> do not) - Change "throw away" to "discard" when describing the -o keep-bad-images option - Revert author e-mail split I brought over from NetBSD, effectively reverting the change bapt made in r267668 MFC after: 3 days Submitted by: bjk Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Mon Nov 9 09:29:38 2015 (r290600) +++ head/usr.sbin/makefs/makefs.8 Mon Nov 9 09:39:07 2015 (r290601) @@ -353,7 +353,7 @@ or .Ql 3 is not implemented. .It Sy keep-bad-images -Don't throw away images whose write was aborted due to an error. +Do not discard images whose write was aborted due to an error. For debugging purposes. .It Sy label Label name of the image. @@ -388,8 +388,7 @@ The utility appeared in .Nx 1.6 . .Sh AUTHORS -.An Luke Mewburn -.Aq lukem@NetBSD.org +.An Luke Mewburn Aq Mt lukem@NetBSD.org (original program), .An Daniel Watt , .An Walter Deignan , From owner-svn-src-all@freebsd.org Mon Nov 9 09:39:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7441A2A264; Mon, 9 Nov 2015 09:39:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8667D1321; Mon, 9 Nov 2015 09:39:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabfh17 with SMTP id fh17so194289098pab.0; Mon, 09 Nov 2015 01:39:38 -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 :content-transfer-encoding:message-id:references:to; bh=f+JoNPkE7lvFrbLcCwKJ/kILN7ZwyuQZPP2YbA4v6A4=; b=c7BOzNHtL2IAGeX5hb8KNG38iMSJCTxVlLwNQNdklFGmSMNrYgVPFyefS70Z9LJFlq 4k9wZWi7cUEB0G3E7HrS4OokifXNQN8Fi+fK0jMam5rPTZM9EfdNgJtuzabBhsnUantl asxj1uF1mH9IA1HZZNDOqX1qM/UKiEXcRZinHRt5+UReRI5GDKwIxxRWmqpPuembeH85 n0lnaQBXnqXOh/M3yaf344QtX4F4PeluMnlhDxmEkK2gXYbpu72Pwwa23T8LFfr3XRYX bOhPwReWphjE2DR/Y19sehWHrdN0kjKHMYq2UHm7aHmuz/3wOfE29Chr+thc1SAyKG6b lAQQ== X-Received: by 10.66.123.72 with SMTP id ly8mr38452224pab.92.1447061978179; Mon, 09 Nov 2015 01:39:38 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:6c97:bf3:2260:c8ab? ([2601:601:800:126d:6c97:bf3:2260:c8ab]) by smtp.gmail.com with ESMTPSA id zi1sm15239422pbc.10.2015.11.09.01.39.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Nov 2015 01:39:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290259 - head/usr.sbin/makefs From: NGie Cooper In-Reply-To: Date: Mon, 9 Nov 2015 01:39:36 -0800 Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201511020736.tA27agJq021424@repo.freebsd.org> To: Benjamin Kaduk X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:39:38 -0000 > On Nov 2, 2015, at 08:49, Benjamin Kaduk wrote: >=20 > On Mon, Nov 2, 2015 at 1:36 AM, Garrett Cooper = wrote: > Author: ngie > Date: Mon Nov 2 07:36:42 2015 > New Revision: 290259 > URL: https://svnweb.freebsd.org/changeset/base/290259 >=20 > Log: > Sync makefs(8) content a bit with src/usr.sbin/makefs/makefs.8@1.53 >=20 > Sections involving unimplemented filesystems (chfs, msdosfs, udf, = v7fs) and > options have been omitted. >=20 > MFC after: 1 week > Obtained from: NetBSD > Sponsored by: EMC / Isilon Storage Division I applied your feedback in r290601 =E2=80=94 thanks :)!= From owner-svn-src-all@freebsd.org Mon Nov 9 09:40:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 430AFA2A2C9; Mon, 9 Nov 2015 09:40:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1A814DE; Mon, 9 Nov 2015 09:40:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA99e0qa020828; Mon, 9 Nov 2015 09:40:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99e0mS020827; Mon, 9 Nov 2015 09:40:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090940.tA99e0mS020827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290602 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:40:01 -0000 Author: ngie Date: Mon Nov 9 09:39:59 2015 New Revision: 290602 URL: https://svnweb.freebsd.org/changeset/base/290602 Log: Bump .Dd Modified: head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Mon Nov 9 09:39:07 2015 (r290601) +++ head/usr.sbin/makefs/makefs.8 Mon Nov 9 09:39:59 2015 (r290602) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2015 +.Dd November 9, 2015 .Dt MAKEFS 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Mon Nov 9 10:11:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4FE0A2AC43; Mon, 9 Nov 2015 10:11:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8355B1B76; Mon, 9 Nov 2015 10:11:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9ABFMh029554; Mon, 9 Nov 2015 10:11:15 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9ABFWb029549; Mon, 9 Nov 2015 10:11:15 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511091011.tA9ABFWb029549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 9 Nov 2015 10:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290603 - in head/sys: net netgraph netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 10:11:16 -0000 Author: melifaro Date: Mon Nov 9 10:11:14 2015 New Revision: 290603 URL: https://svnweb.freebsd.org/changeset/base/290603 Log: Use lladdr_event to propagate gratiotus arp. Differential Revision: https://reviews.freebsd.org/D4019 Modified: head/sys/net/if.c head/sys/net/if_vlan.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netinet/if_ether.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Nov 9 09:39:59 2015 (r290602) +++ head/sys/net/if.c Mon Nov 9 10:11:14 2015 (r290603) @@ -2512,7 +2512,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); error = if_setlladdr(ifp, ifr->ifr_addr.sa_data, ifr->ifr_addr.sa_len); - EVENTHANDLER_INVOKE(iflladdr_event, ifp); + if (error == 0) + EVENTHANDLER_INVOKE(iflladdr_event, ifp); break; case SIOCAIFGROUP: @@ -3375,16 +3376,6 @@ if_setlladdr(struct ifnet *ifp, const u_ ifr.ifr_flagshigh = ifp->if_flags >> 16; (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); } -#ifdef INET - /* - * Also send gratuitous ARPs to notify other nodes about - * the address change. - */ - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(ifp, ifa); - } -#endif } return (0); } Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Nov 9 09:39:59 2015 (r290602) +++ head/sys/net/if_vlan.c Mon Nov 9 10:11:14 2015 (r290603) @@ -523,7 +523,7 @@ vlan_iflladdr(void *arg __unused, struct #ifndef VLAN_ARRAY struct ifvlan *next; #endif - int i; + int error, i; /* * Check if it's a trunk interface first of all @@ -544,8 +544,11 @@ vlan_iflladdr(void *arg __unused, struct LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { #endif /* VLAN_ARRAY */ VLAN_UNLOCK(); - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), + error = if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ifp->if_addrlen); + if (error == 0) + EVENTHANDLER_INVOKE(iflladdr_event, + ifv->ifv_ifp); VLAN_LOCK(); } VLAN_UNLOCK(); Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Mon Nov 9 09:39:59 2015 (r290602) +++ head/sys/netgraph/ng_eiface.c Mon Nov 9 10:11:14 2015 (r290603) @@ -489,7 +489,8 @@ ng_eiface_rcvmsg(node_p node, item_p ite } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); + if (error == 0) + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Mon Nov 9 09:39:59 2015 (r290602) +++ head/sys/netgraph/ng_ether.c Mon Nov 9 10:11:14 2015 (r290603) @@ -534,7 +534,8 @@ ng_ether_rcvmsg(node_p node, item_p item } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); + if (error == 0) + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } case NGM_ETHER_GET_PROMISC: Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Nov 9 09:39:59 2015 (r290602) +++ head/sys/netinet/if_ether.c Mon Nov 9 10:11:14 2015 (r290603) @@ -142,7 +142,9 @@ static void in_arpinput(struct mbuf *); static void arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp, int bridged, struct llentry *la); static void arp_mark_lle_reachable(struct llentry *la); +static void arp_iflladdr(void *arg __unused, struct ifnet *ifp); +static eventhandler_tag iflladdr_tag; static const struct netisr_handler arp_nh = { .nh_name = "arp", @@ -1150,10 +1152,39 @@ arp_ifinit2(struct ifnet *ifp, struct if ifa->ifa_rtrequest = NULL; } +/* + * Sends gratuitous ARPs for each ifaddr to notify other + * nodes about the address change. + */ +static __noinline void +arp_handle_ifllchange(struct ifnet *ifp) +{ + struct ifaddr *ifa; + + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == AF_INET) + arp_ifinit(ifp, ifa); + } +} + +/* + * A handler for interface link layer address change event. + */ +static __noinline void +arp_iflladdr(void *arg __unused, struct ifnet *ifp) +{ + + if ((ifp->if_flags & IFF_UP) != 0) + arp_handle_ifllchange(ifp); +} + static void arp_init(void) { netisr_register(&arp_nh); + if (IS_DEFAULT_VNET(curvnet)) + iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, + arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); } SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); From owner-svn-src-all@freebsd.org Mon Nov 9 10:35:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A063A2925F; Mon, 9 Nov 2015 10:35:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0E1179B; Mon, 9 Nov 2015 10:35:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9AZYva037866; Mon, 9 Nov 2015 10:35:34 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9AZYbP037863; Mon, 9 Nov 2015 10:35:34 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511091035.tA9AZYbP037863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 9 Nov 2015 10:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290604 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 10:35:35 -0000 Author: melifaro Date: Mon Nov 9 10:35:33 2015 New Revision: 290604 URL: https://svnweb.freebsd.org/changeset/base/290604 Log: Decompose arp_ifinit() into arp_add_ifa_lle() and arp_announce_ifaddr(). Rename arp_ifinit2() into arp_announce_ifaddr(). Eliminate zeroing ifa_rtrequest: it was used for calling arp_rtrequest() which was responsible for handling route cloning requests. It became obsolete since r186119 (L2/L3 split). Modified: head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/ip_carp.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Nov 9 10:11:14 2015 (r290603) +++ head/sys/netinet/if_ether.c Mon Nov 9 10:35:33 2015 (r290604) @@ -1091,26 +1091,13 @@ arp_mark_lle_reachable(struct llentry *l la->la_preempt = V_arp_maxtries; } -void -arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) +/* + * Add pernament link-layer record for given interface address. + */ +static __noinline void +arp_add_ifa_lle(struct ifnet *ifp, const struct sockaddr *dst) { struct llentry *lle, *lle_tmp; - struct sockaddr_in *dst_in; - struct sockaddr *dst; - - if (ifa->ifa_carp != NULL) - return; - - ifa->ifa_rtrequest = NULL; - - dst_in = IA_SIN(ifa); - dst = (struct sockaddr *)dst_in; - - if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) == INADDR_ANY) - return; - - arprequest(ifp, &IA_SIN(ifa)->sin_addr, - &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); /* * Interface address LLE record is considered static @@ -1144,12 +1131,30 @@ arp_ifinit(struct ifnet *ifp, struct ifa } void -arp_ifinit2(struct ifnet *ifp, struct ifaddr *ifa, u_char *enaddr) +arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) { - if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) - arprequest(ifp, &IA_SIN(ifa)->sin_addr, - &IA_SIN(ifa)->sin_addr, enaddr); - ifa->ifa_rtrequest = NULL; + const struct sockaddr_in *dst_in; + const struct sockaddr *dst; + + if (ifa->ifa_carp != NULL) + return; + + dst = ifa->ifa_addr; + dst_in = (const struct sockaddr_in *)dst; + + if (ntohl(dst_in->sin_addr.s_addr) == INADDR_ANY) + return; + arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); + + arp_add_ifa_lle(ifp, dst); +} + +void +arp_announce_ifaddr(struct ifnet *ifp, struct in_addr addr, u_char *enaddr) +{ + + if (ntohl(addr.s_addr) != INADDR_ANY) + arprequest(ifp, &addr, &addr, enaddr); } /* Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Mon Nov 9 10:11:14 2015 (r290603) +++ head/sys/netinet/if_ether.h Mon Nov 9 10:35:33 2015 (r290604) @@ -119,7 +119,7 @@ int arpresolve(struct ifnet *ifp, int is void arprequest(struct ifnet *, const struct in_addr *, const struct in_addr *, u_char *); void arp_ifinit(struct ifnet *, struct ifaddr *); -void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *); +void arp_announce_ifaddr(struct ifnet *, struct in_addr addr, u_char *); #endif #endif Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Mon Nov 9 10:11:14 2015 (r290603) +++ head/sys/netinet/ip_carp.c Mon Nov 9 10:35:33 2015 (r290604) @@ -1009,10 +1009,14 @@ static void carp_send_arp(struct carp_softc *sc) { struct ifaddr *ifa; + struct in_addr addr; - CARP_FOREACH_IFA(sc, ifa) - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit2(sc->sc_carpdev, ifa, LLADDR(&sc->sc_addr)); + CARP_FOREACH_IFA(sc, ifa) { + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; + arp_announce_ifaddr(sc->sc_carpdev, addr, LLADDR(&sc->sc_addr)); + } } int From owner-svn-src-all@freebsd.org Mon Nov 9 10:40:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52AD7A2939D; Mon, 9 Nov 2015 10:40:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFC0E19CB; Mon, 9 Nov 2015 10:40:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9AeH2r038058; Mon, 9 Nov 2015 10:40:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9AeG0B038056; Mon, 9 Nov 2015 10:40:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511091040.tA9AeG0B038056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 10:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290605 - in head/lib/msun: . man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 10:40:18 -0000 Author: ngie Date: Mon Nov 9 10:40:16 2015 New Revision: 290605 URL: https://svnweb.freebsd.org/changeset/base/290605 Log: Document powl(3) PR: 191751 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/msun/Makefile head/lib/msun/man/exp.3 Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Nov 9 10:35:33 2015 (r290604) +++ head/lib/msun/Makefile Mon Nov 9 10:40:16 2015 (r290605) @@ -169,7 +169,8 @@ MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 MLINKS+=csqrt.3 csqrtf.3 csqrt.3 csqrtl.3 MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 erf.3 erfl.3 erf.3 erfcl.3 MLINKS+=exp.3 expm1.3 exp.3 expm1f.3 exp.3 expm1l.3 exp.3 pow.3 exp.3 powf.3 \ - exp.3 exp2.3 exp.3 exp2f.3 exp.3 exp2l.3 exp.3 expf.3 exp.3 expl.3 + exp.3 powl.3 exp.3 exp2.3 exp.3 exp2f.3 exp.3 exp2l.3 exp.3 expf.3 \ + exp.3 expl.3 MLINKS+=fabs.3 fabsf.3 fabs.3 fabsl.3 MLINKS+=fdim.3 fdimf.3 fdim.3 fdiml.3 MLINKS+=feclearexcept.3 fegetexceptflag.3 feclearexcept.3 feraiseexcept.3 \ Modified: head/lib/msun/man/exp.3 ============================================================================== --- head/lib/msun/man/exp.3 Mon Nov 9 10:35:33 2015 (r290604) +++ head/lib/msun/man/exp.3 Mon Nov 9 10:40:16 2015 (r290605) @@ -43,7 +43,8 @@ .Nm expm1f , .Nm expm1l , .Nm pow , -.Nm powf +.Nm powf , +.Nm powl .Nd exponential and power functions .Sh LIBRARY .Lb libm @@ -71,6 +72,8 @@ .Fn pow "double x" "double y" .Ft float .Fn powf "float x" "float y" +.Ft long double +.Fn powl "long double x" "long double y" .Sh DESCRIPTION The .Fn exp , @@ -99,9 +102,10 @@ functions compute the value exp(x)\-1 ac .Fa x . .Pp The -.Fn pow +.Fn pow , +.Fn powf , and the -.Fn powf +.Fn powl functions compute the value of .Ar x @@ -122,9 +126,10 @@ Otherwise the error in these functions i These functions will return the appropriate computation unless an error occurs or an argument is out of range. The functions -.Fn pow x y +.Fn pow x y , +.Fn powf x y , and -.Fn powf x y +.Fn powl x y raise an invalid exception and return an \*(Na if .Fa x < 0 and From owner-svn-src-all@freebsd.org Mon Nov 9 10:41:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD3F1A29462; Mon, 9 Nov 2015 10:41:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 785611C2C; Mon, 9 Nov 2015 10:41:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9AfRKQ038149; Mon, 9 Nov 2015 10:41:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9AfRwH038148; Mon, 9 Nov 2015 10:41:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511091041.tA9AfRwH038148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 10:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290606 - head/lib/msun/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 10:41:28 -0000 Author: ngie Date: Mon Nov 9 10:41:27 2015 New Revision: 290606 URL: https://svnweb.freebsd.org/changeset/base/290606 Log: Bump .Dd Modified: head/lib/msun/man/exp.3 Modified: head/lib/msun/man/exp.3 ============================================================================== --- head/lib/msun/man/exp.3 Mon Nov 9 10:40:16 2015 (r290605) +++ head/lib/msun/man/exp.3 Mon Nov 9 10:41:27 2015 (r290606) @@ -28,7 +28,7 @@ .\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 .\" $FreeBSD$ .\" -.Dd June 3, 2013 +.Dd November 9, 2015 .Dt EXP 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Mon Nov 9 11:25:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DFAA2A350; Mon, 9 Nov 2015 11:25:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29DEA1371; Mon, 9 Nov 2015 11:25:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9BP0ZI052302; Mon, 9 Nov 2015 11:25:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BP0Jg052300; Mon, 9 Nov 2015 11:25:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091125.tA9BP0Jg052300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290607 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:25:01 -0000 Author: hselasky Date: Mon Nov 9 11:24:59 2015 New Revision: 290607 URL: https://svnweb.freebsd.org/changeset/base/290607 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/10/sys/dev/usb/net/if_cdce.c stable/10/sys/dev/usb/net/if_urndis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/10/sys/dev/usb/net/if_cdce.c Mon Nov 9 10:41:27 2015 (r290606) +++ stable/10/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:24:59 2015 (r290607) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); Modified: stable/10/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/10/sys/dev/usb/net/if_urndis.c Mon Nov 9 10:41:27 2015 (r290606) +++ stable/10/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:24:59 2015 (r290607) @@ -848,7 +848,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; - } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + } else if (msg.rm_datalen > (uint32_t)(MCLBYTES - ETHER_ALIGN)) { ifp->if_ierrors++; DPRINTF("invalid ethernet size " "%u > %u\n", @@ -862,6 +862,7 @@ urndis_bulk_read_callback(struct usb_xfe /* check if we have a buffer */ if (m != NULL) { + m->m_len = m->m_pkthdr.len = msg.rm_datalen + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + From owner-svn-src-all@freebsd.org Mon Nov 9 11:27:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EC9A2A462; Mon, 9 Nov 2015 11:27:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C990D159D; Mon, 9 Nov 2015 11:27:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9BRV6T052432; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BRVSu052430; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091127.tA9BRVSu052430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290608 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:27:33 -0000 Author: hselasky Date: Mon Nov 9 11:27:31 2015 New Revision: 290608 URL: https://svnweb.freebsd.org/changeset/base/290608 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/9/sys/dev/usb/net/if_cdce.c stable/9/sys/dev/usb/net/if_urndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); Modified: stable/9/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:27:31 2015 (r290608) @@ -848,7 +848,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; - } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + } else if (msg.rm_datalen > (uint32_t)(MCLBYTES - ETHER_ALIGN)) { ifp->if_ierrors++; DPRINTF("invalid ethernet size " "%u > %u\n", @@ -862,6 +862,7 @@ urndis_bulk_read_callback(struct usb_xfe /* check if we have a buffer */ if (m != NULL) { + m->m_len = m->m_pkthdr.len = msg.rm_datalen + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + From owner-svn-src-all@freebsd.org Mon Nov 9 11:29:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04527A2A4C1; Mon, 9 Nov 2015 11:29:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B0A180C; Mon, 9 Nov 2015 11:29:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9BTsXa052564; Mon, 9 Nov 2015 11:29:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BTsYP052563; Mon, 9 Nov 2015 11:29:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091129.tA9BTsYP052563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r290609 - stable/8/sys/dev/usb/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:29:56 -0000 Author: hselasky Date: Mon Nov 9 11:29:54 2015 New Revision: 290609 URL: https://svnweb.freebsd.org/changeset/base/290609 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/8/sys/dev/usb/net/if_cdce.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608) +++ stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:29:54 2015 (r290609) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); From owner-svn-src-all@freebsd.org Mon Nov 9 12:03:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88B5BA2921C; Mon, 9 Nov 2015 12:03:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBBE1C46; Mon, 9 Nov 2015 12:03:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 5E7CBD486D3; Mon, 9 Nov 2015 23:03:46 +1100 (AEDT) Date: Mon, 9 Nov 2015 23:03:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290605 - in head/lib/msun: . man In-Reply-To: <201511091040.tA9AeG0B038056@repo.freebsd.org> Message-ID: <20151109223117.Y2340@besplex.bde.org> References: <201511091040.tA9AeG0B038056@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JsMFsR0-Xu0OIYqm9CUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 12:03:49 -0000 On Mon, 9 Nov 2015, Garrett Cooper wrote: > Log: > Document powl(3) powl was garbage that was intentionally undocumented. At least, I intentionally ignored its non-documentation together with it. > Modified: head/lib/msun/man/exp.3 > ============================================================================== > --- head/lib/msun/man/exp.3 Mon Nov 9 10:35:33 2015 (r290604) > +++ head/lib/msun/man/exp.3 Mon Nov 9 10:40:16 2015 (r290605) > @@ -99,9 +102,10 @@ functions compute the value exp(x)\-1 ac > .Fa x . > .Pp > The > -.Fn pow > +.Fn pow , > +.Fn powf , > and the > -.Fn powf > +.Fn powl > functions compute the value > of > .Ar x powl doesn't compute the value of .Ar x to the exponent .Ar y. It computes the value of (double)(.Ar x) to the exponent (double)(.Ar y), converted to double. > @@ -122,9 +126,10 @@ Otherwise the error in these functions i > These functions will return the appropriate computation unless an error > occurs or an argument is out of range. powl() almost never returns the appropriate computation. Its bugs are most obvious when an argument is too large for double but not out of range. > The functions > -.Fn pow x y > +.Fn pow x y , > +.Fn powf x y , > and > -.Fn powf x y > +.Fn powl x y > raise an invalid exception and return an \*(Na if > .Fa x > < 0 and I doubt that the rest of this section (about exception handling) is correct for powl(). The section on errors wasn't changed since it uses generic pow(). It claims that the error is generally less than 1 ulp. But for powl(), the error is generally more that 4096 ulps. Much more when the error exponentiates. powf() and pow() do well to avoid exponentiation of roundoff errors. Bruce From owner-svn-src-all@freebsd.org Mon Nov 9 12:20:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6EDBA2970D; Mon, 9 Nov 2015 12:19:59 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB734131A; Mon, 9 Nov 2015 12:19:59 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9CJwGs067037; Mon, 9 Nov 2015 12:19:58 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9CJwe7067036; Mon, 9 Nov 2015 12:19:58 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201511091219.tA9CJwe7067036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 9 Nov 2015 12:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290610 - head/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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 12:20:00 -0000 Author: royger Date: Mon Nov 9 12:19:58 2015 New Revision: 290610 URL: https://svnweb.freebsd.org/changeset/base/290610 Log: x86/dma_bounce: rework _bus_dmamap_load_ma implementation The implementation of bus_dmamap_load_ma_triv currently calls _bus_dmamap_load_phys on each page that is part of the passed in buffer. Since each page is treated as an individual buffer, the resulting behaviour is different from the behaviour of _bus_dmamap_load_buffer. This breaks certain drivers, like Xen blkfront. If an unmapped buffer of size 4096 that starts at offset 13 into the first page is passed to the current _bus_dmamap_load_ma implementation (so the ma array contains two pages), the result is that two segments are created, one with a size of 4083 and the other with size 13 (because two independant calls to _bus_dmamap_load_phys are performed, one for each physical page). If the same is done with a mapped buffer and calling _bus_dmamap_load_buffer the result is that only one segment is created, with a size of 4096. This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounce buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implements _bus_dmamap_load_ma so that it's behaviour is the same as the mapped version (_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buffer code, other arches are left untouched. Sponsored by: Citrix Systems R&D Reviewed by: kib, jah (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D888 Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Mon Nov 9 11:29:54 2015 (r290609) +++ head/sys/x86/x86/busdma_bounce.c Mon Nov 9 12:19:58 2015 (r290610) @@ -79,8 +79,8 @@ struct bounce_page { vm_offset_t vaddr; /* kva of bounce buffer */ bus_addr_t busaddr; /* Physical address */ vm_offset_t datavaddr; /* kva of client data */ - vm_page_t datapage; /* physical page of client data */ vm_offset_t dataoffs; /* page offset of client data */ + vm_page_t datapage[2]; /* physical page(s) of client data */ bus_size_t datacount; /* client data count */ STAILQ_ENTRY(bounce_page) links; }; @@ -135,8 +135,8 @@ static int alloc_bounce_pages(bus_dma_ta static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_addr_t addr, - bus_size_t size); + vm_offset_t vaddr, bus_addr_t addr1, + bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, @@ -527,6 +527,51 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm } } +static void +_bus_dmamap_count_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma, + int ma_offs, bus_size_t buflen, int flags) +{ + bus_size_t sg_len, max_sgsize; + int page_index; + vm_paddr_t paddr; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); + CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", + map, &nobounce_dmamap, map->pagesneeded); + + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + page_index = 0; + while (buflen > 0) { + paddr = VM_PAGE_TO_PHYS(ma[page_index]) + ma_offs; + sg_len = PAGE_SIZE - ma_offs; + max_sgsize = MIN(buflen, dmat->common.maxsegsz); + sg_len = MIN(sg_len, max_sgsize); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); + sg_len = MIN(sg_len, max_sgsize); + KASSERT((sg_len & (dmat->common.alignment - 1)) + == 0, ("Segment size is not aligned")); + map->pagesneeded++; + } + if (((ma_offs + sg_len) & ~PAGE_MASK) != 0) + page_index++; + ma_offs = (ma_offs + sg_len) & PAGE_MASK; + KASSERT(buflen >= sg_len, + ("Segment length overruns original buffer")); + buflen -= sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) { @@ -632,7 +677,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); - curaddr = add_bounce_page(dmat, map, 0, curaddr, + curaddr = add_bounce_page(dmat, map, 0, curaddr, 0, sgsize); } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, @@ -701,7 +746,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); sgsize = MIN(sgsize, max_sgsize); - curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, + curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, 0, sgsize); } else { sgsize = MIN(sgsize, max_sgsize); @@ -720,6 +765,88 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } +static int +bounce_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t buflen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + vm_paddr_t paddr, next_paddr; + int error, page_index; + bus_size_t sgsize, max_sgsize; + + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { + /* + * If we have to keep the offset of each page this function + * is not suitable, switch back to bus_dmamap_load_ma_triv + * which is going to do the right thing in this case. + */ + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, + flags, segs, segp); + return (error); + } + + if (map == NULL) + map = &nobounce_dmamap; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_ma(dmat, map, ma, ma_offs, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + page_index = 0; + while (buflen > 0) { + /* + * Compute the segment size, and adjust counts. + */ + paddr = VM_PAGE_TO_PHYS(ma[page_index]) + ma_offs; + max_sgsize = MIN(buflen, dmat->common.maxsegsz); + sgsize = PAGE_SIZE - ma_offs; + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, paddr)) { + sgsize = roundup2(sgsize, dmat->common.alignment); + sgsize = MIN(sgsize, max_sgsize); + KASSERT((sgsize & (dmat->common.alignment - 1)) == 0, + ("Segment size is not aligned")); + /* + * Check if two pages of the user provided buffer + * are used. + */ + if ((ma_offs + sgsize) > PAGE_SIZE) + next_paddr = + VM_PAGE_TO_PHYS(ma[page_index + 1]); + else + next_paddr = 0; + paddr = add_bounce_page(dmat, map, 0, paddr, + next_paddr, sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } + sgsize = _bus_dmamap_addseg(dmat, map, paddr, sgsize, segs, + segp); + if (sgsize == 0) + break; + KASSERT(buflen >= sgsize, + ("Segment length overruns original buffer")); + buflen -= sgsize; + if (((ma_offs + sgsize) & ~PAGE_MASK) != 0) + page_index++; + ma_offs = (ma_offs + sgsize) & PAGE_MASK; + } + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + static void bounce_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) @@ -763,6 +890,7 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma { struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; + bus_size_t datacount1, datacount2; if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL) return; @@ -778,17 +906,38 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma while (bpage != NULL) { tempvaddr = 0; datavaddr = bpage->datavaddr; + datacount1 = bpage->datacount; if (datavaddr == 0) { tempvaddr = - pmap_quick_enter_page(bpage->datapage); + pmap_quick_enter_page(bpage->datapage[0]); datavaddr = tempvaddr | bpage->dataoffs; + datacount1 = min(PAGE_SIZE - bpage->dataoffs, + datacount1); } bcopy((void *)datavaddr, - (void *)bpage->vaddr, bpage->datacount); + (void *)bpage->vaddr, datacount1); if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); + + if (bpage->datapage[1] == 0) { + KASSERT(datacount1 == bpage->datacount, + ("Mismatch between data size and provided memory space")); + goto next_w; + } + + /* + * We are dealing with an unmapped buffer that expands + * over two pages. + */ + datavaddr = pmap_quick_enter_page(bpage->datapage[1]); + datacount2 = bpage->datacount - datacount1; + bcopy((void *)datavaddr, + (void *)(bpage->vaddr + datacount1), datacount2); + pmap_quick_remove_page(datavaddr); + +next_w: bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -798,17 +947,38 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma while (bpage != NULL) { tempvaddr = 0; datavaddr = bpage->datavaddr; + datacount1 = bpage->datacount; if (datavaddr == 0) { tempvaddr = - pmap_quick_enter_page(bpage->datapage); + pmap_quick_enter_page(bpage->datapage[0]); datavaddr = tempvaddr | bpage->dataoffs; + datacount1 = min(PAGE_SIZE - bpage->dataoffs, + datacount1); } - bcopy((void *)bpage->vaddr, - (void *)datavaddr, bpage->datacount); + bcopy((void *)bpage->vaddr, (void *)datavaddr, + datacount1); if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); + + if (bpage->datapage[1] == 0) { + KASSERT(datacount1 == bpage->datacount, + ("Mismatch between data size and provided memory space")); + goto next_r; + } + + /* + * We are dealing with an unmapped buffer that expands + * over two pages. + */ + datavaddr = pmap_quick_enter_page(bpage->datapage[1]); + datacount2 = bpage->datacount - datacount1; + bcopy((void *)(bpage->vaddr + datacount1), + (void *)datavaddr, datacount2); + pmap_quick_remove_page(datavaddr); + +next_r: bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -972,7 +1142,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_addr_t addr, bus_size_t size) + bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; @@ -1002,12 +1172,16 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= addr & PAGE_MASK; - bpage->busaddr |= addr & PAGE_MASK; + bpage->vaddr |= addr1 & PAGE_MASK; + bpage->busaddr |= addr1 & PAGE_MASK; + KASSERT(addr2 == 0, + ("Trying to bounce multiple pages with BUS_DMA_KEEP_PG_OFFSET")); } bpage->datavaddr = vaddr; - bpage->datapage = PHYS_TO_VM_PAGE(addr); - bpage->dataoffs = addr & PAGE_MASK; + bpage->datapage[0] = PHYS_TO_VM_PAGE(addr1); + KASSERT((addr2 & PAGE_MASK) == 0, ("Second page is not aligned")); + bpage->datapage[1] = PHYS_TO_VM_PAGE(addr2); + bpage->dataoffs = addr1 & PAGE_MASK; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); return (bpage->busaddr); @@ -1079,7 +1253,7 @@ struct bus_dma_impl bus_dma_bounce_impl .mem_free = bounce_bus_dmamem_free, .load_phys = bounce_bus_dmamap_load_phys, .load_buffer = bounce_bus_dmamap_load_buffer, - .load_ma = bus_dmamap_load_ma_triv, + .load_ma = bounce_bus_dmamap_load_ma, .map_waitok = bounce_bus_dmamap_waitok, .map_complete = bounce_bus_dmamap_complete, .map_unload = bounce_bus_dmamap_unload, From owner-svn-src-all@freebsd.org Mon Nov 9 12:22:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2487EA298FA; Mon, 9 Nov 2015 12:22:46 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A531911; Mon, 9 Nov 2015 12:22:45 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9CMiHV069829; Mon, 9 Nov 2015 12:22:44 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9CMioB069828; Mon, 9 Nov 2015 12:22:44 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201511091222.tA9CMioB069828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 9 Nov 2015 12:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290611 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 12:22:46 -0000 Author: royger Date: Mon Nov 9 12:22:44 2015 New Revision: 290611 URL: https://svnweb.freebsd.org/changeset/base/290611 Log: xen-blkfront: add support for unmapped IO Using unmapped IO is really beneficial when running inside of a VM, since it avoids IPIs to other vCPUs in order to invalidate the mappings. This patch adds unmapped IO support to blkfront. The following tests results have been obtained when running on a Xen host without HAP: PVHVM 3165.84 real 6354.17 user 4483.32 sys PVHVM with unmapped IO 2099.46 real 4624.52 user 2967.38 sys This is because when running using shadow page tables TLB flushes and range invalidations are much more expensive, so using unmapped IO provides a very important performance boost. Sponsored by: Citrix Systems R&D MFC after: 2 weeks X-MFC-with: r290610 dev/xen/blkfront/blkfront.c: - Add and announce support for unmapped IO. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Nov 9 12:19:58 2015 (r290610) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Nov 9 12:22:44 2015 (r290611) @@ -293,8 +293,12 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, - cm->cm_datalen, xbd_queue_cb, cm, 0); + if (cm->cm_bp != NULL) + error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, + cm->cm_bp, xbd_queue_cb, cm, 0); + else + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, + cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -354,8 +358,6 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; - cm->cm_data = bp->bio_data; - cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -1009,7 +1011,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = 0; + sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, From owner-svn-src-all@freebsd.org Mon Nov 9 12:29:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C2BA29A13; Mon, 9 Nov 2015 12:29:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A23E1B12; Mon, 9 Nov 2015 12:29:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1027D1FE023; Mon, 9 Nov 2015 13:29:12 +0100 (CET) Subject: Re: svn commit: r290610 - head/sys/x86/x86 To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511091219.tA9CJwe7067036@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <564091FF.8090605@selasky.org> Date: Mon, 9 Nov 2015 13:30:55 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511091219.tA9CJwe7067036@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 12:29:14 -0000 On 11/09/15 13:19, Roger Pau Monné wrote: > + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { > + /* > + * If we have to keep the offset of each page this function > + * is not suitable, switch back to bus_dmamap_load_ma_triv > + * which is going to do the right thing in this case. > + */ > + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, > + flags, segs, segp); > + return (error); > + } Hi, There has been an update made to the USB stack, which is currently the only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can probably be skipped or relaxed a bit. The condition which must be fullfilled is: #ifdef USB_DEBUG if (nseg > 1 && ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) != ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { /* * This check verifies there is no page offset hole * between the first and second segment. See the * BUS_DMA_KEEP_PG_OFFSET flag. */ DPRINTFN(0, "Page offset was not preserved\n"); error = 1; goto done; } #endif See: sys/dev/usb/usb_busdma.c --HPS From owner-svn-src-all@freebsd.org Mon Nov 9 15:42:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BECEA29276; Mon, 9 Nov 2015 15:42:01 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 C58FC17F8; Mon, 9 Nov 2015 15:42:00 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wmww144 with SMTP id w144so37672541wmw.0; Mon, 09 Nov 2015 07:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=3v21H7d8rPxBhlu+rqc+SMvr9FcBxI8oHalgBci+aGk=; b=rGOs1arAoWNJJAunbxOqiYzc1NheJ9YS5tZV9trAMQ5je1aCr8wOfREq/xu2p0mzvd VEg6bWCyZo8z6rVbDc2c5ZiA43ydXauQK17P1X4bKCAX/2K0E1heSa71HS+CBqFzBR32 yTzFDwodpoyCJyvZkqL5y0XZU/2zyEd5fVav15krPoqEjDvqD9YKkzv1bSsaB04aTajY X9VKLFt4IabXrgMB80ZajdfU8uFL11FmXIeqC3S9g4o70Cn19uiyXK6kUhiGDi6mvU8l EtiB/8WOTfWsu/xrhBmfm6CUQ2KsJkmpPRuFxW3BdluiI2mqrQEZzMdKgA1NBzqYMyGb /IRA== X-Received: by 10.28.139.208 with SMTP id n199mr27532699wmd.82.1447083718048; Mon, 09 Nov 2015 07:41:58 -0800 (PST) Received: from [172.16.1.30] (15.Red-83-50-122.dynamicIP.rima-tde.net. [83.50.122.15]) by smtp.gmail.com with ESMTPSA id l78sm14926550wmb.5.2015.11.09.07.41.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 07:41:57 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r290610 - head/sys/x86/x86 To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511091219.tA9CJwe7067036@repo.freebsd.org> <564091FF.8090605@selasky.org> From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= X-Enigmail-Draft-Status: N1110 Message-ID: <5640BEBE.3070805@FreeBSD.org> Date: Mon, 9 Nov 2015 16:41:50 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564091FF.8090605@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 15:42:01 -0000 Hello, El 09/11/15 a les 13.30, Hans Petter Selasky ha escrit: > On 11/09/15 13:19, Roger Pau Monné wrote: >> + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { >> + /* >> + * If we have to keep the offset of each page this function >> + * is not suitable, switch back to bus_dmamap_load_ma_triv >> + * which is going to do the right thing in this case. >> + */ >> + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, >> + flags, segs, segp); >> + return (error); >> + } > > Hi, > > There has been an update made to the USB stack, which is currently the > only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can The only in-tree client. We don't know if there are other clients out of the tree. > probably be skipped or relaxed a bit. The condition which must be > fullfilled is: So you basically want a contiguous bounce buffer. I don't think we can just change BUS_DMA_KEEP_PG_OFFSET to mean "use a contiguous bounce buffer". Maybe a new flag could be introduced to describe this new requirement and the old one deprecated. > #ifdef USB_DEBUG > if (nseg > 1 && > ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) != > ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { > /* > * This check verifies there is no page offset hole > * between the first and second segment. See the > * BUS_DMA_KEEP_PG_OFFSET flag. > */ > DPRINTFN(0, "Page offset was not preserved\n"); > error = 1; > goto done; > } > #endif AFAICT with the current bounce implementation on x86 you would have to specify an alignment of PAGE_SIZE in order to have this guarantee without specifying BUS_DMA_KEEP_PG_OFFSET. IMHO, we should change all the current bounce buffer code and switch to use memdescs for everything (ie: bios and mbufs should use a memdesc internally). Then each arch should provide functions to copy from the different kinds of memdescs (either memdescs containing physical or virtual memory), so the bounce code could be unified between all arches. Of course that's easier said than done... Roger. From owner-svn-src-all@freebsd.org Mon Nov 9 15:59:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29C8FA298B6; Mon, 9 Nov 2015 15:59:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3621763; Mon, 9 Nov 2015 15:59:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9Fxihq046964; Mon, 9 Nov 2015 15:59:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9FxgB1046943; Mon, 9 Nov 2015 15:59:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201511091559.tA9FxgB1046943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 Nov 2015 15:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290612 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 15:59:45 -0000 Author: adrian Date: Mon Nov 9 15:59:42 2015 New Revision: 290612 URL: https://svnweb.freebsd.org/changeset/base/290612 Log: ath(4): begin fleshing out a "reset type" extension to force cold/warn resets. Right now the only way to force a cold reset is: * The HAL itself detects it's needed, or * The sysctl, setting all resets to be cold. Trouble is, cold resets take quite a bit longer than warm resets. However, there are situations where a cold reset would be nice. Specifically, after a stuck beacon, BB/MAC hang, stuck calibration results, etc. The vendor HAL has a separate method to set the reset reason (which is how HAL_RESET_BBPANIC gets set) which informs the HAL during the reset path why it occured. This is almost but not quite the same; I may eventually unify both approaches in the future. This commit just extends HAL_RESET_TYPE to include both status (eg BBPANIC) and type (eg do COLD.) None of the HAL code uses it yet though; that'll come later. It also is a big no-op in each HAL - I need to go teach each of the HALs about cold/warm reset through this path. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c head/sys/dev/ath/ath_hal/ar5312/ar5312.h head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Mon Nov 9 15:59:42 2015 (r290612) @@ -313,6 +313,7 @@ ar9300_attach_freebsd_ops(struct ath_hal HAL_BOOL ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { HAL_BOOL r; Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h Mon Nov 9 15:59:42 2015 (r290612) @@ -4,7 +4,7 @@ extern void ar9300_attach_freebsd_ops(struct ath_hal *ah); extern HAL_BOOL ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, - HAL_STATUS *status); + HAL_RESET_TYPE resetType, HAL_STATUS *status); extern void ar9300_config_pcie_freebsd(struct ath_hal *, HAL_BOOL, HAL_BOOL); extern HAL_STATUS ar9300_eeprom_get_freebsd(struct ath_hal *, int param, void *val); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Mon Nov 9 15:59:42 2015 (r290612) @@ -765,6 +765,7 @@ ar9300_Stub_ProcRxDesc(struct ath_hal *a HAL_BOOL ar9300_Stub_Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Mon Nov 9 15:59:42 2015 (r290612) @@ -128,6 +128,7 @@ extern HAL_STATUS ar9300_Stub_ProcRxDesc extern HAL_BOOL ar9300_Stub_Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, HAL_STATUS *status); extern HAL_BOOL ar9300_Stub_SetChannel(struct ath_hal *, const struct ieee80211_channel *); Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ah.h Mon Nov 9 15:59:42 2015 (r290612) @@ -753,6 +753,12 @@ typedef enum { HAL_M_MONITOR = 8 /* Monitor mode */ } HAL_OPMODE; +typedef enum { + HAL_RESET_NORMAL = 0, /* Do normal reset */ + HAL_RESET_BBPANIC = 1, /* Reset because of BB panic */ + HAL_RESET_FORCE_COLD = 2, /* Force full reset */ +} HAL_RESET_TYPE; + typedef struct { uint8_t kv_type; /* one of HAL_CIPHER */ uint8_t kv_apsd; /* Mask for APSD enabled ACs */ @@ -1088,11 +1094,6 @@ typedef enum { HAL_GEN_TIMER_TSF_ANY } HAL_GEN_TIMER_DOMAIN; -typedef enum { - HAL_RESET_NONE = 0x0, - HAL_RESET_BBPANIC = 0x1, -} HAL_RESET_TYPE; - /* * BT Co-existence definitions */ @@ -1354,7 +1355,9 @@ struct ath_hal { /* Reset functions */ HAL_BOOL __ahdecl(*ah_reset)(struct ath_hal *, HAL_OPMODE, struct ieee80211_channel *, - HAL_BOOL bChannelChange, HAL_STATUS *status); + HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, + HAL_STATUS *status); HAL_BOOL __ahdecl(*ah_phyDisable)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_disable)(struct ath_hal *); void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore, Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Nov 9 15:59:42 2015 (r290612) @@ -129,7 +129,8 @@ struct ath_hal; extern void ar5210Detach(struct ath_hal *ah); extern HAL_BOOL ar5210Reset(struct ath_hal *, HAL_OPMODE, - struct ieee80211_channel *, HAL_BOOL bChannelChange, HAL_STATUS *); + struct ieee80211_channel *, HAL_BOOL bChannelChange, + HAL_RESET_TYPE, HAL_STATUS *); extern void ar5210SetPCUConfig(struct ath_hal *); extern HAL_BOOL ar5210PhyDisable(struct ath_hal *); extern HAL_BOOL ar5210Disable(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Mon Nov 9 15:59:42 2015 (r290612) @@ -69,6 +69,7 @@ static void ar5210SetOperatingMode(struc HAL_BOOL ar5210Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { #define N(a) (sizeof (a) /sizeof (a[0])) Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Nov 9 15:59:42 2015 (r290612) @@ -147,6 +147,7 @@ extern void ar5211Detach(struct ath_hal extern HAL_BOOL ar5211Reset(struct ath_hal *, HAL_OPMODE, struct ieee80211_channel *, HAL_BOOL bChannelChange, + HAL_RESET_TYPE, HAL_STATUS *); extern HAL_BOOL ar5211PhyDisable(struct ath_hal *); extern HAL_BOOL ar5211Disable(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Mon Nov 9 15:59:42 2015 (r290612) @@ -154,6 +154,7 @@ static void ar5211SetOperatingMode(struc HAL_BOOL ar5211Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { uint32_t softLedCfg, softLedState; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 9 15:59:42 2015 (r290612) @@ -553,7 +553,7 @@ extern HAL_STATUS ar5212ProcRxDesc(struc extern HAL_BOOL ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, - HAL_STATUS *status); + HAL_RESET_TYPE, HAL_STATUS *status); extern HAL_BOOL ar5212SetChannel(struct ath_hal *, const struct ieee80211_channel *); extern void ar5212SetOperatingMode(struct ath_hal *ah, int opmode); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon Nov 9 15:59:42 2015 (r290612) @@ -116,7 +116,9 @@ write_common(struct ath_hal *ah, const H HAL_BOOL ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, - HAL_BOOL bChannelChange, HAL_STATUS *status) + HAL_BOOL bChannelChange, + HAL_RESET_TYPE, resetType, + HAL_STATUS *status) { #define N(a) (sizeof (a) / sizeof (a[0])) #define FAIL(_code) do { ecode = _code; goto bad; } while (0) Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312.h Mon Nov 9 15:59:42 2015 (r290612) @@ -62,8 +62,10 @@ extern void ar5312SetupClock(struct ath extern void ar5312RestoreClock(struct ath_hal *ah, HAL_OPMODE opmode); extern void ar5312DumpState(struct ath_hal *ah); extern HAL_BOOL ar5312Reset(struct ath_hal *ah, HAL_OPMODE opmode, - struct ieee80211_channel *chan, - HAL_BOOL bChannelChange, HAL_STATUS *status); + struct ieee80211_channel *chan, + HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, + HAL_STATUS *status); extern HAL_BOOL ar5312ChipReset(struct ath_hal *ah, struct ieee80211_channel *chan); extern HAL_BOOL ar5312SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c Mon Nov 9 15:59:42 2015 (r290612) @@ -88,7 +88,9 @@ write_common(struct ath_hal *ah, const H HAL_BOOL ar5312Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, - HAL_BOOL bChannelChange, HAL_STATUS *status) + HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, + HAL_STATUS *status) { #define N(a) (sizeof (a) / sizeof (a[0])) #define FAIL(_code) do { ecode = _code; goto bad; } while (0) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Nov 9 15:59:42 2015 (r290612) @@ -193,7 +193,7 @@ extern void ar5416RxMonitor(struct ath_h const struct ieee80211_channel *); extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *, - HAL_OPMODE, int); + HAL_OPMODE, HAL_RESET_TYPE, int); extern void ar5416SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *); extern void ar5416BeaconInit(struct ath_hal *ah, @@ -303,7 +303,9 @@ extern HAL_STATUS ar5416ProcRxDesc(struc extern HAL_BOOL ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, - HAL_BOOL bChannelChange, HAL_STATUS *status); + HAL_BOOL bChannelChange, + HAL_RESET_TYPE, + HAL_STATUS *status); extern HAL_BOOL ar5416PhyDisable(struct ath_hal *ah); extern HAL_RFGAIN ar5416GetRfgain(struct ath_hal *ah); extern HAL_BOOL ar5416Disable(struct ath_hal *ah); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Nov 9 15:59:42 2015 (r290612) @@ -75,7 +75,9 @@ static void ar5416SetIFSTiming(struct at HAL_BOOL ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, - HAL_BOOL bChannelChange, HAL_STATUS *status) + HAL_BOOL bChannelChange, + HAL_RESET_TYPE resetType, + HAL_STATUS *status) { #define N(a) (sizeof (a) / sizeof (a[0])) #define FAIL(_code) do { ecode = _code; goto bad; } while (0) Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/if_ath.c Mon Nov 9 15:59:42 2015 (r290612) @@ -1916,7 +1916,7 @@ ath_resume(struct ath_softc *sc) ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, - AH_FALSE, &status); + AH_FALSE, HAL_RESET_NORMAL, &status); ath_reset_keycache(sc); ATH_RX_LOCK(sc); @@ -2449,7 +2449,7 @@ ath_init(struct ath_softc *sc) sc->sc_cur_rxchainmask); if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE, - &status)) { + HAL_RESET_NORMAL, &status)) { device_printf(sc->sc_dev, "unable to reset hardware; hal status %u\n", status); return (ENODEV); @@ -2823,7 +2823,8 @@ ath_reset(struct ath_softc *sc, ATH_RESE ath_update_chainmasks(sc, ic->ic_curchan); ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, sc->sc_cur_rxchainmask); - if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status)) + if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, + HAL_RESET_NORMAL, &status)) device_printf(sc->sc_dev, "%s: unable to reset hardware; hal status %u\n", __func__, status); @@ -5423,7 +5424,8 @@ ath_chan_set(struct ath_softc *sc, struc ath_update_chainmasks(sc, chan); ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, sc->sc_cur_rxchainmask); - if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { + if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, + HAL_RESET_NORMAL, &status)) { device_printf(sc->sc_dev, "%s: unable to reset " "channel %u (%u MHz, flags 0x%x), hal status %u\n", __func__, ieee80211_chan2ieee(ic, chan), Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Nov 9 12:22:44 2015 (r290611) +++ head/sys/dev/ath/if_athvar.h Mon Nov 9 15:59:42 2015 (r290612) @@ -1035,8 +1035,9 @@ void ath_intr(void *); */ #define ath_hal_detach(_ah) \ ((*(_ah)->ah_detach)((_ah))) -#define ath_hal_reset(_ah, _opmode, _chan, _fullreset, _pstatus) \ - ((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_fullreset), (_pstatus))) +#define ath_hal_reset(_ah, _opmode, _chan, _fullreset, _resettype, _pstatus) \ + ((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_fullreset), \ + (_resettype), (_pstatus))) #define ath_hal_macversion(_ah) \ (((_ah)->ah_macVersion << 4) | ((_ah)->ah_macRev)) #define ath_hal_getratetable(_ah, _mode) \ From owner-svn-src-all@freebsd.org Mon Nov 9 16:50:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E667A2A5F5; Mon, 9 Nov 2015 16:50:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682A812EE; Mon, 9 Nov 2015 16:50:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9GogA1061646; Mon, 9 Nov 2015 16:50:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9Gog7d061645; Mon, 9 Nov 2015 16:50:42 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511091650.tA9Gog7d061645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 9 Nov 2015 16:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290613 - head/sys/compat/linuxkpi/common/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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 16:50:43 -0000 Author: cem Date: Mon Nov 9 16:50:42 2015 New Revision: 290613 URL: https://svnweb.freebsd.org/changeset/base/290613 Log: linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning The code compiles fine under Clang, but GCC on PPC is less permissive about integer and pointer sizes. (An intmax_t is clearly *large enough* to hold a pointer value.) Another follow-up to r290475. Reported by: jhibbits Sponsored by: EMC / Isilon Storage Division Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 9 15:59:42 2015 (r290612) +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 9 16:50:42 2015 (r290613) @@ -80,7 +80,7 @@ sysctl_handle_attr(SYSCTL_HANDLER_ARGS) ssize_t len; kobj = arg1; - attr = (struct attribute *)arg2; + attr = (struct attribute *)(intptr_t)arg2; if (kobj->ktype == NULL || kobj->ktype->sysfs_ops == NULL) return (ENODEV); buf = (char *)get_zeroed_page(GFP_KERNEL); From owner-svn-src-all@freebsd.org Mon Nov 9 16:51:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3829A2A739; Mon, 9 Nov 2015 16:51:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8D817A3; Mon, 9 Nov 2015 16:51:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 834891BB0; Mon, 9 Nov 2015 16:51:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4167417380; Mon, 9 Nov 2015 16:51:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id LAXuOfvXn6jk; Mon, 9 Nov 2015 16:51:48 +0000 (UTC) Subject: Re: svn commit: r290562 - head/usr.bin/localedef DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 84C021737A To: NGie Cooper , Baptiste Daroussin References: <201511082223.tA8MNMKd025259@repo.freebsd.org> <4EF2AE26-DF25-43D0-8CE2-720975546CD3@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5640CF1A.8050604@FreeBSD.org> Date: Mon, 9 Nov 2015 08:51:38 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <4EF2AE26-DF25-43D0-8CE2-720975546CD3@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ftANG9gMtTAeU0u5qDhnaCfUUe2OO4rBn" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 16:51:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ftANG9gMtTAeU0u5qDhnaCfUUe2OO4rBn Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/8/2015 2:28 PM, NGie Cooper wrote: >=20 >> On Nov 8, 2015, at 14:23, Baptiste Daroussin wrote:= >> >> Author: bapt >> Date: Sun Nov 8 22:23:21 2015 >> New Revision: 290562 >> URL: https://svnweb.freebsd.org/changeset/base/290562 >> >> Log: >> lower again the warnings and remove the pragmas unsupported by gcc 4.= 2.1 >=20 > Thank you. Hopefully this will unbreak mips and partially unbreak sparc= 64 (sparc64 is still hung up on a mismatched definition between strsignal= in string.h and contrib/gcc). >=20 Which may or may not be related to WITH_FAST_DEPEND. I'm starting up some builds now for it. --=20 Regards, Bryan Drewery --ftANG9gMtTAeU0u5qDhnaCfUUe2OO4rBn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQM8dAAoJEDXXcbtuRpfPPHsIAMDZOZnaV0zAxTfGD8qyBUTB YtbqfNv2fD8NxzRqyAIEUVkE4z7FXOBVpH4b+3JSwYaXzR7eTHdbZD+AFkTslO0A AAHQjbTHuNbgTiFUEi+zxvJfMV0aABgjgSsKot/EWziXsOf5aN5FrlMRywToKGit 59UIbAYO4mi6c5IBo49nXK8Fmkcb5bUd2eMsCqXh+Ru951sJx6BDRsMqm8M9QfMA 6cprPbQYjmRKFTTZm+hMqG3u/LGYEFKwGoK4Kc3WimYnWMUyK4dcXz/0+VGk4Sqq dCJpyupVlZuMfXLnr9+/KhLi6gUz5aVzem5LN3bFoknDlP+uobhwN16W4rrFtkQ= =BhHV -----END PGP SIGNATURE----- --ftANG9gMtTAeU0u5qDhnaCfUUe2OO4rBn-- From owner-svn-src-all@freebsd.org Mon Nov 9 16:58:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA117A2A82B; Mon, 9 Nov 2015 16:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9E41AF2; Mon, 9 Nov 2015 16:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 846B51E5A; Mon, 9 Nov 2015 16:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 41C1B173CD; Mon, 9 Nov 2015 16:58:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id F-lYPJ6QphJ7; Mon, 9 Nov 2015 16:58:16 +0000 (UTC) Subject: Re: svn commit: r290612 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 86D6D173C7 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511091559.tA9FxgB1046943@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5640D0A8.3010508@FreeBSD.org> Date: Mon, 9 Nov 2015 08:58:16 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511091559.tA9FxgB1046943@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ISKdAEBceusmIoHsr1MDDA33fhvrQLMnC" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 16:58:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ISKdAEBceusmIoHsr1MDDA33fhvrQLMnC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/9/2015 7:59 AM, Adrian Chadd wrote: > Author: adrian > Date: Mon Nov 9 15:59:42 2015 > New Revision: 290612 > URL: https://svnweb.freebsd.org/changeset/base/290612 >=20 > Log: > ath(4): begin fleshing out a "reset type" extension to force cold/war= n resets. > =20 /root/git/freebsd/sys/modules/ath/../../dev/ath/ath_hal/ar5212/ar5212_res= et.c:120:18: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]= HAL_RESET_TYPE, resetType, --=20 Regards, Bryan Drewery --ISKdAEBceusmIoHsr1MDDA33fhvrQLMnC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQNCoAAoJEDXXcbtuRpfPV44H/jvWwuTW7WlhtkRzhPR3ipFQ c+cinp1vzLo3V14ffzZttqQBcWdmvDrgjsk2W6ESmbmPPwOzhGtxmXEjDjozNn3c 3zUKchGPBgOwqpaE8un2V9t+DxRGWu5sgpS/ac+Fhr3tvPmLLsOKfQJD5vSRuu62 lm85sB0hDWOSGna6Fh/faRbjGM/MFxn0e05uS6KQBxFjQKzOBFg0LChjsNeASL3d Fjg/+sL2pp5ZeHpe3rIYN7lt7PBIn8cA/oH3Qt40VuS5cPMtQ8wswlRL0ZZoQ/3t lPsjyelJBSf3gga8X4qmGDTss/wrev/DSiC6+l1mu1rKnLjdsMBj0mZXu6omT+U= =ewgD -----END PGP SIGNATURE----- --ISKdAEBceusmIoHsr1MDDA33fhvrQLMnC-- From owner-svn-src-all@freebsd.org Mon Nov 9 17:08:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00B26A2AB71; Mon, 9 Nov 2015 17:08:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D6A1811CD; Mon, 9 Nov 2015 17:08:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CF71D118D; Mon, 9 Nov 2015 17:08:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 95B971740E; Mon, 9 Nov 2015 17:08:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id MYKIvR4VwFa5; Mon, 9 Nov 2015 17:08:06 +0000 (UTC) Subject: Re: svn commit: r290433 - in head: share/mk sys/conf tools/build/options DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 22E4117407 To: Craig Rodrigues References: <201511060445.tA64jUjj063307@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5640D2F4.6010101@FreeBSD.org> Date: Mon, 9 Nov 2015 09:08:04 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9XNSGnVk94aEBUN3LlkLSdA0LEgn8fCM8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 17:08:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9XNSGnVk94aEBUN3LlkLSdA0LEgn8fCM8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/7/2015 12:41 AM, Craig Rodrigues wrote: >=20 >=20 > On Thu, Nov 5, 2015 at 8:45 PM, Bryan Drewery > wrote: >=20 > Author: bdrewery > Date: Fri Nov 6 04:45:29 2015 > New Revision: 290433 > URL: https://svnweb.freebsd.org/changeset/base/290433 >=20 > Log: > Add a FAST_DEPEND option, off by default, which speeds up the > build significantly. >=20 > Enabling this by default, for src or out-of-src, can be done once= > more testing > has been done, such as a ports exp-run, and with more compilers. >=20 >=20 > I put WITH_FAST_DEPEND=3D"yes" in make.conf for these builds: >=20 > https://jenkins.freebsd.org/job/FreeBSD_HEAD > https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9 > https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64 >=20 >=20 > For the FreeBSD_HEAD_sparc64 build, there is a weird failure on bootstr= ap: >=20 > https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64/1311/console >=20 > If you put these entries in make.conf: >=20 > TARGET=3Dsparc64 > WITH_FAST_DEPEND=3Dyes >=20 > and do: >=20 > make -j 4 buildworld __MAKE_CONF=3Dmake.conf >=20 > That seems to trigger it. >=20 > Can you take a look? >=20 I'm finally getting to testing this. My initial guess is that WITH_FAST_DEPEND is simply exposing an existing race. The entire gnu/usr.bin/cc directory is full of races and duplication with generating the headers. Something that has been a problem in META_MODE. So either way I will fix it. --=20 Regards, Bryan Drewery --9XNSGnVk94aEBUN3LlkLSdA0LEgn8fCM8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQNL0AAoJEDXXcbtuRpfP7Q4H/i2X9gKaWtTQEsnIVgOvZk/6 kAWzkwYDudBxBFdd0W492dMaP0DLcMuReOv0d6H06ANHTHOGap+0soodkiJWdyBr TRYUyCYUpJTc0w+CpQiYwpUvMEtnFONhHhjIj4voW5vMfziTurQRxSElzF2ioAUy HATpGGWoQq5cRAuSgAvpItOuQh6i5FTel+6rIW/VTnvuZ/ItTiuzIn37mEpwRvVq HuFG51aW0nyUu9/pDk+2F0Vax129iy4a1gkx+eFQH5Q3z1D2KTv0wN+KKY9Dv5ce looRE2XIuz//y69CpcM/rzfaQoZd+HAMXyzHqzQmDR/J2YM25z34XqiYx6t0dnA= =jiIC -----END PGP SIGNATURE----- --9XNSGnVk94aEBUN3LlkLSdA0LEgn8fCM8-- From owner-svn-src-all@freebsd.org Mon Nov 9 17:45:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F303CA2A7BC; Mon, 9 Nov 2015 17:45:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 824A51B2E; Mon, 9 Nov 2015 17:45:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 02A3A25D3A6E; Mon, 9 Nov 2015 17:45:49 +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 43FB6C77092; Mon, 9 Nov 2015 17:45:49 +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 q-UsWMJ5qCC0; Mon, 9 Nov 2015 17:45:47 +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 5C5F0C77091; Mon, 9 Nov 2015 17:45:47 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290547 - in head/sys: arm/annapurna/alpine arm/mv/armadaxp arm/qemu arm/ti/omap4 arm/xilinx kern x86/x86 From: "Bjoern A. Zeeb" In-Reply-To: <201511081426.tA8EQopT086552@repo.freebsd.org> Date: Mon, 9 Nov 2015 17:45:46 +0000 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3CA6AE10-0DBA-4130-A76C-524F387907A8@FreeBSD.org> References: <201511081426.tA8EQopT086552@repo.freebsd.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 17:45:53 -0000 > On 08 Nov 2015, at 14:26 , Tijl Coosemans wrote: >=20 > Author: tijl > Date: Sun Nov 8 14:26:50 2015 > New Revision: 290547 > URL: https://svnweb.freebsd.org/changeset/base/290547 >=20 > Log: > Since r289279 bufinit() uses mp_ncpus, but some architectures set = this > variable during mp_start() which is too late. Move this to = mp_setmaxid() > where other architectures set it and move x86 assertions to MI code. >=20 > Reviewed by: kib (x86 part) >=20 > Modified: > head/sys/arm/annapurna/alpine/alpine_machdep_mp.c > head/sys/arm/mv/armadaxp/armadaxp_mp.c > head/sys/arm/qemu/virt_mp.c Seems copy and paste from the old to the new function brought some = confusion n variable naming; can you please fix? /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: = use of undeclared identifier 'ncpus'; did you mean 'pcpup'? mp_ncpus =3D MIN(ncpus, MAXCPU); ^~~~~ pcpup /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:21: note: expanded = from macro 'MIN' #define MIN(a,b) (((a)<(b))?(a):(b)) ^ ./machine/pcpu.h:65:21: note: 'pcpup' declared here extern struct pcpu *pcpup; ^ /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: = ordered comparison between pointer and integer ('struct pcpu *' and = 'int') [-Werror] mp_ncpus =3D MIN(ncpus, MAXCPU); ^~~~~~~~~~~~~~~~~~ /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:23: note: expanded = from macro 'MIN' #define MIN(a,b) (((a)<(b))?(a):(b)) ~~~^~~~ /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: = use of undeclared identifier 'ncpus'; did you mean 'pcpup'? mp_ncpus =3D MIN(ncpus, MAXCPU); ^~~~~ pcpup /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:30: note: expanded = from macro 'MIN' #define MIN(a,b) (((a)<(b))?(a):(b)) ^ ./machine/pcpu.h:65:21: note: 'pcpup' declared here extern struct pcpu *pcpup; ^ /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: = pointer/integer type mismatch in conditional expression ('struct pcpu *' = and 'int') [-Werror,-Wconditional-type-mismatch] mp_ncpus =3D MIN(ncpus, MAXCPU); ^~~~~~~~~~~~~~~~~~ /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:28: note: expanded = from macro 'MIN' #define MIN(a,b) (((a)<(b))?(a):(b)) ^~~~ ~~~ /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:11: error: = incompatible pointer to integer conversion assigning to 'int' from = 'struct pcpu *' [-Werror,-Wint-conversion] mp_ncpus =3D MIN(ncpus, MAXCPU); ^ ~~~~~~~~~~~~~~~~~~ 5 errors generated. --- virt_mp.o --- *** [virt_mp.o] Error code 1 =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-all@freebsd.org Mon Nov 9 17:57:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1D25A2AB92; Mon, 9 Nov 2015 17:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C47313D9; Mon, 9 Nov 2015 17:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9HvWZO081856; Mon, 9 Nov 2015 17:57:32 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9HvWCk081852; Mon, 9 Nov 2015 17:57:32 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201511091757.tA9HvWCk081852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 9 Nov 2015 17:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290614 - in head/sys: arm/arm arm/conf arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 17:57:33 -0000 Author: bz Date: Mon Nov 9 17:57:32 2015 New Revision: 290614 URL: https://svnweb.freebsd.org/changeset/base/290614 Log: Now that the PMU implementation is independent of HWPMC as of r288992 use it to manage the CCNT. Use the CNNT for get_cyclecount() instead of binuptime() when device pmu is compiled in; if it fails to attach, fall back to the former method. Enable by default for the BeagleBoneBlack configuration. Optained from: Cambridge/L41 Sponsored by: DARPA/AFRL Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D3837 Modified: head/sys/arm/arm/pmu.c head/sys/arm/conf/BEAGLEBONE head/sys/arm/include/cpu.h head/sys/conf/options.arm Modified: head/sys/arm/arm/pmu.c ============================================================================== --- head/sys/arm/arm/pmu.c Mon Nov 9 16:50:42 2015 (r290613) +++ head/sys/arm/arm/pmu.c Mon Nov 9 17:57:32 2015 (r290614) @@ -94,16 +94,44 @@ static struct resource_spec pmu_spec[] = { -1, 0 } }; +/* CCNT */ +#if __ARM_ARCH > 6 +int pmu_attched = 0; +uint32_t ccnt_hi[MAXCPU]; +#endif + +#define PMU_OVSR_C 0x80000000 /* Cycle Counter */ +#define PMU_IESR_C 0x80000000 /* Cycle Counter */ + static int pmu_intr(void *arg) { +#ifdef HWPMC_HOOKS struct trapframe *tf; - - tf = arg; +#endif + uint32_t r; +#if defined(__arm__) && (__ARM_ARCH > 6) + u_int cpu; + + cpu = PCPU_GET(cpuid); + + r = cp15_pmovsr_get(); + if (r & PMU_OVSR_C) { + atomic_add_32(&ccnt_hi[cpu], 1); + /* Clear the event. */ + r &= ~PMU_OVSR_C; + cp15_pmovsr_set(PMU_OVSR_C); + } +#else + r = 1; +#endif #ifdef HWPMC_HOOKS - if (pmc_intr) + /* Only call into the HWPMC framework if we know there is work. */ + if (r != 0 && pmc_intr) { + tf = arg; (*pmc_intr)(PCPU_GET(cpuid), tf); + } #endif return (FILTER_HANDLED); @@ -128,6 +156,9 @@ static int pmu_attach(device_t dev) { struct pmu_softc *sc; +#if defined(__arm__) && (__ARM_ARCH > 6) + uint32_t iesr; +#endif int err; int i; @@ -152,6 +183,20 @@ pmu_attach(device_t dev) } } +#if defined(__arm__) && (__ARM_ARCH > 6) + /* Initialize to 0. */ + for (i = 0; i < MAXCPU; i++) + ccnt_hi[i] = 0; + + /* Enable the interrupt to fire on overflow. */ + iesr = cp15_pminten_get(); + iesr |= PMU_IESR_C; + cp15_pminten_set(iesr); + + /* Need this for getcyclecount() fast path. */ + pmu_attched |= 1; +#endif + return (0); } Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon Nov 9 16:50:42 2015 (r290613) +++ head/sys/arm/conf/BEAGLEBONE Mon Nov 9 17:57:32 2015 (r290614) @@ -102,6 +102,9 @@ device ti_pruss # Mailbox support device ti_mbox +# PMU support (for CCNT). +device pmu + # USB support device usb options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Mon Nov 9 16:50:42 2015 (r290613) +++ head/sys/arm/include/cpu.h Mon Nov 9 17:57:32 2015 (r290614) @@ -14,12 +14,42 @@ void swi_vm(void *); #ifdef _KERNEL #if __ARM_ARCH >= 6 #include -#endif +#ifdef DEV_PMU +#include +#define PMU_OVSR_C 0x80000000 /* Cycle Counter */ +extern uint32_t ccnt_hi[MAXCPU]; +extern int pmu_attched; +#endif /* DEV_PMU */ +#endif /* __ARM_ARCH >= 6 */ + static __inline uint64_t get_cyclecount(void) { #if __ARM_ARCH >= 6 - return cp15_pmccntr_get(); +#if (__ARM_ARCH > 6) && defined(DEV_PMU) + if (pmu_attched) { + u_int cpu; + uint64_t h, h2; + uint32_t l, r; + + cpu = PCPU_GET(cpuid); + h = (uint64_t)atomic_load_acq_32(&ccnt_hi[cpu]); + l = cp15_pmccntr_get(); + /* In case interrupts are disabled we need to check for overflow. */ + r = cp15_pmovsr_get(); + if (r & PMU_OVSR_C) { + atomic_add_32(&ccnt_hi[cpu], 1); + /* Clear the event. */ + cp15_pmovsr_set(PMU_OVSR_C); + } + /* Make sure there was no wrap-around while we read the lo half. */ + h2 = (uint64_t)atomic_load_acq_32(&ccnt_hi[cpu]); + if (h != h2) + l = cp15_pmccntr_get(); + return (h2 << 32 | l); + } else +#endif + return cp15_pmccntr_get(); #else /* No performance counters, so use binuptime(9). This is slooooow */ struct bintime bt; Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Mon Nov 9 16:50:42 2015 (r290613) +++ head/sys/conf/options.arm Mon Nov 9 17:57:32 2015 (r290614) @@ -23,6 +23,7 @@ CPU_XSCALE_IXP425 opt_global.h CPU_XSCALE_IXP435 opt_global.h CPU_XSCALE_PXA2X0 opt_global.h DEV_GIC opt_global.h +DEV_PMU opt_global.h EFI opt_platform.h FLASHADDR opt_global.h GIC_DEFAULT_ICFGR_INIT opt_global.h From owner-svn-src-all@freebsd.org Mon Nov 9 18:33:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85EF1A2A4F3; Mon, 9 Nov 2015 18:33:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5142C1629; Mon, 9 Nov 2015 18:33:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9IXbsX093072; Mon, 9 Nov 2015 18:33:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9IXbIS093067; Mon, 9 Nov 2015 18:33:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511091833.tA9IXbIS093067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Nov 2015 18:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290615 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 18:33:38 -0000 Author: mav Date: Mon Nov 9 18:33:36 2015 New Revision: 290615 URL: https://svnweb.freebsd.org/changeset/base/290615 Log: Introduce portal group options in ctl.conf. While CTL has concept of port options, used at least for iSCSI ports now, before this change it was impossible to set them manually. There still no user-configurable port options now, but I am planning to change that. Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/kernel.c head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Mon Nov 9 17:57:32 2015 (r290614) +++ head/usr.sbin/ctld/ctl.conf.5 Mon Nov 9 18:33:36 2015 (r290615) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2015 +.Dd November 9, 2015 .Dt CTL.CONF 5 .Os .Sh NAME @@ -226,6 +226,8 @@ An IPv4 or IPv6 address and port to list .It Ic offload Ar driver Define iSCSI hardware offload driver to use for this .Sy portal-group . +.It Ic option Ar name Ar value +The CTL-specific port options passed to the kernel. .It Ic redirect Ar address IPv4 or IPv6 address to redirect initiators to. When configured, all initiators attempting to connect to portal Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Nov 9 17:57:32 2015 (r290614) +++ head/usr.sbin/ctld/ctld.c Mon Nov 9 18:33:36 2015 (r290615) @@ -615,6 +615,7 @@ portal_group_new(struct conf *conf, cons if (pg == NULL) log_err(1, "calloc"); pg->pg_name = checked_strdup(name); + TAILQ_INIT(&pg->pg_options); TAILQ_INIT(&pg->pg_portals); TAILQ_INIT(&pg->pg_ports); pg->pg_conf = conf; @@ -629,6 +630,7 @@ portal_group_delete(struct portal_group { struct portal *portal, *tmp; struct port *port, *tport; + struct option *o, *otmp; TAILQ_FOREACH_SAFE(port, &pg->pg_ports, p_pgs, tport) port_delete(port); @@ -636,6 +638,8 @@ portal_group_delete(struct portal_group TAILQ_FOREACH_SAFE(portal, &pg->pg_portals, p_next, tmp) portal_delete(portal); + TAILQ_FOREACH_SAFE(o, &pg->pg_options, o_next, otmp) + option_delete(&pg->pg_options, o); free(pg->pg_name); free(pg->pg_offload); free(pg->pg_redirection); @@ -1406,7 +1410,7 @@ void lun_delete(struct lun *lun) { struct target *targ; - struct lun_option *lo, *tmp; + struct option *o, *tmp; int i; TAILQ_FOREACH(targ, &lun->l_conf->conf_targets, t_next) { @@ -1417,8 +1421,8 @@ lun_delete(struct lun *lun) } TAILQ_REMOVE(&lun->l_conf->conf_luns, lun, l_next); - TAILQ_FOREACH_SAFE(lo, &lun->l_options, lo_next, tmp) - lun_option_delete(lo); + TAILQ_FOREACH_SAFE(o, &lun->l_options, o_next, tmp) + option_delete(&lun->l_options, o); free(lun->l_name); free(lun->l_backend); free(lun->l_device_id); @@ -1504,59 +1508,56 @@ lun_set_ctl_lun(struct lun *lun, uint32_ lun->l_ctl_lun = value; } -struct lun_option * -lun_option_new(struct lun *lun, const char *name, const char *value) +struct option * +option_new(struct options *options, const char *name, const char *value) { - struct lun_option *lo; + struct option *o; - lo = lun_option_find(lun, name); - if (lo != NULL) { - log_warnx("duplicated lun option \"%s\" for lun \"%s\"", - name, lun->l_name); + o = option_find(options, name); + if (o != NULL) { + log_warnx("duplicated option \"%s\"", name); return (NULL); } - lo = calloc(1, sizeof(*lo)); - if (lo == NULL) + o = calloc(1, sizeof(*o)); + if (o == NULL) log_err(1, "calloc"); - lo->lo_name = checked_strdup(name); - lo->lo_value = checked_strdup(value); - lo->lo_lun = lun; - TAILQ_INSERT_TAIL(&lun->l_options, lo, lo_next); + o->o_name = checked_strdup(name); + o->o_value = checked_strdup(value); + TAILQ_INSERT_TAIL(options, o, o_next); - return (lo); + return (o); } void -lun_option_delete(struct lun_option *lo) +option_delete(struct options *options, struct option *o) { - TAILQ_REMOVE(&lo->lo_lun->l_options, lo, lo_next); - - free(lo->lo_name); - free(lo->lo_value); - free(lo); + TAILQ_REMOVE(options, o, o_next); + free(o->o_name); + free(o->o_value); + free(o); } -struct lun_option * -lun_option_find(const struct lun *lun, const char *name) +struct option * +option_find(const struct options *options, const char *name) { - struct lun_option *lo; + struct option *o; - TAILQ_FOREACH(lo, &lun->l_options, lo_next) { - if (strcmp(lo->lo_name, name) == 0) - return (lo); + TAILQ_FOREACH(o, options, o_next) { + if (strcmp(o->o_name, name) == 0) + return (o); } return (NULL); } void -lun_option_set(struct lun_option *lo, const char *value) +option_set(struct option *o, const char *value) { - free(lo->lo_value); - lo->lo_value = checked_strdup(value); + free(o->o_value); + o->o_value = checked_strdup(value); } static struct connection * @@ -1595,7 +1596,7 @@ conf_print(struct conf *conf) struct portal *portal; struct target *targ; struct lun *lun; - struct lun_option *lo; + struct option *o; TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) { fprintf(stderr, "auth-group %s {\n", ag->ag_name); @@ -1620,9 +1621,9 @@ conf_print(struct conf *conf) TAILQ_FOREACH(lun, &conf->conf_luns, l_next) { fprintf(stderr, "\tlun %s {\n", lun->l_name); fprintf(stderr, "\t\tpath %s\n", lun->l_path); - TAILQ_FOREACH(lo, &lun->l_options, lo_next) + TAILQ_FOREACH(o, &lun->l_options, o_next) fprintf(stderr, "\t\toption %s %s\n", - lo->lo_name, lo->lo_value); + lo->o_name, lo->o_value); fprintf(stderr, "\t}\n"); } TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Mon Nov 9 17:57:32 2015 (r290614) +++ head/usr.sbin/ctld/ctld.h Mon Nov 9 18:33:36 2015 (r290615) @@ -105,6 +105,8 @@ struct portal { int p_socket; }; +TAILQ_HEAD(options, option); + #define PG_FILTER_UNKNOWN 0 #define PG_FILTER_NONE 1 #define PG_FILTER_PORTAL 2 @@ -114,6 +116,7 @@ struct portal { struct portal_group { TAILQ_ENTRY(portal_group) pg_next; struct conf *pg_conf; + struct options pg_options; char *pg_name; struct auth_group *pg_discovery_auth_group; int pg_discovery_filter; @@ -152,17 +155,16 @@ struct port { uint32_t p_ctl_port; }; -struct lun_option { - TAILQ_ENTRY(lun_option) lo_next; - struct lun *lo_lun; - char *lo_name; - char *lo_value; +struct option { + TAILQ_ENTRY(option) o_next; + char *o_name; + char *o_value; }; struct lun { TAILQ_ENTRY(lun) l_next; struct conf *l_conf; - TAILQ_HEAD(, lun_option) l_options; + struct options l_options; char *l_name; char *l_backend; uint8_t l_device_type; @@ -386,13 +388,11 @@ void lun_set_serial(struct lun *lun, c void lun_set_size(struct lun *lun, size_t value); void lun_set_ctl_lun(struct lun *lun, uint32_t value); -struct lun_option *lun_option_new(struct lun *lun, +struct option *option_new(struct options *os, const char *name, const char *value); -void lun_option_delete(struct lun_option *clo); -struct lun_option *lun_option_find(const struct lun *lun, - const char *name); -void lun_option_set(struct lun_option *clo, - const char *value); +void option_delete(struct options *os, struct option *co); +struct option *option_find(const struct options *os, const char *name); +void option_set(struct option *o, const char *value); void kernel_init(void); int kernel_lun_add(struct lun *lun); Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Mon Nov 9 17:57:32 2015 (r290614) +++ head/usr.sbin/ctld/kernel.c Mon Nov 9 18:33:36 2015 (r290615) @@ -396,7 +396,7 @@ conf_new_from_kernel(void) struct pport *pp; struct port *cp; struct lun *cl; - struct lun_option *lo; + struct option *o; struct ctl_lun_list list; struct cctl_devlist_data devlist; struct cctl_lun *lun; @@ -626,8 +626,8 @@ retry_port: lun_set_path(cl, nv->value); continue; } - lo = lun_option_new(cl, nv->name, nv->value); - if (lo == NULL) + o = option_new(&cl->l_options, nv->name, nv->value); + if (o == NULL) log_warnx("unable to add CTL lun option %s " "for CTL lun %ju \"%s\"", nv->name, (uintmax_t) lun->lun_id, @@ -652,7 +652,7 @@ str_arg(struct ctl_be_arg *arg, const ch int kernel_lun_add(struct lun *lun) { - struct lun_option *lo; + struct option *o; struct ctl_lun_req req; int error, i, num_options; @@ -687,31 +687,31 @@ kernel_lun_add(struct lun *lun) } if (lun->l_path != NULL) { - lo = lun_option_find(lun, "file"); - if (lo != NULL) { - lun_option_set(lo, lun->l_path); + o = option_find(&lun->l_options, "file"); + if (o != NULL) { + option_set(o, lun->l_path); } else { - lo = lun_option_new(lun, "file", lun->l_path); - assert(lo != NULL); + o = option_new(&lun->l_options, "file", lun->l_path); + assert(o != NULL); } } - lo = lun_option_find(lun, "ctld_name"); - if (lo != NULL) { - lun_option_set(lo, lun->l_name); + o = option_find(&lun->l_options, "ctld_name"); + if (o != NULL) { + option_set(o, lun->l_name); } else { - lo = lun_option_new(lun, "ctld_name", lun->l_name); - assert(lo != NULL); + o = option_new(&lun->l_options, "ctld_name", lun->l_name); + assert(o != NULL); } - lo = lun_option_find(lun, "scsiname"); - if (lo == NULL && lun->l_scsiname != NULL) { - lo = lun_option_new(lun, "scsiname", lun->l_scsiname); - assert(lo != NULL); + o = option_find(&lun->l_options, "scsiname"); + if (o == NULL && lun->l_scsiname != NULL) { + o = option_new(&lun->l_options, "scsiname", lun->l_scsiname); + assert(o != NULL); } num_options = 0; - TAILQ_FOREACH(lo, &lun->l_options, lo_next) + TAILQ_FOREACH(o, &lun->l_options, o_next) num_options++; req.num_be_args = num_options; @@ -724,8 +724,8 @@ kernel_lun_add(struct lun *lun) } i = 0; - TAILQ_FOREACH(lo, &lun->l_options, lo_next) { - str_arg(&req.be_args[i], lo->lo_name, lo->lo_value); + TAILQ_FOREACH(o, &lun->l_options, o_next) { + str_arg(&req.be_args[i], o->o_name, o->o_value); i++; } assert(i == num_options); @@ -760,7 +760,7 @@ kernel_lun_add(struct lun *lun) int kernel_lun_modify(struct lun *lun) { - struct lun_option *lo; + struct option *o; struct ctl_lun_req req; int error, i, num_options; @@ -773,7 +773,7 @@ kernel_lun_modify(struct lun *lun) req.reqdata.modify.lun_size_bytes = lun->l_size; num_options = 0; - TAILQ_FOREACH(lo, &lun->l_options, lo_next) + TAILQ_FOREACH(o, &lun->l_options, o_next) num_options++; req.num_be_args = num_options; @@ -786,8 +786,8 @@ kernel_lun_modify(struct lun *lun) } i = 0; - TAILQ_FOREACH(lo, &lun->l_options, lo_next) { - str_arg(&req.be_args[i], lo->lo_name, lo->lo_value); + TAILQ_FOREACH(o, &lun->l_options, o_next) { + str_arg(&req.be_args[i], o->o_name, o->o_value); i++; } assert(i == num_options); @@ -945,6 +945,7 @@ kernel_limits(const char *offload, size_ int kernel_port_add(struct port *port) { + struct option *o; struct ctl_port_entry entry; struct ctl_req req; struct ctl_lun_map lm; @@ -959,6 +960,8 @@ kernel_port_add(struct port *port) strlcpy(req.driver, "iscsi", sizeof(req.driver)); req.reqtype = CTL_REQ_CREATE; req.num_args = 5; + TAILQ_FOREACH(o, &pg->pg_options, o_next) + req.num_args++; req.args = malloc(req.num_args * sizeof(*req.args)); if (req.args == NULL) log_err(1, "malloc"); @@ -974,6 +977,8 @@ kernel_port_add(struct port *port) if (targ->t_alias) str_arg(&req.args[n++], "cfiscsi_target_alias", targ->t_alias); str_arg(&req.args[n++], "ctld_portal_group_name", pg->pg_name); + TAILQ_FOREACH(o, &pg->pg_options, o_next) + str_arg(&req.args[n++], o->o_name, o->o_value); req.num_args = n; error = ioctl(ctl_fd, CTL_PORT_REQ, &req); free(req.args); Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Mon Nov 9 17:57:32 2015 (r290614) +++ head/usr.sbin/ctld/parse.y Mon Nov 9 18:33:36 2015 (r290615) @@ -346,6 +346,8 @@ portal_group_entry: | portal_group_offload | + portal_group_option + | portal_group_redirect | portal_group_tag @@ -422,6 +424,18 @@ portal_group_offload: OFFLOAD STR } ; +portal_group_option: OPTION STR STR + { + struct option *o; + + o = option_new(&portal_group->pg_options, $2, $3); + free($2); + free($3); + if (o == NULL) + return (1); + } + ; + portal_group_redirect: REDIRECT STR { int error; @@ -963,12 +977,12 @@ lun_ctl_lun: CTL_LUN STR lun_option: OPTION STR STR { - struct lun_option *clo; + struct option *o; - clo = lun_option_new(lun, $2, $3); + o = option_new(&lun->l_options, $2, $3); free($2); free($3); - if (clo == NULL) + if (o == NULL) return (1); } ; From owner-svn-src-all@freebsd.org Mon Nov 9 19:17:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDDA7A2A578; Mon, 9 Nov 2015 19:17:59 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9526212EC; Mon, 9 Nov 2015 19:17:59 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgeb1 with SMTP id b1so99178669qge.1; Mon, 09 Nov 2015 11:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=hMovpbhmtja0beqcHppQtATcTbT+iEm1H0+I3idL/1g=; b=HY0wQHpPSkHg/e2xKMZpdfwICAlxy4vzGdbO3GomNLBdCdVYNOvmMuY8sMsZB6F8Su LR+a7JFiwNXhzAKo7RQhCvwjzOMBtf0QeqgxX8ied/GAXAnQ3AUamHukzaXZ3hIwVq6q sQB/spGs4709+F/F+9Q1ATK+9iUrooRMnc+ALo+aP7CJggmxujQ9zZSmi+V6RZgrUim8 5Z2YODIaznXNDkLy7c8K1MTkHjYEvRSc5IUJlwYMJmJKnndAU22CYAD6dZEHsIfUDk7J xs/khWmtzqZAZodRfz6kGLTkpP6BvSmeGrJFc/l8G1HpA2/93JKBsRS/fgsLkXPPFkmr 60jA== X-Received: by 10.140.31.161 with SMTP id f30mr12074199qgf.95.1447096678620; Mon, 09 Nov 2015 11:17:58 -0800 (PST) Received: from mbp.home (179-125-139-181.desktop.com.br. [179.125.139.181]) by smtp.gmail.com with ESMTPSA id h11sm1603935qge.43.2015.11.09.11.17.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Nov 2015 11:17:57 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r290612 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Content-Type: multipart/signed; boundary="Apple-Mail=_492A18F5-E583-41B6-A135-F8BC2F11C632"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Renato Botelho In-Reply-To: <5640D0A8.3010508@FreeBSD.org> Date: Mon, 9 Nov 2015 17:17:52 -0200 Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2B0092AA-AC59-489F-B250-98025676A80E@FreeBSD.org> References: <201511091559.tA9FxgB1046943@repo.freebsd.org> <5640D0A8.3010508@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 19:18:00 -0000 --Apple-Mail=_492A18F5-E583-41B6-A135-F8BC2F11C632 Content-Type: multipart/mixed; boundary="Apple-Mail=_69077A75-9DDE-402D-9775-72EF63D0CEF2" --Apple-Mail=_69077A75-9DDE-402D-9775-72EF63D0CEF2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Nov 9, 2015, at 14:58, Bryan Drewery wrote: >=20 > On 11/9/2015 7:59 AM, Adrian Chadd wrote: >> Author: adrian >> Date: Mon Nov 9 15:59:42 2015 >> New Revision: 290612 >> URL: https://svnweb.freebsd.org/changeset/base/290612 >>=20 >> Log: >> ath(4): begin fleshing out a "reset type" extension to force = cold/warn resets. >>=20 >=20 > = /root/git/freebsd/sys/modules/ath/../../dev/ath/ath_hal/ar5212/ar5212_rese= t.c:120:18: > error: type specifier missing, defaults to 'int' = [-Werror,-Wimplicit-int] > HAL_RESET_TYPE, resetType, Attached patch fixed it for me. --Apple-Mail=_69077A75-9DDE-402D-9775-72EF63D0CEF2 Content-Disposition: attachment; filename=fix_ath.diff Content-Type: application/octet-stream; name="fix_ath.diff" Content-Transfer-Encoding: 7bit Index: sys/dev/ath/ath_hal/ar5212/ar5212_reset.c =================================================================== --- sys/dev/ath/ath_hal/ar5212/ar5212_reset.c (revision 290615) +++ sys/dev/ath/ath_hal/ar5212/ar5212_reset.c (working copy) @@ -117,7 +117,7 @@ ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, - HAL_RESET_TYPE, resetType, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { #define N(a) (sizeof (a) / sizeof (a[0])) Index: sys/dev/ath/ath_hal/ar5416/ar5416.h =================================================================== --- sys/dev/ath/ath_hal/ar5416/ar5416.h (revision 290615) +++ sys/dev/ath/ath_hal/ar5416/ar5416.h (working copy) @@ -193,7 +193,7 @@ const struct ieee80211_channel *); extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *, - HAL_OPMODE, HAL_RESET_TYPE, int); + HAL_OPMODE, int); extern void ar5416SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *); extern void ar5416BeaconInit(struct ath_hal *ah, --Apple-Mail=_69077A75-9DDE-402D-9775-72EF63D0CEF2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 -- Renato Botelho --Apple-Mail=_69077A75-9DDE-402D-9775-72EF63D0CEF2-- --Apple-Mail=_492A18F5-E583-41B6-A135-F8BC2F11C632 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 - http://gpgtools.org iQIcBAEBCgAGBQJWQPFhAAoJEPHw56GfYleQXmgP/3xBMx0ZzqhjksjpLXus4WMX /DItm/tMLEVOSbEh3BNBZKiriN3yWEaaJGljcY7yaHNxhDGxHRdQCscrDgqdMusi Cs8HgLMQ9C9RdxTrIHb4enAVg8qWag+RAn88LXPo4p5o7OJBPv5buh2Xuq7DTsqf mGA1sWxMwRGjBkhbQvlQCxvZIg1QKFShzGoxA7FOjxdx77S9/zC/IkAjExAJmP1p Nas/TspEg0ZNbk9M9kl+cwO+sCdrKS+E72VtmiQ5laKH+UnFoHXs7TGzTUg1ipzk fy9ITtIX795mWrATZLu7Evp14ohEmllxoIim4mFTKg9HyfPiyrL8RmV76mFnivfH rr0jUi3cbaQ3ENO7lLSs6zZ51TGMmXPYH6+amjdexL3TpB+mCyvCq/LyChNVzY1t i5P779PwQVLKopk1v0bwfE3NAFCQbjB1iOJJP0/CV3IJSNtIVxWECuoA0vfoyccy H0KK0eipX712yMDRND5GByZMIOreTKn0gM2tPEOjcsyeqlJE+xO+LJYK28kIHorP f2o3fUt3zhDJAf49P6GrTELTL3A95EFvyg8xkIEy0ppIvNGkL5tZZ7LD8/bIZmJC O61rjKV4Bgjkt7oy18K1ksar56uuW33+2WNQ0hw02sSOxmO2ZK1lZO4xQCOpitD4 s/qh5ltugQi0whCYU5fA =XaYO -----END PGP SIGNATURE----- --Apple-Mail=_492A18F5-E583-41B6-A135-F8BC2F11C632-- From owner-svn-src-all@freebsd.org Mon Nov 9 19:19:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20567A2A617 for ; Mon, 9 Nov 2015 19:19:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8B43153D for ; Mon, 9 Nov 2015 19:19:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 9 Nov 2015 19:19:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tA9JJDs1001472; Mon, 9 Nov 2015 12:19:13 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1447096753.91534.514.camel@freebsd.org> Subject: Re: svn commit: r290610 - head/sys/x86/x86 From: Ian Lepore To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 09 Nov 2015 12:19:13 -0700 In-Reply-To: <5640BEBE.3070805@FreeBSD.org> References: <201511091219.tA9CJwe7067036@repo.freebsd.org> <564091FF.8090605@selasky.org> <5640BEBE.3070805@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 19:19:22 -0000 On Mon, 2015-11-09 at 16:41 +0100, Roger Pau Monné wrote: > Hello, > > El 09/11/15 a les 13.30, Hans Petter Selasky ha escrit: > > On 11/09/15 13:19, Roger Pau Monné wrote: > > > + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { > > > + /* > > > + * If we have to keep the offset of each page this > > > function > > > + * is not suitable, switch back to > > > bus_dmamap_load_ma_triv > > > + * which is going to do the right thing in this case. > > > + */ > > > + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, > > > ma_offs, > > > + flags, segs, segp); > > > + return (error); > > > + } > > > > Hi, > > > > There has been an update made to the USB stack, which is currently > > the > > only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can > > The only in-tree client. We don't know if there are other clients out > of > the tree. > The BUS_DMA_KEEP_PG_OFFSET flag is not documented anywhere except in a short coment block near its #define which is less than 100% rigorous in specifying exactly what the flag even means. For example it is documented as being a "hint" but also includes the word "must". It doesn't say whether the flag is to be used to create a tag, to create a map, or to load a buffer. It says the offset must be kept the same in the first segment but doesn't really fully explain what the USB requirements are (and the flag was added specifically for USB). To me, all of that adds up to freedom to clarify the meaning of the flag in both code and documentation without a lot of worrying about out of tree code. And the mips and arm busdma implementations are soon going to leverage that freedom into much better implementations based on the new understanding of what that flag really requires. > > probably be skipped or relaxed a bit. The condition which must be > > fullfilled is: > > So you basically want a contiguous bounce buffer. I don't think we > can > just change BUS_DMA_KEEP_PG_OFFSET to mean "use a contiguous bounce > buffer". Maybe a new flag could be introduced to describe this new > requirement and the old one deprecated. > It's not "I want a contiguous buffer". It is "I want contiguous offsets when transitioning between (potentially non-continguous) pages." That grants you the freedom to bounce a couple different ways depending on what's most efficient for the platform and the situation. For example, you can maintain the offset-within-page in the first segment and allow the offset in all subsequent pages (bounced or not) to be zero. That's what all current implementations are doing, but it can require two full bounce pages to handle a 2-byte transfer that happens to be split across two pages (and yes that happens; it's not even rare in USB, as lots of DMA is done specifying buffers and variables on kernel stacks or in softc member variables). It also allows for the possibility of changing the offset in the first segment if doing so avoids any page crossings at all (which handles everything from the 2-byte worst case to a 4096-byte buffer). > > #ifdef USB_DEBUG > > if (nseg > 1 && > > ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) > > != > > ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { > > /* > > * This check verifies there is no page offset hole > > * between the first and second segment. See the > > * BUS_DMA_KEEP_PG_OFFSET flag. > > */ > > DPRINTFN(0, "Page offset was not preserved\n"); > > error = 1; > > goto done; > > } > > #endif > > AFAICT with the current bounce implementation on x86 you would have > to > specify an alignment of PAGE_SIZE in order to have this guarantee > without specifying BUS_DMA_KEEP_PG_OFFSET. > > IMHO, we should change all the current bounce buffer code and switch > to > use memdescs for everything (ie: bios and mbufs should use a memdesc > internally). Then each arch should provide functions to copy from the > different kinds of memdescs (either memdescs containing physical or > virtual memory), so the bounce code could be unified between all > arches. > Of course that's easier said than done... > I completely disagree with this, mostly because I'm halfway through a set of changes that will make arm and mips bounce handling look completely different than x86 or other platforms. That reflects the differences in underlying hardware that leads to completely different reasons for bouncing in the first place. x86 code bounces DMA when there are exclusion regions in the physical address space where DMA cannot occur. On ARM and MIPS that situation just basically never occurs (except maybe on a few ancient arm xscale systems), and virtually all bouncing is due to DMA buffers not being on cache line boundaries. Because bio and mbuf DMA typically is cache -aligned, that means that almost all bouncing is a handful of bytes at a time, and the page-replacement bounce scheme that was copied from x86 just isn't efficient (in fact it wastes megabytes of memory in preallocated bounce buffers that small-memory arm and mips systems can't really afford to waste). -- Ian From owner-svn-src-all@freebsd.org Mon Nov 9 20:03:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D212A2A477; Mon, 9 Nov 2015 20:03:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5B91CC1; Mon, 9 Nov 2015 20:03:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iody8 with SMTP id y8so197481605iod.1; Mon, 09 Nov 2015 12:03: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=MEX6m3399qlxF3uql4R0m2WQusMMhSp4FbZtHQJ8M80=; b=yoGckvxahiAB26cbwtmQGISYjp+Ag+IkujizLPTSMA3qF7B8Q8YSXkDkkHLGUF8Ps6 4mtkocGKOHkOwvJsqXt/RgS2e69Ablv4TOE5YvG0cXLjS98dQe7orhDqOxPZ8K8oWgff oh3wIlWjA8rFkQ7IRh7mA1Kj8L+0n7Sl4Cq+BerqbeZK373uc/jnNKh4ORmnhMfpG0fb iGZdnMWgagkGOdnEMMeySUGIXTTjdKLxh7S9eRvkj5IbAXeW3UaCNBFaVwaIguGN7QSv TTesRMcCQzwUUnPN/QJDXBbtVpl59SOjOIN6D6FqaA2EQZz8Se1chiMjidtoPD/VsAMI q4ag== MIME-Version: 1.0 X-Received: by 10.107.10.199 with SMTP id 68mr249990iok.75.1447099395463; Mon, 09 Nov 2015 12:03:15 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.217.196 with HTTP; Mon, 9 Nov 2015 12:03:15 -0800 (PST) In-Reply-To: <2B0092AA-AC59-489F-B250-98025676A80E@FreeBSD.org> References: <201511091559.tA9FxgB1046943@repo.freebsd.org> <5640D0A8.3010508@FreeBSD.org> <2B0092AA-AC59-489F-B250-98025676A80E@FreeBSD.org> Date: Mon, 9 Nov 2015 12:03:15 -0800 X-Google-Sender-Auth: 91PC918UQpXDcYxWJ48eSX3zar8 Message-ID: Subject: Re: svn commit: r290612 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... From: Adrian Chadd To: Renato Botelho Cc: Bryan Drewery , "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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 20:03:16 -0000 hiya, Sorry - Please commit this; I can't commit things right at the moment! -a On 9 November 2015 at 11:17, Renato Botelho wrote: >> On Nov 9, 2015, at 14:58, Bryan Drewery wrote: >> >> On 11/9/2015 7:59 AM, Adrian Chadd wrote: >>> Author: adrian >>> Date: Mon Nov 9 15:59:42 2015 >>> New Revision: 290612 >>> URL: https://svnweb.freebsd.org/changeset/base/290612 >>> >>> Log: >>> ath(4): begin fleshing out a "reset type" extension to force cold/warn resets. >>> >> >> /root/git/freebsd/sys/modules/ath/../../dev/ath/ath_hal/ar5212/ar5212_reset.c:120:18: >> error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] >> HAL_RESET_TYPE, resetType, > > Attached patch fixed it for me. > > > > -- > Renato Botelho > > From owner-svn-src-all@freebsd.org Mon Nov 9 20:23:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF5BA2AA44; Mon, 9 Nov 2015 20:23:01 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 366A717D4; Mon, 9 Nov 2015 20:23:01 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9KN0Fb029647; Mon, 9 Nov 2015 20:23:00 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9KN0wi029645; Mon, 9 Nov 2015 20:23:00 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201511092023.tA9KN0wi029645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Mon, 9 Nov 2015 20:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290616 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 20:23:01 -0000 Author: garga (ports committer) Date: Mon Nov 9 20:22:59 2015 New Revision: 290616 URL: https://svnweb.freebsd.org/changeset/base/290616 Log: Fix kernel build, broken in r290612 Approved by: adrian Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon Nov 9 18:33:36 2015 (r290615) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon Nov 9 20:22:59 2015 (r290616) @@ -117,7 +117,7 @@ HAL_BOOL ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, - HAL_RESET_TYPE, resetType, + HAL_RESET_TYPE resetType, HAL_STATUS *status) { #define N(a) (sizeof (a) / sizeof (a[0])) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Nov 9 18:33:36 2015 (r290615) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Nov 9 20:22:59 2015 (r290616) @@ -193,7 +193,7 @@ extern void ar5416RxMonitor(struct ath_h const struct ieee80211_channel *); extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *); extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *, - HAL_OPMODE, HAL_RESET_TYPE, int); + HAL_OPMODE, int); extern void ar5416SetBeaconTimers(struct ath_hal *, const HAL_BEACON_TIMERS *); extern void ar5416BeaconInit(struct ath_hal *ah, From owner-svn-src-all@freebsd.org Mon Nov 9 20:24:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3ADA2AAB8; Mon, 9 Nov 2015 20:24:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::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 612F21951; Mon, 9 Nov 2015 20:24:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgea14 with SMTP id a14so72599622qge.0; Mon, 09 Nov 2015 12:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/iCTqG2MUB2vK+PAfYeSaWEoanBnTiMfIiuNPzV48nA=; b=JuXhDuHAWsLVNwVir5NGfeCsLr3QecGHNolLq6FFdRef46AbHTNw8PBH+Gsw4tt6lA YIhTdLCDZu86hmD1i/ZQxduCXA4NWmAGi5Im1e3LAzX3YVhivVxlHVuY/b8ps3adZrPh 40bX/1eeOwK4alz9RmXrDWMeb/zDRiMh67jSWymSkTBrstmKYSpooN3TZIgmvrMZR0Dd C2+qXLsBasmOVT7pHUTKbKXjcWVim2rRPoDWfsXFlwqK41Qhk8IuYOqhG6B7HUqCPb3X aCB9z8Q4QVlcg+PHKlBJ1u0Ue0xi7lQxCHPpesWJf6Dg7JpDD/wCVPwwpOe08vHTY/71 0lmw== X-Received: by 10.140.236.14 with SMTP id h14mr32671821qhc.7.1447100639409; Mon, 09 Nov 2015 12:23:59 -0800 (PST) Received: from mbp.home (179-125-139-181.desktop.com.br. [179.125.139.181]) by smtp.gmail.com with ESMTPSA id b108sm5571243qgf.20.2015.11.09.12.23.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Nov 2015 12:23:58 -0800 (PST) Sender: Renato Botelho Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: svn commit: r290612 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... From: Renato Botelho In-Reply-To: Date: Mon, 9 Nov 2015 18:23:54 -0200 Cc: Bryan Drewery , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <71DA13E4-6BAF-422E-A5A7-A81577A3E577@FreeBSD.org> References: <201511091559.tA9FxgB1046943@repo.freebsd.org> <5640D0A8.3010508@FreeBSD.org> <2B0092AA-AC59-489F-B250-98025676A80E@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 20:24:00 -0000 > On Nov 9, 2015, at 18:03, Adrian Chadd wrote: > > hiya, > > Sorry - Please commit this; I can't commit things right at the moment! Done, r290616 -- Renato Botelho From owner-svn-src-all@freebsd.org Mon Nov 9 21:04:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BCCCA29B2D; Mon, 9 Nov 2015 21:04:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F255C1924; Mon, 9 Nov 2015 21:04:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id EB5B015A3; Mon, 9 Nov 2015 21:04:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id A2B1B179EF; Mon, 9 Nov 2015 21:04:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id t1c-CTqzR_Po; Mon, 9 Nov 2015 21:04:53 +0000 (UTC) Subject: Re: svn commit: r290433 - in head: share/mk sys/conf tools/build/options DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B2ED1179E7 References: <201511060445.tA64jUjj063307@repo.freebsd.org> <5640D2F4.6010101@FreeBSD.org> Cc: Craig Rodrigues , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56410A70.2080601@FreeBSD.org> Date: Mon, 9 Nov 2015 13:04:48 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5640D2F4.6010101@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="do9DXDT7tAvsi2NWdQVUCg6H1i1VWDXel" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 21:04:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --do9DXDT7tAvsi2NWdQVUCg6H1i1VWDXel Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/9/2015 9:08 AM, Bryan Drewery wrote: > On 11/7/2015 12:41 AM, Craig Rodrigues wrote: >> >> >> On Thu, Nov 5, 2015 at 8:45 PM, Bryan Drewery > > wrote: >> >> Author: bdrewery >> Date: Fri Nov 6 04:45:29 2015 >> New Revision: 290433 >> URL: https://svnweb.freebsd.org/changeset/base/290433 >> >> Log: >> Add a FAST_DEPEND option, off by default, which speeds up the >> build significantly. >> >> Enabling this by default, for src or out-of-src, can be done onc= e >> more testing >> has been done, such as a ports exp-run, and with more compilers.= >> >> >> I put WITH_FAST_DEPEND=3D"yes" in make.conf for these builds: >> >> https://jenkins.freebsd.org/job/FreeBSD_HEAD >> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9 >> https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64 >> >> >> For the FreeBSD_HEAD_sparc64 build, there is a weird failure on bootst= rap: >> >> https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64/1311/console >> >> If you put these entries in make.conf: >> >> TARGET=3Dsparc64 >> WITH_FAST_DEPEND=3Dyes >> >> and do: >> >> make -j 4 buildworld __MAKE_CONF=3Dmake.conf >> >> That seems to trigger it. >> >> Can you take a look? >> >=20 > I'm finally getting to testing this. My initial guess is that > WITH_FAST_DEPEND is simply exposing an existing race. The entire > gnu/usr.bin/cc directory is full of races and duplication with > generating the headers. Something that has been a problem in META_MODE.= > So either way I will fix it. >=20 >=20 I have figured this out and will have a fix in soon. It's a subtle problem with having multiple files match expected objects based on suffix transformation rules, that mkdep was avoiding. --=20 Regards, Bryan Drewery --do9DXDT7tAvsi2NWdQVUCg6H1i1VWDXel Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQQpwAAoJEDXXcbtuRpfP6v8IALAwptpO7q7OTpBeXCJj0X9q Tcd8DXtBDBomLaDG9MyyPvJPhvTGnbubg+Mepby88fIxKpv0lK0QKHDptA+Xp/47 7zmq2/Q4oMODT4w5Z0l1LRuuSZs890n/oAa1Glf+JFEvfQk3gkVvgnFhLXurhEvl 3x1q7ctnNBnnux0miU7q1sSMSyGfDyhChcS25dyNvWCb1Gnl2xhSWnjCZJsdJIGk TeThP1JROJ2TLXDMJjrIg3OYhFOkN6xXbQZ2ecNzfKz15N5ZKnsCUYu0cE4v2BKD UVTEN6C/K6CLDXVcziw8PAZtTTpMK/S0Q6ydHO4rtRDgpl1vn08xV4ILsP27iI0= =sQOf -----END PGP SIGNATURE----- --do9DXDT7tAvsi2NWdQVUCg6H1i1VWDXel-- From owner-svn-src-all@freebsd.org Mon Nov 9 21:17:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BADBBA2A0AE; Mon, 9 Nov 2015 21:17:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 826B212E3; Mon, 9 Nov 2015 21:17:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id CFEF378225A; Tue, 10 Nov 2015 08:17:38 +1100 (AEDT) Date: Tue, 10 Nov 2015 08:17:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: <201511091650.tA9Gog7d061645@repo.freebsd.org> Message-ID: <20151110080516.M4088@besplex.bde.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R6/+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=IL1IYBiebmrG-NjXDhIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 21:17:47 -0000 On Mon, 9 Nov 2015, Conrad E. Meyer wrote: > Log: > linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning > > The code compiles fine under Clang, but GCC on PPC is less permissive about > integer and pointer sizes. (An intmax_t is clearly *large enough* to hold a > pointer value.) > > Another follow-up to r290475. This shouldn't compile either. > Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 9 15:59:42 2015 (r290612) > +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 9 16:50:42 2015 (r290613) > @@ -80,7 +80,7 @@ sysctl_handle_attr(SYSCTL_HANDLER_ARGS) > ssize_t len; > > kobj = arg1; > - attr = (struct attribute *)arg2; > + attr = (struct attribute *)(intptr_t)arg2; This can have any result (except undefined behviour) since the pointer type is not void *. No warning is required but a good compiler would give 1. > if (kobj->ktype == NULL || kobj->ktype->sysfs_ops == NULL) > return (ENODEV); > buf = (char *)get_zeroed_page(GFP_KERNEL); This shouldn't compile either. The pointer type is not void *, and the integer type is neither intptr_t nor uintptr_t except accidentally on some arches (it is unsigned long), while uintptr_t is unsigned on i386 and unsigned long on amd64. No warning is required, but a good compiler would give 1 and a half. This works on x86 of course, and the code isn't required to work on anything else, but the compiler doesn't know this so should warn about logical type mismatches. Bruce From owner-svn-src-all@freebsd.org Mon Nov 9 21:53:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD03DA2ACCE; Mon, 9 Nov 2015 21:53:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9519C1C18; Mon, 9 Nov 2015 21:53:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9Lrdgn057221; Mon, 9 Nov 2015 21:53:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9LrdnD057220; Mon, 9 Nov 2015 21:53:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092153.tA9LrdnD057220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 21:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290617 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 21:53:40 -0000 Author: bapt Date: Mon Nov 9 21:53:39 2015 New Revision: 290617 URL: https://svnweb.freebsd.org/changeset/base/290617 Log: Also remove directories along with old locales Reported by: andreast Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Nov 9 20:22:59 2015 (r290616) +++ head/ObsoleteFiles.inc Mon Nov 9 21:53:39 2015 (r290617) @@ -39,60 +39,73 @@ # done # 20151107: String collation improvements +OLD_FILES+=usr/share/locale/UTF-8/LC_CTYPE +OLD_DIRS+=usr/share/locale/UTF-8 OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_COLLATE OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_CTYPE OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_MESSAGES OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_MONETARY OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_NUMERIC OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_TIME +OLD_DIRS+=usr/share/locale/kk_KZ.PT154/ OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/kk_KZ.UTF-8 OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/la_LN.ISO8859-1 OLD_FILES+=usr/share/locale/la_LN.ISO8859-13/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-13/LC_CTYPE +OLD_DIRS+=usr/share/locale/la_LN.ISO8859-13 OLD_FILES+=usr/share/locale/la_LN.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/la_LN.ISO8859-15 OLD_FILES+=usr/share/locale/la_LN.ISO8859-2/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-2/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.ISO8859-2/LC_TIME +OLD_DIRS+=usr/share/locale/la_LN.ISO8859-2 OLD_FILES+=usr/share/locale/la_LN.ISO8859-4/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-4/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.ISO8859-4/LC_TIME +OLD_DIRS+=usr/share/locale/la_LN.ISO8859-4 OLD_FILES+=usr/share/locale/la_LN.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/la_LN.US-ASCII OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/mn_MN.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/mn_MN.UTF-8 OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/no_NO.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/no_NO.ISO8859-1 OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/no_NO.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/no_NO.ISO8859-15 OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/no_NO.UTF-8/LC_TIME -OLD_FILES+=usr/share/locale/UTF-8/LC_CTYPE +OLD_DIRS+=usr/share/locale/no_NO.UTF-8 OLD_FILES+=usr/bin/colldef OLD_FILES+=usr/share/man/man1/colldef.1.gz OLD_FILES+=usr/bin/mklocale From owner-svn-src-all@freebsd.org Mon Nov 9 22:06:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE827A2A037; Mon, 9 Nov 2015 22:06:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85BB5157F; Mon, 9 Nov 2015 22:06:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9M6McI060115; Mon, 9 Nov 2015 22:06:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9M6MlV060111; Mon, 9 Nov 2015 22:06:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092206.tA9M6MlV060111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 22:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290618 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:06:23 -0000 Author: bapt Date: Mon Nov 9 22:06:22 2015 New Revision: 290618 URL: https://svnweb.freebsd.org/changeset/base/290618 Log: locales: Enforce US-ASCII encoding (limited to 7-bit) The US-ASCII format was getting treated identically to POSIX. It is supposed to throw an ILSEQ errno if a value of 0x80 or greater is encountered, so let's bring back the "ASCII" handling. While here, change nl_codeset to return US-ASCII only when the encoding really is "US-ASCII". Before "C" and "POSIX" encoding returned this string, so now they return "POSIX". Discussed with: ache Submitted by: marino Obtained from: DragonflyBSD Modified: head/lib/libc/locale/Makefile.inc head/lib/libc/locale/mblocal.h head/lib/libc/locale/nl_langinfo.c head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Mon Nov 9 21:53:39 2015 (r290617) +++ head/lib/libc/locale/Makefile.inc Mon Nov 9 22:06:22 2015 (r290618) @@ -4,7 +4,7 @@ # locale sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/locale ${LIBC_SRCTOP}/locale -SRCS+= big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ +SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c ctype.c isctype.c iswctype.c \ ldpart.c lmessages.c lmonetary.c lnumeric.c localeconv.c mblen.c \ mbrlen.c \ Modified: head/lib/libc/locale/mblocal.h ============================================================================== --- head/lib/libc/locale/mblocal.h Mon Nov 9 21:53:39 2015 (r290617) +++ head/lib/libc/locale/mblocal.h Mon Nov 9 22:06:22 2015 (r290618) @@ -76,6 +76,7 @@ int _GB2312_init(struct xlocale_ctype *, int _GBK_init(struct xlocale_ctype *, _RuneLocale *); int _BIG5_init(struct xlocale_ctype *, _RuneLocale *); int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *); +int _ascii_init(struct xlocale_ctype *, _RuneLocale *); typedef size_t (*mbrtowc_pfn_t)(wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict); Modified: head/lib/libc/locale/nl_langinfo.c ============================================================================== --- head/lib/libc/locale/nl_langinfo.c Mon Nov 9 21:53:39 2015 (r290617) +++ head/lib/libc/locale/nl_langinfo.c Mon Nov 9 22:06:22 2015 (r290618) @@ -71,6 +71,8 @@ nl_langinfo_l(nl_item item, locale_t loc else if (strcmp(s, "MSKanji") == 0) ret = "SJIS"; else if (strcmp(s, "NONE") == 0) + ret = "POSIX"; + else if (strcmp(s, "NONE:US-ASCII") == 0) ret = "US-ASCII"; else if (strncmp(s, "NONE:", 5) == 0) ret = (char *)(s + 5); Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Mon Nov 9 21:53:39 2015 (r290617) +++ head/lib/libc/locale/setrunelocale.c Mon Nov 9 22:06:22 2015 (r290618) @@ -129,7 +129,9 @@ __setrunelocale(struct xlocale_ctype *l, rl->__sputrune = NULL; rl->__sgetrune = NULL; - if (strncmp(rl->__encoding, "NONE", 4) == 0) + if (strcmp(rl->__encoding, "NONE:US-ASCII") == 0) + ret = _ascii_init(l, rl); + else if (strncmp(rl->__encoding, "NONE", 4) == 0) ret = _none_init(l, rl); else if (strcmp(rl->__encoding, "UTF-8") == 0) ret = _UTF8_init(l, rl); From owner-svn-src-all@freebsd.org Mon Nov 9 22:09:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B512AA2A0B8; Mon, 9 Nov 2015 22:09:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6715F1861; Mon, 9 Nov 2015 22:09:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9M9ciI060265; Mon, 9 Nov 2015 22:09:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9M9cZh060262; Mon, 9 Nov 2015 22:09:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092209.tA9M9cZh060262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 22:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290619 - head/share/timedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:09:39 -0000 Author: bapt Date: Mon Nov 9 22:09:38 2015 New Revision: 290619 URL: https://svnweb.freebsd.org/changeset/base/290619 Log: Regenerate timedef now that the tools pad CJK correctly Modified: head/share/timedef/zh_Hans_CN.GB2312.src head/share/timedef/zh_Hans_CN.eucCN.src head/share/timedef/zh_Hant_TW.Big5.src Modified: head/share/timedef/zh_Hans_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_Hans_CN.GB2312.src Mon Nov 9 22:06:22 2015 (r290618) +++ head/share/timedef/zh_Hans_CN.GB2312.src Mon Nov 9 22:09:38 2015 (r290619) @@ -4,15 +4,15 @@ # ----------------------------------------------------------------------------- # # Short month names -#1TB -#2TB -#3TB -#4TB -#5TB -#6TB -#7TB -#8TB -#9TB +!!#1TB +!!#2TB +!!#3TB +!!#4TB +!!#5TB +!!#6TB +!!#7TB +!!#8TB +!!#9TB #1#0TB #1#1TB #1#2TB Modified: head/share/timedef/zh_Hans_CN.eucCN.src ============================================================================== --- head/share/timedef/zh_Hans_CN.eucCN.src Mon Nov 9 22:06:22 2015 (r290618) +++ head/share/timedef/zh_Hans_CN.eucCN.src Mon Nov 9 22:09:38 2015 (r290619) @@ -4,15 +4,15 @@ # ----------------------------------------------------------------------------- # # Short month names -£±Ô -£²Ô -£³Ô -£´Ô -£µÔ -£¶Ô -£·Ô -£¸Ô -£¹Ô +¡¡£±Ô +¡¡£²Ô +¡¡£³Ô +¡¡£´Ô +¡¡£µÔ +¡¡£¶Ô +¡¡£·Ô +¡¡£¸Ô +¡¡£¹Ô £±£°Ô £±£±Ô £±£²Ô Modified: head/share/timedef/zh_Hant_TW.Big5.src ============================================================================== --- head/share/timedef/zh_Hant_TW.Big5.src Mon Nov 9 22:06:22 2015 (r290618) +++ head/share/timedef/zh_Hant_TW.Big5.src Mon Nov 9 22:09:38 2015 (r290619) @@ -4,15 +4,15 @@ # ----------------------------------------------------------------------------- # # Short month names -¢°¤ë -¢±¤ë -¢²¤ë -¢³¤ë -¢´¤ë -¢µ¤ë -¢¶¤ë -¢·¤ë -¢¸¤ë +¡@¢°¤ë +¡@¢±¤ë +¡@¢²¤ë +¡@¢³¤ë +¡@¢´¤ë +¡@¢µ¤ë +¡@¢¶¤ë +¡@¢·¤ë +¡@¢¸¤ë ¢°¢¯¤ë ¢°¢°¤ë ¢°¢±¤ë From owner-svn-src-all@freebsd.org Mon Nov 9 22:11:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8BBA2A16B; Mon, 9 Nov 2015 22:11:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 797841A78; Mon, 9 Nov 2015 22:11:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9MBbiA062936; Mon, 9 Nov 2015 22:11:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9MBb0O062935; Mon, 9 Nov 2015 22:11:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092211.tA9MBb0O062935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 22:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290620 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:11:38 -0000 Author: bapt Date: Mon Nov 9 22:11:37 2015 New Revision: 290620 URL: https://svnweb.freebsd.org/changeset/base/290620 Log: Readd ascii.c forgotten in r290618 Added: head/lib/libc/locale/ascii.c (contents, props changed) Added: head/lib/libc/locale/ascii.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/ascii.c Mon Nov 9 22:11:37 2015 (r290620) @@ -0,0 +1,192 @@ +/* + * Copyright 2013 Garrett D'Amore + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 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. + * + * @(#)none.c 8.1 (Berkeley) 6/4/93 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mblocal.h" + +static size_t _ascii_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _ascii_mbsinit(const mbstate_t *); +static size_t _ascii_mbsnrtowcs(wchar_t * __restrict dst, + const char ** __restrict src, size_t nms, size_t len, + mbstate_t * __restrict ps __unused); +static size_t _ascii_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); +static size_t _ascii_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict); + +int +_ascii_init(struct xlocale_ctype *l, _RuneLocale *rl) +{ + + l->__mbrtowc = _ascii_mbrtowc; + l->__mbsinit = _ascii_mbsinit; + l->__mbsnrtowcs = _ascii_mbsnrtowcs; + l->__wcrtomb = _ascii_wcrtomb; + l->__wcsnrtombs = _ascii_wcsnrtombs; + l->runes = rl; + l->__mb_cur_max = 1; + l->__mb_sb_limit = 128; + return(0); +} + +static int +_ascii_mbsinit(const mbstate_t *ps __unused) +{ + /* + * Encoding is not state dependent - we are always in the + * initial state. + */ + return (1); +} + +static size_t +_ascii_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, + mbstate_t * __restrict ps __unused) +{ + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (0); + if (n == 0) + /* Incomplete multibyte sequence */ + return ((size_t)-2); + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + if (pwc != NULL) + *pwc = (unsigned char)*s; + return (*s == '\0' ? 0 : 1); +} + +static size_t +_ascii_wcrtomb(char * __restrict s, wchar_t wc, + mbstate_t * __restrict ps __unused) +{ + + if (s == NULL) + /* Reset to initial shift state (no-op) */ + return (1); + if (wc < 0 || wc > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + *s = (unsigned char)wc; + return (1); +} + +static size_t +_ascii_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, + size_t nms, size_t len, mbstate_t * __restrict ps __unused) +{ + const char *s; + size_t nchr; + + if (dst == NULL) { + s = memchr(*src, '\0', nms); + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + return (s != NULL ? s - *src : nms); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nms-- > 0) { + if (*s & 0x80) { + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = (unsigned char)*s++) == L'\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} + +static size_t +_ascii_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, + size_t nwc, size_t len, mbstate_t * __restrict ps __unused) +{ + const wchar_t *s; + size_t nchr; + + if (dst == NULL) { + for (s = *src; nwc > 0 && *s != L'\0'; s++, nwc--) { + if (*s < 0 || *s > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + } + return (s - *src); + } + + s = *src; + nchr = 0; + while (len-- > 0 && nwc-- > 0) { + if (*s < 0 || *s > 127) { + errno = EILSEQ; + return ((size_t)-1); + } + if ((*dst++ = *s++) == '\0') { + *src = NULL; + return (nchr); + } + nchr++; + } + *src = s; + return (nchr); +} From owner-svn-src-all@freebsd.org Mon Nov 9 22:12:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53DAAA2A291; Mon, 9 Nov 2015 22:12:31 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A0F1EC7; Mon, 9 Nov 2015 22:12:31 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9MCU2d063014; Mon, 9 Nov 2015 22:12:30 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9MCUMi063013; Mon, 9 Nov 2015 22:12:30 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201511092212.tA9MCUMi063013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 9 Nov 2015 22:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290621 - head/sys/arm/qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:12:31 -0000 Author: tijl Date: Mon Nov 9 22:12:29 2015 New Revision: 290621 URL: https://svnweb.freebsd.org/changeset/base/290621 Log: Fix typo (s/ncpus/mp_ncpus/) Reported by: bz Modified: head/sys/arm/qemu/virt_mp.c Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Mon Nov 9 22:11:37 2015 (r290620) +++ head/sys/arm/qemu/virt_mp.c Mon Nov 9 22:12:29 2015 (r290621) @@ -71,7 +71,7 @@ platform_mp_setmaxid(void) mp_ncpus = ofw_cpu_early_foreach(virt_maxid, true); if (mp_ncpus < 1) mp_ncpus = 1; - mp_ncpus = MIN(ncpus, MAXCPU); + mp_ncpus = MIN(mp_ncpus, MAXCPU); } static boolean_t From owner-svn-src-all@freebsd.org Mon Nov 9 22:18:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9180A2A358; Mon, 9 Nov 2015 22:18:53 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay106.isp.belgacom.be (mailrelay106.isp.belgacom.be [195.238.20.133]) by mx1.freebsd.org (Postfix) with ESMTP id E322610FF; Mon, 9 Nov 2015 22:18:52 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B7AgC4GkFW/zhosVtegztTYA++PwENgWMhhW8CgUQ5FAEBAQEBAQGBCoQ2AQEEOhwjEAsUBAkaCw8qHgYTiDIBCMFkAQEBAQEBAQMBAQEBAQEBGASLUok5BZZIhR6IAWV+hECWKh8BAUKCER0WgUE9NIVmAQEB Received: from 56.104-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.104.56]) by relay.skynet.be with ESMTP; 09 Nov 2015 23:17:40 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id tA9MHdFk033137; Mon, 9 Nov 2015 23:17:40 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Mon, 9 Nov 2015 23:17:39 +0100 From: Tijl Coosemans To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290547 - in head/sys: arm/annapurna/alpine arm/mv/armadaxp arm/qemu arm/ti/omap4 arm/xilinx kern x86/x86 Message-ID: <20151109231739.362141d6@kalimero.tijl.coosemans.org> In-Reply-To: <3CA6AE10-0DBA-4130-A76C-524F387907A8@FreeBSD.org> References: <201511081426.tA8EQopT086552@repo.freebsd.org> <3CA6AE10-0DBA-4130-A76C-524F387907A8@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:18:54 -0000 On Mon, 9 Nov 2015 17:45:46 +0000 "Bjoern A. Zeeb" wrote: >> On 08 Nov 2015, at 14:26 , Tijl Coosemans wrote: >> >> Author: tijl >> Date: Sun Nov 8 14:26:50 2015 >> New Revision: 290547 >> URL: https://svnweb.freebsd.org/changeset/base/290547 >> >> Log: >> Since r289279 bufinit() uses mp_ncpus, but some architectures set this >> variable during mp_start() which is too late. Move this to mp_setmaxid() >> where other architectures set it and move x86 assertions to MI code. >> >> Reviewed by: kib (x86 part) >> >> Modified: >> head/sys/arm/annapurna/alpine/alpine_machdep_mp.c >> head/sys/arm/mv/armadaxp/armadaxp_mp.c >> head/sys/arm/qemu/virt_mp.c > > Seems copy and paste from the old to the new function brought some > confusion n variable naming; can you please fix? > > > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: use of undeclared identifier 'ncpus'; did you mean 'pcpup'? > mp_ncpus = MIN(ncpus, MAXCPU); > ^~~~~ > pcpup > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:21: note: expanded from macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ^ > ./machine/pcpu.h:65:21: note: 'pcpup' declared here > extern struct pcpu *pcpup; > ^ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: ordered comparison between pointer and integer ('struct pcpu *' and 'int') [-Werror] > mp_ncpus = MIN(ncpus, MAXCPU); > ^~~~~~~~~~~~~~~~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:23: note: expanded from macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ~~~^~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: use of undeclared identifier 'ncpus'; did you mean 'pcpup'? > mp_ncpus = MIN(ncpus, MAXCPU); > ^~~~~ > pcpup > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:30: note: expanded from macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ^ > ./machine/pcpu.h:65:21: note: 'pcpup' declared here > extern struct pcpu *pcpup; > ^ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: pointer/integer type mismatch in conditional expression ('struct pcpu *' and 'int') [-Werror,-Wconditional-type-mismatch] > mp_ncpus = MIN(ncpus, MAXCPU); > ^~~~~~~~~~~~~~~~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:28: note: expanded from macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ^~~~ ~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:11: error: incompatible pointer to integer conversion assigning to 'int' from 'struct pcpu *' [-Werror,-Wint-conversion] > mp_ncpus = MIN(ncpus, MAXCPU); > ^ ~~~~~~~~~~~~~~~~~~ > 5 errors generated. > --- virt_mp.o --- > *** [virt_mp.o] Error code 1 Fixed in r290621. From owner-svn-src-all@freebsd.org Mon Nov 9 22:19:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35895A2A3A1; Mon, 9 Nov 2015 22:19:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF9A01270; Mon, 9 Nov 2015 22:19:45 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmdw130 with SMTP id w130so48350513wmd.0; Mon, 09 Nov 2015 14:19:43 -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=+J6CCoAzSsGec2ac/9pGWlcgeIRhj5s1qdw+MtTnwkw=; b=sU6XfNVMGHRbMFc5WoJ2YtfV86atByJXvmDoAWSm2ANJurfrXXc9ayAF6UhPjaRZ3M 3Z8JczRt+3ZQyVyin4pZh5y9e88n5yUYnp7VaIT/IfkYCtwm9Hxj302Xnn+58GvyYJ/n drRb1tQUVGdR83tvrlzIxo5/YpdMy4fxvPn/mJ+k9iE3U3eTs1Y6n/e/NhWz8tHWsBec GNOqEo066A3vTI8uDDwBYyWVwPrL3cBTv0ncChik5/RTKRvn8ZAqKOYh2G3iPfBWhii8 EuKvdfcGazpba8aA4Va2KHTqSVuHMVih/L+kWPxFg6ECC3TpTGth1MmRYqRHYTZP4HLD pS2Q== X-Received: by 10.28.87.67 with SMTP id l64mr26854011wmb.72.1447107583383; Mon, 09 Nov 2015 14:19:43 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id y77sm16442425wme.15.2015.11.09.14.19.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 14:19:42 -0800 (PST) Sender: Baptiste Daroussin Date: Mon, 9 Nov 2015 23:19:40 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r290494 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter contrib/netbsd-tests/l... Message-ID: <20151109221940.GH10134@ivaldir.etoilebsd.net> References: <201511071243.tA7Chaai034980@repo.freebsd.org> <563FAAD4.4070403@freebsd.org> <20151108214131.GB10134@ivaldir.etoilebsd.net> <563FCB59.5030505@freebsd.org> <20151108222810.GE10134@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QwZB9vYiNIzNXIj" Content-Disposition: inline In-Reply-To: <20151108222810.GE10134@ivaldir.etoilebsd.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:19:46 -0000 --+QwZB9vYiNIzNXIj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 08, 2015 at 11:28:10PM +0100, Baptiste Daroussin wrote: > On Mon, Nov 09, 2015 at 01:23:21AM +0300, Andrey Chernov wrote: > > On 09.11.2015 0:41, Baptiste Daroussin wrote: > > >>> Deleted: head/lib/libc/locale/ascii.c > > >>=20 > > >> BTW, why this one is deleted (along with ASCII locales)? It > > >> serves its job as "strict ASCII checker" right. > > >>=20 > > > The ASCII locales are still there, just using the same rules for > > > everything as their unicode counter part except of course for > > > LC_CTYPE. > > >=20 > > > There was no left usage for that code so I removed it. If there are > > > strong opinions for bringing it back, I can do it. > >=20 > > ascii.c specifically test for bit8 and sets EILSEQ (unlike, say, > > ISO-8859-1 Unicode subset or C locale). IMHO it should be restored. > >=20 >=20 > hum, ok make sense. I'll make some regression tests and bring it back as = soon as > I can. >=20 strict ASCII is back Best regards, Bapt --+QwZB9vYiNIzNXIj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZBG/wACgkQ8kTtMUmk6EyAGgCffUofFffjQcS7bnMSYcN1jq+x 80IAoL35us9sP4o9F3DLHfFvfAPqThHP =Sdpr -----END PGP SIGNATURE----- --+QwZB9vYiNIzNXIj-- From owner-svn-src-all@freebsd.org Mon Nov 9 22:22:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E8FA2A568; Mon, 9 Nov 2015 22:22:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E3BBC178B; Mon, 9 Nov 2015 22:22:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DBDA51653; Mon, 9 Nov 2015 22:22:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 961F517C59; Mon, 9 Nov 2015 22:22:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id iThint7uAW9e; Mon, 9 Nov 2015 22:22:56 +0000 (UTC) Subject: Re: svn commit: r290619 - head/share/timedef DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com D829817C54 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511092209.tA9M9cZh060262@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56411CBF.4080004@FreeBSD.org> Date: Mon, 9 Nov 2015 14:22:55 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511092209.tA9M9cZh060262@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VXVurg66hi4hebj3Abp1OQJggWMsdlART" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:22:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VXVurg66hi4hebj3Abp1OQJggWMsdlART Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/9/2015 2:09 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Nov 9 22:09:38 2015 > New Revision: 290619 > URL: https://svnweb.freebsd.org/changeset/base/290619 >=20 > Log: > Regenerate timedef now that the tools pad CJK correctly How? I didn't really get an answer last time, can we move this to the build? --=20 Regards, Bryan Drewery --VXVurg66hi4hebj3Abp1OQJggWMsdlART Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQRy/AAoJEDXXcbtuRpfPjzAIALbc0ZCA/mzbpe1Z+fDNa2Eu h1qHLpdE02zSdSu8SLUErydQK2a5WOD8OMX8RjMAhjeirCohzWZlthERvNCGVJ0r eq0vqQMVhBRT9IKgGWkA4rQURDlu+o2N7sIYa6ZSKyLZt9Q6iVN/f7QRFUnoYPQ6 QByYag5k0H2yMhwlK/KaACw4wLYwjHhLAjChNWFV8AM83iIfjPlQ/mxWW0WK3l2g wBuyJUL2E8QcjsnCzIfkoOPJDZMBho4zb76k7EgbS2oppClo823mYBBP9L29R9T8 X2bylYoasNsq5g57hivLlF2JD4UrPU8Otv0wOXRLPVAAG1BvpxBCEPyJy+69mOA= =AuO9 -----END PGP SIGNATURE----- --VXVurg66hi4hebj3Abp1OQJggWMsdlART-- From owner-svn-src-all@freebsd.org Mon Nov 9 22:29:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CED1A2A766; Mon, 9 Nov 2015 22:29:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9ADF1B3A; Mon, 9 Nov 2015 22:29:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9MTlQB066123; Mon, 9 Nov 2015 22:29:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9MTltq066122; Mon, 9 Nov 2015 22:29:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092229.tA9MTltq066122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 22:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290622 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 22:29:49 -0000 Author: bapt Date: Mon Nov 9 22:29:47 2015 New Revision: 290622 URL: https://svnweb.freebsd.org/changeset/base/290622 Log: nl_langinfo: Simplify case ladder The NONE:US-ASCII case isn't necessary. The "NONE:" case will handle US-ASCII, so let's remove the redundant handling. Submitted by: marino Obtained from: DragonflyBSD Modified: head/lib/libc/locale/nl_langinfo.c Modified: head/lib/libc/locale/nl_langinfo.c ============================================================================== --- head/lib/libc/locale/nl_langinfo.c Mon Nov 9 22:12:29 2015 (r290621) +++ head/lib/libc/locale/nl_langinfo.c Mon Nov 9 22:29:47 2015 (r290622) @@ -72,8 +72,6 @@ nl_langinfo_l(nl_item item, locale_t loc ret = "SJIS"; else if (strcmp(s, "NONE") == 0) ret = "POSIX"; - else if (strcmp(s, "NONE:US-ASCII") == 0) - ret = "US-ASCII"; else if (strncmp(s, "NONE:", 5) == 0) ret = (char *)(s + 5); else From owner-svn-src-all@freebsd.org Mon Nov 9 23:08:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C30A2A145; Mon, 9 Nov 2015 23:08:55 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 0528D1B6C; Mon, 9 Nov 2015 23:08:55 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmec201 with SMTP id c201so106159053wme.0; Mon, 09 Nov 2015 15:08:53 -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=LrU0hpbEnjCaCEIZUZG+75tA78VbhvjW65DzXzLij9U=; b=c0/+9mOtSUoQCuHpxNPn83sElPpUQRnjn9EC/Zq9TS8LHFLI0cpUEY+Cnuxc8Zh8xg DDV/A3BmY0CZE+plzPWB4iiUTB2MKrKpl+UYpAfZc98TLrVcMtE6Pz0QZtLH5By/7yYc umBNu5yCLQ/QIcnNaTFb6HaCGyub0jWgHbxe1TPk89dXrjNu1aicVmuJ1O1ATl5J2ztJ tUFLvD/Si60TCMXiXeVL4CAuhLPdLpO1cXP4Twotusbc7ZZIk5FnQ5975X2ebowoJnwj PIFfPjsqebkiFT+V2bO4tYYbzegXcenWuPYBIh03sxZbUE7IQyrwWkxf4yi6r48jHzvD CstQ== X-Received: by 10.28.212.18 with SMTP id l18mr31487745wmg.93.1447110533335; Mon, 09 Nov 2015 15:08:53 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id w73sm16615846wme.12.2015.11.09.15.08.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 15:08:52 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 10 Nov 2015 00:08:49 +0100 From: Baptiste Daroussin To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290619 - head/share/timedef Message-ID: <20151109230849.GI10134@ivaldir.etoilebsd.net> References: <201511092209.tA9M9cZh060262@repo.freebsd.org> <56411CBF.4080004@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="poJSiGMzRSvrLGLs" Content-Disposition: inline In-Reply-To: <56411CBF.4080004@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:08:55 -0000 --poJSiGMzRSvrLGLs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 09, 2015 at 02:22:55PM -0800, Bryan Drewery wrote: > On 11/9/2015 2:09 PM, Baptiste Daroussin wrote: > > Author: bapt > > Date: Mon Nov 9 22:09:38 2015 > > New Revision: 290619 > > URL: https://svnweb.freebsd.org/changeset/base/290619 > >=20 > > Log: > > Regenerate timedef now that the tools pad CJK correctly >=20 > How? >=20 > I didn't really get an answer last time, can we move this to the build? Fetch data from http://cldr.unicode.org including the tools. Put them extracted in a given directory that you export as CLDRDIR: run: make CLDRDIR=3D"${CLDRDIR}" POSIX grab unidata from there: http://www.unicode.org/Public/zipped/8.0.0/ put it extracted in a given directory that you export as UNIDATA make CLDRDIR=3D"${CLDRDIR}" UNIDATA=3D"${UNIDATA}" install Generated form sources is probably a bad idea because the tools are updated along with the sources and sometime broken (like v28) and it requires java = to generate the POSIX data and our own tools uses perl. Best regards, Bapt --poJSiGMzRSvrLGLs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZBJ4EACgkQ8kTtMUmk6Ex+tgCfUR/nxylyOQmSM9UZs5UhswAT HV8AmgPwIQmktwhQd/DGgguoq9oFYOw/ =eH8R -----END PGP SIGNATURE----- --poJSiGMzRSvrLGLs-- From owner-svn-src-all@freebsd.org Mon Nov 9 23:10:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20386A2A1B7; Mon, 9 Nov 2015 23:10:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::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 D326C1CEA; Mon, 9 Nov 2015 23:10:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qgec40 with SMTP id c40so97206129qge.2; Mon, 09 Nov 2015 15:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rPm4WXdngeJ2DVq3AO0FCZ8XXQyQfuSvYZ/Q5s6+mLQ=; b=jztgg1cV9voyaFtWzNtvWI/jabyfBncxX2FJ75AQNcRRv7nBBC36GtTPLNRtjOapJE PMGQDrpCfeHY9P3In2s7OlNGT9HLi0rmSxvaFha+DTt+73JcelCBL7Q+IglpIK9/6z4y S1wuoUJpzy2mUm2YG9p21wS1hFUhL95JIjcEfMVOKTT9t9IRK8beVMB5krQ40ZRQjn7L YPtUqjBJ1+vLCUWRaNxW73wPI9wlO1sENZ1hG4dG1w+nO1qhGLn1Fa5tuJU1D4Hx2j6T LYmJ+8txEvTq6f6kQNEwZ2AW+N4wDYrNUEvrN/iS07uah5uEdrWuhZtlccZ3YAQ7+o4q cOYA== MIME-Version: 1.0 X-Received: by 10.140.144.202 with SMTP id 193mr606731qhq.38.1447110614974; Mon, 09 Nov 2015 15:10:14 -0800 (PST) Received: by 10.140.88.209 with HTTP; Mon, 9 Nov 2015 15:10:14 -0800 (PST) In-Reply-To: <20151109230849.GI10134@ivaldir.etoilebsd.net> References: <201511092209.tA9M9cZh060262@repo.freebsd.org> <56411CBF.4080004@FreeBSD.org> <20151109230849.GI10134@ivaldir.etoilebsd.net> Date: Mon, 9 Nov 2015 15:10:14 -0800 Message-ID: Subject: Re: svn commit: r290619 - head/share/timedef From: NGie Cooper To: Baptiste Daroussin Cc: Bryan Drewery , "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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:10:16 -0000 On Mon, Nov 9, 2015 at 3:08 PM, Baptiste Daroussin wrote: > On Mon, Nov 09, 2015 at 02:22:55PM -0800, Bryan Drewery wrote: >> On 11/9/2015 2:09 PM, Baptiste Daroussin wrote: >> > Author: bapt >> > Date: Mon Nov 9 22:09:38 2015 >> > New Revision: 290619 >> > URL: https://svnweb.freebsd.org/changeset/base/290619 >> > >> > Log: >> > Regenerate timedef now that the tools pad CJK correctly >> >> How? >> >> I didn't really get an answer last time, can we move this to the build? > > Fetch data from http://cldr.unicode.org including the tools. > Put them extracted in a given directory that you export as CLDRDIR: > run: make CLDRDIR="${CLDRDIR}" POSIX > grab unidata from there: http://www.unicode.org/Public/zipped/8.0.0/ > put it extracted in a given directory that you export as UNIDATA > make CLDRDIR="${CLDRDIR}" UNIDATA="${UNIDATA}" install > > Generated form sources is probably a bad idea because the tools are updated > along with the sources and sometime broken (like v28) and it requires java to > generate the POSIX data and our own tools uses perl. *blinks* could you please add a README for this? Thanks, -NGie From owner-svn-src-all@freebsd.org Mon Nov 9 23:11:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA13EA2A261; Mon, 9 Nov 2015 23:11:37 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462721F94; Mon, 9 Nov 2015 23:11:37 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmec201 with SMTP id c201so106236566wme.0; Mon, 09 Nov 2015 15:11:35 -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=7oFIo5pdcFSVBS1+lL+AJ6qsd+OsCTlBIfai2+Vq9sU=; b=Lc0AFZAAfkgwlqYhRj48JrLo+lRIS0oggjcctsdG5x/CU5ZGoNE6R/XJ4BPTu9Z6NI V7vT0xtWSgKQjazIFuIgxeUiUh5F8Kl+sCLGmp1RxSAi0X8yOcBEQOmab04225NLSB6h GT3OmWkT/4RyatAmOF10/JlbXyViLAgOveweRy128inM3hoA8SJIPVZy0ZenmPZksJIm eaOPTPaB3yOjKBoC+CiM/00iqJG5YZZku3xRHb94VfACzeXQDTA/ZSHKSVnMxKw0hZi/ wbPyloHeuElJEG6QnRNRZEnzAGCwfUFRSPDvvZBZkG4gis4pC2ZwxycLi392CeYUeUIq NZ+A== X-Received: by 10.194.22.40 with SMTP id a8mr328840wjf.109.1447110695884; Mon, 09 Nov 2015 15:11:35 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id an7sm304141wjc.44.2015.11.09.15.11.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 15:11:35 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 10 Nov 2015 00:11:33 +0100 From: Baptiste Daroussin To: NGie Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bryan Drewery Subject: Re: svn commit: r290619 - head/share/timedef Message-ID: <20151109231133.GJ10134@ivaldir.etoilebsd.net> References: <201511092209.tA9M9cZh060262@repo.freebsd.org> <56411CBF.4080004@FreeBSD.org> <20151109230849.GI10134@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DesjdUuHQDwS2t4N" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:11:37 -0000 --DesjdUuHQDwS2t4N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 09, 2015 at 03:10:14PM -0800, NGie Cooper wrote: > On Mon, Nov 9, 2015 at 3:08 PM, Baptiste Daroussin wro= te: > > On Mon, Nov 09, 2015 at 02:22:55PM -0800, Bryan Drewery wrote: > >> On 11/9/2015 2:09 PM, Baptiste Daroussin wrote: > >> > Author: bapt > >> > Date: Mon Nov 9 22:09:38 2015 > >> > New Revision: 290619 > >> > URL: https://svnweb.freebsd.org/changeset/base/290619 > >> > > >> > Log: > >> > Regenerate timedef now that the tools pad CJK correctly > >> > >> How? > >> > >> I didn't really get an answer last time, can we move this to the build? > > > > Fetch data from http://cldr.unicode.org including the tools. > > Put them extracted in a given directory that you export as CLDRDIR: > > run: make CLDRDIR=3D"${CLDRDIR}" POSIX > > grab unidata from there: http://www.unicode.org/Public/zipped/8.0.0/ > > put it extracted in a given directory that you export as UNIDATA > > make CLDRDIR=3D"${CLDRDIR}" UNIDATA=3D"${UNIDATA}" install > > > > Generated form sources is probably a bad idea because the tools are upd= ated > > along with the sources and sometime broken (like v28) and it requires j= ava to > > generate the POSIX data and our own tools uses perl. >=20 > *blinks* could you please add a README for this? > Thanks, Sure I will Best regards, Bapt --DesjdUuHQDwS2t4N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZBKCUACgkQ8kTtMUmk6Ew/NQCeLkX+bC/HTfGI39ICjnzRPcB9 dEgAn1U7iqD+BgIcAwj9ad27knPQzAOs =6fyU -----END PGP SIGNATURE----- --DesjdUuHQDwS2t4N-- From owner-svn-src-all@freebsd.org Mon Nov 9 23:19:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BE0A2A4A2; Mon, 9 Nov 2015 23:19:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D60134D; Mon, 9 Nov 2015 23:19:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NJa5F080221; Mon, 9 Nov 2015 23:19:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NJatj080219; Mon, 9 Nov 2015 23:19:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092319.tA9NJatj080219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290623 - in head: targets/pseudo/userland usr.sbin usr.sbin/fmtree usr.sbin/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:19:37 -0000 Author: bdrewery Date: Mon Nov 9 23:19:36 2015 New Revision: 290623 URL: https://svnweb.freebsd.org/changeset/base/290623 Log: Rename usr.sbin/mtree to usr.sbin/fmtree since it is not what /usr/sbin/mtree actually is (which is usr.sbin/nmtree). This has tricked me numerous times. Added: head/usr.sbin/fmtree/ - copied from r290622, head/usr.sbin/mtree/ Deleted: head/usr.sbin/mtree/ Modified: head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Mon Nov 9 22:29:47 2015 (r290622) +++ head/targets/pseudo/userland/Makefile.depend Mon Nov 9 23:19:36 2015 (r290623) @@ -512,6 +512,7 @@ DIRDEPS+= \ usr.sbin/fifolog/fifolog_writer \ usr.sbin/fifolog/fifolog_reader \ usr.sbin/flowctl \ + usr.sbin/fmtree \ usr.sbin/freebsd-update \ usr.sbin/fwcontrol \ usr.sbin/genrandom \ @@ -567,7 +568,6 @@ DIRDEPS+= \ usr.sbin/mpsutil \ usr.sbin/mptutil \ usr.sbin/mtest \ - usr.sbin/mtree \ usr.sbin/named \ usr.sbin/named-checkconf \ usr.sbin/named-checkzone \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Nov 9 22:29:47 2015 (r290622) +++ head/usr.sbin/Makefile Mon Nov 9 23:19:36 2015 (r290623) @@ -155,7 +155,7 @@ SUBDIR+= fdwrite .endif .if ${MK_FMTREE} != "no" -SUBDIR+= mtree +SUBDIR+= fmtree .endif .if ${MK_FREEBSD_UPDATE} != "no" From owner-svn-src-all@freebsd.org Mon Nov 9 23:20:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA495A2A503; Mon, 9 Nov 2015 23:20:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98D7F1547; Mon, 9 Nov 2015 23:20:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NKj4c080346; Mon, 9 Nov 2015 23:20:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NKjo3080345; Mon, 9 Nov 2015 23:20:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092320.tA9NKjo3080345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290624 - head/targets/pseudo/userland X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:20:46 -0000 Author: bdrewery Date: Mon Nov 9 23:20:45 2015 New Revision: 290624 URL: https://svnweb.freebsd.org/changeset/base/290624 Log: Connect nmtree Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Mon Nov 9 23:19:36 2015 (r290623) +++ head/targets/pseudo/userland/Makefile.depend Mon Nov 9 23:20:45 2015 (r290624) @@ -581,6 +581,7 @@ DIRDEPS+= \ usr.sbin/nfsuserd \ usr.sbin/ngctl \ usr.sbin/nghook \ + usr.sbin/nmtree \ usr.sbin/nologin \ usr.sbin/nscd \ usr.sbin/nsec3hash \ From owner-svn-src-all@freebsd.org Mon Nov 9 23:23:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D12A2A6BB; Mon, 9 Nov 2015 23:23:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0531319F2; Mon, 9 Nov 2015 23:23:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NNUZD083026; Mon, 9 Nov 2015 23:23:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NNUft083025; Mon, 9 Nov 2015 23:23:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511092323.tA9NNUft083025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Nov 2015 23:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290625 - head/tools/tools/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:23:31 -0000 Author: bapt Date: Mon Nov 9 23:23:29 2015 New Revision: 290625 URL: https://svnweb.freebsd.org/changeset/base/290625 Log: Add a README to explain how to generate the locales from CLDR data Added: head/tools/tools/locale/README (contents, props changed) Added: head/tools/tools/locale/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/locale/README Mon Nov 9 23:23:29 2015 (r290625) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +To generate the locales: + +Tools needed: java, perl and devel/p5-Tie-IxHash + +fetch cldr data from: http://cldr.unicode.org +extract in a directory ~/unicode/cldr/v27.0.1 for example +fetch unidata from http://www.unicode.org/Public/zipped/ (latest version) +extract in a directory ~/unicode/UNIDATA/8.0.0 for example + +either modify tools/tools/locales/etc/unicode.conf or export variables: +CLDRDIR="~/unicode/cldr/v27.0.1" +UNIDATADIR="~/unicode/UNIDATA/8.0.0" + +run: +make POSIX +make install From owner-svn-src-all@freebsd.org Mon Nov 9 23:24:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5985CA2A700; Mon, 9 Nov 2015 23:24:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 422A81B65; Mon, 9 Nov 2015 23:24:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3A0121878; Mon, 9 Nov 2015 23:24:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CD11117D6E; Mon, 9 Nov 2015 23:24:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id l-BzCGtKPoV5; Mon, 9 Nov 2015 23:24:01 +0000 (UTC) Subject: Re: svn commit: r290625 - head/tools/tools/locale DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EA7B517D69 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511092323.tA9NNUft083025@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56412B10.6020504@FreeBSD.org> Date: Mon, 9 Nov 2015 15:24:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511092323.tA9NNUft083025@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBW5oFN9lnU9o1L6OmWisMrvn0hnRG1Og" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:24:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gBW5oFN9lnU9o1L6OmWisMrvn0hnRG1Og Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you! On 11/9/2015 3:23 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Nov 9 23:23:29 2015 > New Revision: 290625 > URL: https://svnweb.freebsd.org/changeset/base/290625 >=20 > Log: > Add a README to explain how to generate the locales from CLDR data >=20 > Added: > head/tools/tools/locale/README (contents, props changed) >=20 > Added: head/tools/tools/locale/README > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/tools/locale/README Mon Nov 9 23:23:29 2015 (r290625) > @@ -0,0 +1,18 @@ > +# $FreeBSD$ > + > +To generate the locales: > + > +Tools needed: java, perl and devel/p5-Tie-IxHash > + > +fetch cldr data from: http://cldr.unicode.org > +extract in a directory ~/unicode/cldr/v27.0.1 for example > +fetch unidata from http://www.unicode.org/Public/zipped/ (latest versi= on) > +extract in a directory ~/unicode/UNIDATA/8.0.0 for example > + > +either modify tools/tools/locales/etc/unicode.conf or export variables= : > +CLDRDIR=3D"~/unicode/cldr/v27.0.1" > +UNIDATADIR=3D"~/unicode/UNIDATA/8.0.0" > + > +run: > +make POSIX > +make install >=20 --=20 Regards, Bryan Drewery --gBW5oFN9lnU9o1L6OmWisMrvn0hnRG1Og Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQSsQAAoJEDXXcbtuRpfPKnwH/0dTlXtcqg1ly6Y5p2zKypsk CX6hrvZo5BEjkM8RCymJSF94750EuhBJQLzNgO5hzcRxmJ3VsBZjYCEJ2JCcEEFv 90mV1mzz2VgHOJ7Us+kdM8qHwfBX5uHhGAxb/5/rLblnTenpc7kPQF/GVcvpuyTC J8rtchGbmn/2lHJQ15VDMCB2gSljS8KhzQM84qnz0wTGyQJcF3x3UljBylUEGP6u V7J6bc9AZukB7Y7m/JqWOszoIAz0Gj4o3qymyf1BzJkVjMUGNaTTCNbH14l5ABwS bWaRrYOgrsiCOJHx2qUeZeYVsTHl7+57p4FnIDmI/U05cPSH0SDDB7sKOA6Dxtg= =Dv5p -----END PGP SIGNATURE----- --gBW5oFN9lnU9o1L6OmWisMrvn0hnRG1Og-- From owner-svn-src-all@freebsd.org Mon Nov 9 23:36:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED0CA2AACF; Mon, 9 Nov 2015 23:36:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07D2131B; Mon, 9 Nov 2015 23:36:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NakBB086025; Mon, 9 Nov 2015 23:36:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NakfC086022; Mon, 9 Nov 2015 23:36:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092336.tA9NakfC086022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290626 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:36:48 -0000 Author: bdrewery Date: Mon Nov 9 23:36:46 2015 New Revision: 290626 URL: https://svnweb.freebsd.org/changeset/base/290626 Log: Move 'make cleandir' from Makefile to Makefile.inc1. This leads the way for fixing cross-build cleanup, and eventually replacing 'cleandir' with it during the build. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Mon Nov 9 23:23:29 2015 (r290625) +++ head/Makefile Mon Nov 9 23:36:46 2015 (r290626) @@ -113,7 +113,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ check-old check-old-dirs check-old-files check-old-libs \ - checkdpadd clean cleandepend cleandir \ + checkdpadd clean cleandepend cleandir cleanworld \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ @@ -212,38 +212,6 @@ buildworld: upgrade_checks .endif # -# This 'cleanworld' target is not included in TGTS, because it is not a -# recursive target. All of the work for it is done right here. It is -# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be -# created by bsd.obj.mk, except that we don't want to .include that file -# in this makefile. -# -# In the following, the first 'rm' in a series will usually remove all -# files and directories. If it does not, then there are probably some -# files with file flags set, so this unsets them and tries the 'rm' a -# second time. There are situations where this target will be cleaning -# some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. Removing all -# files without file flags set in the first 'rm' instance saves time, -# because 'chflags' will need to operate on fewer files afterwards. -# -BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} -cleanworld: -.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} -.if exists(${BW_CANONICALOBJDIR}/) - -rm -rf ${BW_CANONICALOBJDIR}/* - -chflags -R 0 ${BW_CANONICALOBJDIR} - rm -rf ${BW_CANONICALOBJDIR}/* -.endif - # To be safe in this case, fall back to a 'make cleandir' - ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir -.else - -rm -rf ${.OBJDIR}/* - -chflags -R 0 ${.OBJDIR} - rm -rf ${.OBJDIR}/* -.endif - -# # Handle the user-driven targets, using the source relative mk files. # Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Nov 9 23:23:29 2015 (r290625) +++ head/Makefile.inc1 Mon Nov 9 23:36:46 2015 (r290626) @@ -2205,6 +2205,36 @@ builddtb: ############### +# cleanworld +# In the following, the first 'rm' in a series will usually remove all +# files and directories. If it does not, then there are probably some +# files with file flags set, so this unsets them and tries the 'rm' a +# second time. There are situations where this target will be cleaning +# some directories via more than one method, but that duplication is +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. +# +# It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be +# created by bsd.obj.mk, except that we don't want to .include that file +# in this makefile. +# +BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} +cleanworld: .PHONY +.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} +.if exists(${BW_CANONICALOBJDIR}/) + -rm -rf ${BW_CANONICALOBJDIR}/* + -chflags -R 0 ${BW_CANONICALOBJDIR} + rm -rf ${BW_CANONICALOBJDIR}/* +.endif + # To be safe in this case, fall back to a 'make cleandir' + ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir +.else + -rm -rf ${.OBJDIR}/* + -chflags -R 0 ${.OBJDIR} + rm -rf ${.OBJDIR}/* +.endif + .if defined(TARGET) && defined(TARGET_ARCH) .if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH} From owner-svn-src-all@freebsd.org Mon Nov 9 23:36:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A998A2AB0E; Mon, 9 Nov 2015 23:36:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 173CB14CD; Mon, 9 Nov 2015 23:36:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NawlP086073; Mon, 9 Nov 2015 23:36:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NawF0086072; Mon, 9 Nov 2015 23:36:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092336.tA9NawF0086072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290627 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:36:59 -0000 Author: bdrewery Date: Mon Nov 9 23:36:57 2015 New Revision: 290627 URL: https://svnweb.freebsd.org/changeset/base/290627 Log: Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees. This simplifies the logic to always try removing the objdir if it exists and to fallback on a 'cleandir' if no objdir exists. The reasoning for this is to avoid rm -rf src/* (r126024) Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Nov 9 23:36:46 2015 (r290626) +++ head/Makefile.inc1 Mon Nov 9 23:36:57 2015 (r290627) @@ -2219,20 +2219,16 @@ builddtb: # created by bsd.obj.mk, except that we don't want to .include that file # in this makefile. # -BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} +BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR} cleanworld: .PHONY -.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} .if exists(${BW_CANONICALOBJDIR}/) -rm -rf ${BW_CANONICALOBJDIR}/* -chflags -R 0 ${BW_CANONICALOBJDIR} rm -rf ${BW_CANONICALOBJDIR}/* .endif +.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} # To be safe in this case, fall back to a 'make cleandir' ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir -.else - -rm -rf ${.OBJDIR}/* - -chflags -R 0 ${.OBJDIR} - rm -rf ${.OBJDIR}/* .endif .if defined(TARGET) && defined(TARGET_ARCH) From owner-svn-src-all@freebsd.org Mon Nov 9 23:37:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0735A2AB55; Mon, 9 Nov 2015 23:37:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E40614E4; Mon, 9 Nov 2015 23:37:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9Nb1PQ086125; Mon, 9 Nov 2015 23:37:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9Nb19I086123; Mon, 9 Nov 2015 23:37:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092337.tA9Nb19I086123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290628 - in head/etc: . 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:37:02 -0000 Author: bdrewery Date: Mon Nov 9 23:37:01 2015 New Revision: 290628 URL: https://svnweb.freebsd.org/changeset/base/290628 Log: When extracting mtrees, pass -i so schg/sappnd are respected. This fixes /var/empty not being schg in the installation. This was a change from fmtree to nmtree, that -i is now required to apply these flags. PR: 194189 Submitted by: guyyur@gmail.com MFC after: 2 weeks Relnotes: yes Modified: head/etc/Makefile head/etc/rc.d/var Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Nov 9 23:36:57 2015 (r290627) +++ head/etc/Makefile Mon Nov 9 23:37:01 2015 (r290628) @@ -370,10 +370,10 @@ distrib-dirs: ${MTREES:N/*} d=${DESTDIR}$$1; \ shift; \ test -d $$d || mkdir -p $$d; \ - ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ + ${ECHO} ${MTREE_CMD} -deiU ${MTREE_FOLLOWS_SYMLINKS} \ -f $$m -p $$d; \ ${MTREE_FILTER} $$m | \ - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -p $$d; \ + ${MTREE_CMD} -deiU ${MTREE_FOLLOWS_SYMLINKS} -p $$d; \ done; true .if defined(NO_ROOT) @set ${MTREES}; \ Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Mon Nov 9 23:36:57 2015 (r290627) +++ head/etc/rc.d/var Mon Nov 9 23:37:01 2015 (r290628) @@ -41,12 +41,12 @@ load_rc_config $name populate_var() { - /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null + /usr/sbin/mtree -deiU -f /etc/mtree/BSD.var.dist -p /var > /dev/null case ${sendmail_enable} in [Nn][Oo][Nn][Ee]) ;; *) - /usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null + /usr/sbin/mtree -deiU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null ;; esac } From owner-svn-src-all@freebsd.org Mon Nov 9 23:37:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11A29A2AB8A; Mon, 9 Nov 2015 23:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFA9C1626; Mon, 9 Nov 2015 23:37:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9Nb4O6086185; Mon, 9 Nov 2015 23:37:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9Nb4DL086183; Mon, 9 Nov 2015 23:37:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092337.tA9Nb4DL086183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290629 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:37:06 -0000 Author: bdrewery Date: Mon Nov 9 23:37:04 2015 New Revision: 290629 URL: https://svnweb.freebsd.org/changeset/base/290629 Log: FAST_DEPEND: Fix building of wrong source files in some cases. Similar to the original reason for these dependency hints to be added, in r124637, the missing-dependency file case can lead to building of the wrong source. A clear example of this is in gnu/lib/libstdc++ where the .PATH contains both contrib/gcc and contrib/libstdc++/src. contrib/gcc has a debug.c. contrib/libstdc++/src has a debug.cc. When building for the objects of debug.o, debug.So, and debug.po, it is ambiguous for which src file to use due to the suffix transformation rules, even though the proper one is listed first in .PATH. This was normally avoided due to these dependency hints for the initial build, and then mkdep would add an explicit 'debug.o: debug.cc' dependency into the .depend file. WITH_FAST_DEPEND does not generate the .depend file with these, but puts them into .depend.debug.o instead. Rather than extending the exists() check to each object's .depend.* file, just enable the hint when when using WITH_FAST_DEPEND. It fixes the problem and seems to be safe enough to use since it is mapping SRCS back to OBJS, rather than letting make make assumptions from OBJS to SRCS. A similar check mapping objects to headers is present in some mk files but was not extended here for FAST_DEPEND since it has not yet been found to be a problem. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Nov 9 23:37:01 2015 (r290628) +++ head/share/mk/bsd.dep.mk Mon Nov 9 23:37:04 2015 (r290629) @@ -88,7 +88,7 @@ tags: ${SRCS} .if defined(SRCS) CLEANFILES?= -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .for _S in ${SRCS:N*.[dhly]} ${_S:R}.o: ${_S} .endfor @@ -99,7 +99,7 @@ ${_S:R}.o: ${_S} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} @@ -130,7 +130,7 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_YC:R}.o: ${_YC} .endif .endfor Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Nov 9 23:37:01 2015 (r290628) +++ head/share/mk/bsd.lib.mk Mon Nov 9 23:37:04 2015 (r290629) @@ -417,9 +417,11 @@ lint: ${SRCS:M*.c} .include -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) +.if ${MK_FAST_DEPEND} == "no" ${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +.endif .for _S in ${SRCS:N*.[hly]} ${_S:R}.po: ${_S} .endfor From owner-svn-src-all@freebsd.org Mon Nov 9 23:38:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B667A2AC4A; Mon, 9 Nov 2015 23:38:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F2E971A7B; Mon, 9 Nov 2015 23:38:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E587C11B2; Mon, 9 Nov 2015 23:38:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9B88117DDF; Mon, 9 Nov 2015 23:38:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id PcAVcqVsNZIg; Mon, 9 Nov 2015 23:38:32 +0000 (UTC) Subject: Re: svn commit: r290433 - in head: share/mk sys/conf tools/build/options DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CDD5317DDA Cc: Craig Rodrigues , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Garrett Cooper References: <201511060445.tA64jUjj063307@repo.freebsd.org> <5640D2F4.6010101@FreeBSD.org> <56410A70.2080601@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56412E77.8020600@FreeBSD.org> Date: Mon, 9 Nov 2015 15:38:31 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56410A70.2080601@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ck3KLGOUvn33OBbtHApf9MfoiSSVdRf26" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:38:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ck3KLGOUvn33OBbtHApf9MfoiSSVdRf26 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/9/2015 1:04 PM, Bryan Drewery wrote: > On 11/9/2015 9:08 AM, Bryan Drewery wrote: >> On 11/7/2015 12:41 AM, Craig Rodrigues wrote: >>> >>> >>> On Thu, Nov 5, 2015 at 8:45 PM, Bryan Drewery >> > wrote: >>> >>> Author: bdrewery >>> Date: Fri Nov 6 04:45:29 2015 >>> New Revision: 290433 >>> URL: https://svnweb.freebsd.org/changeset/base/290433 >>> >>> Log: >>> Add a FAST_DEPEND option, off by default, which speeds up the >>> build significantly. >>> >>> Enabling this by default, for src or out-of-src, can be done on= ce >>> more testing >>> has been done, such as a ports exp-run, and with more compilers= =2E >>> >>> >>> I put WITH_FAST_DEPEND=3D"yes" in make.conf for these builds: >>> >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9 >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64 >>> >>> >>> For the FreeBSD_HEAD_sparc64 build, there is a weird failure on boots= trap: >>> >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_sparc64/1311/console >>> >>> If you put these entries in make.conf: >>> >>> TARGET=3Dsparc64 >>> WITH_FAST_DEPEND=3Dyes >>> >>> and do: >>> >>> make -j 4 buildworld __MAKE_CONF=3Dmake.conf >>> >>> That seems to trigger it. >>> >>> Can you take a look? >>> >> >> I'm finally getting to testing this. My initial guess is that >> WITH_FAST_DEPEND is simply exposing an existing race. The entire >> gnu/usr.bin/cc directory is full of races and duplication with >> generating the headers. Something that has been a problem in META_MODE= =2E >> So either way I will fix it. >> >> >=20 > I have figured this out and will have a fix in soon. It's a subtle > problem with having multiple files match expected objects based on > suffix transformation rules, that mkdep was avoiding. >=20 r290629 fixes the GCC build with WITH_FAST_DEPEND. --=20 Regards, Bryan Drewery --ck3KLGOUvn33OBbtHApf9MfoiSSVdRf26 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWQS53AAoJEDXXcbtuRpfP7zoH/A95oBvx+V6tDllv9/azJl+J Fwig+64hPKRc03hNCAXWaexoxDhLcyJwmv2x/mU0UPx5dd+KheHIW+hi3aa6eJrw cCVmv5d7ZXBh+cMCaw23h6/Mr4Eo7wi/GgZqEKdsgUJnBXAWPLIk4UAinnngdHXI JvS+jX/PHyyNHELAOFo0eA0a3lGBwXybsBLfaxqFsVXfNHBcYUFPZxHcUzxVB9FP bbNKISM2VK7GuxL+FlGqZLJDU5u/8tpEoExGVNN2VcuVpPZdRVVAIDtGmSuVRve6 UTWbzLv/eknZO6wp54LN206uITdUvQrsK+T3LyPG3I+izsQOFaCbAkxgLEnhIaQ= =McJk -----END PGP SIGNATURE----- --ck3KLGOUvn33OBbtHApf9MfoiSSVdRf26-- From owner-svn-src-all@freebsd.org Mon Nov 9 23:46:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30E76A2AEB4; Mon, 9 Nov 2015 23:46:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C1311F6A; Mon, 9 Nov 2015 23:46:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9NkErD088953; Mon, 9 Nov 2015 23:46:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NkEks088951; Mon, 9 Nov 2015 23:46:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201511092346.tA9NkEks088951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 9 Nov 2015 23:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290630 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:46:15 -0000 Author: avos Date: Mon Nov 9 23:46:13 2015 New Revision: 290630 URL: https://svnweb.freebsd.org/changeset/base/290630 Log: urtwn(4): refactor and fix TX path. - Split urtwn_tx_start() into urtwn_tx_data() and urtwn_tx_start() (the last will be used for beacon updates / raw xmit path). - Remove unneeded code from _urtwn_getbuf(). - Use CCK11 for data frames in 11b mode. - Send EAPOL frames at 1 Mbps. - Reduce code duplication in urtwn_tx_data(). - Fix sequence numbering. - Add IEEE80211_RADIOTAP_F_WEP flag for encrypted frames. - Check URTWN_RUNNING flag under lock. Tested with RTL8188EU, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4017 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Nov 9 23:37:04 2015 (r290629) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Nov 9 23:46:13 2015 (r290630) @@ -230,9 +230,11 @@ static void urtwn_watchdog(void *); static void urtwn_update_avgrssi(struct urtwn_softc *, int, int8_t); static int8_t urtwn_get_rssi(struct urtwn_softc *, int, void *); static int8_t urtwn_r88e_get_rssi(struct urtwn_softc *, int, void *); -static int urtwn_tx_start(struct urtwn_softc *, +static int urtwn_tx_data(struct urtwn_softc *, struct ieee80211_node *, struct mbuf *, struct urtwn_data *); +static void urtwn_tx_start(struct urtwn_softc *, struct mbuf *, + uint8_t, struct urtwn_data *); static int urtwn_transmit(struct ieee80211com *, struct mbuf *); static void urtwn_start(struct urtwn_softc *); static void urtwn_parent(struct ieee80211com *); @@ -989,8 +991,6 @@ _urtwn_getbuf(struct urtwn_softc *sc) if (bf != NULL) STAILQ_REMOVE_HEAD(&sc->sc_tx_inactive, next); else - bf = NULL; - if (bf == NULL) DPRINTF("%s: %s\n", __func__, "out of xmit buffers"); return (bf); } @@ -1774,56 +1774,37 @@ urtwn_r88e_get_rssi(struct urtwn_softc * } static int -urtwn_tx_start(struct urtwn_softc *sc, struct ieee80211_node *ni, - struct mbuf *m0, struct urtwn_data *data) +urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, + struct mbuf *m, struct urtwn_data *data) { struct ieee80211_frame *wh; - struct ieee80211_key *k; + struct ieee80211_key *k = NULL; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; - struct usb_xfer *xfer; struct r92c_tx_desc *txd; - uint8_t raid, type; - uint16_t sum; - int i, xferlen; - struct usb_xfer *urtwn_pipes[4] = { - sc->sc_xfer[URTWN_BULK_TX_BE], - sc->sc_xfer[URTWN_BULK_TX_BK], - sc->sc_xfer[URTWN_BULK_TX_VI], - sc->sc_xfer[URTWN_BULK_TX_VO] - }; + uint8_t macid, raid, ridx, subtype, type, qsel; + int ismcast; URTWN_ASSERT_LOCKED(sc); /* * Software crypto. */ - wh = mtod(m0, struct ieee80211_frame *); + wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { - k = ieee80211_crypto_encap(ni, m0); + k = ieee80211_crypto_encap(ni, m); if (k == NULL) { device_printf(sc->sc_dev, "ieee80211_crypto_encap returns NULL.\n"); - /* XXX we don't expect the fragmented frames */ return (ENOBUFS); } /* in case packet header moved, reset pointer */ - wh = mtod(m0, struct ieee80211_frame *); - } - - switch (type) { - case IEEE80211_FC0_TYPE_CTL: - case IEEE80211_FC0_TYPE_MGT: - xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; - break; - default: - KASSERT(M_WME_GETAC(m0) < 4, - ("unsupported WME pipe %d", M_WME_GETAC(m0))); - xfer = urtwn_pipes[M_WME_GETAC(m0)]; - break; + wh = mtod(m, struct ieee80211_frame *); } /* Fill Tx descriptor. */ @@ -1831,71 +1812,79 @@ urtwn_tx_start(struct urtwn_softc *sc, s memset(txd, 0, sizeof(*txd)); txd->txdw0 |= htole32( - SM(R92C_TXDW0_PKTLEN, m0->m_pkthdr.len) | SM(R92C_TXDW0_OFFSET, sizeof(*txd)) | R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + if (ismcast) txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); - if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && - type == IEEE80211_FC0_TYPE_DATA) { - if (ic->ic_curmode == IEEE80211_MODE_11B) - raid = R92C_RAID_11B; - else - raid = R92C_RAID_11BG; - if (sc->chip & URTWN_CHIP_88E) { - txd->txdw1 |= htole32( - SM(R88E_TXDW1_MACID, URTWN_MACID_BSS) | - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | - SM(R92C_TXDW1_RAID, raid)); - txd->txdw2 |= htole32(R88E_TXDW2_AGGBK); - } else { - txd->txdw1 |= htole32( - SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | - SM(R92C_TXDW1_RAID, raid) | R92C_TXDW1_AGGBK); - } - if (ic->ic_flags & IEEE80211_F_USEPROT) { - if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { - txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF | - R92C_TXDW4_HWRTSEN); - } else if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) { - txd->txdw4 |= htole32(R92C_TXDW4_RTSEN | - R92C_TXDW4_HWRTSEN); + + raid = R92C_RAID_11B; /* by default */ + ridx = URTWN_RIDX_CCK1; + if (!ismcast) { + macid = URTWN_MACID_BSS; + + if (type == IEEE80211_FC0_TYPE_DATA) { + qsel = R92C_TXDW1_QSEL_BE; + + if (!(m->m_flags & M_EAPOL)) { + if (ic->ic_curmode != IEEE80211_MODE_11B) { + raid = R92C_RAID_11BG; + ridx = URTWN_RIDX_OFDM54; + } else + ridx = URTWN_RIDX_CCK11; } - } - /* Send RTS at OFDM24. */ - txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, - URTWN_RIDX_OFDM24)); - txd->txdw5 |= htole32(0x0001ff00); - /* Send data at OFDM54. */ - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, - URTWN_RIDX_OFDM54)); + + if (sc->chip & URTWN_CHIP_88E) + txd->txdw2 |= htole32(R88E_TXDW2_AGGBK); + else + txd->txdw1 |= htole32(R92C_TXDW1_AGGBK); + + if (ic->ic_flags & IEEE80211_F_USEPROT) { + switch (ic->ic_protmode) { + case IEEE80211_PROT_CTSONLY: + txd->txdw4 |= htole32( + R92C_TXDW4_CTS2SELF | + R92C_TXDW4_HWRTSEN); + break; + case IEEE80211_PROT_RTSCTS: + txd->txdw4 |= htole32( + R92C_TXDW4_RTSEN | + R92C_TXDW4_HWRTSEN); + break; + default: + break; + } + } + txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, + URTWN_RIDX_OFDM24)); + txd->txdw5 |= htole32(0x0001ff00); + } else /* IEEE80211_FC0_TYPE_MGT */ + qsel = R92C_TXDW1_QSEL_MGNT; } else { - txd->txdw1 |= htole32( - SM(R92C_TXDW1_MACID, 0) | - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT) | - SM(R92C_TXDW1_RAID, R92C_RAID_11B)); + macid = URTWN_MACID_BC; + qsel = R92C_TXDW1_QSEL_MGNT; + } + + txd->txdw1 |= htole32( + SM(R92C_TXDW1_QSEL, qsel) | + SM(R92C_TXDW1_RAID, raid)); + + if (sc->chip & URTWN_CHIP_88E) + txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, macid)); + else + txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, macid)); - /* Force CCK1. */ + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); + /* not sure here */ + if (ridx <= URTWN_RIDX_CCK11) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, - URTWN_RIDX_CCK1)); - } - /* Set sequence number (already little endian). */ - txd->txdseq |= *(uint16_t *)wh->i_seq; if (!IEEE80211_QOS_HAS_SEQ(wh)) { /* Use HW sequence numbering for non-QoS frames. */ - txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ); - txd->txdseq |= htole16(0x8000); - } else - txd->txdw4 |= htole32(R92C_TXDW4_QOS); - - /* Compute Tx descriptor checksum. */ - sum = 0; - for (i = 0; i < sizeof(*txd) / 2; i++) - sum ^= ((uint16_t *)txd)[i]; - txd->txdsum = sum; /* NB: already little endian. */ + txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN); + } else { + /* Set sequence number. */ + txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); + } if (ieee80211_radiotap_active_vap(vap)) { struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; @@ -1903,19 +1892,64 @@ urtwn_tx_start(struct urtwn_softc *sc, s tap->wt_flags = 0; tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); - ieee80211_radiotap_tx(vap, m0); + if (k != NULL) + tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; + ieee80211_radiotap_tx(vap, m); } - xferlen = sizeof(*txd) + m0->m_pkthdr.len; - m_copydata(m0, 0, m0->m_pkthdr.len, (caddr_t)&txd[1]); + data->ni = ni; + + urtwn_tx_start(sc, m, type, data); + + return (0); +} + +static void +urtwn_tx_start(struct urtwn_softc *sc, struct mbuf *m, uint8_t type, + struct urtwn_data *data) +{ + struct usb_xfer *xfer; + struct r92c_tx_desc *txd; + uint16_t ac, sum; + int i, xferlen; + struct usb_xfer *urtwn_pipes[WME_NUM_AC] = { + sc->sc_xfer[URTWN_BULK_TX_BE], + sc->sc_xfer[URTWN_BULK_TX_BK], + sc->sc_xfer[URTWN_BULK_TX_VI], + sc->sc_xfer[URTWN_BULK_TX_VO] + }; + + URTWN_ASSERT_LOCKED(sc); + + ac = M_WME_GETAC(m); + + switch (type) { + case IEEE80211_FC0_TYPE_CTL: + case IEEE80211_FC0_TYPE_MGT: + xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; + break; + default: + xfer = urtwn_pipes[ac]; + break; + } + + txd = (struct r92c_tx_desc *)data->buf; + txd->txdw0 |= htole32(SM(R92C_TXDW0_PKTLEN, m->m_pkthdr.len)); + + /* Compute Tx descriptor checksum. */ + sum = 0; + for (i = 0; i < sizeof(*txd) / 2; i++) + sum ^= ((uint16_t *)txd)[i]; + txd->txdsum = sum; /* NB: already little endian. */ + + xferlen = sizeof(*txd) + m->m_pkthdr.len; + m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&txd[1]); data->buflen = xferlen; - data->ni = ni; - data->m = m0; + data->m = m; STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); usbd_transfer_start(xfer); - return (0); } static int @@ -1956,7 +1990,7 @@ urtwn_start(struct urtwn_softc *sc) } ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (urtwn_tx_start(sc, ni, m, bf) != 0) { + if (urtwn_tx_data(sc, ni, m, bf) != 0) { if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); @@ -3526,30 +3560,36 @@ urtwn_raw_xmit(struct ieee80211_node *ni struct ieee80211com *ic = ni->ni_ic; struct urtwn_softc *sc = ic->ic_softc; struct urtwn_data *bf; + int error; /* prevent management frames from being sent if we're not ready */ + URTWN_LOCK(sc); if (!(sc->sc_flags & URTWN_RUNNING)) { - m_freem(m); - return (ENETDOWN); + error = ENETDOWN; + goto end; } - URTWN_LOCK(sc); + bf = urtwn_getbuf(sc); if (bf == NULL) { - m_freem(m); - URTWN_UNLOCK(sc); - return (ENOBUFS); + error = ENOBUFS; + goto end; } - if (urtwn_tx_start(sc, ni, m, bf) != 0) { - m_freem(m); + if ((error = urtwn_tx_data(sc, ni, m, bf)) != 0) { STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); - URTWN_UNLOCK(sc); - return (EIO); + goto end; } + sc->sc_txtimer = 5; + callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); + +end: + if (error != 0) + m_freem(m); + URTWN_UNLOCK(sc); - return (0); + return (error); } static void Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Mon Nov 9 23:37:04 2015 (r290629) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Mon Nov 9 23:46:13 2015 (r290630) @@ -1037,12 +1037,12 @@ struct r92c_tx_desc { uint16_t txdw3; uint16_t txdseq; +#define R92C_TXDSEQ_HWSEQ_EN 0x8000 uint32_t txdw4; #define R92C_TXDW4_RTSRATE_M 0x0000003f #define R92C_TXDW4_RTSRATE_S 0 -#define R92C_TXDW4_QOS 0x00000040 -#define R92C_TXDW4_HWSEQ 0x00000080 +#define R92C_TXDW4_HWSEQ_QOS 0x00000040 #define R92C_TXDW4_DRVRATE 0x00000100 #define R92C_TXDW4_CTS2SELF 0x00000800 #define R92C_TXDW4_RTSEN 0x00001000 From owner-svn-src-all@freebsd.org Tue Nov 10 00:12:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAC3A2A7AB; Tue, 10 Nov 2015 00:12:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 424151CD3; Tue, 10 Nov 2015 00:12:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA0C1bB096813; Tue, 10 Nov 2015 00:12:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA0C1mI096810; Tue, 10 Nov 2015 00:12:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201511100012.tAA0C1mI096810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 10 Nov 2015 00:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290631 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 00:12:02 -0000 Author: avos Date: Tue Nov 10 00:12:00 2015 New Revision: 290631 URL: https://svnweb.freebsd.org/changeset/base/290631 Log: urtwn(4): add HOSTAP mode support. Tested with RTL8188EU, HOSTAP and STA modes Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4034 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Nov 9 23:46:13 2015 (r290630) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 00:12:00 2015 (r290631) @@ -221,7 +221,15 @@ static int urtwn_read_chipid(struct urt static void urtwn_read_rom(struct urtwn_softc *); static void urtwn_r88e_read_rom(struct urtwn_softc *); static int urtwn_ra_init(struct urtwn_softc *); -static void urtwn_tsf_sync_enable(struct urtwn_softc *); +static void urtwn_init_beacon(struct urtwn_softc *, + struct urtwn_vap *); +static int urtwn_setup_beacon(struct urtwn_softc *, + struct ieee80211_node *); +static void urtwn_update_beacon(struct ieee80211vap *, int); +static int urtwn_tx_beacon(struct urtwn_softc *sc, + struct urtwn_vap *); +static void urtwn_tsf_sync_enable(struct urtwn_softc *, + struct ieee80211vap *); static void urtwn_set_led(struct urtwn_softc *, int, int); static void urtwn_set_mode(struct urtwn_softc *, uint8_t); static int urtwn_newstate(struct ieee80211vap *, @@ -441,6 +449,7 @@ urtwn_attach(device_t self) ic->ic_caps = IEEE80211_C_STA /* station mode */ | IEEE80211_C_MONITOR /* monitor mode */ + | IEEE80211_C_HOSTAP /* hostap mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ @@ -565,6 +574,7 @@ urtwn_vap_create(struct ieee80211com *ic const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { + struct urtwn_softc *sc = ic->ic_softc; struct urtwn_vap *uvp; struct ieee80211vap *vap; @@ -582,9 +592,13 @@ urtwn_vap_create(struct ieee80211com *ic return (NULL); } + if (opmode == IEEE80211_M_HOSTAP) + urtwn_init_beacon(sc, uvp); + /* override state transition machine */ uvp->newstate = vap->iv_newstate; vap->iv_newstate = urtwn_newstate; + vap->iv_update_beacon = urtwn_update_beacon; /* complete setup */ ieee80211_vap_attach(vap, ieee80211_media_change, @@ -597,7 +611,12 @@ static void urtwn_vap_delete(struct ieee80211vap *vap) { struct urtwn_vap *uvp = URTWN_VAP(vap); + enum ieee80211_opmode opmode = vap->iv_opmode; + if (opmode == IEEE80211_M_HOSTAP) { + if (uvp->bcn_mbuf != NULL) + m_freem(uvp->bcn_mbuf); + } ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); } @@ -831,7 +850,8 @@ urtwn_txeof(struct urtwn_softc *sc, stru URTWN_ASSERT_LOCKED(sc); - ieee80211_tx_complete(data->ni, data->m, status); + if (data->ni != NULL) /* not a beacon frame */ + ieee80211_tx_complete(data->ni, data->m, status); data->ni = NULL; data->m = NULL; @@ -1477,10 +1497,144 @@ urtwn_ra_init(struct urtwn_softc *sc) } static void -urtwn_tsf_sync_enable(struct urtwn_softc *sc) +urtwn_init_beacon(struct urtwn_softc *sc, struct urtwn_vap *uvp) { - urtwn_write_1(sc, R92C_BCN_CTRL, - urtwn_read_1(sc, R92C_BCN_CTRL) & ~R92C_BCN_CTRL_DIS_TSF_UDT0); + struct r92c_tx_desc *txd = &uvp->bcn_desc; + + txd->txdw0 = htole32( + SM(R92C_TXDW0_OFFSET, sizeof(*txd)) | R92C_TXDW0_BMCAST | + R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); + txd->txdw1 = htole32( + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BEACON) | + SM(R92C_TXDW1_RAID, R92C_RAID_11B)); + + if (sc->chip & URTWN_CHIP_88E) + txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, URTWN_MACID_BC)); + else + txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC)); + + txd->txdw4 = htole32(R92C_TXDW4_DRVRATE); + txd->txdw5 = htole32(SM(R92C_TXDW5_DATARATE, URTWN_RIDX_CCK1)); + txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN); +} + +static int +urtwn_setup_beacon(struct urtwn_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct urtwn_vap *uvp = URTWN_VAP(vap); + struct mbuf *m; + int error; + + URTWN_ASSERT_LOCKED(sc); + + if (ni->ni_chan == IEEE80211_CHAN_ANYC) + return (EINVAL); + + m = ieee80211_beacon_alloc(ni); + if (m == NULL) { + device_printf(sc->sc_dev, + "%s: could not allocate beacon frame\n", __func__); + return (ENOMEM); + } + + if (uvp->bcn_mbuf != NULL) + m_freem(uvp->bcn_mbuf); + + uvp->bcn_mbuf = m; + + if ((error = urtwn_tx_beacon(sc, uvp)) != 0) + return (error); + + /* XXX bcnq stuck workaround */ + if ((error = urtwn_tx_beacon(sc, uvp)) != 0) + return (error); + + return (0); +} + +static void +urtwn_update_beacon(struct ieee80211vap *vap, int item) +{ + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + struct urtwn_vap *uvp = URTWN_VAP(vap); + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; + struct ieee80211_node *ni = vap->iv_bss; + int mcast = 0; + + URTWN_LOCK(sc); + if (uvp->bcn_mbuf == NULL) { + uvp->bcn_mbuf = ieee80211_beacon_alloc(ni); + if (uvp->bcn_mbuf == NULL) { + device_printf(sc->sc_dev, + "%s: could not allocate beacon frame\n", __func__); + URTWN_UNLOCK(sc); + return; + } + } + URTWN_UNLOCK(sc); + + if (item == IEEE80211_BEACON_TIM) + mcast = 1; /* XXX */ + + setbit(bo->bo_flags, item); + ieee80211_beacon_update(ni, uvp->bcn_mbuf, mcast); + + URTWN_LOCK(sc); + urtwn_tx_beacon(sc, uvp); + URTWN_UNLOCK(sc); +} + +/* + * Push a beacon frame into the chip. Beacon will + * be repeated by the chip every R92C_BCN_INTERVAL. + */ +static int +urtwn_tx_beacon(struct urtwn_softc *sc, struct urtwn_vap *uvp) +{ + struct r92c_tx_desc *desc = &uvp->bcn_desc; + struct urtwn_data *bf; + + URTWN_ASSERT_LOCKED(sc); + + bf = urtwn_getbuf(sc); + if (bf == NULL) + return (ENOMEM); + + memcpy(bf->buf, desc, sizeof(*desc)); + urtwn_tx_start(sc, uvp->bcn_mbuf, IEEE80211_FC0_TYPE_MGT, bf); + + sc->sc_txtimer = 5; + callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); + + return (0); +} + +static void +urtwn_tsf_sync_enable(struct urtwn_softc *sc, struct ieee80211vap *vap) +{ + /* Reset TSF. */ + urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); + + switch (vap->iv_opmode) { + case IEEE80211_M_STA: + /* Enable TSF synchronization. */ + urtwn_write_1(sc, R92C_BCN_CTRL, + urtwn_read_1(sc, R92C_BCN_CTRL) & + ~R92C_BCN_CTRL_DIS_TSF_UDT0); + break; + case IEEE80211_M_HOSTAP: + /* Enable beaconing. */ + urtwn_write_1(sc, R92C_MBID_NUM, + urtwn_read_1(sc, R92C_MBID_NUM) | R92C_MBID_TXBCN_RPT0); + urtwn_write_1(sc, R92C_BCN_CTRL, + urtwn_read_1(sc, R92C_BCN_CTRL) | R92C_BCN_CTRL_EN_BCN); + break; + default: + device_printf(sc->sc_dev, "undefined opmode %d\n", + vap->iv_opmode); + return; + } } static void @@ -1528,6 +1682,9 @@ urtwn_newstate(struct ieee80211vap *vap, struct urtwn_softc *sc = ic->ic_softc; struct ieee80211_node *ni; enum ieee80211_state ostate; + uint32_t reg; + uint8_t mode; + int error = 0; ostate = vap->iv_state; DPRINTF("%s -> %s\n", ieee80211_state_name[ostate], @@ -1547,14 +1704,18 @@ urtwn_newstate(struct ieee80211vap *vap, /* Stop Rx of data frames. */ urtwn_write_2(sc, R92C_RXFLTMAP2, 0); - /* Rest TSF. */ - urtwn_write_1(sc, R92C_DUAL_TSF_RST, 0x03); - /* Disable TSF synchronization. */ urtwn_write_1(sc, R92C_BCN_CTRL, - urtwn_read_1(sc, R92C_BCN_CTRL) | + (urtwn_read_1(sc, R92C_BCN_CTRL) & ~R92C_BCN_CTRL_EN_BCN) | R92C_BCN_CTRL_DIS_TSF_UDT0); + /* Disable beaconing. */ + urtwn_write_1(sc, R92C_MBID_NUM, + urtwn_read_1(sc, R92C_MBID_NUM) & ~R92C_MBID_TXBCN_RPT0); + + /* Reset TSF. */ + urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); + /* Reset EDCA parameters. */ urtwn_write_4(sc, R92C_EDCA_VO_PARAM, 0x002f3217); urtwn_write_4(sc, R92C_EDCA_VI_PARAM, 0x005e4317); @@ -1583,8 +1744,31 @@ urtwn_newstate(struct ieee80211vap *vap, } ni = ieee80211_ref_node(vap->iv_bss); + + if (ic->ic_bsschan == IEEE80211_CHAN_ANYC || + ni->ni_chan == IEEE80211_CHAN_ANYC) { + device_printf(sc->sc_dev, + "%s: could not move to RUN state\n", __func__); + error = EINVAL; + goto end_run; + } + + switch (vap->iv_opmode) { + case IEEE80211_M_STA: + mode = R92C_MSR_INFRA; + break; + case IEEE80211_M_HOSTAP: + mode = R92C_MSR_AP; + break; + default: + device_printf(sc->sc_dev, "undefined opmode %d\n", + vap->iv_opmode); + error = EINVAL; + goto end_run; + } + /* Set media status to 'Associated'. */ - urtwn_set_mode(sc, R92C_MSR_INFRA); + urtwn_set_mode(sc, mode); /* Set BSSID. */ urtwn_write_4(sc, R92C_BSSID + 0, LE_READ_4(&ni->ni_bssid[0])); @@ -1606,13 +1790,28 @@ urtwn_newstate(struct ieee80211vap *vap, /* Allow Rx from our BSSID only. */ if (ic->ic_promisc == 0) { - urtwn_write_4(sc, R92C_RCR, - urtwn_read_4(sc, R92C_RCR) | - R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN); + reg = urtwn_read_4(sc, R92C_RCR); + + if (vap->iv_opmode != IEEE80211_M_HOSTAP) + reg |= R92C_RCR_CBSSID_DATA; + + reg |= R92C_RCR_CBSSID_BCN; + + urtwn_write_4(sc, R92C_RCR, reg); + } + + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + error = urtwn_setup_beacon(sc, ni); + if (error != 0) { + device_printf(sc->sc_dev, + "unable to push beacon into the chip, " + "error %d\n", error); + goto end_run; + } } /* Enable TSF synchronization. */ - urtwn_tsf_sync_enable(sc); + urtwn_tsf_sync_enable(sc, vap); urtwn_write_1(sc, R92C_SIFS_CCK + 1, 10); urtwn_write_1(sc, R92C_SIFS_OFDM + 1, 10); @@ -1634,14 +1833,17 @@ urtwn_newstate(struct ieee80211vap *vap, /* Reset temperature calibration state machine. */ sc->thcal_state = 0; sc->thcal_lctemp = 0; + +end_run: ieee80211_free_node(ni); break; default: break; } + URTWN_UNLOCK(sc); IEEE80211_LOCK(ic); - return(uvp->newstate(vap, nstate, arg)); + return (error != 0 ? error : uvp->newstate(vap, nstate, arg)); } static void @@ -2791,11 +2993,25 @@ urtwn_rxfilter_init(struct urtwn_softc * /* Filter for management frames. */ filter = 0x7f3f; - if (vap->iv_opmode == IEEE80211_M_STA) { + switch (vap->iv_opmode) { + case IEEE80211_M_STA: filter &= ~( R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_ASSOC_REQ) | R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_REASSOC_REQ) | R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_PROBE_REQ)); + break; + case IEEE80211_M_HOSTAP: + filter &= ~( + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_ASSOC_RESP) | + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_REASSOC_RESP) | + R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_BEACON)); + break; + case IEEE80211_M_MONITOR: + break; + default: + device_printf(sc->sc_dev, "%s: undefined opmode %d\n", + __func__, vap->iv_opmode); + break; } urtwn_write_2(sc, R92C_RXFLTMAP0, filter); @@ -3172,7 +3388,10 @@ urtwn_set_promisc(struct urtwn_softc *sc if (vap->iv_state == IEEE80211_S_RUN) { switch (vap->iv_opmode) { case IEEE80211_M_STA: - mask2 |= R92C_RCR_CBSSID_BCN | R92C_RCR_CBSSID_DATA; + mask2 |= R92C_RCR_CBSSID_DATA; + /* FALLTHROUGH */ + case IEEE80211_M_HOSTAP: + mask2 |= R92C_RCR_CBSSID_BCN; break; default: device_printf(sc->sc_dev, "%s: undefined opmode %d\n", Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Mon Nov 9 23:46:13 2015 (r290630) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Tue Nov 10 00:12:00 2015 (r290631) @@ -495,6 +495,14 @@ #define R92C_BCN_CTRL_EN_BCN 0x08 #define R92C_BCN_CTRL_DIS_TSF_UDT0 0x10 +/* Bits for R92C_MBID_NUM. */ +#define R92C_MBID_TXBCN_RPT0 0x08 +#define R92C_MBID_TXBCN_RPT1 0x10 + +/* Bits for R92C_DUAL_TSF_RST. */ +#define R92C_DUAL_TSF_RST0 0x01 +#define R92C_DUAL_TSF_RST1 0x02 + /* Bits for R92C_APSD_CTRL. */ #define R92C_APSD_CTRL_OFF 0x40 #define R92C_APSD_CTRL_OFF_STATUS 0x80 Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Mon Nov 9 23:46:13 2015 (r290630) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 00:12:00 2015 (r290631) @@ -89,6 +89,9 @@ struct urtwn_fw_info { struct urtwn_vap { struct ieee80211vap vap; + struct r92c_tx_desc bcn_desc; + struct mbuf *bcn_mbuf; + int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); }; From owner-svn-src-all@freebsd.org Tue Nov 10 00:37:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA31A2AF5F; Tue, 10 Nov 2015 00:37:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0D81AB3; Tue, 10 Nov 2015 00:37:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id EF0C74B29; Tue, 10 Nov 2015 00:37:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r290631 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511100012.tAA0C1mI096810@repo.freebsd.org> From: Jung-uk Kim Message-ID: <56413C40.9040304@FreeBSD.org> Date: Mon, 9 Nov 2015 19:37:20 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511100012.tAA0C1mI096810@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 00:37:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 11/09/2015 19:12, Andriy Voskoboinyk wrote: > Author: avos Date: Tue Nov 10 00:12:00 2015 New Revision: 290631 > URL: https://svnweb.freebsd.org/changeset/base/290631 > > Log: urtwn(4): add HOSTAP mode support. > > Tested with RTL8188EU, HOSTAP and STA modes > > Reviewed by: kevlo Approved by: adrian (mentor) Differential > Revision: https://reviews.freebsd.org/D4034 ... It doesn't build. Maybe you meant: - --- sys/dev/usb/wlan/if_urtwn.c (revision 290631) +++ sys/dev/usb/wlan/if_urtwn.c (working copy) @@ -1505,7 +1505,7 @@ urtwn_init_beacon(struct urtwn_softc *sc, struct u SM(R92C_TXDW0_OFFSET, sizeof(*txd)) | R92C_TXDW0_BMCAST | R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); txd->txdw1 = htole32( - - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BEACON) | + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | SM(R92C_TXDW1_RAID, R92C_RAID_11B)); if (sc->chip & URTWN_CHIP_88E) Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWQTw6AAoJEHyflib82/FG0b0H/2JgdYiAF9uEo2xjnz/HHatb b03+3Q9+eyVZWprMpZMsN1/3k3GJyfKltwECRmkA145fajDRy9JBsdLRyT3raLfx E8drgj/cqtwiDb1kF+Nlxz36k4CJzhHR1aSzZXTnNuGJMCqj1H9dJrfEIrWESYxm WDP9t5QgHspjS9gSXrLICziiPcTwxQWmC5XrxHxIm8kNnC27KYfI4tBM5gYEaCB+ ElnQETZZiRV9q5nPkXN6MJYSydUh/ZdVfYnx5glzc8my6hLEchQPXxiVowoR+Q4O 5KEv77cGI5AMKG8cLhboLdd+5+h1OQqOuqRFzpdEyjNvoRJB8P/YANSob0T9Y4Y= =X8RK -----END PGP SIGNATURE----- From owner-svn-src-all@freebsd.org Tue Nov 10 00:42:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F27A2B100; Tue, 10 Nov 2015 00:42:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95E321E33; Tue, 10 Nov 2015 00:42:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA0gWMK006158; Tue, 10 Nov 2015 00:42:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA0gWJq006157; Tue, 10 Nov 2015 00:42:32 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201511100042.tAA0gWJq006157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 10 Nov 2015 00:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290632 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 00:42:33 -0000 Author: avos Date: Tue Nov 10 00:42:32 2015 New Revision: 290632 URL: https://svnweb.freebsd.org/changeset/base/290632 Log: urtwn(4): fix the build. Add some missing bits from D4020. Modified: head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Tue Nov 10 00:12:00 2015 (r290631) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Tue Nov 10 00:42:32 2015 (r290632) @@ -1028,8 +1028,16 @@ struct r92c_tx_desc { #define R92C_TXDW1_AGGBK 0x00000040 #define R92C_TXDW1_QSEL_M 0x00001f00 #define R92C_TXDW1_QSEL_S 8 -#define R92C_TXDW1_QSEL_BE 0x00 + +#define R92C_TXDW1_QSEL_BE 0x00 /* or 0x03 */ +#define R92C_TXDW1_QSEL_BK 0x01 /* or 0x02 */ +#define R92C_TXDW1_QSEL_VI 0x04 /* or 0x05 */ +#define R92C_TXDW1_QSEL_VO 0x06 /* or 0x07 */ +#define URTWN_MAX_TID 8 + +#define R92C_TXDW1_QSEL_BEACON 0x10 #define R92C_TXDW1_QSEL_MGNT 0x12 + #define R92C_TXDW1_RAID_M 0x000f0000 #define R92C_TXDW1_RAID_S 16 #define R92C_TXDW1_CIPHER_M 0x00c00000 From owner-svn-src-all@freebsd.org Tue Nov 10 00:44:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A843A2B147; Tue, 10 Nov 2015 00:44:52 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f195.google.com (mail-lb0-f195.google.com [209.85.217.195]) (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 06BD11FB4; Tue, 10 Nov 2015 00:44:51 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by lbbcs9 with SMTP id cs9so5509762lbb.0; Mon, 09 Nov 2015 16:44:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=content-type:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=AeQBKKoSfu9/IK0piJWlXtsrSk0xzAaM2m1MCDzni4g=; b=elLUcT5THosMGZkbTVp6yJuYJbET8zCb8i+pp+DnE0mx02KkuQohiATplLdjhP3A5b 3FK8ewvU6E1s1h8Cf6Ext2EW34Ob45bxqwRx1gyO3hgpKVa3SMdjbvaHRbjVU400HWnU gTtrYjuwmlwZXLA4tbXW16N52rbsrn1k9vUi+qpxwXssQG7CCPUZUgXyDEmNcYb4f7qk mvj09KV0ZdMO0j7wDu0qswNxOJPePWk/vEoJwjf66G3gFvuobEMrbvWUReQcmAvNJQUq zjrUhfa7ahStugUZY7P0Azv5CuMI3vC6hPzW0kyMifVos3zIaOqXBR/JvG6menUzceiq rSEQ== X-Received: by 10.112.189.193 with SMTP id gk1mr343044lbc.98.1447116284013; Mon, 09 Nov 2015 16:44:44 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id qp7sm91169lbc.24.2015.11.09.16.44.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Nov 2015 16:44:43 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Jung-uk Kim" Subject: Re: svn commit: r290631 - head/sys/dev/usb/wlan References: <201511100012.tAA0C1mI096810@repo.freebsd.org> <56413C40.9040304@FreeBSD.org> Date: Tue, 10 Nov 2015 02:44:40 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <56413C40.9040304@FreeBSD.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 00:44:52 -0000 Tue, 10 Nov 2015 02:37:20 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Jung-uk Kim = : > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 11/09/2015 19:12, Andriy Voskoboinyk wrote: >> Author: avos Date: Tue Nov 10 00:12:00 2015 New Revision: 290631 >> URL: https://svnweb.freebsd.org/changeset/base/290631 >> >> Log: urtwn(4): add HOSTAP mode support. >> >> Tested with RTL8188EU, HOSTAP and STA modes >> >> Reviewed by: kevlo Approved by: adrian (mentor) Differential >> Revision: https://reviews.freebsd.org/D4034 > ... > It doesn't build. > Sorry (should be fixed now). > > Jung-uk Kim > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJWQTw6AAoJEHyflib82/FG0b0H/2JgdYiAF9uEo2xjnz/HHatb > b03+3Q9+eyVZWprMpZMsN1/3k3GJyfKltwECRmkA145fajDRy9JBsdLRyT3raLfx > E8drgj/cqtwiDb1kF+Nlxz36k4CJzhHR1aSzZXTnNuGJMCqj1H9dJrfEIrWESYxm > WDP9t5QgHspjS9gSXrLICziiPcTwxQWmC5XrxHxIm8kNnC27KYfI4tBM5gYEaCB+ > ElnQETZZiRV9q5nPkXN6MJYSydUh/ZdVfYnx5glzc8my6hLEchQPXxiVowoR+Q4O > 5KEv77cGI5AMKG8cLhboLdd+5+h1OQqOuqRFzpdEyjNvoRJB8P/YANSob0T9Y4Y=3D > =3DX8RK > -----END PGP SIGNATURE----- From owner-svn-src-all@freebsd.org Tue Nov 10 02:29:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 468DBA2AC0F; Tue, 10 Nov 2015 02:29:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D62E1D4D; Tue, 10 Nov 2015 02:29:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA2TKMW035463; Tue, 10 Nov 2015 02:29:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA2TJW2035461; Tue, 10 Nov 2015 02:29:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201511100229.tAA2TJW2035461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Nov 2015 02:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290633 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 02:29:21 -0000 Author: np Date: Tue Nov 10 02:29:19 2015 New Revision: 290633 URL: https://svnweb.freebsd.org/changeset/base/290633 Log: cxgbe/t4_tom: add a knob to the default configuration file to tune the TOE for LAN operation. It is possible to set this to other values (cluster for networks with little loss and really tight RTTs, and wan for relatively large RTTs and/or lossy networks) depending on the environment in which the TOE is being used. None of this affects plain NIC operation in any way. MFC after: 1 week Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Tue Nov 10 00:42:32 2015 (r290632) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Tue Nov 10 02:29:19 2015 (r290633) @@ -33,6 +33,9 @@ tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K + # cluster, lan, or wan. + tp_tcptuning = lan + # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 @@ -160,7 +163,7 @@ [fini] version = 0x1 - checksum = 0xb4168add + checksum = 0xc5e9ef34 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Tue Nov 10 00:42:32 2015 (r290632) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Tue Nov 10 02:29:19 2015 (r290633) @@ -42,6 +42,9 @@ tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K + # cluster, lan, or wan. + tp_tcptuning = lan + # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 @@ -173,7 +176,7 @@ [fini] version = 0x1 - checksum = 0x4f45e608 + checksum = 0x6b54f66d # # $FreeBSD$ # From owner-svn-src-all@freebsd.org Tue Nov 10 07:17:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49828A2B63D; Tue, 10 Nov 2015 07:17:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14081197C; Tue, 10 Nov 2015 07:17:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA7HdkX019741; Tue, 10 Nov 2015 07:17:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA7Hdpe019739; Tue, 10 Nov 2015 07:17:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511100717.tAA7Hdpe019739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Nov 2015 07:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290634 - stable/10/bin/rm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:17:40 -0000 Author: bapt Date: Tue Nov 10 07:17:38 2015 New Revision: 290634 URL: https://svnweb.freebsd.org/changeset/base/290634 Log: MFC r290480 Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1 edition 2013. No need anymore to disable the protection if one set the POXILY_CORRECT environment variable. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D4092 Modified: stable/10/bin/rm/rm.1 stable/10/bin/rm/rm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/rm/rm.1 ============================================================================== --- stable/10/bin/rm/rm.1 Tue Nov 10 02:29:19 2015 (r290633) +++ stable/10/bin/rm/rm.1 Tue Nov 10 07:17:38 2015 (r290634) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd April 25, 2013 +.Dd November 7, 2015 .Dt RM 1 .Os .Sh NAME @@ -235,7 +235,7 @@ not the standard error output. The .Nm command conforms to -.St -p1003.2 . +.St -p1003.1-2013 . .Pp The simplified .Nm unlink Modified: stable/10/bin/rm/rm.c ============================================================================== --- stable/10/bin/rm/rm.c Tue Nov 10 02:29:19 2015 (r290633) +++ stable/10/bin/rm/rm.c Tue Nov 10 07:17:38 2015 (r290634) @@ -155,8 +155,7 @@ main(int argc, char *argv[]) } checkdot(argv); - if (getenv("POSIXLY_CORRECT") == NULL) - checkslash(argv); + checkslash(argv); uid = geteuid(); (void)signal(SIGINFO, siginfo); From owner-svn-src-all@freebsd.org Tue Nov 10 07:31:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766A5A2BC34; Tue, 10 Nov 2015 07:31:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 130D91281; Tue, 10 Nov 2015 07:31:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA7VgqT023391; Tue, 10 Nov 2015 07:31:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA7Vgt3023388; Tue, 10 Nov 2015 07:31:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511100731.tAA7Vgt3023388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 07:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290635 - in vendor/fsx: . dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:31:43 -0000 Author: ngie Date: Tue Nov 10 07:31:41 2015 New Revision: 290635 URL: https://svnweb.freebsd.org/changeset/base/290635 Log: Copy fsx from http://codemonkey.org.uk/projects/fsx/fsx-macosforge/ Added: vendor/fsx/ vendor/fsx/dist/ vendor/fsx/dist/APPLE_LICENSE vendor/fsx/dist/Makefile (contents, props changed) vendor/fsx/dist/fsx.c (contents, props changed) Added: vendor/fsx/dist/APPLE_LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/fsx/dist/APPLE_LICENSE Tue Nov 10 07:31:41 2015 (r290635) @@ -0,0 +1,367 @@ +APPLE PUBLIC SOURCE LICENSE +Version 2.0 - August 6, 2003 + +Please read this License carefully before downloading this software. +By downloading or using this software, you are agreeing to be bound by +the terms of this License. If you do not or cannot agree to the terms +of this License, please do not download or use the software. + +1. General; Definitions. This License applies to any program or other +work which Apple Computer, Inc. ("Apple") makes publicly available and +which contains a notice placed by Apple identifying such program or +work as "Original Code" and stating that it is subject to the terms of +this Apple Public Source License version 2.0 ("License"). As used in +this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is +the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to Apple and (ii) that cover subject +matter contained in the Original Code, but only to the extent +necessary to use, reproduce and/or distribute the Original Code +without infringement; and (b) in the case where You are the grantor of +rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to You and (ii) that cover subject matter in Your +Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or +contributes to the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the +combination of Original Code and any Modifications, and/or any +respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or +otherwise make Covered Code available, directly or indirectly, to +anyone other than You; and/or (b) to use Covered Code, alone or as +part of a Larger Work, in any way to provide a service, including but +not limited to delivery of content, through electronic communication +with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change +to, the substance and/or structure of the Original Code, any previous +Modifications, the combination of Original Code and any previous +Modifications, and/or any respective portions thereof. When code is +released as a series of files, a Modification is: (a) any addition to +or deletion from the contents of a file containing Covered Code; +and/or (b) any new file or other representation of computer program +statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other +work as originally made available by Apple under this License, +including the Source Code of any updates or upgrades to such programs +or works made available by Apple under this License, and that has been +expressly identified by Apple as such in the header file(s) of such +work; and (b) the object code compiled from such Source Code and +originally made available by Apple under this License. + +1.8 "Source Code" means the human readable form of a program or other +work that is suitable for making modifications to it, including all +modules it contains, plus any associated interface definition files, +scripts used to control compilation and installation of an executable +(object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising +rights under this License. For legal entities, "You" or "Your" +includes any entity which controls, is controlled by, or is under +common control with, You, where "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of fifty percent +(50%) or more of the outstanding shares or beneficial ownership of +such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms +and conditions of this License, Apple hereby grants You, effective on +the date You accept this License and download the Original Code, a +world-wide, royalty-free, non-exclusive license, to the extent of +Apple's Applicable Patent Rights and copyrights covering the Original +Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, +internally distribute within Your organization, and Externally Deploy +verbatim, unmodified copies of the Original Code, for commercial or +non-commercial purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the +copyright and other proprietary notices and disclaimers of Apple as +they appear in the Original Code, and keep intact all notices in the +Original Code that refer to this License; and + +(b) You must include a copy of this License with every copy of Source +Code of Covered Code and documentation You distribute or Externally +Deploy, and You may not offer or impose any terms on such Source Code +that alter or restrict this License or the recipients' rights +hereunder, except as permitted under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, +display, perform, internally distribute within Your organization, and +Externally Deploy Your Modifications and Covered Code, for commercial +or non-commercial purposes, provided that in each instance You also +meet all of these conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to +the Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the +notice in Exhibit A in each file of the Source Code of all Your +Modifications, and cause the modified files to carry prominent notices +stating that You changed the files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make +Source Code of all Your Externally Deployed Modifications either +available to those to whom You have Externally Deployed Your +Modifications, or publicly available. Source Code of Your Externally +Deployed Modifications must be released under the terms set forth in +this License, including the license grants set forth in Section 3 +below, for as long as you Externally Deploy the Covered Code or twelve +(12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your +Externally Deployed Modifications electronically (e.g. download from a +web site). + +2.3 Distribution of Executable Versions. In addition, if You +Externally Deploy Covered Code (Original Code and/or Modifications) in +object code, executable form only, You must include a prominent +notice, in the code itself as well as in related documentation, +stating that Source Code of the Covered Code is available under the +terms of this License with information on how and where to obtain such +Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that +although Apple and each Contributor grants the licenses to their +respective portions of the Covered Code set forth herein, no +assurances are provided by Apple or any Contributor that the Covered +Code does not infringe the patent or other intellectual property +rights of any other entity. Apple and each Contributor disclaim any +liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a +condition to exercising the rights and licenses granted hereunder, You +hereby assume sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow You to distribute the Covered Code, it is +Your responsibility to acquire that license before distributing the +Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the +licenses granted to You under this License, You hereby grant to any +person or entity receiving or distributing Covered Code under this +License a non-exclusive, royalty-free, perpetual, irrevocable license, +under Your Applicable Patent Rights and other intellectual property +rights (other than patent) owned or controlled by You, to use, +reproduce, display, perform, modify, sublicense, distribute and +Externally Deploy Your Modifications of the same scope and extent as +Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered +Code with other code not governed by the terms of this License and +distribute the Larger Work as a single product. In each such instance, +You must make sure the requirements of this License are fulfilled for +the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in +Section 2, no other patent rights, express or implied, are granted by +Apple herein. Modifications and/or Larger Works may require additional +patent licenses from Apple which Apple may grant in its sole +discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, +warranty, support, indemnity or liability obligations and/or other +rights consistent with the scope of the license granted herein +("Additional Terms") to one or more recipients of Covered Code. +However, You may do so only on Your own behalf and as Your sole +responsibility, and not on behalf of Apple or any Contributor. You +must obtain the recipient's agreement that any such Additional Terms +are offered by You alone, and You hereby agree to indemnify, defend +and hold Apple and every Contributor harmless for any liability +incurred by or claims asserted against Apple or such Contributor by +reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new +versions of this License from time to time. Each version will be given +a distinguishing version number. Once Original Code has been published +under a particular version of this License, You may continue to use it +under the terms of that version. You may also choose to use such +Original Code under the terms of any subsequent version of this +License published by Apple. No one other than Apple has the right to +modify the terms applicable to Covered Code created under this +License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in +part pre-release, untested, or not fully tested works. The Covered +Code may contain errors that could cause failures or loss of data, and +may be incomplete or contain inaccuracies. You expressly acknowledge +and agree that use of the Covered Code, or any portion thereof, is at +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. +You acknowledge that the Covered Code is not intended for use in the +operation of nuclear facilities, aircraft navigation, communication +systems, or air traffic control machines in which case the failure of +the Covered Code could lead to death, personal injury, or severe +physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY +TO YOU. In no event shall Apple's total liability to You for all +damages (other than as may be required by applicable law) under this +License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", +"QuickTime", "QuickTime Streaming Server" or any other trademarks, +service marks, logos or trade names belonging to Apple (collectively +"Apple Marks") or to any trademark, service mark, logo or trade name +belonging to any Contributor. You agree not to use any Apple Marks in +or as part of the name of products derived from the Original Code or +to endorse or promote products derived from the Original Code other +than as expressly permitted by and in strict compliance at all times +with Apple's third party trademark usage guidelines which are posted +at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, +each Contributor retains all rights, title and interest in and to any +Modifications made by such Contributor. Apple retains all rights, +title and interest in and to the Original Code and any Modifications +made by or on behalf of Apple ("Apple Modifications"), and such Apple +Modifications will not be automatically subject to this License. Apple +may, at its sole discretion, choose to license such Apple +Modifications under this License, or on different terms from those +contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with +any term(s) of this License and fail to cure such breach within 30 +days of becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during +the term of this License, commence an action for patent infringement +against Apple; provided that Apple did not first commence +an action for patent infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately +stop any further use, reproduction, modification, sublicensing and +distribution of the Covered Code. All sublicenses to the Covered Code +which have been properly granted prior to termination shall survive +any termination of this License. Provisions which, by their nature, +should remain in effect beyond the termination of this License shall +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, +12.2 and 13. No party will be liable to any other for compensation, +indemnity or damages of any sort solely as a result of terminating +this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of +any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as +defined in FAR 2.101. Government software and technical data rights in +the Covered Code include only those rights customarily provided to the +public as defined in this License. This customary commercial license +in technical data and software is provided in accordance with FAR +12.211 (Technical Data) and 12.212 (Computer Software) and, for +Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- +Commercial Items) and 227.7202-3 (Rights in Commercial Computer +Software or Computer Software Documentation). Accordingly, all U.S. +Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as +creating an agency, partnership, joint venture or any other form of +legal association between or among You, Apple or any Contributor, and +You will not represent to the contrary, whether expressly, by +implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair +Apple's right to acquire, license, develop, have others develop for +it, market and/or distribute technology or products that perform the +same or similar functions as, or otherwise compete with, +Modifications, Larger Works, technology or products that You may +develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to +enforce any provision of this License will not be deemed a waiver of +future enforcement of that or any other provision. Any law or +regulation which provides that the language of a contract shall be +construed against the drafter will not apply to this License. + +13.5 Severability. (a) If for any reason a court of competent +jurisdiction finds any provision of this License, or portion thereof, +to be unenforceable, that provision of the License will be enforced to +the maximum extent permissible so as to effect the economic benefits +and intent of the parties, and the remainder of this License will +continue in full force and effect. (b) Notwithstanding the foregoing, +if applicable law prohibits or restricts You from fully and/or +specifically complying with Sections 2 and/or 3 or prevents the +enforceability of either of those Sections, this License will +immediately terminate and You must immediately discontinue any use of +the Covered Code and destroy all copies of it that are in your +possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution +between You and Apple relating to this License shall take place in the +Northern District of California, and You and Apple hereby consent to +the personal jurisdiction of, and venue in, the state and federal +courts within that District with respect to this License. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the +entire agreement between the parties with respect to the subject +matter hereof. This License shall be governed by the laws of the +United States and the State of California, except that body of +California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following +clause applies: The parties hereby confirm that they have requested +that this License and all related documents be drafted in English. Les +parties ont exige que le present contrat et tous les documents +connexes soient rediges en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +Reserved. + +This file contains Original Code and/or Modifications of Original Code +as defined in and that are subject to the Apple Public Source License +Version 2.0 (the 'License'). You may not use this file except in +compliance with the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this +file. + +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +Please see the License for the specific language governing rights and +limitations under the License." Added: vendor/fsx/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/fsx/dist/Makefile Tue Nov 10 07:31:41 2015 (r290635) @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Apple Inc. All rights reserved. +# +# @APPLE_LICENSE_HEADER_START@ +# +# This file contains Original Code and/or Modifications of Original Code +# as defined in and that are subject to the Apple Public Source License +# Version 2.0 (the 'License'). You may not use this file except in +# compliance with the License. Please obtain a copy of the License at +# http://www.opensource.apple.com/apsl/ and read it before using this +# file. +# +# The Original Code and all software distributed under the License are +# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +# Please see the License for the specific language governing rights and +# limitations under the License. +# +# @APPLE_LICENSE_HEADER_END@ +# + +ARCHS := ppc i386 x86_64 +INTERNAL_FRAMEWORKS := /AppleInternal/Library/Frameworks +CFLAGS := $(ARCHS:%=-arch %) -Wall -O3 + +ifeq ($(wildcard $(INTERNAL_FRAMEWORKS)), $(INTERNAL_FRAMEWORKS)) +CPPFLAGS += -DXILOG +CFLAGS += -F/AppleInternal/Library/Frameworks +LIBS += -framework XILog +endif + +.PHONY: clean + +fsx: + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ fsx.c $(LIBS) + +clean: + -rm -f *.o fsx + Added: vendor/fsx/dist/fsx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/fsx/dist/fsx.c Tue Nov 10 07:31:41 2015 (r290635) @@ -0,0 +1,1849 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + * + * File: fsx.c + * Author: Avadis Tevanian, Jr. + * + * File system exerciser. + * + * Rewrite and enhancements 1998-2003 Conrad Minshall -- conrad at mac.com + * + * Various features from Joe Sokol, Pat Dirks, and Clark Warner. + * + * Small changes to work under Linux -- davej at suse.de + * + * Sundry porting patches from Guy Harris 12/2001 + * + * Checks for mmap last-page zero fill. + * + * Oct 2006: Now includes Wenguang's changes, Jim's Named Fork support, + * Peter's EA changes, and XILog additions + * + * Various features/enhancements from Mike Mackovitch -- macko at apple.com + * + * Added no-cached r/w option May 2008 -- rtucker at apple.com, bsuinn at apple.com + * + * Compile with: + cc -Wall -O3 fsx.c -o fsx + gcc -arch ppc -arch i386 -arch ppc64 -arch x86_64 -Wall -O3 fsx.c -o fsx -DXILOG -F/AppleInternal/Library/Frameworks -framework XILog + * + */ + +#include +#include +#include +#include +#include +#include +#include +#ifdef _UWIN +# include +# include +#endif +#include +#include +#ifndef MAP_FILE +# define MAP_FILE 0 +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef XILOG +# include +#endif + +/* + * A log entry is an operation and a bunch of arguments. + */ + +struct log_entry { + int opnum; + int operation; + int args[3]; +}; + +#define DEFAULT_LOGSIZE 1024 + +struct log_entry *oplog; /* the log */ +int logptr = 0; /* current position in log */ +int logcount = 0; /* total ops */ + +/* + * Define operations + */ + +#define OP_READ 1 +#define OP_WRITE 2 +#define OP_TRUNCATE 3 +#define OP_CLOSEOPEN 4 +#define OP_MAPREAD 5 +#define OP_MAPWRITE 6 +#define OP_SKIPPED 7 +#define OP_NOCACHEREAD 8 +#define OP_NOCACHEWRITE 9 + +int page_size; +int page_mask; + +char *good_buf; /* a pointer to the correct data */ +char *temp_buf; /* a pointer to the current data */ +char fname[MAXPATHLEN]; /* name of our test file */ +int fd; /* fd for our test file */ +int ea_lastwrite = 0; /* Size of the last EA Write */ +char *eaname; /* Name of the EA key */ + +off_t file_size = 0; +off_t biggest = 0; +char state[256]; +unsigned long testcalls = 0; /* calls to function "test" */ + +unsigned long simulatedopcount = 0; /* -b flag */ +int closeprob = 0; /* -c flag */ +int debug = 0; /* -v flag */ +unsigned long debugstart = 0; /* -D flag */ +int ea = 0; /* -e flag */ +unsigned long maxfilelen = 256 * 1024; /* -l flag */ +int sizechecks = 1; /* -n flag disables them */ +int maxoplen = 64 * 1024; /* -o flag */ +int quiet = 0; /* -q flag */ +unsigned long progressinterval = 0; /* -p flag */ +int readbdy = 1; /* -r flag */ +int style = 0; /* -s flag */ +int truncbdy = 1; /* -t flag */ +int writebdy = 1; /* -w flag */ +long monitorstart = -1; /* -m flag */ +long monitorend = -1; /* -m flag */ +int lite = 0; /* -L flag */ +long numops = -1; /* -N flag */ +int randomoplen = 1; /* -O flag disables it */ +int seed = 0; /* -S flag */ +int mapped_writes = 1; /* -W flag disables */ +int mapped_reads = 1; /* -R flag disables it */ +int logsize = DEFAULT_LOGSIZE; /* -G flag */ +int datasize = 4; /* -T flag */ +int modsize = 0; +int fsxgoodfd = -1; +FILE * fsxlogf = NULL; +int badoff = -1; +int closeopen = 0; +int sync_before_close = 0; /* -y flag enables it */ +int interactive = 0; /* -i flag interactive */ +int interactiveSince = -1; /* -I flag when to start interactive */ +int usehole = 1; // by default use hole (sparse file) +int slow_motion = 0; +long duration = 0; /* -d flag */ +unsigned int pinginterval = 10000; // About every 30sec? +#ifdef XILOG +XILogRef xilogref; +#endif +int gUseRandomNoCache = 0; /* -C randomly mix cached and un-cached r/w ops */ + +char *msgbuf; +int msgbuflen; + +void dotruncate(unsigned size); +void writefileimage(void); + +#define get_data_at(cp) \ + (((*(((unsigned char *)(cp)) + 0)) << 0) | \ + ((datasize < 2) ? 0 : \ + ((*(((unsigned char *)(cp)) + 1)) << 8)) | \ + ((datasize < 4) ? 0 : \ + (((*(((unsigned char *)(cp)) + 2)) << 16) | \ + ((*(((unsigned char *)(cp)) + 3)) << 24)))) + +#define set_data_at(cp, val) \ + do { \ + (*(((unsigned char *)(cp)) + 0)) = ((val) >> 0) & 0xff; \ + if (datasize < 2) break; \ + (*(((unsigned char *)(cp)) + 1)) = (((val) >> 8) & 0xff); \ + if (datasize < 4) break; \ + (*(((unsigned char *)(cp)) + 2)) = (((val) >> 16) & 0xff); \ + (*(((unsigned char *)(cp)) + 3)) = (((val) >> 24) & 0xff); \ + } while (0) + +#define SHOWLOGENTRY(OPSTART, OPEND) \ + (!quiet && \ + ((progressinterval && (testcalls % progressinterval == 0)) || \ + (debug && \ + ((monitorstart == -1) || \ + (((OPEND) > monitorstart) && \ + ((monitorend == -1) || ((OPSTART) <= monitorend))))))) + +void docloseopen(void); + +int parsetime(char *t) +{ + int i = 0; + int secs = 0; + char b[128]; bzero(b, 128); + + for (i=0; i < strlen(t); i++) { + switch (t[i]) { + case 's': + secs += atoi(b); + bzero(b, 128); + break; + case 'm': + secs += atoi(b) * 60; + bzero(b, 128); + break; + case 'h': + secs += atoi(b) * 60 * 60; + bzero(b, 128); + break; + case 'd': + secs += atoi(b) * 60 * 60 * 24; + bzero(b, 128); + break; + case 'w': + secs += atoi(b) * 60 * 60 * 24 * 7; + bzero(b, 128); + break; + case 'y': + secs += atoi(b) * 60 * 60 * 24 * 365; + bzero(b, 128); + break; + default: + sprintf(b, "%s%c", b, t[i]); + } + } + if (secs == 0) // maybe they just gave us a number? + secs = atoi(t); + return(secs); +} + + +void +mvwarnc(code, fmt, ap) + int code; + const char *fmt; + va_list ap; +{ + fprintf(stderr, "fsx: "); + if (fmt != NULL) { + vfprintf(stderr, fmt, ap); + fprintf(stderr, ": "); + } + fprintf(stderr, "%s\n", strerror(code)); +} + + +void +mwarn(const char * fmt, ...) +{ + va_list ap; + va_start(ap, fmt); +#ifdef XILOG + XILogMsg(fmt, ap); + XILogMsg("%s", strerror(errno)); + va_end(ap); + va_start(ap, fmt); +#endif + mvwarnc(errno, fmt, ap); + va_end(ap); +} + + +void +prt(char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); +#ifdef XILOG + XILogMsg(fmt, args); + va_end(args); + va_start(args, fmt); +#endif + vfprintf(stdout, fmt, args); + fflush(stdout); + va_end(args); + if (fsxlogf) { + va_start(args, fmt); + vfprintf(fsxlogf, fmt, args); + fflush(fsxlogf); + va_end(args); + } + fflush(stdout); +} + +void +prt2(char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + vfprintf(stdout, fmt, args); + va_end(args); + if (fsxlogf) { + va_start(args, fmt); + vfprintf(fsxlogf, fmt, args); + va_end(args); + } + fflush(stdout); +} + + +void +prterr(char *prefix) +{ +#ifdef XILOG + XILogErr("%s%s%s", prefix, prefix ? ": " : "", strerror(errno)); +#endif + prt2("%s%s%s\n", prefix, prefix ? ": " : "", strerror(errno)); +} + + +int +log4(int operation, int arg0, int arg1, int arg2) +{ + int logent = logptr; + struct log_entry *le = &oplog[logent]; + le->opnum = logcount + 1; + le->operation = operation; + if (closeopen) + le->operation = ~ le->operation; + le->args[0] = arg0; + le->args[1] = arg1; + le->args[2] = arg2; + logptr++; + logcount++; + if (msgbuflen) { + snprintf(msgbuf, msgbuflen+1, "%d", logcount); + } + if (logptr >= logsize) + logptr = 0; + return logent; +} + + +void +offset_last_mod(int offset, int *write, int *tdown, int *tup) +{ + int i, count, down, opnum, operation; + struct log_entry *lp; + + *write = *tdown = *tup = -1; + + opnum = logcount; + i = logptr - 1; + if (i < 0) + i = logsize - 1; + if (logcount < logsize) { + count = logcount; + } else { + count = logsize; + } + for ( ; count > 0; count--, opnum--) { + lp = &oplog[i]; + operation = lp->operation; + if ((closeopen = operation < 0)) + operation = ~ operation; + switch (operation) { + case OP_MAPWRITE: + case OP_WRITE: + if (*write != -1) + break; + if ((offset >= lp->args[0]) && (offset < (lp->args[0] + lp->args[1]))) + *write = opnum; + break; + case OP_TRUNCATE: + down = lp->args[0] < lp->args[1]; + if ((offset >= lp->args[!down]) && (offset < lp->args[!!down])) { + if (down && (*tdown == -1)) + *tdown = opnum; + else if (!down && (*tup == -1)) + *tup = opnum; + } + break; + } + if ((*write != -1) && (*tdown != -1) && (*tup != -1)) + return; + i--; + if (i < 0) + i = logsize - 1; + } +} + +void +logentrydump(int logent, int opnum) +{ + struct log_entry *lp = &oplog[logent]; + int down; + + if (modsize) + prt("%d(%d): ", opnum, opnum%modsize); + else + prt("%d: ", opnum); + if ((closeopen = lp->operation < 0)) + lp->operation = ~ lp->operation; + + switch (lp->operation) { + case OP_MAPREAD: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "MAPREAD", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if ((badoff >= lp->args[0]) && (badoff < lp->args[0] + lp->args[1])) + { + prt("\t***RRRR***"); + } + break; + case OP_MAPWRITE: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "MAPWRITE", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if ((badoff >= lp->args[0]) && (badoff < lp->args[0] + lp->args[1])) + { + prt("\t******WWWW"); + } + break; + case OP_READ: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "READ", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if (badoff >= lp->args[0] && + badoff < lp->args[0] + lp->args[1]) + { + prt("\t***RRRR***"); + } + break; + case OP_WRITE: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "WRITE", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if (lp->args[0] > lp->args[2]) + { + prt(" HOLE"); + } + else if ((lp->args[0] + lp->args[1]) > lp->args[2]) + { + prt(" EXTEND"); + } + if (((badoff >= lp->args[0]) || (badoff >= lp->args[2])) && + (badoff < (lp->args[0] + lp->args[1]))) + { + prt("\t***WWWW"); + } + break; + case OP_NOCACHEREAD: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "NOCACHEREAD", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if (badoff >= lp->args[0] && + badoff < lp->args[0] + lp->args[1]) + { + prt("\t***RRRR***"); + } + break; + case OP_NOCACHEWRITE: + prt("%-15s 0x%x (%d) thru 0x%x (%d)\t(0x%x (%d) bytes)", "NOCACHEWRITE", + lp->args[0], lp->args[0], + lp->args[0] + lp->args[1] - 1, lp->args[0] + lp->args[1] - 1, + lp->args[1], lp->args[1]); + if (lp->args[0] > lp->args[2]) + { + prt(" HOLE"); + } + else if ((lp->args[0] + lp->args[1]) > lp->args[2]) + { + prt(" EXTEND"); + } + if (((badoff >= lp->args[0]) || (badoff >= lp->args[2])) && + (badoff < (lp->args[0] + lp->args[1]))) + { + prt("\t***WWWW"); + } + break; + case OP_TRUNCATE: + down = lp->args[0] < lp->args[1]; + prt("%-15s from 0x%x (%d) to 0x%x (%d)", + down ? "TRUNCATE DOWN" : "TRUNCATE UP", + lp->args[1], lp->args[1], + lp->args[0], lp->args[0]); + if ((badoff >= lp->args[!down]) && + (badoff < lp->args[!!down])) + { + prt("\t******WWWW"); + } + break; + case OP_SKIPPED: + prt("SKIPPED (no operation)"); + break; + default: + prt("BOGUS LOG ENTRY (operation code = %d)!", + lp->operation); + } + if (closeopen) + { + prt("\n\t\tCLOSE/OPEN"); + } + prt("\n"); +} + + +void +logdump(void) +{ + int i, count, opnum; + + // don't dump log if we've been logging ops via debug + if (debug) return; + + prt("LOG DUMP (%d total operations):\n", logcount); + if (logcount < logsize) { + i = 0; + count = logcount; + opnum = 1; + } else { + i = logptr; + count = logsize; + opnum = 1 + logcount - logsize; + } + for ( ; count > 0; count--, opnum++) { + logentrydump(i, opnum); + i++; + if (i == logsize) + i = 0; + } +} + + +void +save_buffer(char *buffer, off_t bufferlength, int fd) +{ + off_t ret; + ssize_t byteswritten; + + if (fd <= 0 || bufferlength == 0) + return; + + if (bufferlength > SSIZE_MAX) { + prt("fsx flaw: overflow in save_buffer\n"); + exit(67); + } + if (lite) { + off_t size_by_seek = lseek(fd, (off_t)0, SEEK_END); + if (size_by_seek == (off_t)-1) + prterr("save_buffer: lseek eof"); + else if (bufferlength > size_by_seek) { + mwarn("WARNING: save_buffer: .fsxgood file too short... will save 0x%llx bytes instead of 0x%llx\n", (unsigned long long)size_by_seek, + (unsigned long long)bufferlength); + bufferlength = size_by_seek; + } + } + + ret = lseek(fd, (off_t)0, SEEK_SET); + if (ret == (off_t)-1) + prterr("save_buffer: lseek 0"); + + byteswritten = write(fd, buffer, (size_t)bufferlength); + if (byteswritten != bufferlength) { + if (byteswritten == -1) + prterr("save_buffer write"); + else + mwarn("WARNING: save_buffer: short write, 0x%x bytes instead of 0x%llx\n", + (unsigned)byteswritten, + (unsigned long long)bufferlength); + } +} + + +void +failure(int status) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 10 07:32:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69E2A2BC88; Tue, 10 Nov 2015 07:32:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63E721472; Tue, 10 Nov 2015 07:32:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA7WnuJ025392; Tue, 10 Nov 2015 07:32:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA7Wnsr025391; Tue, 10 Nov 2015 07:32:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511100732.tAA7Wnsr025391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 07:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290636 - vendor/fsx/2012-04-17 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:32:50 -0000 Author: ngie Date: Tue Nov 10 07:32:49 2015 New Revision: 290636 URL: https://svnweb.freebsd.org/changeset/base/290636 Log: Copy fsx to 2012-04-17, the last time the code was changed/imported Added: vendor/fsx/2012-04-17/ - copied from r290635, vendor/fsx/dist/ From owner-svn-src-all@freebsd.org Tue Nov 10 07:34:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BD00A2BCCA; Tue, 10 Nov 2015 07:34:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 207AD1614; Tue, 10 Nov 2015 07:34:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1E2B519A7; Tue, 10 Nov 2015 07:34:35 +0000 (UTC) Date: Tue, 10 Nov 2015 07:34:35 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290620 - head/lib/libc/locale Message-ID: <20151110073435.GA68685@FreeBSD.org> References: <201511092211.tA9MBb0O062935@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511092211.tA9MBb0O062935@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:34:35 -0000 On Mon, Nov 09, 2015 at 10:11:37PM +0000, Baptiste Daroussin wrote: > New Revision: 290620 > URL: https://svnweb.freebsd.org/changeset/base/290620 > > Log: > Readd ascii.c forgotten in r290618 > > Added: > head/lib/libc/locale/ascii.c (contents, props changed) I think it should've been repocopied. ./danfe From owner-svn-src-all@freebsd.org Tue Nov 10 07:42:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 399C8A2A03F; Tue, 10 Nov 2015 07:42:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0117C1BE9; Tue, 10 Nov 2015 07:42:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B213F1FE022; Tue, 10 Nov 2015 08:42:38 +0100 (CET) Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux To: Bruce Evans , "Conrad E. Meyer" References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <5641A056.2040805@selasky.org> Date: Tue, 10 Nov 2015 08:44:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151110080516.M4088@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:42:41 -0000 On 11/09/15 22:17, Bruce Evans wrote: > On Mon, 9 Nov 2015, Conrad E. Meyer wrote: > >> Log: >> linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC warning >> >> The code compiles fine under Clang, but GCC on PPC is less permissive >> about >> integer and pointer sizes. (An intmax_t is clearly *large enough* to >> hold a >> pointer value.) >> >> Another follow-up to r290475. > > This shouldn't compile either. > Hi Conrad, > static int > -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intptr_t arg2, > +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intmax_t arg2, > struct sysctl_req *req, struct rm_priotracker *tracker) Given that the second argument is sometimes used for pointers, maybe we should keep it intptr_t. Or add a compile time assert that sizeof(intmax) >= sizeof(intptr_t) which I think doesn't hold? --HPS From owner-svn-src-all@freebsd.org Tue Nov 10 08:11:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53D2A2B030; Tue, 10 Nov 2015 08:11:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FACB1C3C; Tue, 10 Nov 2015 08:11:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA8BRnB034339; Tue, 10 Nov 2015 08:11:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA8BR0R034338; Tue, 10 Nov 2015 08:11:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511100811.tAA8BR0R034338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Nov 2015 08:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290637 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 08:11:28 -0000 Author: bapt Date: Tue Nov 10 08:11:27 2015 New Revision: 290637 URL: https://svnweb.freebsd.org/changeset/base/290637 Log: return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales as it used to be in previous version of the locales. Returning "POSIX" has too many fallouts. Modified: head/lib/libc/locale/nl_langinfo.c Modified: head/lib/libc/locale/nl_langinfo.c ============================================================================== --- head/lib/libc/locale/nl_langinfo.c Tue Nov 10 07:32:49 2015 (r290636) +++ head/lib/libc/locale/nl_langinfo.c Tue Nov 10 08:11:27 2015 (r290637) @@ -71,7 +71,7 @@ nl_langinfo_l(nl_item item, locale_t loc else if (strcmp(s, "MSKanji") == 0) ret = "SJIS"; else if (strcmp(s, "NONE") == 0) - ret = "POSIX"; + ret = "US-ASCII"; else if (strncmp(s, "NONE:", 5) == 0) ret = (char *)(s + 5); else From owner-svn-src-all@freebsd.org Tue Nov 10 08:39:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 209D4A2BB03; Tue, 10 Nov 2015 08:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E093E1D5D; Tue, 10 Nov 2015 08:39:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA8d8QC042885; Tue, 10 Nov 2015 08:39:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA8d7Hk042884; Tue, 10 Nov 2015 08:39:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201511100839.tAA8d7Hk042884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Nov 2015 08:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290638 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 08:39:09 -0000 Author: kib Date: Tue Nov 10 08:39:07 2015 New Revision: 290638 URL: https://svnweb.freebsd.org/changeset/base/290638 Log: MFC r290047: Do not perform read-ahead for BA_CLRBUF request when we are low on memory or when dirty buffer queue is too large. Modified: stable/10/sys/ufs/ffs/ffs_balloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:11:27 2015 (r290637) +++ stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:39:07 2015 (r290638) @@ -429,7 +429,9 @@ retry: brelse(bp); if (flags & BA_CLRBUF) { int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT; - if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { + if (seqcount != 0 && + (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 && + !(vm_page_count_severe() || buf_dirty_count_severe())) { error = cluster_read(vp, ip->i_size, lbn, (int)fs->fs_bsize, NOCRED, MAXBSIZE, seqcount, gbflags, &nbp); @@ -998,7 +1000,9 @@ retry: */ if (flags & BA_CLRBUF) { int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT; - if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { + if (seqcount != 0 && + (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 && + !(vm_page_count_severe() || buf_dirty_count_severe())) { error = cluster_read(vp, ip->i_size, lbn, (int)fs->fs_bsize, NOCRED, MAXBSIZE, seqcount, gbflags, &nbp); From owner-svn-src-all@freebsd.org Tue Nov 10 09:27:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3C9A2AE9F; Tue, 10 Nov 2015 09:27:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F5E14AF; Tue, 10 Nov 2015 09:27:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAA9RqHj058102; Tue, 10 Nov 2015 09:27:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA9RqmV058100; Tue, 10 Nov 2015 09:27:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511100927.tAA9RqmV058100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2015 09:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290639 - in head/sys/dev/usb: . input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 09:27:54 -0000 Author: hselasky Date: Tue Nov 10 09:27:52 2015 New Revision: 290639 URL: https://svnweb.freebsd.org/changeset/base/290639 Log: Update the wsp driver to support newer touch pads, like found in MacBookPro11,4 and MacBook12,1. This update adds support for the force touch parameter. PR: 204420 MFC after: 1 week Modified: head/sys/dev/usb/input/wsp.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Tue Nov 10 08:39:07 2015 (r290638) +++ head/sys/dev/usb/input/wsp.c Tue Nov 10 09:27:52 2015 (r290639) @@ -94,8 +94,8 @@ static struct wsp_tuning { .z_factor = 5, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, - .pressure_tap_threshold = 100, - .scr_hor_threshold = 10, + .pressure_tap_threshold = 120, + .scr_hor_threshold = 20, }; static void @@ -122,8 +122,6 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressu SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); -#define WSP_IFACE_INDEX 1 - /* * Some tables, structures, definitions and constant values for the * touchpad protocol has been copied from Linux's @@ -155,21 +153,30 @@ struct bt_data { enum tp_type { TYPE1, /* plain trackpad */ TYPE2, /* button integrated in trackpad */ - TYPE3 /* additional header fields since June 2013 */ + TYPE3, /* additional header fields since June 2013 */ + TYPE4 /* additional header field for pressure data */ }; /* trackpad finger data offsets, le16-aligned */ #define FINGER_TYPE1 (13 * 2) #define FINGER_TYPE2 (15 * 2) #define FINGER_TYPE3 (19 * 2) +#define FINGER_TYPE4 (23 * 2) /* trackpad button data offsets */ #define BUTTON_TYPE2 15 #define BUTTON_TYPE3 23 +#define BUTTON_TYPE4 31 /* list of device capability bits */ #define HAS_INTEGRATED_BUTTON 1 +/* trackpad finger data block size */ +#define FSIZE_TYPE1 (14 * 2) +#define FSIZE_TYPE2 (14 * 2) +#define FSIZE_TYPE3 (14 * 2) +#define FSIZE_TYPE4 (15 * 2) + /* trackpad finger header - little endian */ struct tp_header { uint8_t flag; @@ -197,9 +204,10 @@ struct tp_finger { int16_t orientation; /* 16384 when point, else 15 bit angle */ int16_t touch_major; /* touch area, major axis */ int16_t touch_minor; /* touch area, minor axis */ - int16_t unused[3]; /* zeros */ + int16_t unused[2]; /* zeros */ + int16_t pressure; /* pressure on forcetouch touchpad */ int16_t multi; /* one finger: varies, more fingers: - * constant */ + * constant */ } __packed; /* trackpad finger data size, empirically at least ten fingers */ @@ -207,7 +215,7 @@ struct tp_finger { #define SIZEOF_FINGER sizeof(struct tp_finger) #define SIZEOF_ALL_FINGERS (MAX_FINGERS * SIZEOF_FINGER) -#if (WSP_BUFFER_MAX < ((MAX_FINGERS * 14 * 2) + FINGER_TYPE3)) +#if (WSP_BUFFER_MAX < ((MAX_FINGERS * FSIZE_TYPE4) + FINGER_TYPE4)) #error "WSP_BUFFER_MAX is too small" #endif @@ -224,6 +232,7 @@ enum { WSP_FLAG_WELLSPRING7, WSP_FLAG_WELLSPRING7A, WSP_FLAG_WELLSPRING8, + WSP_FLAG_WELLSPRING9, WSP_FLAG_MAX, }; @@ -231,69 +240,213 @@ enum { struct wsp_dev_params { uint8_t caps; /* device capability bitmask */ uint8_t tp_type; /* type of trackpad interface */ + uint8_t tp_button; /* offset to button data */ uint8_t tp_offset; /* offset to trackpad finger data */ + uint8_t tp_fsize; /* bytes in single finger block */ + uint8_t tp_delta; /* offset from header to finger struct */ + uint8_t iface_index; + uint8_t um_size; /* usb control message length */ + uint8_t um_req_val; /* usb control message value */ + uint8_t um_req_idx; /* usb control message index */ + uint8_t um_switch_idx; /* usb control message mode switch index */ + uint8_t um_switch_on; /* usb control message mode switch on */ + uint8_t um_switch_off; /* usb control message mode switch off */ }; static const struct wsp_dev_params wsp_dev_params[WSP_FLAG_MAX] = { [WSP_FLAG_WELLSPRING1] = { .caps = 0, .tp_type = TYPE1, + .tp_button = 0, .tp_offset = FINGER_TYPE1, + .tp_fsize = FSIZE_TYPE1, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING2] = { .caps = 0, .tp_type = TYPE1, + .tp_button = 0, .tp_offset = FINGER_TYPE1, + .tp_fsize = FSIZE_TYPE1, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING3] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING4] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING4A] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING5] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING6] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING5A] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING6A] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING7] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING7A] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE2, + .tp_button = BUTTON_TYPE2, .tp_offset = FINGER_TYPE2, + .tp_fsize = FSIZE_TYPE2, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, }, [WSP_FLAG_WELLSPRING8] = { .caps = HAS_INTEGRATED_BUTTON, .tp_type = TYPE3, + .tp_button = BUTTON_TYPE3, .tp_offset = FINGER_TYPE3, + .tp_fsize = FSIZE_TYPE3, + .tp_delta = 0, + .iface_index = 0, + .um_size = 8, + .um_req_val = 0x03, + .um_req_idx = 0x00, + .um_switch_idx = 0, + .um_switch_on = 0x01, + .um_switch_off = 0x08, + }, + [WSP_FLAG_WELLSPRING9] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = TYPE4, + .tp_button = BUTTON_TYPE4, + .tp_offset = FINGER_TYPE4, + .tp_fsize = FSIZE_TYPE4, + .tp_delta = 2, + .iface_index = 2, + .um_size = 2, + .um_req_val = 0x03, + .um_req_idx = 0x02, + .um_switch_idx = 1, + .um_switch_on = 0x01, + .um_switch_off = 0x00, }, }; @@ -346,7 +499,7 @@ static const STRUCT_USB_HOST_ID wsp_devs WSP_DEV(APPLE, WELLSPRING5A_JIS, WSP_FLAG_WELLSPRING5A), /* MacbookPro10,1 (unibody, June 2012) */ - /* MacbookPro11,? (unibody, June 2013) */ + /* MacbookPro11,1-3 (unibody, June 2013) */ WSP_DEV(APPLE, WELLSPRING7_ANSI, WSP_FLAG_WELLSPRING7), WSP_DEV(APPLE, WELLSPRING7_ISO, WSP_FLAG_WELLSPRING7), WSP_DEV(APPLE, WELLSPRING7_JIS, WSP_FLAG_WELLSPRING7), @@ -360,6 +513,11 @@ static const STRUCT_USB_HOST_ID wsp_devs WSP_DEV(APPLE, WELLSPRING8_ANSI, WSP_FLAG_WELLSPRING8), WSP_DEV(APPLE, WELLSPRING8_ISO, WSP_FLAG_WELLSPRING8), WSP_DEV(APPLE, WELLSPRING8_JIS, WSP_FLAG_WELLSPRING8), + + /* MacbookPro12,1 MacbookPro11,4 */ + WSP_DEV(APPLE, WELLSPRING9_ANSI, WSP_FLAG_WELLSPRING9), + WSP_DEV(APPLE, WELLSPRING9_ISO, WSP_FLAG_WELLSPRING9), + WSP_DEV(APPLE, WELLSPRING9_JIS, WSP_FLAG_WELLSPRING9), }; #define WSP_FIFO_BUF_SIZE 8 /* bytes */ @@ -421,11 +579,6 @@ struct wsp_softc { uint8_t tp_data[WSP_BUFFER_MAX] __aligned(4); /* trackpad transferred data */ }; -typedef enum interface_mode { - RAW_SENSOR_MODE = 0x01, - HID_MODE = 0x08 -} interface_mode; - /* * function prototypes */ @@ -473,14 +626,19 @@ static const struct usb_config wsp_confi }; static usb_error_t -wsp_set_device_mode(struct wsp_softc *sc, interface_mode mode) +wsp_set_device_mode(struct wsp_softc *sc, uint8_t on) { + const struct wsp_dev_params *params = sc->sc_params; uint8_t mode_bytes[8]; usb_error_t err; + /* Type 3 does not require a mode switch */ + if (params->tp_type == TYPE3) + return 0; + err = usbd_req_get_report(sc->sc_usb_device, NULL, - mode_bytes, sizeof(mode_bytes), 0, - 0x03, 0x00); + mode_bytes, params->um_size, params->iface_index, + params->um_req_val, params->um_req_idx); if (err != USB_ERR_NORMAL_COMPLETION) { DPRINTF("Failed to read device mode (%d)\n", err); @@ -495,11 +653,12 @@ wsp_set_device_mode(struct wsp_softc *sc */ pause("WHW", hz / 4); - mode_bytes[0] = mode; + mode_bytes[params->um_switch_idx] = + on ? params->um_switch_on : params->um_switch_off; return (usbd_req_set_report(sc->sc_usb_device, NULL, - mode_bytes, sizeof(mode_bytes), 0, - 0x03, 0x00)); + mode_bytes, params->um_size, params->iface_index, + params->um_req_val, params->um_req_idx)); } static int @@ -524,17 +683,29 @@ static int wsp_probe(device_t self) { struct usb_attach_arg *uaa = device_get_ivars(self); + struct usb_interface_descriptor *id; + struct usb_interface *iface; + uint8_t i; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - if (uaa->info.bIfaceIndex != WSP_IFACE_INDEX) - return (ENXIO); - - if ((uaa->info.bInterfaceClass != UICLASS_HID) || - (uaa->info.bInterfaceProtocol != 0)) + /* figure out first interface matching */ + for (i = 1;; i++) { + iface = usbd_get_iface(uaa->device, i); + if (iface == NULL || i == 3) + return (ENXIO); + id = iface->idesc; + if ((id == NULL) || + (id->bInterfaceClass != UICLASS_HID) || + (id->bInterfaceProtocol != 0 && + id->bInterfaceProtocol != UIPROTO_MOUSE)) + continue; + break; + } + /* check if we are attaching to the first match */ + if (uaa->info.bIfaceIndex != i) return (ENXIO); - return (usbd_lookup_id_by_uaa(wsp_devs, sizeof(wsp_devs), uaa)); } @@ -569,6 +740,9 @@ wsp_attach(device_t dev) sc->sc_usb_device = uaa->device; + /* get device specific configuration */ + sc->sc_params = wsp_dev_params + USB_GET_DRIVER_INFO(uaa); + /* * By default the touchpad behaves like a HID device, sending * packets with reportID = 8. Such reports contain only @@ -584,13 +758,13 @@ wsp_attach(device_t dev) * device back into HID mode before switching it to RAW * mode. Else the device does not work like expected. */ - err = wsp_set_device_mode(sc, HID_MODE); + err = wsp_set_device_mode(sc, 0); if (err != USB_ERR_NORMAL_COMPLETION) { DPRINTF("Failed to set mode to HID MODE (%d)\n", err); return (ENXIO); } - err = wsp_set_device_mode(sc, RAW_SENSOR_MODE); + err = wsp_set_device_mode(sc, 1); if (err != USB_ERR_NORMAL_COMPLETION) { DPRINTF("failed to set mode to RAW MODE (%d)\n", err); return (ENXIO); @@ -598,9 +772,6 @@ wsp_attach(device_t dev) mtx_init(&sc->sc_mutex, "wspmtx", NULL, MTX_DEF | MTX_RECURSE); - /* get device specific configuration */ - sc->sc_params = wsp_dev_params + USB_GET_DRIVER_INFO(uaa); - err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, wsp_config, WSP_N_TRANSFER, sc, &sc->sc_mutex); @@ -642,7 +813,7 @@ wsp_detach(device_t dev) { struct wsp_softc *sc = device_get_softc(dev); - (void) wsp_set_device_mode(sc, HID_MODE); + (void) wsp_set_device_mode(sc, 0); mtx_lock(&sc->sc_mutex); if (sc->sc_state & WSP_ENABLED) @@ -692,6 +863,13 @@ wsp_intr_callback(struct usb_xfer *xfer, pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, sc->tp_data, len); + if ((len < params->tp_offset + params->tp_fsize) || + ((len - params->tp_offset) % params->tp_fsize) != 0) { + DPRINTFN(WSP_LLEVEL_INFO, "Invalid length: %d, %x, %x\n", + len, sc->tp_data[0], sc->tp_data[1]); + goto tr_setup; + } + if (len < sc->tp_datalen) { /* make sure we don't process old data */ memset(sc->tp_data + len, 0, sc->tp_datalen - len); @@ -699,12 +877,9 @@ wsp_intr_callback(struct usb_xfer *xfer, h = (struct tp_header *)(sc->tp_data); - if (params->tp_type == TYPE2) { - ibt = sc->tp_data[BUTTON_TYPE2]; - ntouch = sc->tp_data[BUTTON_TYPE2 - 1]; - } else if (params->tp_type == TYPE3) { - ibt = sc->tp_data[BUTTON_TYPE3]; - ntouch = sc->tp_data[BUTTON_TYPE3 - 1]; + if (params->tp_type >= TYPE2) { + ibt = sc->tp_data[params->tp_button]; + ntouch = sc->tp_data[params->tp_button - 1]; } /* range check */ if (ntouch < 0) @@ -712,33 +887,33 @@ wsp_intr_callback(struct usb_xfer *xfer, else if (ntouch > MAX_FINGERS) ntouch = MAX_FINGERS; - f = (struct tp_finger *)(sc->tp_data + params->tp_offset); - for (i = 0; i != ntouch; i++) { + f = (struct tp_finger *)(sc->tp_data + params->tp_offset + params->tp_delta + i * params->tp_fsize); /* swap endianness, if any */ if (le16toh(0x1234) != 0x1234) { - f[i].origin = le16toh((uint16_t)f[i].origin); - f[i].abs_x = le16toh((uint16_t)f[i].abs_x); - f[i].abs_y = le16toh((uint16_t)f[i].abs_y); - f[i].rel_x = le16toh((uint16_t)f[i].rel_x); - f[i].rel_y = le16toh((uint16_t)f[i].rel_y); - f[i].tool_major = le16toh((uint16_t)f[i].tool_major); - f[i].tool_minor = le16toh((uint16_t)f[i].tool_minor); - f[i].orientation = le16toh((uint16_t)f[i].orientation); - f[i].touch_major = le16toh((uint16_t)f[i].touch_major); - f[i].touch_minor = le16toh((uint16_t)f[i].touch_minor); - f[i].multi = le16toh((uint16_t)f[i].multi); + f->origin = le16toh((uint16_t)f->origin); + f->abs_x = le16toh((uint16_t)f->abs_x); + f->abs_y = le16toh((uint16_t)f->abs_y); + f->rel_x = le16toh((uint16_t)f->rel_x); + f->rel_y = le16toh((uint16_t)f->rel_y); + f->tool_major = le16toh((uint16_t)f->tool_major); + f->tool_minor = le16toh((uint16_t)f->tool_minor); + f->orientation = le16toh((uint16_t)f->orientation); + f->touch_major = le16toh((uint16_t)f->touch_major); + f->touch_minor = le16toh((uint16_t)f->touch_minor); + f->pressure = le16toh((uint16_t)f->pressure); + f->multi = le16toh((uint16_t)f->multi); } - DPRINTFN(WSP_LLEVEL_INFO, "[%d]ibt=%d, taps=%d, u=%x, o=%4d, ax=%5d, ay=%5d, " - "rx=%5d, ry=%5d, tlmaj=%4d, tlmin=%4d, ot=%5d, tchmaj=%4d, tchmin=%4d, m=%4x\n", - i, ibt, ntouch, h->q2, - f[i].origin, f[i].abs_x, f[i].abs_y, f[i].rel_x, f[i].rel_y, - f[i].tool_major, f[i].tool_minor, f[i].orientation, - f[i].touch_major, f[i].touch_minor, f[i].multi); - - sc->pos_x[i] = f[i].abs_x; - sc->pos_y[i] = -f[i].abs_y; - sc->index[i] = &f[i]; + DPRINTFN(WSP_LLEVEL_INFO, + "[%d]ibt=%d, taps=%d, o=%4d, ax=%5d, ay=%5d, " + "rx=%5d, ry=%5d, tlmaj=%4d, tlmin=%4d, ot=%4x, " + "tchmaj=%4d, tchmin=%4d, presure=%4d, m=%4x\n", + i, ibt, ntouch, f->origin, f->abs_x, f->abs_y, + f->rel_x, f->rel_y, f->tool_major, f->tool_minor, f->orientation, + f->touch_major, f->touch_minor, f->pressure, f->multi); + sc->pos_x[i] = f->abs_x; + sc->pos_y[i] = -f->abs_y; + sc->index[i] = f; } sc->sc_status.flags &= ~MOUSE_POSCHANGED; @@ -750,24 +925,24 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->sc_status.button |= MOUSE_BUTTON1DOWN; sc->ibtn = 1; } - if (h->q2 == 4) - sc->intr_count++; + sc->intr_count++; if (sc->ntaps < ntouch) { switch (ntouch) { case 1: - if (f[0].touch_major > tun.pressure_tap_threshold) + if (sc->index[0]->touch_major > tun.pressure_tap_threshold && + sc->index[0]->tool_major <= 1200) sc->ntaps = 1; break; case 2: - if (f[0].touch_major > tun.pressure_tap_threshold && - f[1].touch_major > tun.pressure_tap_threshold) + if (sc->index[0]->touch_major > tun.pressure_tap_threshold-30 && + sc->index[1]->touch_major > tun.pressure_tap_threshold-30) sc->ntaps = 2; break; case 3: - if (f[0].touch_major > tun.pressure_tap_threshold && - f[1].touch_major > tun.pressure_tap_threshold && - f[2].touch_major > tun.pressure_tap_threshold) + if (sc->index[0]->touch_major > tun.pressure_tap_threshold-40 && + sc->index[1]->touch_major > tun.pressure_tap_threshold-40 && + sc->index[2]->touch_major > tun.pressure_tap_threshold-40) sc->ntaps = 3; break; default: @@ -779,7 +954,7 @@ wsp_intr_callback(struct usb_xfer *xfer, abs(sc->pos_x[0] - sc->pos_x[1]), abs(sc->pos_y[0] - sc->pos_y[1]))); } - if (f[0].touch_major < tun.pressure_untouch_threshold && + if (sc->index[0]->touch_major < tun.pressure_untouch_threshold && sc->sc_status.button == 0) { sc->sc_touch = WSP_UNTOUCH; if (sc->intr_count < WSP_TAP_MAX_COUNT && @@ -840,10 +1015,10 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->rdy = 0; sc->rdz = 0; sc->scr_mode = WSP_SCR_NONE; - } else if (f[0].touch_major >= tun.pressure_touch_threshold && + } else if (sc->index[0]->touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_UNTOUCH) { /* ignore first touch */ sc->sc_touch = WSP_FIRST_TOUCH; - } else if (f[0].touch_major >= tun.pressure_touch_threshold && + } else if (sc->index[0]->touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_FIRST_TOUCH) { /* ignore second touch */ sc->sc_touch = WSP_SECOND_TOUCH; DPRINTFN(WSP_LLEVEL_INFO, "Fist pre_x=%5d, pre_y=%5d\n", @@ -853,22 +1028,26 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->sc_touch = WSP_TOUCHING; if (ntouch != 0 && - h->q2 == 4 && - f[0].touch_major >= tun.pressure_touch_threshold) { + sc->index[0]->touch_major >= tun.pressure_touch_threshold) { dx = sc->pos_x[0] - sc->pre_pos_x; dy = sc->pos_y[0] - sc->pre_pos_y; - /* Ignore movement from ibt=1 to ibt=0 */ - if (sc->sc_status.obutton != 0 && - sc->sc_status.button == 0) { - dx = 0; - dy = 0; - } + /* Ignore movement during button is releasing */ + if (sc->ibtn != 0 && sc->sc_status.button == 0) + dx = dy = 0; + /* Ignore movement if ntouch changed */ - if (sc->o_ntouch != ntouch) { - dx = 0; - dy = 0; - } + if (sc->o_ntouch != ntouch) + dx = dy = 0; + + /* Ignore unexpeted movment when typing */ + if (ntouch == 1 && sc->index[0]->tool_major > 1200) + dx = dy = 0; + + if (sc->ibtn != 0 && ntouch == 1 && + sc->intr_count < WSP_TAP_MAX_COUNT && + abs(sc->dx_sum) < 1 && abs(sc->dy_sum) < 1 ) + dx = dy = 0; if (ntouch == 2 && sc->sc_status.button != 0) { dx = sc->pos_x[sc->finger] - sc->pre_pos_x; @@ -878,26 +1057,23 @@ wsp_intr_callback(struct usb_xfer *xfer, * Ignore movement of switch finger or * movement from ibt=0 to ibt=1 */ - if (f[0].origin == 0 || f[1].origin == 0 || + if (sc->index[0]->origin == 0 || sc->index[1]->origin == 0 || sc->sc_status.obutton != sc->sc_status.button) { - dx = 0; - dy = 0; + dx = dy = 0; sc->finger = 0; } - if ((abs(f[0].rel_x) + abs(f[0].rel_y)) < - (abs(f[1].rel_x) + abs(f[1].rel_y)) && + if ((abs(sc->index[0]->rel_x) + abs(sc->index[0]->rel_y)) < + (abs(sc->index[1]->rel_x) + abs(sc->index[1]->rel_y)) && sc->finger == 0) { sc->sc_touch = WSP_SECOND_TOUCH; - dx = 0; - dy = 0; + dx = dy = 0; sc->finger = 1; } - if ((abs(f[0].rel_x) + abs(f[0].rel_y)) >= - (abs(f[1].rel_x) + abs(f[1].rel_y)) && + if ((abs(sc->index[0]->rel_x) + abs(sc->index[0]->rel_y)) >= + (abs(sc->index[1]->rel_x) + abs(sc->index[1]->rel_y)) && sc->finger == 1) { sc->sc_touch = WSP_SECOND_TOUCH; - dx = 0; - dy = 0; + dx = dy = 0; sc->finger = 0; } DPRINTFN(WSP_LLEVEL_INFO, "dx=%5d, dy=%5d, mov=%5d\n", @@ -926,8 +1102,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (sc->scr_mode == WSP_SCR_NONE && abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > - abs(sc->dy_sum) * 3 ? WSP_SCR_HOR : - WSP_SCR_VER; + abs(sc->dy_sum) * 2 ? WSP_SCR_HOR : WSP_SCR_VER; DPRINTFN(WSP_LLEVEL_INFO, "scr_mode=%5d, count=%d, dx_sum=%d, dy_sum=%d\n", sc->scr_mode, sc->intr_count, sc->dx_sum, sc->dy_sum); if (sc->scr_mode == WSP_SCR_HOR) @@ -935,8 +1110,7 @@ wsp_intr_callback(struct usb_xfer *xfer, else sc->dt_sum = 0; - dx = 0; - dy = 0; + dx = dy = 0; if (sc->dz_count == 0) dz = sc->dz_sum / tun.z_factor; if (sc->scr_mode == WSP_SCR_HOR || @@ -944,15 +1118,12 @@ wsp_intr_callback(struct usb_xfer *xfer, abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) dz = 0; } - if (ntouch == 3) { - dx = 0; - dy = 0; - dz = 0; - } + if (ntouch == 3) + dx = dy = dz = 0; if (sc->intr_count < WSP_TAP_MAX_COUNT && - abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) { + abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) dx = dy = dz = 0; - } else + else sc->intr_count = WSP_TAP_MAX_COUNT; if (dx || dy || dz) sc->sc_status.flags |= MOUSE_POSCHANGED; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Nov 10 08:39:07 2015 (r290638) +++ head/sys/dev/usb/usbdevs Tue Nov 10 09:27:52 2015 (r290639) @@ -1131,6 +1131,10 @@ product APPLE WELLSPRING7A_JIS 0x025b Ap product APPLE WELLSPRING8_ANSI 0x0290 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING8_ISO 0x0291 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING8_JIS 0x0292 Apple Internal Keyboard/Trackpad +/* MacbookPro12,1 */ +product APPLE WELLSPRING9_ANSI 0x0272 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING9_ISO 0x0273 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING9_JIS 0x0274 Apple Internal Keyboard/Trackpad product APPLE MOUSE 0x0301 Mouse M4848 product APPLE OPTMOUSE 0x0302 Optical mouse product APPLE MIGHTYMOUSE 0x0304 Mighty Mouse From owner-svn-src-all@freebsd.org Tue Nov 10 10:49:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC85DA2BBCB; Tue, 10 Nov 2015 10:49:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 882991827; Tue, 10 Nov 2015 10:49:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAAnQbj096359; Tue, 10 Nov 2015 10:49:26 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAAnQfE096358; Tue, 10 Nov 2015 10:49:26 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511101049.tAAAnQfE096358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 10 Nov 2015 10:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290640 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 10:49:27 -0000 Author: des Date: Tue Nov 10 10:49:26 2015 New Revision: 290640 URL: https://svnweb.freebsd.org/changeset/base/290640 Log: Upgrade my claim on fetch and libfetch since people don't seem to give a hoot about "advance notification requested". Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Nov 10 09:27:52 2015 (r290639) +++ head/MAINTAINERS Tue Nov 10 10:49:26 2015 (r290640) @@ -45,8 +45,8 @@ isci(4) jimharris Pre-commit review req nvme(4) jimharris Pre-commit review requested. nvd(4) jimharris Pre-commit review requested. nvmecontrol(8) jimharris Pre-commit review requested. -libfetch des Advance notification requested. -fetch des Advance notification requested. +libfetch des Pre-commit review requested. +fetch des Pre-commit review requested. libpam des Pre-commit review requested. openssh des Pre-commit review requested. pseudofs des Pre-commit review requested. From owner-svn-src-all@freebsd.org Tue Nov 10 10:50:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33090A2BC27; Tue, 10 Nov 2015 10:50:07 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B10DD1993; Tue, 10 Nov 2015 10:50:06 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 1387E20E7; Tue, 10 Nov 2015 10:50:04 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 775FA3F8D2; Tue, 10 Nov 2015 11:49:58 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Michael Gmelin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bapt@freebsd.org Subject: Re: svn commit: r288217 - head/lib/libfetch References: <201509251424.t8PEONdo071309@repo.freebsd.org> Date: Tue, 10 Nov 2015 11:49:58 +0100 In-Reply-To: <201509251424.t8PEONdo071309@repo.freebsd.org> (Michael Gmelin's message of "Fri, 25 Sep 2015 14:24:23 +0000 (UTC)") Message-ID: <86egfy9lih.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 10:50:07 -0000 Michael Gmelin writes: > Log: > Fix non-POSIX-compliant use of getaddrinfo in libfetch >=20=20=20 > Submitted by: Boris Kolpackov > Reviewed by: bapt > Approved by: bapt > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D3724 Not reviewed by: des DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Tue Nov 10 10:55:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CFE0A2BE43; Tue, 10 Nov 2015 10:55:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E63FC1EC5; Tue, 10 Nov 2015 10:55:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAAtvLW099177; Tue, 10 Nov 2015 10:55:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAAtvHU099176; Tue, 10 Nov 2015 10:55:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201511101055.tAAAtvHU099176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Nov 2015 10:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290641 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 10:55:59 -0000 Author: tuexen Date: Tue Nov 10 10:55:57 2015 New Revision: 290641 URL: https://svnweb.freebsd.org/changeset/base/290641 Log: Add support for SCTP checksum offloading for the 82580 controller similar to the 82576 controller. Tested with Intel i340 cards. Reviewed by: erj@ MFC after: 1 week Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Nov 10 10:49:26 2015 (r290640) +++ head/sys/dev/e1000/if_igb.c Tue Nov 10 10:55:57 2015 (r290641) @@ -1258,7 +1258,8 @@ igb_init_locked(struct adapter *adapter) if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); #if __FreeBSD_version >= 800000 - if (adapter->hw.mac.type == e1000_82576) + if ((adapter->hw.mac.type == e1000_82576) || + (adapter->hw.mac.type == e1000_82580)) ifp->if_hwassist |= CSUM_SCTP; #endif } @@ -4681,8 +4682,9 @@ igb_initialize_receive_units(struct adap rxcsum |= E1000_RXCSUM_PCSD; #if __FreeBSD_version >= 800000 /* For SCTP Offload */ - if ((hw->mac.type == e1000_82576) - && (ifp->if_capenable & IFCAP_RXCSUM)) + if (((hw->mac.type == e1000_82576) || + (hw->mac.type == e1000_82580)) && + (ifp->if_capenable & IFCAP_RXCSUM)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else { @@ -4690,7 +4692,8 @@ igb_initialize_receive_units(struct adap if (ifp->if_capenable & IFCAP_RXCSUM) { rxcsum |= E1000_RXCSUM_IPPCSE; #if __FreeBSD_version >= 800000 - if (adapter->hw.mac.type == e1000_82576) + if ((adapter->hw.mac.type == e1000_82576) || + (adapter->hw.mac.type == e1000_82580)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else From owner-svn-src-all@freebsd.org Tue Nov 10 10:56:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7128AA2BF58; Tue, 10 Nov 2015 10:56:53 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38FA61182; Tue, 10 Nov 2015 10:56:53 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAAuqxK099249; Tue, 10 Nov 2015 10:56:52 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAAuqCJ099248; Tue, 10 Nov 2015 10:56:52 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201511101056.tAAAuqCJ099248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 10 Nov 2015 10:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290642 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 10:56:53 -0000 Author: skra Date: Tue Nov 10 10:56:52 2015 New Revision: 290642 URL: https://svnweb.freebsd.org/changeset/base/290642 Log: Fix slots DMA memory handling. It's similar to r290553. Discussed with: gonzo Approved by: kib (mentor) Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Tue Nov 10 10:55:57 2015 (r290641) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Tue Nov 10 10:56:52 2015 (r290642) @@ -213,10 +213,10 @@ vchiq_platform_init(VCHIQ_STATE_T *state failed_vchiq_init: failed_init_slots: -failed_load: bus_dmamap_unload(bcm_slots_dma_tag, bcm_slots_dma_map); +failed_load: + bus_dmamem_free(bcm_slots_dma_tag, g_slot_mem, bcm_slots_dma_map); failed_alloc: - bus_dmamap_destroy(bcm_slots_dma_tag, bcm_slots_dma_map); bus_dma_tag_destroy(bcm_slots_dma_tag); return err; @@ -227,7 +227,7 @@ vchiq_platform_exit(VCHIQ_STATE_T *state { bus_dmamap_unload(bcm_slots_dma_tag, bcm_slots_dma_map); - bus_dmamap_destroy(bcm_slots_dma_tag, bcm_slots_dma_map); + bus_dmamem_free(bcm_slots_dma_tag, g_slot_mem, bcm_slots_dma_map); bus_dma_tag_destroy(bcm_slots_dma_tag); } From owner-svn-src-all@freebsd.org Tue Nov 10 10:59:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8522A2A0A1; Tue, 10 Nov 2015 10:59:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 938D615D5; Tue, 10 Nov 2015 10:59:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAAxeOg099378; Tue, 10 Nov 2015 10:59:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAAxea4099377; Tue, 10 Nov 2015 10:59:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511101059.tAAAxea4099377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 10:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290643 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 10:59:41 -0000 Author: ngie Date: Tue Nov 10 10:59:40 2015 New Revision: 290643 URL: https://svnweb.freebsd.org/changeset/base/290643 Log: - Move the testing entries up for netbsd-tests/pjdfstest - Add pjd to contrib/pjdfstest - Add atf to the list; add jmmv - Add tests - Add share/mk/*.test.mk Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Nov 10 10:56:52 2015 (r290642) +++ head/MAINTAINERS Tue Nov 10 10:59:40 2015 (r290643) @@ -57,6 +57,11 @@ contrib/libc++ dim Pre-commit review pr contrib/libcxxrt dim Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb emaste Pre-commit review preferred. +atf freebsd-testing,jmmv,ngie Pre-commit review requested. +contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. +contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. +share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. +tests freebsd-testing,ngie Pre-commit review requested. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. @@ -103,8 +108,6 @@ contrib/pf glebius Pre-commit review rec file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. -contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. -contrib/pjdfstest freebsd-testing,ngie Pre-commit review requested. geom freebsd-geom@FreeBSD.org geom_concat pjd Pre-commit review preferred. geom_eli pjd Pre-commit review preferred. From owner-svn-src-all@freebsd.org Tue Nov 10 11:04:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B257A2A301; Tue, 10 Nov 2015 11:04:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AFEB1A93; Tue, 10 Nov 2015 11:04:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAB4OAM002254; Tue, 10 Nov 2015 11:04:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAB4OoG002253; Tue, 10 Nov 2015 11:04:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511101104.tAAB4OoG002253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2015 11:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290644 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 11:04:25 -0000 Author: hselasky Date: Tue Nov 10 11:04:23 2015 New Revision: 290644 URL: https://svnweb.freebsd.org/changeset/base/290644 Log: Renew my MAINTAINERS entries. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Nov 10 10:59:40 2015 (r290643) +++ head/MAINTAINERS Tue Nov 10 11:04:23 2015 (r290644) @@ -62,6 +62,9 @@ contrib/netbsd-tests freebsd-testing,ngi contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. tests freebsd-testing,ngie Pre-commit review requested. +sys/dev/usb hselasky If in doubt, ask. +sys/dev/sound/usb hselasky If in doubt, ask. +sys/compat/linuxkpi hselasky If in doubt, ask. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. @@ -126,9 +129,6 @@ linux emul emulation Please discuss chan bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. -sys/dev/usb hselasky If in doubt, ask. -sys/dev/sound/usb hselasky If in doubt, ask. -sys/compat/linuxkpi hselasky If in doubt, ask. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. From owner-svn-src-all@freebsd.org Tue Nov 10 11:19:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 348F7A2AB71; Tue, 10 Nov 2015 11:19:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F186F1BD5; Tue, 10 Nov 2015 11:19:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAABJbJ0005539; Tue, 10 Nov 2015 11:19:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAABJbuu005538; Tue, 10 Nov 2015 11:19:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511101119.tAABJbuu005538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 11:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290645 - head/usr.sbin/bootparamd/bootparamd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 11:19:38 -0000 Author: ngie Date: Tue Nov 10 11:19:36 2015 New Revision: 290645 URL: https://svnweb.freebsd.org/changeset/base/290645 Log: Fix some trivial warnings with bootparamd/main.c - Convert K&R to something a bit less ancient - Remove an incorrect, duplicate prototype for bootparamprog_1(..) MFC after: 1 week PR: 71667 Submitted by: bcran Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bootparamd/bootparamd/main.c Modified: head/usr.sbin/bootparamd/bootparamd/main.c ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/main.c Tue Nov 10 11:04:23 2015 (r290644) +++ head/usr.sbin/bootparamd/bootparamd/main.c Tue Nov 10 11:19:36 2015 (r290645) @@ -36,13 +36,10 @@ in_addr_t route_addr = -1; struct sockaddr_in my_addr; char *bootpfile = "/etc/bootparams"; -extern void bootparamprog_1(); static void usage(void); int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { SVCXPRT *transp; struct hostent *he; @@ -110,7 +107,7 @@ char **argv; } static void -usage() +usage(void) { fprintf(stderr, "usage: bootparamd [-d] [-s] [-r router] [-f bootparmsfile]\n"); From owner-svn-src-all@freebsd.org Tue Nov 10 11:28:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67942A2AFD5; Tue, 10 Nov 2015 11:28:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14E3E1338; Tue, 10 Nov 2015 11:28:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAABS3s3008416; Tue, 10 Nov 2015 11:28:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAABS3iH008415; Tue, 10 Nov 2015 11:28:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511101128.tAABS3iH008415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 11:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290646 - head/lib/libc/tests/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 11:28:04 -0000 Author: ngie Date: Tue Nov 10 11:28:02 2015 New Revision: 290646 URL: https://svnweb.freebsd.org/changeset/base/290646 Log: Add missing licensing boilerplate to test-fnmatch.c Carry over licensing author info from fnmatch_test.c (jilles@) MFC after: 1 week X-MFC with: r290572 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/gen/test-fnmatch.c Modified: head/lib/libc/tests/gen/test-fnmatch.c ============================================================================== --- head/lib/libc/tests/gen/test-fnmatch.c Tue Nov 10 11:19:36 2015 (r290645) +++ head/lib/libc/tests/gen/test-fnmatch.c Tue Nov 10 11:28:02 2015 (r290646) @@ -1,3 +1,28 @@ +/*- + * Copyright (c) 2010 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$"); From owner-svn-src-all@freebsd.org Tue Nov 10 11:45:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B8A0A2B45E; Tue, 10 Nov 2015 11:45:43 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9971BDC; Tue, 10 Nov 2015 11:45:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAABjfGr013971; Tue, 10 Nov 2015 11:45:41 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAABjf6b013970; Tue, 10 Nov 2015 11:45:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201511101145.tAABjf6b013970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 10 Nov 2015 11:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290647 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 11:45:43 -0000 Author: mmel Date: Tue Nov 10 11:45:41 2015 New Revision: 290647 URL: https://svnweb.freebsd.org/changeset/base/290647 Log: ARM: Improve robustness of locore_v6.S and fix errors. - boot page table is not allocated in data section, so must be cleared before use - map only one section (1 MB) for SOCDEV mapping (*) - DSB must be used for ensuring of finishing TLB operations - Invalidate BTB when appropriate PR: 198360 Reported by: Daisuke Aoyama (*) Approved by: kib (mentor) Modified: head/sys/arm/arm/locore-v6.S Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Tue Nov 10 11:28:02 2015 (r290646) +++ head/sys/arm/arm/locore-v6.S Tue Nov 10 11:45:41 2015 (r290647) @@ -142,9 +142,11 @@ ASENTRY_NP(_start) orr r7, #CPU_CONTROL_AFLT_ENABLE orr r7, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r7) + DSB ISB bl dcache_inv_poc_all mcr CP15_ICIALLU + DSB ISB /* @@ -155,6 +157,14 @@ ASENTRY_NP(_start) adr r0, Lpagetable bl translate_va_to_pa + /* Clear boot page table */ + mov r1, r0 + mov r2, L1_TABLE_SIZE + mov r3,#0 +1: str r3, [r1], #4 + subs r2, #4 + bgt 1b + /* * Map PA == VA */ @@ -174,9 +184,10 @@ ASENTRY_NP(_start) bl build_pagetables #if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Create the custom map used for early_printf(). */ + /* Create the custom map (1MB) used for early_printf(). */ ldr r1, =SOCDEV_PA ldr r2, =SOCDEV_VA + mov r3, #1 bl build_pagetables #endif bl init_mmu @@ -300,7 +311,9 @@ ASENTRY_NP(init_mmu) ISB mcr CP15_TLBIALL /* Flush TLB */ mcr CP15_BPIALL /* Flush Branch predictor */ + DSB ISB + mov pc, lr END(init_mmu) @@ -328,6 +341,7 @@ ASENTRY_NP(reinit_mmu) bl dcache_inv_pou_all #endif mcr CP15_ICIALLU + DSB ISB /* Set auxiliary register */ @@ -336,6 +350,7 @@ ASENTRY_NP(reinit_mmu) eor r8, r8, r6 /* Set bits */ teq r7, r8 mcrne CP15_ACTLR(r8) + DSB ISB /* Enable caches. */ @@ -350,8 +365,8 @@ ASENTRY_NP(reinit_mmu) DSB ISB - /* Flush all TLBs */ - mcr CP15_TLBIALL + mcr CP15_TLBIALL /* Flush TLB */ + mcr CP15_BPIALL /* Flush Branch predictor */ DSB ISB @@ -362,6 +377,7 @@ ASENTRY_NP(reinit_mmu) bl dcache_inv_pou_all #endif mcr CP15_ICIALLU + DSB ISB pop {r4-r11, pc} @@ -453,11 +469,13 @@ ASENTRY_NP(mpentry) orr r0, #CPU_CONTROL_AFLT_ENABLE orr r0, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r0) + DSB ISB /* Invalidate L1 cache I+D cache */ bl dcache_inv_pou_all mcr CP15_ICIALLU + DSB ISB /* Find the delta between VA and PA */ From owner-svn-src-all@freebsd.org Tue Nov 10 12:02:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B23EA2A04E; Tue, 10 Nov 2015 12:02:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 517D11B3C; Tue, 10 Nov 2015 12:02:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAC2hxg019540; Tue, 10 Nov 2015 12:02:43 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAC2fZG019525; Tue, 10 Nov 2015 12:02:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201511101202.tAAC2fZG019525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 10 Nov 2015 12:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290648 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:02:44 -0000 Author: mmel Date: Tue Nov 10 12:02:41 2015 New Revision: 290648 URL: https://svnweb.freebsd.org/changeset/base/290648 Log: ARM: Remove trailing whitespace from sys/arm/include No functional changes. Approved by: kib (mentor) Modified: head/sys/arm/include/_stdint.h head/sys/arm/include/armreg.h head/sys/arm/include/asm.h head/sys/arm/include/atags.h head/sys/arm/include/atomic-v4.h head/sys/arm/include/board.h head/sys/arm/include/bus.h head/sys/arm/include/cpufunc.h head/sys/arm/include/devmap.h head/sys/arm/include/disassem.h head/sys/arm/include/endian.h head/sys/arm/include/pcb.h head/sys/arm/include/pcpu.h head/sys/arm/include/physmem.h head/sys/arm/include/pl310.h Modified: head/sys/arm/include/_stdint.h ============================================================================== --- head/sys/arm/include/_stdint.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/_stdint.h Tue Nov 10 12:02:41 2015 (r290648) @@ -139,7 +139,7 @@ * 7.18.3 Limits of other integer types */ /* Limits of ptrdiff_t. */ -#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MIN INT32_MIN #define PTRDIFF_MAX INT32_MAX /* Limits of sig_atomic_t. */ Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/armreg.h Tue Nov 10 12:02:41 2015 (r290648) @@ -285,7 +285,7 @@ * in r0 steppings. See errata * 364296. */ -/* ARM1176 Auxiliary Control Register (CP15 register 1, opcode2 1) */ +/* ARM1176 Auxiliary Control Register (CP15 register 1, opcode2 1) */ #define ARM1176_AUXCTL_PHD 0x10000000 /* inst. prefetch halting disable */ #define ARM1176_AUXCTL_BFD 0x20000000 /* branch folding disable */ #define ARM1176_AUXCTL_FSD 0x40000000 /* force speculative ops disable */ Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/asm.h Tue Nov 10 12:02:41 2015 (r290648) @@ -167,7 +167,7 @@ #else #define __FBSDID(s) /* nothing */ #endif - + #define WEAK_ALIAS(alias,sym) \ .weak alias; \ Modified: head/sys/arm/include/atags.h ============================================================================== --- head/sys/arm/include/atags.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/atags.h Tue Nov 10 12:02:41 2015 (r290648) @@ -64,7 +64,7 @@ struct arm_lbabi_core uint32_t pagesize; uint32_t rootdev; }; - + /* * ATAG_MEM data -- Can be more than one to describe different * banks. @@ -75,7 +75,7 @@ struct arm_lbabi_mem32 uint32_t start; /* start of physical memory */ }; -/* +/* * ATAG_INITRD2 - Compressed ramdisk image details */ struct arm_lbabi_initrd @@ -92,7 +92,7 @@ struct arm_lbabi_serial_number uint32_t low; uint32_t high; }; - + /* * ATAG_REVISION - board revision */ @@ -100,7 +100,7 @@ struct arm_lbabi_revision { uint32_t rev; }; - + /* * ATAG_CMDLINE - Command line from uboot */ @@ -109,7 +109,7 @@ struct arm_lbabi_command_line char command[1]; /* Minimum command length */ }; -struct arm_lbabi_tag +struct arm_lbabi_tag { struct arm_lbabi_header tag_hdr; union { Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/atomic-v4.h Tue Nov 10 12:02:41 2015 (r290648) @@ -116,7 +116,7 @@ static __inline u_int32_t atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int ret; - + __with_interrupts_disabled( { if (*p == cmpval) { @@ -133,7 +133,7 @@ static __inline u_int64_t atomic_cmpset_64(volatile u_int64_t *p, volatile u_int64_t cmpval, volatile u_int64_t newval) { int ret; - + __with_interrupts_disabled( { if (*p == cmpval) { Modified: head/sys/arm/include/board.h ============================================================================== --- head/sys/arm/include/board.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/board.h Tue Nov 10 12:02:41 2015 (r290648) @@ -37,7 +37,7 @@ struct arm_board { const char *board_name; /* Human readable name */ arm_board_init_fn *board_init; /* Board initialize code */ }; - + #if defined(ARM_MANY_BOARD) #include "board_id.h" Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/bus.h Tue Nov 10 12:02:41 2015 (r290648) @@ -128,7 +128,7 @@ struct bus_space { 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) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint8_t *, bus_size_t); @@ -138,7 +138,7 @@ struct bus_space { 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, the less commonly used functions. */ void (*bs_w_2) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint16_t); @@ -154,7 +154,7 @@ struct bus_space { 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) (bus_space_tag_t, bus_space_handle_t, bus_size_t, const uint8_t *, bus_size_t); @@ -210,7 +210,7 @@ struct bus_space { 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) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint8_t *, bus_size_t); @@ -220,7 +220,7 @@ struct bus_space { 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) (bus_space_tag_t, bus_space_handle_t, bus_size_t, uint8_t); @@ -240,7 +240,7 @@ struct bus_space { 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) (bus_space_tag_t, bus_space_handle_t, bus_size_t, const uint8_t *, bus_size_t); @@ -335,10 +335,10 @@ __generate_inline_bs_rs(bus_space_read_2 __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); +__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. @@ -392,10 +392,10 @@ __generate_inline_bs_ws(bus_space_write_ __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); +__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); /* @@ -581,7 +581,7 @@ void __bs_c(f,_bs_rm_2) (bus_space_tag_t #define bs_rm_4_proto(f) \ 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); + bus_size_t offset, uint32_t *addr, bus_size_t count); #define bs_rm_8_proto(f) \ void __bs_c(f,_bs_rm_8) (bus_space_tag_t t, bus_space_handle_t bsh, \ Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/cpufunc.h Tue Nov 10 12:02:41 2015 (r290648) @@ -59,7 +59,7 @@ breakpoint(void) struct cpu_functions { /* CPU functions */ - + u_int (*cf_id) (void); void (*cf_cpwait) (void); @@ -73,12 +73,12 @@ struct cpu_functions { /* TLB functions */ - void (*cf_tlb_flushID) (void); - void (*cf_tlb_flushID_SE) (u_int va); + void (*cf_tlb_flushID) (void); + void (*cf_tlb_flushID_SE) (u_int va); void (*cf_tlb_flushI) (void); - void (*cf_tlb_flushI_SE) (u_int va); + void (*cf_tlb_flushI_SE) (u_int va); void (*cf_tlb_flushD) (void); - void (*cf_tlb_flushD_SE) (u_int va); + void (*cf_tlb_flushD_SE) (u_int va); /* * Cache operations: @@ -109,7 +109,7 @@ struct cpu_functions { * It is used to intialize the MMU when it is in an unknown * state (such as when it may have lines tagged as valid * that belong to a previous set of mappings). - * + * * I-cache Synch (all or range): * The goal is to synchronize the instruction stream, * so you may beed to write-back dirty D-cache blocks Modified: head/sys/arm/include/devmap.h ============================================================================== --- head/sys/arm/include/devmap.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/devmap.h Tue Nov 10 12:02:41 2015 (r290648) @@ -70,7 +70,7 @@ void arm_devmap_register_table(const str * custom initarm() routines in older code. If the table pointer is NULL, this * will use the table installed previously by arm_devmap_register_table(). */ -void arm_devmap_bootstrap(vm_offset_t _l1pt, +void arm_devmap_bootstrap(vm_offset_t _l1pt, const struct arm_devmap_entry *_table); /* Modified: head/sys/arm/include/disassem.h ============================================================================== --- head/sys/arm/include/disassem.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/disassem.h Tue Nov 10 12:02:41 2015 (r290648) @@ -42,7 +42,7 @@ #define _MACHINE_DISASSEM_H_ typedef struct { u_int (*di_readword)(u_int); - void (*di_printaddr)(u_int); + void (*di_printaddr)(u_int); int (*di_printf)(const char *, ...) __printflike(1, 2); } disasm_interface_t; Modified: head/sys/arm/include/endian.h ============================================================================== --- head/sys/arm/include/endian.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/endian.h Tue Nov 10 12:02:41 2015 (r290648) @@ -92,7 +92,7 @@ __bswap32_var(__uint32_t v) "mov %0, %0, ror #8\n" "eor %0, %0, %1, lsr #8\n" : "+r" (v), "=r" (t1)); - + return (v); } @@ -106,9 +106,9 @@ __bswap16_var(__uint16_t v) "orr %0, %0, %0, lsr #16\n" "bic %0, %0, %0, lsl #16" : "+r" (ret)); - + return ((__uint16_t)ret); -} +} #ifdef __OPTIMIZE__ Modified: head/sys/arm/include/pcb.h ============================================================================== --- head/sys/arm/include/pcb.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/pcb.h Tue Nov 10 12:02:41 2015 (r290648) @@ -62,7 +62,7 @@ struct pcb { #endif struct vfp_state pcb_vfpstate; /* VP/NEON state */ u_int pcb_vfpcpu; /* VP/NEON last cpu */ -} __aligned(8); /* +} __aligned(8); /* * We need the PCB to be aligned on 8 bytes, as we may * access it using ldrd/strd, and ARM ABI require it * to by aligned on 8 bytes. Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/pcpu.h Tue Nov 10 12:02:41 2015 (r290648) @@ -76,7 +76,7 @@ extern struct pcpu *pcpup; (pcpup + (id & CPU_MASK)); \ }) #endif - + static inline struct thread * get_curthread(void) { Modified: head/sys/arm/include/physmem.h ============================================================================== --- head/sys/arm/include/physmem.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/physmem.h Tue Nov 10 12:02:41 2015 (r290648) @@ -65,7 +65,7 @@ void arm_physmem_print_tables(void); #include -static inline void +static inline void arm_physmem_hardware_regions(struct mem_region * mrptr, int mrcount) { while (mrcount--) { @@ -75,11 +75,11 @@ arm_physmem_hardware_regions(struct mem_ } static inline void -arm_physmem_exclude_regions(struct mem_region * mrptr, int mrcount, +arm_physmem_exclude_regions(struct mem_region * mrptr, int mrcount, uint32_t exflags) { while (mrcount--) { - arm_physmem_exclude_region(mrptr->mr_start, mrptr->mr_size, + arm_physmem_exclude_region(mrptr->mr_start, mrptr->mr_size, exflags); ++mrptr; } Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue Nov 10 11:45:41 2015 (r290647) +++ head/sys/arm/include/pl310.h Tue Nov 10 12:02:41 2015 (r290648) @@ -155,7 +155,7 @@ struct pl310_softc { * pl310_write4 - write a 32-bit value from the PL310 registers * @off: byte offset within the register set to read from * @val: the value to write into the register - * + * * * LOCKING: * None From owner-svn-src-all@freebsd.org Tue Nov 10 12:15:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 972C6A2A787; Tue, 10 Nov 2015 12:15:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EDB017FD; Tue, 10 Nov 2015 12:15:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAACFDq3022534; Tue, 10 Nov 2015 12:15:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAACFD2E022533; Tue, 10 Nov 2015 12:15:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201511101215.tAACFD2E022533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Nov 2015 12:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290649 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:15:14 -0000 Author: kib Date: Tue Nov 10 12:15:13 2015 New Revision: 290649 URL: https://svnweb.freebsd.org/changeset/base/290649 Log: Implement atomic_testandset_{32,int,long,64} for ARMv6. Only little-endian configuration for 64-bit variant is supported. Reviewed by: mmel Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4113 Modified: head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Tue Nov 10 12:02:41 2015 (r290648) +++ head/sys/arm/include/atomic-v6.h Tue Nov 10 12:15:13 2015 (r290649) @@ -593,6 +593,54 @@ atomic_store_rel_long(volatile u_long *p *p = v; } +static __inline int +atomic_testandset_32(volatile uint32_t *p, u_int v) +{ + uint32_t tmp, tmp2, res, mask; + + mask = 1u << (v & 0x1f); + tmp = tmp2 = 0; + __asm __volatile( + "1: ldrex %0, [%4] \n" + " orr %1, %0, %3 \n" + " strex %2, %1, [%4] \n" + " cmp %2, #0 \n" + " it ne \n" + " bne 1b \n" + : "=&r" (res), "=&r" (tmp), "=&r" (tmp2) + : "r" (mask), "r" (p) + : "cc", "memory"); + return ((res & mask) != 0); +} + +static __inline int +atomic_testandset_int(volatile u_int *p, u_int v) +{ + + return (atomic_testandset_32((volatile uint32_t *)p, v)); +} + +static __inline int +atomic_testandset_long(volatile u_long *p, u_int v) +{ + + return (atomic_testandset_32((volatile uint32_t *)p, v)); +} + +static __inline int +atomic_testandset_64(volatile uint64_t *p, u_int v) +{ + volatile uint32_t *p32; + + p32 = (volatile uint32_t *)p; + /* Assume little-endian */ + if (v >= 32) { + v &= 0x1f; + p32++; + } + return (atomic_testandset_32(p32, v)); +} + #undef ATOMIC_ACQ_REL #undef ATOMIC_ACQ_REL_LONG From owner-svn-src-all@freebsd.org Tue Nov 10 12:20:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C600A2A9B2; Tue, 10 Nov 2015 12:20:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B82121B63; Tue, 10 Nov 2015 12:20:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAACKMWd022741; Tue, 10 Nov 2015 12:20:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAACKMpn022738; Tue, 10 Nov 2015 12:20:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511101220.tAACKMpn022738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2015 12:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290650 - in head/sys: dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 modules/mlx5en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:20:24 -0000 Author: hselasky Date: Tue Nov 10 12:20:22 2015 New Revision: 290650 URL: https://svnweb.freebsd.org/changeset/base/290650 Log: Add mlx5 and mlx5en driver(s) for ConnectX-4 and ConnectX-4LX cards from Mellanox Technologies. The current driver supports ethernet speeds up to and including 100 GBit/s. Infiniband support will be done later. The code added is not compiled by default, which will be done by a separate commit. Sponsored by: Mellanox Technologies MFC after: 2 weeks Added: head/sys/dev/mlx5/ head/sys/dev/mlx5/cq.h (contents, props changed) head/sys/dev/mlx5/device.h (contents, props changed) head/sys/dev/mlx5/doorbell.h (contents, props changed) head/sys/dev/mlx5/driver.h (contents, props changed) head/sys/dev/mlx5/flow_table.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/ head/sys/dev/mlx5/mlx5_core/mlx5_alloc.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_core.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_cq.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_eq.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_fw.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_health.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_mad.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_main.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_mcg.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_mr.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_pd.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_port.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_qp.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_srq.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_uar.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_vport.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_wq.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/transobj.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/wq.h (contents, props changed) head/sys/dev/mlx5/mlx5_en/ head/sys/dev/mlx5/mlx5_en/en.h (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/tcp_tlro.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/tcp_tlro.h (contents, props changed) head/sys/dev/mlx5/mlx5_ifc.h (contents, props changed) head/sys/dev/mlx5/mlx5_rdma_if.h (contents, props changed) head/sys/dev/mlx5/qp.h (contents, props changed) head/sys/dev/mlx5/srq.h (contents, props changed) head/sys/dev/mlx5/vport.h (contents, props changed) head/sys/modules/mlx5/ head/sys/modules/mlx5/Makefile (contents, props changed) head/sys/modules/mlx5en/ head/sys/modules/mlx5en/Makefile (contents, props changed) Added: head/sys/dev/mlx5/cq.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/cq.h Tue Nov 10 12:20:22 2015 (r290650) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 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 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 MLX5_CORE_CQ_H +#define MLX5_CORE_CQ_H + +#include +#include +#include + + +struct mlx5_core_cq { + u32 cqn; + int cqe_sz; + __be32 *set_ci_db; + __be32 *arm_db; + atomic_t refcount; + struct completion free; + unsigned vector; + int irqn; + void (*comp) (struct mlx5_core_cq *); + void (*event) (struct mlx5_core_cq *, int); + struct mlx5_uar *uar; + u32 cons_index; + unsigned arm_sn; + struct mlx5_rsc_debug *dbg; + int pid; +}; + + +enum { + MLX5_CQE_SYNDROME_LOCAL_LENGTH_ERR = 0x01, + MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR = 0x02, + MLX5_CQE_SYNDROME_LOCAL_PROT_ERR = 0x04, + MLX5_CQE_SYNDROME_WR_FLUSH_ERR = 0x05, + MLX5_CQE_SYNDROME_MW_BIND_ERR = 0x06, + MLX5_CQE_SYNDROME_BAD_RESP_ERR = 0x10, + MLX5_CQE_SYNDROME_LOCAL_ACCESS_ERR = 0x11, + MLX5_CQE_SYNDROME_REMOTE_INVAL_REQ_ERR = 0x12, + MLX5_CQE_SYNDROME_REMOTE_ACCESS_ERR = 0x13, + MLX5_CQE_SYNDROME_REMOTE_OP_ERR = 0x14, + MLX5_CQE_SYNDROME_TRANSPORT_RETRY_EXC_ERR = 0x15, + MLX5_CQE_SYNDROME_RNR_RETRY_EXC_ERR = 0x16, + MLX5_CQE_SYNDROME_REMOTE_ABORTED_ERR = 0x22, +}; + +enum { + MLX5_CQE_OWNER_MASK = 1, + MLX5_CQE_REQ = 0, + MLX5_CQE_RESP_WR_IMM = 1, + MLX5_CQE_RESP_SEND = 2, + MLX5_CQE_RESP_SEND_IMM = 3, + MLX5_CQE_RESP_SEND_INV = 4, + MLX5_CQE_RESIZE_CQ = 5, + MLX5_CQE_SIG_ERR = 12, + MLX5_CQE_REQ_ERR = 13, + MLX5_CQE_RESP_ERR = 14, + MLX5_CQE_INVALID = 15, +}; + +enum { + MLX5_CQ_MODIFY_PERIOD = 1 << 0, + MLX5_CQ_MODIFY_COUNT = 1 << 1, + MLX5_CQ_MODIFY_OVERRUN = 1 << 2, +}; + +enum { + MLX5_CQ_OPMOD_RESIZE = 1, + MLX5_MODIFY_CQ_MASK_LOG_SIZE = 1 << 0, + MLX5_MODIFY_CQ_MASK_PG_OFFSET = 1 << 1, + MLX5_MODIFY_CQ_MASK_PG_SIZE = 1 << 2, +}; + +struct mlx5_cq_modify_params { + int type; + union { + struct { + u32 page_offset; + u8 log_cq_size; + } resize; + + struct { + } moder; + + struct { + } mapping; + } params; +}; + +static inline int cqe_sz_to_mlx_sz(u8 size) +{ + return size == 64 ? CQE_SIZE_64 : CQE_SIZE_128; +} + +static inline void mlx5_cq_set_ci(struct mlx5_core_cq *cq) +{ + *cq->set_ci_db = cpu_to_be32(cq->cons_index & 0xffffff); +} + +enum { + MLX5_CQ_DB_REQ_NOT_SOL = 1 << 24, + MLX5_CQ_DB_REQ_NOT = 0 << 24 +}; + +static inline void mlx5_cq_arm(struct mlx5_core_cq *cq, u32 cmd, + void __iomem *uar_page, + spinlock_t *doorbell_lock, + u32 cons_index) +{ + __be32 doorbell[2]; + u32 sn; + u32 ci; + + sn = cq->arm_sn & 3; + ci = cons_index & 0xffffff; + + *cq->arm_db = cpu_to_be32(sn << 28 | cmd | ci); + + /* Make sure that the doorbell record in host memory is + * written before ringing the doorbell via PCI MMIO. + */ + wmb(); + + doorbell[0] = cpu_to_be32(sn << 28 | cmd | ci); + doorbell[1] = cpu_to_be32(cq->cqn); + + mlx5_write64(doorbell, uar_page + MLX5_CQ_DOORBELL, doorbell_lock); +} + +int mlx5_init_cq_table(struct mlx5_core_dev *dev); +void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev); +int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, + struct mlx5_create_cq_mbox_in *in, int inlen); +int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); +int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, + struct mlx5_query_cq_mbox_out *out); +int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, + struct mlx5_modify_cq_mbox_in *in, int in_sz); +int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, u16 cq_period, + u16 cq_max_count); +int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); +void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); + +#endif /* MLX5_CORE_CQ_H */ Added: head/sys/dev/mlx5/device.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/device.h Tue Nov 10 12:20:22 2015 (r290650) @@ -0,0 +1,1187 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 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 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 MLX5_DEVICE_H +#define MLX5_DEVICE_H + +#include +#include +#include + +#define FW_INIT_TIMEOUT_MILI 2000 +#define FW_INIT_WAIT_MS 2 + +#if defined(__LITTLE_ENDIAN) +#define MLX5_SET_HOST_ENDIANNESS 0 +#elif defined(__BIG_ENDIAN) +#define MLX5_SET_HOST_ENDIANNESS 0x80 +#else +#error Host endianness not defined +#endif + +/* helper macros */ +#define __mlx5_nullp(typ) ((struct mlx5_ifc_##typ##_bits *)0) +#define __mlx5_bit_sz(typ, fld) sizeof(__mlx5_nullp(typ)->fld) +#define __mlx5_bit_off(typ, fld) __offsetof(struct mlx5_ifc_##typ##_bits, fld) +#define __mlx5_dw_off(typ, fld) (__mlx5_bit_off(typ, fld) / 32) +#define __mlx5_64_off(typ, fld) (__mlx5_bit_off(typ, fld) / 64) +#define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - (__mlx5_bit_off(typ, fld) & 0x1f)) +#define __mlx5_mask(typ, fld) ((u32)((1ull << __mlx5_bit_sz(typ, fld)) - 1)) +#define __mlx5_dw_mask(typ, fld) (__mlx5_mask(typ, fld) << __mlx5_dw_bit_off(typ, fld)) +#define __mlx5_st_sz_bits(typ) sizeof(struct mlx5_ifc_##typ##_bits) + +#define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8) +#define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) +#define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) +#define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8) +#define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32) +#define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) +#define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld)) + +/* insert a value to a struct */ +#define MLX5_SET(typ, p, fld, v) do { \ + BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \ + BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) > 32); \ + *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \ + cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \ + (~__mlx5_dw_mask(typ, fld))) | (((v) & __mlx5_mask(typ, fld)) \ + << __mlx5_dw_bit_off(typ, fld))); \ +} while (0) + +#define MLX5_SET_TO_ONES(typ, p, fld) do { \ + BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \ + BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) > 32); \ + *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \ + cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \ + (~__mlx5_dw_mask(typ, fld))) | ((__mlx5_mask(typ, fld)) \ + << __mlx5_dw_bit_off(typ, fld))); \ +} while (0) + +#define MLX5_GET(typ, p, fld) ((be32_to_cpu(*((__be32 *)(p) +\ +__mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \ +__mlx5_mask(typ, fld)) + +#define MLX5_GET_PR(typ, p, fld) ({ \ + u32 ___t = MLX5_GET(typ, p, fld); \ + pr_debug(#fld " = 0x%x\n", ___t); \ + ___t; \ +}) + +#define MLX5_SET64(typ, p, fld, v) do { \ + BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) != 64); \ + BUILD_BUG_ON(__mlx5_bit_off(typ, fld) % 64); \ + *((__be64 *)(p) + __mlx5_64_off(typ, fld)) = cpu_to_be64(v); \ +} while (0) + +#define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + __mlx5_64_off(typ, fld))) + +enum { + MLX5_MAX_COMMANDS = 32, + MLX5_CMD_DATA_BLOCK_SIZE = 512, + MLX5_PCI_CMD_XPORT = 7, + MLX5_MKEY_BSF_OCTO_SIZE = 4, + MLX5_MAX_PSVS = 4, +}; + +enum { + MLX5_EXTENDED_UD_AV = 0x80000000, +}; + +enum { + MLX5_STAT_RATE_OFFSET = 5, +}; + +enum { + MLX5_INLINE_SEG = 0x80000000, +}; + +enum { + MLX5_HW_START_PADDING = MLX5_INLINE_SEG, +}; + +enum { + MLX5_MIN_PKEY_TABLE_SIZE = 128, + MLX5_MAX_LOG_PKEY_TABLE = 5, +}; + +enum { + MLX5_PERM_LOCAL_READ = 1 << 2, + MLX5_PERM_LOCAL_WRITE = 1 << 3, + MLX5_PERM_REMOTE_READ = 1 << 4, + MLX5_PERM_REMOTE_WRITE = 1 << 5, + MLX5_PERM_ATOMIC = 1 << 6, + MLX5_PERM_UMR_EN = 1 << 7, +}; + +enum { + MLX5_PCIE_CTRL_SMALL_FENCE = 1 << 0, + MLX5_PCIE_CTRL_RELAXED_ORDERING = 1 << 2, + MLX5_PCIE_CTRL_NO_SNOOP = 1 << 3, + MLX5_PCIE_CTRL_TLP_PROCE_EN = 1 << 6, + MLX5_PCIE_CTRL_TPH_MASK = 3 << 4, +}; + +enum { + MLX5_MKEY_REMOTE_INVAL = 1 << 24, + MLX5_MKEY_FLAG_SYNC_UMR = 1 << 29, + MLX5_MKEY_BSF_EN = 1 << 30, + MLX5_MKEY_LEN64 = 1 << 31, +}; + +enum { + MLX5_EN_RD = (u64)1, + MLX5_EN_WR = (u64)2 +}; + +enum { + MLX5_BF_REGS_PER_PAGE = 4, + MLX5_MAX_UAR_PAGES = 1 << 8, + MLX5_NON_FP_BF_REGS_PER_PAGE = 2, + MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE, +}; + +enum { + MLX5_MKEY_MASK_LEN = 1ull << 0, + MLX5_MKEY_MASK_PAGE_SIZE = 1ull << 1, + MLX5_MKEY_MASK_START_ADDR = 1ull << 6, + MLX5_MKEY_MASK_PD = 1ull << 7, + MLX5_MKEY_MASK_EN_RINVAL = 1ull << 8, + MLX5_MKEY_MASK_EN_SIGERR = 1ull << 9, + MLX5_MKEY_MASK_BSF_EN = 1ull << 12, + MLX5_MKEY_MASK_KEY = 1ull << 13, + MLX5_MKEY_MASK_QPN = 1ull << 14, + MLX5_MKEY_MASK_LR = 1ull << 17, + MLX5_MKEY_MASK_LW = 1ull << 18, + MLX5_MKEY_MASK_RR = 1ull << 19, + MLX5_MKEY_MASK_RW = 1ull << 20, + MLX5_MKEY_MASK_A = 1ull << 21, + MLX5_MKEY_MASK_SMALL_FENCE = 1ull << 23, + MLX5_MKEY_MASK_FREE = 1ull << 29, +}; + +enum { + MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1, + MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4, + MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5, + MLX5_PORT_CHANGE_SUBTYPE_LID = 6, + MLX5_PORT_CHANGE_SUBTYPE_PKEY = 7, + MLX5_PORT_CHANGE_SUBTYPE_GUID = 8, + MLX5_PORT_CHANGE_SUBTYPE_CLIENT_REREG = 9, +}; + +enum { + MLX5_DEV_CAP_FLAG_XRC = 1LL << 3, + MLX5_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, + MLX5_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9, + MLX5_DEV_CAP_FLAG_APM = 1LL << 17, + MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, + MLX5_DEV_CAP_FLAG_SCQE_BRK_MOD = 1LL << 21, + MLX5_DEV_CAP_FLAG_BLOCK_MCAST = 1LL << 23, + MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29, + MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30, + MLX5_DEV_CAP_FLAG_ROCE = 1LL << 34, + MLX5_DEV_CAP_FLAG_DCT = 1LL << 37, + MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, + MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46, +}; + +enum { + MLX5_ROCE_VERSION_1 = 0, + MLX5_ROCE_VERSION_1_5 = 1, + MLX5_ROCE_VERSION_2 = 2, +}; + +enum { + MLX5_ROCE_VERSION_1_CAP = 1 << MLX5_ROCE_VERSION_1, + MLX5_ROCE_VERSION_1_5_CAP = 1 << MLX5_ROCE_VERSION_1_5, + MLX5_ROCE_VERSION_2_CAP = 1 << MLX5_ROCE_VERSION_2, +}; + +enum { + MLX5_ROCE_L3_TYPE_IPV4 = 0, + MLX5_ROCE_L3_TYPE_IPV6 = 1, +}; + +enum { + MLX5_ROCE_L3_TYPE_IPV4_CAP = 1 << 1, + MLX5_ROCE_L3_TYPE_IPV6_CAP = 1 << 2, +}; + +enum { + MLX5_OPCODE_NOP = 0x00, + MLX5_OPCODE_SEND_INVAL = 0x01, + MLX5_OPCODE_RDMA_WRITE = 0x08, + MLX5_OPCODE_RDMA_WRITE_IMM = 0x09, + MLX5_OPCODE_SEND = 0x0a, + MLX5_OPCODE_SEND_IMM = 0x0b, + MLX5_OPCODE_LSO = 0x0e, + MLX5_OPCODE_RDMA_READ = 0x10, + MLX5_OPCODE_ATOMIC_CS = 0x11, + MLX5_OPCODE_ATOMIC_FA = 0x12, + MLX5_OPCODE_ATOMIC_MASKED_CS = 0x14, + MLX5_OPCODE_ATOMIC_MASKED_FA = 0x15, + MLX5_OPCODE_BIND_MW = 0x18, + MLX5_OPCODE_CONFIG_CMD = 0x1f, + + MLX5_RECV_OPCODE_RDMA_WRITE_IMM = 0x00, + MLX5_RECV_OPCODE_SEND = 0x01, + MLX5_RECV_OPCODE_SEND_IMM = 0x02, + MLX5_RECV_OPCODE_SEND_INVAL = 0x03, + + MLX5_CQE_OPCODE_ERROR = 0x1e, + MLX5_CQE_OPCODE_RESIZE = 0x16, + + MLX5_OPCODE_SET_PSV = 0x20, + MLX5_OPCODE_GET_PSV = 0x21, + MLX5_OPCODE_CHECK_PSV = 0x22, + MLX5_OPCODE_RGET_PSV = 0x26, + MLX5_OPCODE_RCHECK_PSV = 0x27, + + MLX5_OPCODE_UMR = 0x25, + +}; + +enum { + MLX5_SET_PORT_RESET_QKEY = 0, + MLX5_SET_PORT_GUID0 = 16, + MLX5_SET_PORT_NODE_GUID = 17, + MLX5_SET_PORT_SYS_GUID = 18, + MLX5_SET_PORT_GID_TABLE = 19, + MLX5_SET_PORT_PKEY_TABLE = 20, +}; + +enum { + MLX5_MAX_PAGE_SHIFT = 31 +}; + +enum { + MLX5_ADAPTER_PAGE_SHIFT = 12, + MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT, +}; + +enum { + MLX5_CAP_OFF_CMDIF_CSUM = 46, +}; + +struct mlx5_inbox_hdr { + __be16 opcode; + u8 rsvd[4]; + __be16 opmod; +}; + +struct mlx5_outbox_hdr { + u8 status; + u8 rsvd[3]; + __be32 syndrome; +}; + +struct mlx5_cmd_layout { + u8 type; + u8 rsvd0[3]; + __be32 inlen; + __be64 in_ptr; + __be32 in[4]; + __be32 out[4]; + __be64 out_ptr; + __be32 outlen; + u8 token; + u8 sig; + u8 rsvd1; + u8 status_own; +}; + + +struct mlx5_health_buffer { + __be32 assert_var[5]; + __be32 rsvd0[3]; + __be32 assert_exit_ptr; + __be32 assert_callra; + __be32 rsvd1[2]; + __be32 fw_ver; + __be32 hw_id; + __be32 rsvd2; + u8 irisc_index; + u8 synd; + __be16 ext_sync; +}; + +struct mlx5_init_seg { + __be32 fw_rev; + __be32 cmdif_rev_fw_sub; + __be32 rsvd0[2]; + __be32 cmdq_addr_h; + __be32 cmdq_addr_l_sz; + __be32 cmd_dbell; + __be32 rsvd1[120]; + __be32 initializing; + struct mlx5_health_buffer health; + __be32 rsvd2[884]; + __be32 health_counter; + __be32 rsvd3[1019]; + __be64 ieee1588_clk; + __be32 ieee1588_clk_type; + __be32 clr_intx; +}; + +struct mlx5_eqe_comp { + __be32 reserved[6]; + __be32 cqn; +}; + +struct mlx5_eqe_qp_srq { + __be32 reserved[6]; + __be32 qp_srq_n; +}; + +struct mlx5_eqe_cq_err { + __be32 cqn; + u8 reserved1[7]; + u8 syndrome; +}; + +struct mlx5_eqe_port_state { + u8 reserved0[8]; + u8 port; +}; + +struct mlx5_eqe_gpio { + __be32 reserved0[2]; + __be64 gpio_event; +}; + +struct mlx5_eqe_congestion { + u8 type; + u8 rsvd0; + u8 congestion_level; +}; + +struct mlx5_eqe_stall_vl { + u8 rsvd0[3]; + u8 port_vl; +}; + +struct mlx5_eqe_cmd { + __be32 vector; + __be32 rsvd[6]; +}; + +struct mlx5_eqe_page_req { + u8 rsvd0[2]; + __be16 func_id; + __be32 num_pages; + __be32 rsvd1[5]; +}; + +struct mlx5_eqe_vport_change { + u8 rsvd0[2]; + __be16 vport_num; + __be32 rsvd1[6]; +}; + + +#define PORT_MODULE_EVENT_MODULE_STATUS_MASK 0xF +#define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF + +enum { + MLX5_MODULE_STATUS_PLUGGED = 0x1, + MLX5_MODULE_STATUS_UNPLUGGED = 0x2, + MLX5_MODULE_STATUS_ERROR = 0x3, +}; + +enum { + MLX5_MODULE_EVENT_ERROR_POWER_BUDGET_EXCEEDED = 0x0, + MLX5_MODULE_EVENT_ERROR_LONG_RANGE_FOR_NON_MLNX_CABLE_MODULE = 0x1, + MLX5_MODULE_EVENT_ERROR_BUS_STUCK = 0x2, + MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT = 0x3, + MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4, + MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5, + MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, +}; + +struct mlx5_eqe_port_module_event { + u8 rsvd0; + u8 module; + u8 rsvd1; + u8 module_status; + u8 rsvd2[2]; + u8 error_type; +}; + +union ev_data { + __be32 raw[7]; + struct mlx5_eqe_cmd cmd; + struct mlx5_eqe_comp comp; + struct mlx5_eqe_qp_srq qp_srq; + struct mlx5_eqe_cq_err cq_err; + struct mlx5_eqe_port_state port; + struct mlx5_eqe_gpio gpio; + struct mlx5_eqe_congestion cong; + struct mlx5_eqe_stall_vl stall_vl; + struct mlx5_eqe_page_req req_pages; + struct mlx5_eqe_port_module_event port_module_event; + struct mlx5_eqe_vport_change vport_change; +} __packed; + +struct mlx5_eqe { + u8 rsvd0; + u8 type; + u8 rsvd1; + u8 sub_type; + __be32 rsvd2[7]; + union ev_data data; + __be16 rsvd3; + u8 signature; + u8 owner; +} __packed; + +struct mlx5_cmd_prot_block { + u8 data[MLX5_CMD_DATA_BLOCK_SIZE]; + u8 rsvd0[48]; + __be64 next; + __be32 block_num; + u8 rsvd1; + u8 token; + u8 ctrl_sig; + u8 sig; +}; + +enum { + MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5, +}; + +struct mlx5_err_cqe { + u8 rsvd0[32]; + __be32 srqn; + u8 rsvd1[18]; + u8 vendor_err_synd; + u8 syndrome; + __be32 s_wqe_opcode_qpn; + __be16 wqe_counter; + u8 signature; + u8 op_own; +}; + +struct mlx5_cqe64 { + u8 tunneled_etc; + u8 rsvd0[3]; + u8 lro_tcppsh_abort_dupack; + u8 lro_min_ttl; + __be16 lro_tcp_win; + __be32 lro_ack_seq_num; + __be32 rss_hash_result; + u8 rss_hash_type; + u8 ml_path; + u8 rsvd20[2]; + __be16 check_sum; + __be16 slid; + __be32 flags_rqpn; + u8 hds_ip_ext; + u8 l4_hdr_type_etc; + __be16 vlan_info; + __be32 srqn; /* [31:24]: lro_num_seg, [23:0]: srqn */ + __be32 imm_inval_pkey; + u8 rsvd40[4]; + __be32 byte_cnt; + __be64 timestamp; + __be32 sop_drop_qpn; + __be16 wqe_counter; + u8 signature; + u8 op_own; +}; + +static inline bool get_cqe_lro_timestamp_valid(struct mlx5_cqe64 *cqe) +{ + return (cqe->lro_tcppsh_abort_dupack >> 7) & 1; +} + +static inline bool get_cqe_lro_tcppsh(struct mlx5_cqe64 *cqe) +{ + return (cqe->lro_tcppsh_abort_dupack >> 6) & 1; +} + +static inline u8 get_cqe_l4_hdr_type(struct mlx5_cqe64 *cqe) +{ + return (cqe->l4_hdr_type_etc >> 4) & 0x7; +} + +static inline u16 get_cqe_vlan(struct mlx5_cqe64 *cqe) +{ + return be16_to_cpu(cqe->vlan_info) & 0xfff; +} + +static inline void get_cqe_smac(struct mlx5_cqe64 *cqe, u8 *smac) +{ + memcpy(smac, &cqe->rss_hash_type , 4); + memcpy(smac + 4, &cqe->slid , 2); +} + +static inline bool cqe_has_vlan(struct mlx5_cqe64 *cqe) +{ + return cqe->l4_hdr_type_etc & 0x1; +} + +static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe) +{ + return cqe->tunneled_etc & 0x1; +} + +enum { + CQE_L4_HDR_TYPE_NONE = 0x0, + CQE_L4_HDR_TYPE_TCP_NO_ACK = 0x1, + CQE_L4_HDR_TYPE_UDP = 0x2, + CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA = 0x3, + CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA = 0x4, +}; + +enum { + /* source L3 hash types */ + CQE_RSS_SRC_HTYPE_IP = 0x3 << 0, + CQE_RSS_SRC_HTYPE_IPV4 = 0x1 << 0, + CQE_RSS_SRC_HTYPE_IPV6 = 0x2 << 0, + + /* destination L3 hash types */ + CQE_RSS_DST_HTYPE_IP = 0x3 << 2, + CQE_RSS_DST_HTYPE_IPV4 = 0x1 << 2, + CQE_RSS_DST_HTYPE_IPV6 = 0x2 << 2, + + /* source L4 hash types */ + CQE_RSS_SRC_HTYPE_L4 = 0x3 << 4, + CQE_RSS_SRC_HTYPE_TCP = 0x1 << 4, + CQE_RSS_SRC_HTYPE_UDP = 0x2 << 4, + CQE_RSS_SRC_HTYPE_IPSEC = 0x3 << 4, + + /* destination L4 hash types */ + CQE_RSS_DST_HTYPE_L4 = 0x3 << 6, + CQE_RSS_DST_HTYPE_TCP = 0x1 << 6, + CQE_RSS_DST_HTYPE_UDP = 0x2 << 6, + CQE_RSS_DST_HTYPE_IPSEC = 0x3 << 6, +}; + +enum { + CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0, + CQE_ROCE_L3_HEADER_TYPE_IPV6 = 0x1, + CQE_ROCE_L3_HEADER_TYPE_IPV4 = 0x2, +}; + +enum { + CQE_L2_OK = 1 << 0, + CQE_L3_OK = 1 << 1, + CQE_L4_OK = 1 << 2, +}; + +struct mlx5_sig_err_cqe { + u8 rsvd0[16]; + __be32 expected_trans_sig; + __be32 actual_trans_sig; + __be32 expected_reftag; + __be32 actual_reftag; + __be16 syndrome; + u8 rsvd22[2]; + __be32 mkey; + __be64 err_offset; + u8 rsvd30[8]; + __be32 qpn; + u8 rsvd38[2]; + u8 signature; + u8 op_own; +}; + +struct mlx5_wqe_srq_next_seg { + u8 rsvd0[2]; + __be16 next_wqe_index; + u8 signature; + u8 rsvd1[11]; +}; + +union mlx5_ext_cqe { + struct ib_grh grh; + u8 inl[64]; +}; + +struct mlx5_cqe128 { + union mlx5_ext_cqe inl_grh; + struct mlx5_cqe64 cqe64; +}; + +struct mlx5_srq_ctx { + u8 state_log_sz; + u8 rsvd0[3]; + __be32 flags_xrcd; + __be32 pgoff_cqn; + u8 rsvd1[4]; + u8 log_pg_sz; + u8 rsvd2[7]; + __be32 pd; + __be16 lwm; + __be16 wqe_cnt; + u8 rsvd3[8]; + __be64 db_record; +}; + +struct mlx5_create_srq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 input_srqn; + u8 rsvd0[4]; + struct mlx5_srq_ctx ctx; + u8 rsvd1[208]; + __be64 pas[0]; +}; + +struct mlx5_create_srq_mbox_out { + struct mlx5_outbox_hdr hdr; + __be32 srqn; + u8 rsvd[4]; +}; + +struct mlx5_destroy_srq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 srqn; + u8 rsvd[4]; +}; + +struct mlx5_destroy_srq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + +struct mlx5_query_srq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 srqn; + u8 rsvd0[4]; +}; + +struct mlx5_query_srq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd0[8]; + struct mlx5_srq_ctx ctx; + u8 rsvd1[32]; + __be64 pas[0]; +}; + +struct mlx5_arm_srq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 srqn; + __be16 rsvd; + __be16 lwm; +}; + +struct mlx5_arm_srq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + +struct mlx5_cq_context { + u8 status; + u8 cqe_sz_flags; + u8 st; + u8 rsvd3; + u8 rsvd4[6]; + __be16 page_offset; + __be32 log_sz_usr_page; + __be16 cq_period; + __be16 cq_max_count; + __be16 rsvd20; + __be16 c_eqn; + u8 log_pg_sz; + u8 rsvd25[7]; + __be32 last_notified_index; + __be32 solicit_producer_index; + __be32 consumer_counter; + __be32 producer_counter; + u8 rsvd48[8]; + __be64 db_record_addr; +}; + +struct mlx5_create_cq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 input_cqn; + u8 rsvdx[4]; + struct mlx5_cq_context ctx; + u8 rsvd6[192]; + __be64 pas[0]; +}; + +struct mlx5_create_cq_mbox_out { + struct mlx5_outbox_hdr hdr; + __be32 cqn; + u8 rsvd0[4]; +}; + +struct mlx5_destroy_cq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 cqn; + u8 rsvd0[4]; +}; + +struct mlx5_destroy_cq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd0[8]; +}; + +struct mlx5_query_cq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 cqn; + u8 rsvd0[4]; +}; + +struct mlx5_query_cq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd0[8]; + struct mlx5_cq_context ctx; + u8 rsvd6[16]; + __be64 pas[0]; +}; + +struct mlx5_modify_cq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 cqn; + __be32 field_select; + struct mlx5_cq_context ctx; + u8 rsvd[192]; + __be64 pas[0]; +}; + +struct mlx5_modify_cq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + +struct mlx5_eq_context { + u8 status; + u8 ec_oi; + u8 st; + u8 rsvd2[7]; + __be16 page_pffset; + __be32 log_sz_usr_page; + u8 rsvd3[7]; + u8 intr; + u8 log_page_size; + u8 rsvd4[15]; + __be32 consumer_counter; + __be32 produser_counter; + u8 rsvd5[16]; +}; + +struct mlx5_create_eq_mbox_in { + struct mlx5_inbox_hdr hdr; + u8 rsvd0[3]; + u8 input_eqn; + u8 rsvd1[4]; + struct mlx5_eq_context ctx; + u8 rsvd2[8]; + __be64 events_mask; + u8 rsvd3[176]; + __be64 pas[0]; +}; + +struct mlx5_create_eq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd0[3]; + u8 eq_number; + u8 rsvd1[4]; +}; + +struct mlx5_map_eq_mbox_in { + struct mlx5_inbox_hdr hdr; + __be64 mask; + u8 mu; + u8 rsvd0[2]; + u8 eqn; + u8 rsvd1[24]; +}; + +struct mlx5_map_eq_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + +struct mlx5_query_eq_mbox_in { + struct mlx5_inbox_hdr hdr; + u8 rsvd0[3]; + u8 eqn; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 10 12:27:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56AC4A2AC75; Tue, 10 Nov 2015 12:27:51 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::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 DF6E41F8E; Tue, 10 Nov 2015 12:27:50 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wmww144 with SMTP id w144so115364736wmw.1; Tue, 10 Nov 2015 04:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=v7V+++GO9+RPz6RYF9YB1Ww0+ES8BnhzS+5cVX2kSAo=; b=RAGXMeOebPeWm24FgQxxe+qIE8SiTaRJotGiAUE8OXeYzRITgauGUKkf5X2wJT+h5b qc0vNr1L3YHM+Tge0aMGjUxu5U9zWXZxgt8ZCQJC87Mo0L0TxjMA4Uvz8Do9P3cB0wtI I4Ka4LbRKGLU4u5T2onfZWZzM5Ocb6K3Y0ov04/mXAPDb8+xVrogtHtnVfE8QPDKnWvJ dHQGitqidPmmQlkRmBOulBPMScyNguqRphNNI/bqA+cdtdi14HItgp6/bRm+4Z7tVN3F EVVa7EGuZkpgef84koQawkh84qHkccA0gw4otjjLVShmuec3DOZ8yszUmnDW7gyXgdFG NohQ== X-Received: by 10.28.6.70 with SMTP id 67mr4809021wmg.54.1447158469329; Tue, 10 Nov 2015 04:27:49 -0800 (PST) Received: from [172.16.1.30] (15.Red-83-50-122.dynamicIP.rima-tde.net. [83.50.122.15]) by smtp.gmail.com with ESMTPSA id u17sm3872670wmd.8.2015.11.10.04.27.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 04:27:48 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r290610 - head/sys/x86/x86 To: Ian Lepore , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511091219.tA9CJwe7067036@repo.freebsd.org> <564091FF.8090605@selasky.org> <5640BEBE.3070805@FreeBSD.org> <1447096753.91534.514.camel@freebsd.org> From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= X-Enigmail-Draft-Status: N1110 Message-ID: <5641E2C2.8020009@FreeBSD.org> Date: Tue, 10 Nov 2015 13:27:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447096753.91534.514.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:27:51 -0000 El 09/11/15 a les 20.19, Ian Lepore ha escrit: > On Mon, 2015-11-09 at 16:41 +0100, Roger Pau Monné wrote: >> Hello, >> >> El 09/11/15 a les 13.30, Hans Petter Selasky ha escrit: >>> On 11/09/15 13:19, Roger Pau Monné wrote: >>>> + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { >>>> + /* >>>> + * If we have to keep the offset of each page this >>>> function >>>> + * is not suitable, switch back to >>>> bus_dmamap_load_ma_triv >>>> + * which is going to do the right thing in this case. >>>> + */ >>>> + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, >>>> ma_offs, >>>> + flags, segs, segp); >>>> + return (error); >>>> + } >>> >>> Hi, >>> >>> There has been an update made to the USB stack, which is currently >>> the >>> only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can >> >> The only in-tree client. We don't know if there are other clients out >> of >> the tree. >> > > The BUS_DMA_KEEP_PG_OFFSET flag is not documented anywhere except in a > short coment block near its #define which is less than 100% rigorous in > specifying exactly what the flag even means. For example it is > documented as being a "hint" but also includes the word "must". It > doesn't say whether the flag is to be used to create a tag, to create a > map, or to load a buffer. It says the offset must be kept the same in > the first segment but doesn't really fully explain what the USB > requirements are (and the flag was added specifically for USB). > > To me, all of that adds up to freedom to clarify the meaning of the > flag in both code and documentation without a lot of worrying about out > of tree code. And the mips and arm busdma implementations are soon > going to leverage that freedom into much better implementations based > on the new understanding of what that flag really requires. Maybe rename the flag to BUS_DMA_CONTIGUOUS_PG_OFFSET? >>> probably be skipped or relaxed a bit. The condition which must be >>> fullfilled is: >> >> So you basically want a contiguous bounce buffer. I don't think we >> can >> just change BUS_DMA_KEEP_PG_OFFSET to mean "use a contiguous bounce >> buffer". Maybe a new flag could be introduced to describe this new >> requirement and the old one deprecated. >> > > It's not "I want a contiguous buffer". It is "I want contiguous > offsets when transitioning between (potentially non-continguous) > pages." That grants you the freedom to bounce a couple different ways > depending on what's most efficient for the platform and the situation. > > For example, you can maintain the offset-within-page in the first > segment and allow the offset in all subsequent pages (bounced or not) > to be zero. That's what all current implementations are doing, but it > can require two full bounce pages to handle a 2-byte transfer that > happens to be split across two pages (and yes that happens; it's not > even rare in USB, as lots of DMA is done specifying buffers and > variables on kernel stacks or in softc member variables). > > It also allows for the possibility of changing the offset in the first > segment if doing so avoids any page crossings at all (which handles > everything from the 2-byte worst case to a 4096-byte buffer). Yes, that's what I've now tried to do in x86: https://reviews.freebsd.org/D4119 Change the offset in the first segment and then making sure everything is contiguous in terms of offsets. >>> #ifdef USB_DEBUG >>> if (nseg > 1 && >>> ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) >>> != >>> ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { >>> /* >>> * This check verifies there is no page offset hole >>> * between the first and second segment. See the >>> * BUS_DMA_KEEP_PG_OFFSET flag. >>> */ >>> DPRINTFN(0, "Page offset was not preserved\n"); >>> error = 1; >>> goto done; >>> } >>> #endif >> >> AFAICT with the current bounce implementation on x86 you would have >> to >> specify an alignment of PAGE_SIZE in order to have this guarantee >> without specifying BUS_DMA_KEEP_PG_OFFSET. >> >> IMHO, we should change all the current bounce buffer code and switch >> to >> use memdescs for everything (ie: bios and mbufs should use a memdesc >> internally). Then each arch should provide functions to copy from the >> different kinds of memdescs (either memdescs containing physical or >> virtual memory), so the bounce code could be unified between all >> arches. >> Of course that's easier said than done... >> > > I completely disagree with this, mostly because I'm halfway through a > set of changes that will make arm and mips bounce handling look > completely different than x86 or other platforms. That reflects the > differences in underlying hardware that leads to completely different > reasons for bouncing in the first place. > > x86 code bounces DMA when there are exclusion regions in the physical > address space where DMA cannot occur. On ARM and MIPS that situation > just basically never occurs (except maybe on a few ancient arm xscale > systems), and virtually all bouncing is due to DMA buffers not being on > cache line boundaries. Because bio and mbuf DMA typically is cache > -aligned, that means that almost all bouncing is a handful of bytes at > a time, and the page-replacement bounce scheme that was copied from x86 > just isn't efficient (in fact it wastes megabytes of memory in > preallocated bounce buffers that small-memory arm and mips systems > can't really afford to waste). I see, I guess you are right that other arches have very different requirements in terms of bouncing, and that unifying them wouldn't work that well. I got that conclusion after looking at some of the busdma implementations for other arches which right now look quite similar, didn't know there was a major rework planned. Roger. From owner-svn-src-all@freebsd.org Tue Nov 10 12:49:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18113A2B513 for ; Tue, 10 Nov 2015 12:49:02 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (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 B04A41C1B for ; Tue, 10 Nov 2015 12:49:01 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so84734258lfs.3 for ; Tue, 10 Nov 2015 04:48:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ePEE6f4L/v9SX/u9lFJkd8XdeKY75cWiZI2vJ2R5LVw=; b=Uve7wOmWUN8fdh2Oiep/DIc/WOVpc8+h5QlQLN1X31WCFJqQ1lINVxlDqt7KZtc3zd SL0gIbqxfeTThbS0qEwWDj/+uXccKfK1HED6zqpajnRi/oOR5qylLMeTPgVL7muUuqzv u+KJog5buT4sI0FpZRVH6dcJ79zGcW159H2sGKFUPoBLuMahTR6kPfecWyiueIWVPGAv 5Rb94/3L6K9wx1U/6rudtSepBcvvFnzTQ6e0wxI74HfKhLiQn20Edqh7iM53MI9BLUdA SkySBQ9jOsvyU/CYS+hwUEJOYRscQGQDDBj2ttkBvszNQ4mDzOArWHE0gC0PhFVleSbw hv/w== X-Gm-Message-State: ALoCoQkGnSnmNu8zD2yKP46NZD+st/wf8YPVVkCJxLxbCcnEdKKTr4AAN2KxnWp/8eh0PkyUxZIx X-Received: by 10.25.156.5 with SMTP id f5mr1518454lfe.46.1447159733595; Tue, 10 Nov 2015 04:48:53 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id c7sm494304lfe.22.2015.11.10.04.48.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 04:48:53 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511100811.tAA8BR0R034338@repo.freebsd.org> From: Andrey Chernov Message-ID: <5641E7B4.2070508@freebsd.org> Date: Tue, 10 Nov 2015 15:48:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511100811.tAA8BR0R034338@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:49:02 -0000 On 10.11.2015 11:11, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Nov 10 08:11:27 2015 > New Revision: 290637 > URL: https://svnweb.freebsd.org/changeset/base/290637 > > Log: > return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales > as it used to be in previous version of the locales. Returning > "POSIX" has too many fallouts. You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be different with real US-ASCII. It is what glibc returns for C/POSIX locale and most ports expected, being linux-oriented. > > Modified: > head/lib/libc/locale/nl_langinfo.c > > Modified: head/lib/libc/locale/nl_langinfo.c > ============================================================================== > --- head/lib/libc/locale/nl_langinfo.c Tue Nov 10 07:32:49 2015 (r290636) > +++ head/lib/libc/locale/nl_langinfo.c Tue Nov 10 08:11:27 2015 (r290637) > @@ -71,7 +71,7 @@ nl_langinfo_l(nl_item item, locale_t loc > else if (strcmp(s, "MSKanji") == 0) > ret = "SJIS"; > else if (strcmp(s, "NONE") == 0) > - ret = "POSIX"; > + ret = "US-ASCII"; > else if (strncmp(s, "NONE:", 5) == 0) > ret = (char *)(s + 5); > else > -- http://ache.vniz.net/ From owner-svn-src-all@freebsd.org Tue Nov 10 12:52:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38BAAA2B76A; Tue, 10 Nov 2015 12:52:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DF110AF; Tue, 10 Nov 2015 12:52:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAACqQio033784; Tue, 10 Nov 2015 12:52:26 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAACqQrE033782; Tue, 10 Nov 2015 12:52:26 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201511101252.tAACqQrE033782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 10 Nov 2015 12:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290651 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:52:28 -0000 Author: avos Date: Tue Nov 10 12:52:26 2015 New Revision: 290651 URL: https://svnweb.freebsd.org/changeset/base/290651 Log: urtwn(4): add IBSS mode support Tested with RTL8188EU, IBSS and STA modes. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4038 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:20:22 2015 (r290650) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:52:26 2015 (r290651) @@ -228,10 +228,14 @@ static int urtwn_setup_beacon(struct ur static void urtwn_update_beacon(struct ieee80211vap *, int); static int urtwn_tx_beacon(struct urtwn_softc *sc, struct urtwn_vap *); +static void urtwn_tsf_task_adhoc(void *, int); static void urtwn_tsf_sync_enable(struct urtwn_softc *, struct ieee80211vap *); static void urtwn_set_led(struct urtwn_softc *, int, int); static void urtwn_set_mode(struct urtwn_softc *, uint8_t); +static void urtwn_ibss_recv_mgmt(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, int, int); static int urtwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void urtwn_watchdog(void *); @@ -449,6 +453,7 @@ urtwn_attach(device_t self) ic->ic_caps = IEEE80211_C_STA /* station mode */ | IEEE80211_C_MONITOR /* monitor mode */ + | IEEE80211_C_IBSS /* adhoc mode */ | IEEE80211_C_HOSTAP /* hostap mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ @@ -592,13 +597,18 @@ urtwn_vap_create(struct ieee80211com *ic return (NULL); } - if (opmode == IEEE80211_M_HOSTAP) + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_IBSS) urtwn_init_beacon(sc, uvp); /* override state transition machine */ uvp->newstate = vap->iv_newstate; vap->iv_newstate = urtwn_newstate; vap->iv_update_beacon = urtwn_update_beacon; + if (opmode == IEEE80211_M_IBSS) { + uvp->recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = urtwn_ibss_recv_mgmt; + TASK_INIT(&uvp->tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, vap); + } /* complete setup */ ieee80211_vap_attach(vap, ieee80211_media_change, @@ -610,13 +620,13 @@ urtwn_vap_create(struct ieee80211com *ic static void urtwn_vap_delete(struct ieee80211vap *vap) { + struct ieee80211com *ic = vap->iv_ic; struct urtwn_vap *uvp = URTWN_VAP(vap); - enum ieee80211_opmode opmode = vap->iv_opmode; - if (opmode == IEEE80211_M_HOSTAP) { - if (uvp->bcn_mbuf != NULL) - m_freem(uvp->bcn_mbuf); - } + if (uvp->bcn_mbuf != NULL) + m_freem(uvp->bcn_mbuf); + if (vap->iv_opmode == IEEE80211_M_IBSS) + ieee80211_draintask(ic, &uvp->tsf_task_adhoc); ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); } @@ -1611,8 +1621,50 @@ urtwn_tx_beacon(struct urtwn_softc *sc, } static void +urtwn_tsf_task_adhoc(void *arg, int pending) +{ + struct ieee80211vap *vap = arg; + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + struct ieee80211_node *ni; + uint32_t reg; + + URTWN_LOCK(sc); + ni = ieee80211_ref_node(vap->iv_bss); + reg = urtwn_read_1(sc, R92C_BCN_CTRL); + + /* Accept beacons with the same BSSID. */ + urtwn_set_rx_bssid_all(sc, 0); + + /* Enable synchronization. */ + reg &= ~R92C_BCN_CTRL_DIS_TSF_UDT0; + urtwn_write_1(sc, R92C_BCN_CTRL, reg); + + /* Synchronize. */ + usb_pause_mtx(&sc->sc_mtx, hz * ni->ni_intval * 5 / 1000); + + /* Disable synchronization. */ + reg |= R92C_BCN_CTRL_DIS_TSF_UDT0; + urtwn_write_1(sc, R92C_BCN_CTRL, reg); + + /* Remove beacon filter. */ + urtwn_set_rx_bssid_all(sc, 1); + + /* Enable beaconing. */ + urtwn_write_1(sc, R92C_MBID_NUM, + urtwn_read_1(sc, R92C_MBID_NUM) | R92C_MBID_TXBCN_RPT0); + reg |= R92C_BCN_CTRL_EN_BCN; + + urtwn_write_1(sc, R92C_BCN_CTRL, reg); + ieee80211_free_node(ni); + URTWN_UNLOCK(sc); +} + +static void urtwn_tsf_sync_enable(struct urtwn_softc *sc, struct ieee80211vap *vap) { + struct ieee80211com *ic = &sc->sc_ic; + struct urtwn_vap *uvp = URTWN_VAP(vap); + /* Reset TSF. */ urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); @@ -1623,6 +1675,9 @@ urtwn_tsf_sync_enable(struct urtwn_softc urtwn_read_1(sc, R92C_BCN_CTRL) & ~R92C_BCN_CTRL_DIS_TSF_UDT0); break; + case IEEE80211_M_IBSS: + ieee80211_runtask(ic, &uvp->tsf_task_adhoc); + break; case IEEE80211_M_HOSTAP: /* Enable beaconing. */ urtwn_write_1(sc, R92C_MBID_NUM, @@ -1674,6 +1729,37 @@ urtwn_set_mode(struct urtwn_softc *sc, u urtwn_write_1(sc, R92C_MSR, reg); } +static void +urtwn_ibss_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, + const struct ieee80211_rx_stats *rxs, + int rssi, int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + struct urtwn_vap *uvp = URTWN_VAP(vap); + uint64_t ni_tstamp, curr_tstamp; + + uvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); + + if (vap->iv_state == IEEE80211_S_RUN && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { + ni_tstamp = le64toh(ni->ni_tstamp.tsf); +#ifdef D3831 + URTWN_LOCK(sc); + urtwn_get_tsf(sc, &curr_tstamp); + URTWN_UNLOCK(sc); + curr_tstamp = le64toh(curr_tstamp); + + if (ni_tstamp >= curr_tstamp) + (void) ieee80211_ibss_merge(ni); +#else + (void) sc; + (void) curr_tstamp; +#endif + } +} + static int urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -1757,6 +1843,9 @@ urtwn_newstate(struct ieee80211vap *vap, case IEEE80211_M_STA: mode = R92C_MSR_INFRA; break; + case IEEE80211_M_IBSS: + mode = R92C_MSR_ADHOC; + break; case IEEE80211_M_HOSTAP: mode = R92C_MSR_AP; break; @@ -1794,13 +1883,14 @@ urtwn_newstate(struct ieee80211vap *vap, if (vap->iv_opmode != IEEE80211_M_HOSTAP) reg |= R92C_RCR_CBSSID_DATA; - - reg |= R92C_RCR_CBSSID_BCN; + if (vap->iv_opmode != IEEE80211_M_IBSS) + reg |= R92C_RCR_CBSSID_BCN; urtwn_write_4(sc, R92C_RCR, reg); } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_IBSS) { error = urtwn_setup_beacon(sc, ni); if (error != 0) { device_printf(sc->sc_dev, @@ -3007,6 +3097,7 @@ urtwn_rxfilter_init(struct urtwn_softc * R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_BEACON)); break; case IEEE80211_M_MONITOR: + case IEEE80211_M_IBSS: break; default: device_printf(sc->sc_dev, "%s: undefined opmode %d\n", @@ -3335,7 +3426,9 @@ urtwn_scan_start(struct ieee80211com *ic URTWN_LOCK(sc); /* Receive beacons / probe responses from any BSSID. */ - urtwn_set_rx_bssid_all(sc, 1); + if (ic->ic_opmode != IEEE80211_M_IBSS) + urtwn_set_rx_bssid_all(sc, 1); + /* Set gain for scanning. */ urtwn_set_gain(sc, 0x20); URTWN_UNLOCK(sc); @@ -3348,8 +3441,9 @@ urtwn_scan_end(struct ieee80211com *ic) URTWN_LOCK(sc); /* Restore limitations. */ - if (ic->ic_promisc == 0) + if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_IBSS) urtwn_set_rx_bssid_all(sc, 0); + /* Set gain under link. */ urtwn_set_gain(sc, 0x32); URTWN_UNLOCK(sc); @@ -3393,6 +3487,9 @@ urtwn_set_promisc(struct urtwn_softc *sc case IEEE80211_M_HOSTAP: mask2 |= R92C_RCR_CBSSID_BCN; break; + case IEEE80211_M_IBSS: + mask2 |= R92C_RCR_CBSSID_DATA; + break; default: device_printf(sc->sc_dev, "%s: undefined opmode %d\n", __func__, vap->iv_opmode); Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:20:22 2015 (r290650) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:52:26 2015 (r290651) @@ -87,13 +87,18 @@ struct urtwn_fw_info { }; struct urtwn_vap { - struct ieee80211vap vap; + struct ieee80211vap vap; - struct r92c_tx_desc bcn_desc; - struct mbuf *bcn_mbuf; - - int (*newstate)(struct ieee80211vap *, - enum ieee80211_state, int); + struct r92c_tx_desc bcn_desc; + struct mbuf *bcn_mbuf; + struct task tsf_task_adhoc; + + int (*newstate)(struct ieee80211vap *, + enum ieee80211_state, int); + void (*recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, + int, int); }; #define URTWN_VAP(vap) ((struct urtwn_vap *)(vap)) From owner-svn-src-all@freebsd.org Tue Nov 10 13:04:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8FAA2BE41; Tue, 10 Nov 2015 13:04:35 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 A89531E55; Tue, 10 Nov 2015 13:04:34 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmec201 with SMTP id c201so132448250wme.0; Tue, 10 Nov 2015 05:04:33 -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=ZdJsYCT6fvAVFMvjGfiXn+ptfOuFHd21QSNOPZqraLA=; b=lV81FLMkxQeBQSObclHB9hZW72nUNpvHOx8VLNq9lCc5eoRVBiN1Vrn3JrLnlEN4Ro krdtnN6NnPu9bSEfNdOfaCKgE1ouHn+A7QaVlis4xahwwAvhmBE809o8G22LP6AlW54r 1u7km/rscW/X39OPwgrN2dwzxMnKsH2wEVN5tTLeYl7Ql+RomaiZrIc/XuFFD96GFFwy FjIyWtd70GWxQrwUu+o6PztNUSzeCyBI/rEfiGn82IJchBDCYOQDg1K/+B3sOi3XL+cR GTYj/PFYkf3Xwj7l3sdZFzEgkbz3W2I0AdNcVy9Yg1GMCt7OJjsR75SDLz+un6CBp3R4 KPnw== X-Received: by 10.28.138.148 with SMTP id m142mr4367656wmd.79.1447160673025; Tue, 10 Nov 2015 05:04:33 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id l1sm4012919wmg.21.2015.11.10.05.04.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 05:04:32 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 10 Nov 2015 14:04:30 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290637 - head/lib/libc/locale Message-ID: <20151110130430.GK10134@ivaldir.etoilebsd.net> References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYjDATHXTWnytHRU" Content-Disposition: inline In-Reply-To: <5641E7B4.2070508@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:04:35 -0000 --zYjDATHXTWnytHRU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: > On 10.11.2015 11:11, Baptiste Daroussin wrote: > > Author: bapt > > Date: Tue Nov 10 08:11:27 2015 > > New Revision: 290637 > > URL: https://svnweb.freebsd.org/changeset/base/290637 > >=20 > > Log: > > return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales > > as it used to be in previous version of the locales. Returning > > "POSIX" has too many fallouts. >=20 > You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be > different with real US-ASCII. It is what glibc returns for C/POSIX > locale and most ports expected, being linux-oriented. >=20 I thought about it, but in the end it is probably safer for now that nl_lan= ginfo return US-ASCII as it did in the past, to reduce breakage with FreeBSD only= code that maybe be existing ou there. Best regards, Bapt --zYjDATHXTWnytHRU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZB614ACgkQ8kTtMUmk6EzYgQCfXFG6rUQYZfwgFYdqA8QRJL3m h7EAnRXpZv+n0MNHyyFYmzKgmW0bsb2B =WAjW -----END PGP SIGNATURE----- --zYjDATHXTWnytHRU-- From owner-svn-src-all@freebsd.org Tue Nov 10 13:15:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE963A2A27F; Tue, 10 Nov 2015 13:15:35 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF6E18DA; Tue, 10 Nov 2015 13:15:35 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAADFYW3039786; Tue, 10 Nov 2015 13:15:34 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAADFY4Y039785; Tue, 10 Nov 2015 13:15:34 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201511101315.tAADFY4Y039785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 10 Nov 2015 13:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290655 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:15:35 -0000 Author: skra Date: Tue Nov 10 13:15:34 2015 New Revision: 290655 URL: https://svnweb.freebsd.org/changeset/base/290655 Log: Fix pmap_fault(). It turned out that alignment abort may have higher priority than both translation and permission ones. Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Nov 10 13:11:22 2015 (r290654) +++ head/sys/arm/arm/pmap-v6-new.c Tue Nov 10 13:15:34 2015 (r290655) @@ -6152,8 +6152,9 @@ pmap_fault(pmap_t pmap, vm_offset_t far, * All L1 tables should always be mapped and present. * However, we check only current one herein. For user mode, * only permission abort from malicious user is not fatal. + * And alignment abort as it may have higher priority. */ - if (!usermode || (idx != FAULT_PERM_L2)) { + if (!usermode || (idx != FAULT_ALIGN && idx != FAULT_PERM_L2)) { CTR4(KTR_PMAP, "%s: pmap %#x pm_pt1 %#x far %#x", __func__, pmap, pmap->pm_pt1, far); panic("%s: pm_pt1 abort", __func__); @@ -6166,9 +6167,10 @@ pmap_fault(pmap_t pmap, vm_offset_t far, * L1 table. However, only existing L2 tables are mapped * in PT2MAP. For user mode, only L2 translation abort and * permission abort from malicious user is not fatal. + * And alignment abort as it may have higher priority. */ - if (!usermode || - (idx != FAULT_TRAN_L2 && idx != FAULT_PERM_L2)) { + if (!usermode || (idx != FAULT_ALIGN && + idx != FAULT_TRAN_L2 && idx != FAULT_PERM_L2)) { CTR4(KTR_PMAP, "%s: pmap %#x PT2MAP %#x far %#x", __func__, pmap, PT2MAP, far); panic("%s: PT2MAP abort", __func__); From owner-svn-src-all@freebsd.org Tue Nov 10 13:20:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32511A2A3DA; Tue, 10 Nov 2015 13:20:23 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFE7B1B29; Tue, 10 Nov 2015 13:20:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAADKM9Y039991; Tue, 10 Nov 2015 13:20:22 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAADKLVw039989; Tue, 10 Nov 2015 13:20:21 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201511101320.tAADKLVw039989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 10 Nov 2015 13:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290656 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:20:23 -0000 Author: skra Date: Tue Nov 10 13:20:21 2015 New Revision: 290656 URL: https://svnweb.freebsd.org/changeset/base/290656 Log: Fix cp15 PAR definition and function. While here, add cp15 ATS1CPW function which checks an address for privileged (PL1) write access. The function is inlined so it does not bring any cost, but makes function set for checking privileged access complete. Approved by: kib (mentor) Modified: head/sys/arm/include/cpu-v6.h head/sys/arm/include/sysreg.h Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Tue Nov 10 13:15:34 2015 (r290655) +++ head/sys/arm/include/cpu-v6.h Tue Nov 10 13:20:21 2015 (r290656) @@ -156,8 +156,9 @@ _RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0)) _RF0(cp15_actlr_get, CP15_ACTLR(%0)) _WF1(cp15_actlr_set, CP15_ACTLR(%0)) #if __ARM_ARCH >= 6 -_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)); -_RF0(cp15_par_get, CP15_PAR); +_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)) +_WF1(cp15_ats1cpw_set, CP15_ATS1CPW(%0)) +_RF0(cp15_par_get, CP15_PAR(%0)) _RF0(cp15_sctlr_get, CP15_SCTLR(%0)) #endif Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Tue Nov 10 13:15:34 2015 (r290655) +++ head/sys/arm/include/sysreg.h Tue Nov 10 13:20:21 2015 (r290656) @@ -130,7 +130,7 @@ #define CP15_BPIALLIS p15, 0, r0, c7, c1, 6 /* Branch predictor invalidate all IS */ #endif -#define CP15_PAR p15, 0, r0, c7, c4, 0 /* Physical Address Register */ +#define CP15_PAR(rr) p15, 0, rr, c7, c4, 0 /* Physical Address Register */ #define CP15_ICIALLU p15, 0, r0, c7, c5, 0 /* Instruction cache invalidate all PoU */ #define CP15_ICIMVAU(rr) p15, 0, rr, c7, c5, 1 /* Instruction cache invalidate */ From owner-svn-src-all@freebsd.org Tue Nov 10 13:20:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D4B1A2A501 for ; Tue, 10 Nov 2015 13:20:48 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 BFA591CC5 for ; Tue, 10 Nov 2015 13:20:47 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lffu14 with SMTP id u14so27574653lff.1 for ; Tue, 10 Nov 2015 05:20:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=kvt0N0Bhd8iEynC6lN1a2L1iMqeRsPV0imrEMPy69qg=; b=f0g4vmkN2uFSJ0OMrdT88UzMCE+5XC9BaGoF7/V7i3VT375ThCwdVyIJ518Q9nnf6E LyPKI+/KNtKuAebSafjec5eHOlyFYutNWg924s9KvssNCoL/6oNtyhBYVx/XIZxES2UW 4YwC/WpflQF+Cb3aTluJm9Wh0gw4JO6vytXq4zQCbXSoRzm3iPPYVuNdyjuARi0A4DR6 fyDQh7UQ9aY8RtU3L3GWf/TT81pdMvaHCLFf9f+dEwLBGqwPsqgPqM0z0mlacd08iwAZ l2N9hNnQMCiIud0ApGkuW/DkbgBQijxDV/KLAN644O6oe0QnB+EXclef8IBl/FsNV3Sa Z+AA== X-Gm-Message-State: ALoCoQki1CWtcFwD52m0Dpi19kWRjlrD+FiwE434mrLEa0li2CUNA8YckaNAkZAFtS1T0sS42Ezq X-Received: by 10.25.25.11 with SMTP id 11mr1564024lfz.91.1447161639862; Tue, 10 Nov 2015 05:20:39 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m124sm510774lfd.40.2015.11.10.05.20.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 05:20:38 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <5641EF26.8060600@freebsd.org> Date: Tue, 10 Nov 2015 16:20:38 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151110130430.GK10134@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="njvqVghl7507oWfDOK1N41KbIegcVuWee" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:20:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --njvqVghl7507oWfDOK1N41KbIegcVuWee Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 10.11.2015 16:04, Baptiste Daroussin wrote: > On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: >> On 10.11.2015 11:11, Baptiste Daroussin wrote: >>> Author: bapt >>> Date: Tue Nov 10 08:11:27 2015 >>> New Revision: 290637 >>> URL: https://svnweb.freebsd.org/changeset/base/290637 >>> >>> Log: >>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales >>> as it used to be in previous version of the locales. Returning >>> "POSIX" has too many fallouts. >> >> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be >> different with real US-ASCII. It is what glibc returns for C/POSIX >> locale and most ports expected, being linux-oriented. >> > I thought about it, but in the end it is probably safer for now that nl= _langinfo > return US-ASCII as it did in the past, to reduce breakage with FreeBSD = only code > that maybe be existing ou there. All FreeBSD code I know never check locale this way. IMHO probability of potential danger to meet some linux-oriented port with this check is much much higher than to meet similar FreeBSD only code in the wild. In any case, changing collate order from A-Za-z to aA-zZ we do just now have much higher probability to break unknown FreeBSD only code, so one breaking change can go with other one together. --=20 http://ache.vniz.net/ --njvqVghl7507oWfDOK1N41KbIegcVuWee Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWQe8mAAoJEKUckv0MjfbKKTwH/0KbQ3fyGWPdpR3eCzhPMBAW z+zq2PM3pvko/MztZxBZZS9AMbEfGuDtpEem+tIv8p8MqIXEBP4cgiuEGyaPc8CA 1pEHa+bOtMfuz0gToRibvbgcUxR3S83GPb/Gqjul5B1Xc8aDAB8dhRhi+vUfhfHY 8CEljwHQUo5Nh6vLB6jdY+LzyLSdo9eUlnJG8nfvOCwuuJBeBWFco9Dllp5hn8Up j29RTuT/pYbCVAjx1RQ0xPnTm+D+yGAJecYh1jLQu1VNUTelJgipS21sDQG8+mkZ 0NfWc/9QDB2Fx5caIedmdT6svpCeipgHilxPkHNLBzlth/Kqy2Hqmhmw8Hw3JOA= =ottt -----END PGP SIGNATURE----- --njvqVghl7507oWfDOK1N41KbIegcVuWee-- From owner-svn-src-all@freebsd.org Tue Nov 10 13:28:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A7C0A2A6A4; Tue, 10 Nov 2015 13:28:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6D11348; Tue, 10 Nov 2015 13:28:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAADSfFA042914; Tue, 10 Nov 2015 13:28:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAADSfkY042911; Tue, 10 Nov 2015 13:28:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511101328.tAADSfkY042911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 13:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290659 - in head: share/man/man4 share/man/man5 tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:28:43 -0000 Author: ngie Date: Tue Nov 10 13:28:41 2015 New Revision: 290659 URL: https://svnweb.freebsd.org/changeset/base/290659 Log: - Move ng_bluetooth.4 under MK_BLUETOOTH != no - Move all section 5 bluetooth manpages under MK_BLUETOOTH != no MFC after: 3 days PR: 193260 Reported by: Philippe Michel Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/Makefile head/share/man/man5/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Nov 10 13:27:02 2015 (r290658) +++ head/share/man/man4/Makefile Tue Nov 10 13:28:41 2015 (r290659) @@ -311,7 +311,6 @@ MAN= aac.4 \ ng_atm.4 \ ngatmbase.4 \ ng_atmllc.4 \ - ng_bluetooth.4 \ ng_bpf.4 \ ng_bridge.4 \ ng_bt3c.4 \ @@ -821,6 +820,10 @@ _bhyve.4= bhyve.4 .endif .endif +.if ${MK_BLUETOOTH} != "no" +MAN+= ng_bluetooth.4 +.endif + .if ${MACHINE_CPUARCH} == "mips" _nvram2env.4= nvram2env.4 .endif Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Tue Nov 10 13:27:02 2015 (r290658) +++ head/share/man/man5/Makefile Tue Nov 10 13:28:41 2015 (r290659) @@ -7,9 +7,6 @@ MAN= acct.5 \ ar.5 \ a.out.5 \ - bluetooth.device.conf.5 \ - bluetooth.hosts.5 \ - bluetooth.protocols.5 \ ${_boot.config.5} \ core.5 \ devfs.5 \ @@ -84,6 +81,12 @@ MLINKS+=src.conf.5 src-env.conf.5 MAN+= autofs.5 .endif +.if ${MK_BLUETOOTH} != "no" +MAN+= bluetooth.device.conf.5 \ + bluetooth.hosts.5 \ + bluetooth.protocols.5 +.endif + .if ${MK_FREEBSD_UPDATE} != "no" MAN+= freebsd-update.conf.5 .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 10 13:27:02 2015 (r290658) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 10 13:28:41 2015 (r290659) @@ -517,6 +517,10 @@ OLD_FILES+=usr/share/man/man3/sdp_regist OLD_FILES+=usr/share/man/man3/sdp_search.3.gz OLD_FILES+=usr/share/man/man3/sdp_unregister_service.3.gz OLD_FILES+=usr/share/man/man3/sdp_uuid2desc.3.gz +OLD_FILES+=usr/share/man/man4/ng_bluetooth.4.gz +OLD_FILES+=usr/share/man/man5/bluetooth.device.conf.5.gz +OLD_FILES+=usr/share/man/man5/bluetooth.hosts.5.gz +OLD_FILES+=usr/share/man/man5/bluetooth.protocols.5.gz OLD_FILES+=usr/share/man/man5/hcsecd.conf.5.gz OLD_FILES+=usr/share/man/man8/ath3kfw.8.gz OLD_FILES+=usr/share/man/man8/bcmfw.8.gz From owner-svn-src-all@freebsd.org Tue Nov 10 13:32:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86D2FA2A8B6; Tue, 10 Nov 2015 13:32:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52FA718B5; Tue, 10 Nov 2015 13:32:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAADW5x9045620; Tue, 10 Nov 2015 13:32:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAADW5oN045619; Tue, 10 Nov 2015 13:32:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511101332.tAADW5oN045619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 10 Nov 2015 13:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290660 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:32:06 -0000 Author: ngie Date: Tue Nov 10 13:32:05 2015 New Revision: 290660 URL: https://svnweb.freebsd.org/changeset/base/290660 Log: Move the MK_BLUETOOTH block down below the architecture specific sections by the other generic options MFC after: 3 days X-MFC with: r290659 PR: 193260 Sponsored by: EMC / Isilon Storage Divisions Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Nov 10 13:28:41 2015 (r290659) +++ head/share/man/man4/Makefile Tue Nov 10 13:32:05 2015 (r290660) @@ -820,10 +820,6 @@ _bhyve.4= bhyve.4 .endif .endif -.if ${MK_BLUETOOTH} != "no" -MAN+= ng_bluetooth.4 -.endif - .if ${MACHINE_CPUARCH} == "mips" _nvram2env.4= nvram2env.4 .endif @@ -832,6 +828,10 @@ _nvram2env.4= nvram2env.4 SUBDIR= man4.${MACHINE_CPUARCH} .endif +.if ${MK_BLUETOOTH} != "no" +MAN+= ng_bluetooth.4 +.endif + .if ${MK_CCD} != "no" _ccd.4= ccd.4 .endif From owner-svn-src-all@freebsd.org Tue Nov 10 13:36:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05023A2A9DF; Tue, 10 Nov 2015 13:36:21 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 9F75E1C35; Tue, 10 Nov 2015 13:36:20 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmvv187 with SMTP id v187so8200334wmv.1; Tue, 10 Nov 2015 05:36:19 -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=0VZTP7uZbhkdzIFOqQJVBis4EkH2kcD/xCm2OQBBdrY=; b=QhCPFoi/6muSRYIjoAlwdRkuJposAtLmcHLex8m2V8CrTpiFRLFu2HGPZaKrRBY8Da GywCPol5ku6gvRPnADsfKvtR/jVMa5JZuEAvs+EVzO/mNVeIEUZ3UvFxwI+ubXN3QXz5 50PevZjRjSK6XSy9rXsusWe7D0870xC/YtTP/RkOEg2KxCiK9t0csQoF0iIGwWcMO7Gy QBqSAsh7Dgt/S/U3yZcHMpbrQqualJVpTOkWWsag8IA3hg2pnacBWag56fhhOj8A15Jc wTe/SOQlhc+/auFLxb+qTkVzoitHK74mzIYHK7Qdo+HcN8j4dFRvX1GBf+E95t50p208 0ppw== X-Received: by 10.28.144.138 with SMTP id s132mr4594202wmd.97.1447162579115; Tue, 10 Nov 2015 05:36:19 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id 194sm4156407wmh.19.2015.11.10.05.36.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 05:36:18 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 10 Nov 2015 14:36:15 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290637 - head/lib/libc/locale Message-ID: <20151110133615.GL10134@ivaldir.etoilebsd.net> References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZYM6PqDyfNytx60" Content-Disposition: inline In-Reply-To: <5641EF26.8060600@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:36:21 -0000 --/ZYM6PqDyfNytx60 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: > On 10.11.2015 16:04, Baptiste Daroussin wrote: > > On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: > >> On 10.11.2015 11:11, Baptiste Daroussin wrote: > >>> Author: bapt > >>> Date: Tue Nov 10 08:11:27 2015 > >>> New Revision: 290637 > >>> URL: https://svnweb.freebsd.org/changeset/base/290637 > >>> > >>> Log: > >>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales > >>> as it used to be in previous version of the locales. Returning > >>> "POSIX" has too many fallouts. > >> > >> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be > >> different with real US-ASCII. It is what glibc returns for C/POSIX > >> locale and most ports expected, being linux-oriented. > >> > > I thought about it, but in the end it is probably safer for now that nl= _langinfo > > return US-ASCII as it did in the past, to reduce breakage with FreeBSD = only code > > that maybe be existing ou there. >=20 > All FreeBSD code I know never check locale this way. IMHO probability of > potential danger to meet some linux-oriented port with this check is > much much higher than to meet similar FreeBSD only code in the wild. In > any case, changing collate order from A-Za-z to aA-zZ we do just now > have much higher probability to break unknown FreeBSD only code, so one > breaking change can go with other one together. >=20 That is true, except that the new collation thing is invalidated as soon as= you set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a workaroun= d while changing the return value of nl_langinfo() is not workaroundable. --- Bapt --/ZYM6PqDyfNytx60 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEUEARECAAYFAlZB8s8ACgkQ8kTtMUmk6EzJIgCeN7YthORHwzLKgrJ9JeXPmP4v LaUAmNjGL+a9PxwZDWnHPmNvE5vPi6I= =Jaf2 -----END PGP SIGNATURE----- --/ZYM6PqDyfNytx60-- From owner-svn-src-all@freebsd.org Tue Nov 10 13:47:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE62A2AFC8; Tue, 10 Nov 2015 13:47:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37CDC186E; Tue, 10 Nov 2015 13:47:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAADlSBX048485; Tue, 10 Nov 2015 13:47:28 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAADlSHh048484; Tue, 10 Nov 2015 13:47:28 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201511101347.tAADlSHh048484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 10 Nov 2015 13:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290661 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 13:47:29 -0000 Author: mmel Date: Tue Nov 10 13:47:28 2015 New Revision: 290661 URL: https://svnweb.freebsd.org/changeset/base/290661 Log: ARM: Refactor interrupt_enable/disable/restore. Allow manipulation with PSR_A bit on ARMv6+. Remove declaration of unused functions. This effectively enables asynchronous aborts on early bootstrap stage, which previously was not enabled due to an error in enable_interrupts(). PR: 201434 Reported by: Gregory Soutade Approved by: kib (mentor) Modified: head/sys/arm/include/cpufunc.h Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Nov 10 13:32:05 2015 (r290660) +++ head/sys/arm/include/cpufunc.h Tue Nov 10 13:47:28 2015 (r290661) @@ -47,6 +47,7 @@ #ifdef _KERNEL #include +#include #include #include /* For in[bwl] and out[bwl] */ @@ -520,45 +521,54 @@ void xscalec3_context_switch (void); /* * Macros for manipulating CPU interrupts */ -static __inline u_int32_t __set_cpsr_c(u_int bic, u_int eor) __attribute__((__unused__)); +#if __ARM_ARCH < 6 +#define __ARM_INTR_BITS (PSR_I | PSR_F) +#else +#define __ARM_INTR_BITS (PSR_I | PSR_F | PSR_A) +#endif -static __inline u_int32_t -__set_cpsr_c(u_int bic, u_int eor) +static __inline uint32_t +__set_cpsr(uint32_t bic, uint32_t eor) { - u_int32_t tmp, ret; + uint32_t tmp, ret; __asm __volatile( - "mrs %0, cpsr\n" /* Get the CPSR */ - "bic %1, %0, %2\n" /* Clear bits */ - "eor %1, %1, %3\n" /* XOR bits */ - "msr cpsr_c, %1\n" /* Set the control field of CPSR */ + "mrs %0, cpsr\n" /* Get the CPSR */ + "bic %1, %0, %2\n" /* Clear bits */ + "eor %1, %1, %3\n" /* XOR bits */ + "msr cpsr_xc, %1\n" /* Set the CPSR */ : "=&r" (ret), "=&r" (tmp) : "r" (bic), "r" (eor) : "memory"); return ret; } -#define ARM_CPSR_F32 (1 << 6) /* FIQ disable */ -#define ARM_CPSR_I32 (1 << 7) /* IRQ disable */ +static __inline uint32_t +disable_interrupts(uint32_t mask) +{ -#define disable_interrupts(mask) \ - (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), \ - (mask) & (ARM_CPSR_I32 | ARM_CPSR_F32))) - -#define enable_interrupts(mask) \ - (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), 0)) - -#define restore_interrupts(old_cpsr) \ - (__set_cpsr_c((ARM_CPSR_I32 | ARM_CPSR_F32), \ - (old_cpsr) & (ARM_CPSR_I32 | ARM_CPSR_F32))) + return (__set_cpsr(mask & __ARM_INTR_BITS, mask & __ARM_INTR_BITS)); +} + +static __inline uint32_t +enable_interrupts(uint32_t mask) +{ + + return (__set_cpsr(mask & __ARM_INTR_BITS, 0)); +} + +static __inline uint32_t +restore_interrupts(uint32_t old_cpsr) +{ + + return (__set_cpsr(__ARM_INTR_BITS, old_cpsr & __ARM_INTR_BITS)); +} static __inline register_t intr_disable(void) { - register_t s; - s = disable_interrupts(ARM_CPSR_I32 | ARM_CPSR_F32); - return (s); + return (disable_interrupts(PSR_I | PSR_F)); } static __inline void @@ -567,10 +577,7 @@ intr_restore(register_t s) restore_interrupts(s); } - -/* Functions to manipulate the CPSR. */ -u_int SetCPSR(u_int bic, u_int eor); -u_int GetCPSR(void); +#undef __ARM_INTR_BITS /* * Functions to manipulate cpu r13 From owner-svn-src-all@freebsd.org Tue Nov 10 14:14:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AF69A2B7C0; Tue, 10 Nov 2015 14:14:34 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F8515C2; Tue, 10 Nov 2015 14:14:33 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAEEXeK057070; Tue, 10 Nov 2015 14:14:33 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAEEWHZ057069; Tue, 10 Nov 2015 14:14:32 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201511101414.tAAEEWHZ057069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Tue, 10 Nov 2015 14:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290662 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 14:14:34 -0000 Author: jpaetzel Date: Tue Nov 10 14:14:32 2015 New Revision: 290662 URL: https://svnweb.freebsd.org/changeset/base/290662 Log: Fix a bug in the CPU % limiting code If you attempt to set a pcpu limit that is higher than 110% using rctl (for instance, you want a jail to be able to use 2 cores on your system so you set pcpu to 200%) the thing you are trying to limit becomes unthrottled. PR: 189870 Submitted by: dustinwenz@ebureau.com Reviewed by: trasz MFC after: 1 week Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue Nov 10 13:47:28 2015 (r290661) +++ head/sys/kern/kern_racct.c Tue Nov 10 14:14:32 2015 (r290662) @@ -517,16 +517,16 @@ racct_adjust_resource(struct racct *racc /* * There are some cases where the racct %cpu resource would grow - * beyond 100%. - * For example in racct_proc_exit() we add the process %cpu usage - * to the ucred racct containers. If too many processes terminated - * in a short time span, the ucred %cpu resource could grow too much. - * Also, the 4BSD scheduler sometimes returns for a thread more than - * 100% cpu usage. So we set a boundary here to 100%. + * beyond 100% per core. For example in racct_proc_exit() we add + * the process %cpu usage to the ucred racct containers. If too + * many processes terminated in a short time span, the ucred %cpu + * resource could grow too much. Also, the 4BSD scheduler sometimes + * returns for a thread more than 100% cpu usage. So we set a sane + * boundary here to 100% * the maxumum number of CPUs. */ if ((resource == RACCT_PCTCPU) && - (racct->r_resources[RACCT_PCTCPU] > 100 * 1000000)) - racct->r_resources[RACCT_PCTCPU] = 100 * 1000000; + (racct->r_resources[RACCT_PCTCPU] > 100 * 1000000 * (int64_t)MAXCPU)) + racct->r_resources[RACCT_PCTCPU] = 100 * 1000000 * (int64_t)MAXCPU; } static int From owner-svn-src-all@freebsd.org Tue Nov 10 14:14:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F845A2B7F2; Tue, 10 Nov 2015 14:14:43 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08F6180E; Tue, 10 Nov 2015 14:14:42 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAEEgad057140; Tue, 10 Nov 2015 14:14:42 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAEEfPI057133; Tue, 10 Nov 2015 14:14:41 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511101414.tAAEEfPI057133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 10 Nov 2015 14:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290663 - in head/sys: modules modules/tests modules/tests/callout_test modules/tests/framework tests tests/callout_test tests/framework X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 14:14:43 -0000 Author: rrs Date: Tue Nov 10 14:14:41 2015 New Revision: 290663 URL: https://svnweb.freebsd.org/changeset/base/290663 Log: Add a kernel test framework. The callout_test is a demonstration and will only work with the upcoming async-drain functionality. Tests can be added to the tests directory and then the framework can be used to launch those tests. MFC after: 1 month Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D1755 Added: head/sys/modules/tests/ head/sys/modules/tests/callout_test/ head/sys/modules/tests/callout_test/Makefile (contents, props changed) head/sys/modules/tests/framework/ head/sys/modules/tests/framework/Makefile (contents, props changed) head/sys/tests/ head/sys/tests/callout_test/ head/sys/tests/callout_test.h (contents, props changed) head/sys/tests/callout_test/callout_test.c (contents, props changed) head/sys/tests/framework/ head/sys/tests/framework/kern_testfrwk.c (contents, props changed) head/sys/tests/kern_testfrwk.h (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Nov 10 14:14:32 2015 (r290662) +++ head/sys/modules/Makefile Tue Nov 10 14:14:41 2015 (r290663) @@ -343,6 +343,8 @@ SUBDIR= \ ${_syscons} \ sysvipc \ ${_ti} \ + tests/framework \ + tests/callout_test \ tl \ tmpfs \ ${_toecore} \ Added: head/sys/modules/tests/callout_test/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tests/callout_test/Makefile Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,15 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../tests/callout_test + +KMOD= callout_test +SRCS= callout_test.c + +# +# Enable full debugging +# +#CFLAGS += -g + +.include Added: head/sys/modules/tests/framework/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tests/framework/Makefile Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,15 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../tests/framework + +KMOD= kern_testfrwk +SRCS= kern_testfrwk.c + +# +# Enable full debugging +# +#CFLAGS += -g + +.include Added: head/sys/tests/callout_test.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/tests/callout_test.h Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,34 @@ +#ifndef __callout_test_h__ +#define __callout_test_h__ +/*- + * Copyright (c) 2015 + * Netflix Incorporated, 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 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. + *__FBSDID("$FreeBSD$"); + * + */ +struct callout_test { + int number_of_callouts; + int test_number; +}; +#endif Added: head/sys/tests/callout_test/callout_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/tests/callout_test/callout_test.c Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,284 @@ +/*- + * Copyright (c) 2015 Netflix Inc. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#else +#define cpu_spinwait() +#endif + +MALLOC_DEFINE(M_CALLTMP, "Temp callout Memory", "CalloutTest"); + +struct callout_run { + struct mtx lock; + struct callout *co_array; + int co_test; + int co_number_callouts; + int co_return_npa; + int co_completed; + int callout_waiting; + int drain_calls; + int cnt_zero; + int cnt_one; + int index; +}; + +static struct callout_run *comaster[MAXCPU]; + +uint64_t callout_total=0; + +static void execute_the_co_test(); + +static void +co_saydone(void *arg) +{ + struct callout_run *rn; + rn = (struct callout_run *)arg; + printf("The callout test is now complete for thread %d\n", + rn->index); + printf("number_callouts:%d\n", + rn->co_number_callouts); + printf("Callouts that bailed (Not PENDING or ACTIVE cleared):%d\n", + rn->co_return_npa); + printf("Callouts that completed:%d\n", rn->co_completed); + printf("Drain calls:%d\n", rn->drain_calls); + printf("Zero returns:%d non-zero:%d\n", + rn->cnt_zero, + rn->cnt_one); + +} + +static void +drainit(void *arg) +{ + struct callout_run *rn; + rn = (struct callout_run *)arg; + mtx_lock(&rn->lock); + rn->drain_calls++; + mtx_unlock(&rn->lock); +} + +static void +test_callout(void *arg) +{ + struct callout_run *rn; + int cpu; + + critical_enter(); + cpu = curcpu; + critical_exit(); + rn = (struct callout_run *)arg; + atomic_add_int(&rn->callout_waiting, 1); + mtx_lock(&rn->lock); + if (callout_pending(&rn->co_array[cpu]) || + !callout_active(&rn->co_array[cpu])) { + rn->co_return_npa++; + atomic_subtract_int(&rn->callout_waiting, 1); + mtx_unlock(&rn->lock); + return; + } + callout_deactivate(&rn->co_array[cpu]); + rn->co_completed++; + mtx_unlock(&rn->lock); + atomic_subtract_int(&rn->callout_waiting, 1); +} + +void +execute_the_co_test(struct callout_run *rn) +{ + int i, ret, cpu; + uint32_t tk_s, tk_e, tk_d; + + mtx_lock(&rn->lock); + rn->callout_waiting = 0; + for(i=0; ico_number_callouts; i++) { + if (rn->co_test == 1) { + /* start all on spread out cpu's */ + cpu = i % mp_ncpus; + callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, + cpu, 0); + } else { + /* Start all on the same CPU */ + callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, + rn->index, 0); + } + } + tk_s = ticks; + while (rn->callout_waiting != rn->co_number_callouts) { + cpu_spinwait(); + tk_e = ticks; + tk_d = tk_e - tk_s; + if (tk_d > 100) { + break; + } + } + /* OK everyone is waiting and we have the lock */ + for(i=0; ico_number_callouts; i++) { + ret = callout_async_drain(&rn->co_array[i], drainit); + if (ret) { + rn->cnt_one++; + } else { + rn->cnt_zero++; + } + } + rn->callout_waiting -= rn->cnt_one; + mtx_unlock(&rn->lock); + /* Now wait until all are done */ + tk_s = ticks; + while (rn->callout_waiting > 0) { + cpu_spinwait(); + tk_e = ticks; + tk_d = tk_e - tk_s; + if (tk_d > 100) { + break; + } + } + co_saydone((void *)rn); +} + + +static void +run_callout_test(struct kern_test *test) +{ + struct callout_test *u; + size_t sz; + int i; + struct callout_run *rn; + int index = test->tot_threads_running; + + u = (struct callout_test *)test->test_options; + if (comaster[index] == NULL) { + rn = comaster[index] = malloc(sizeof(struct callout_run), M_CALLTMP, M_WAITOK); + memset(comaster[index], 0, sizeof(struct callout_run)); + mtx_init(&rn->lock, "callouttest", NULL, MTX_DUPOK); + rn->index = index; + } else { + rn = comaster[index]; + rn->co_number_callouts = rn->co_return_npa = 0; + rn->co_completed = rn->callout_waiting = 0; + rn->drain_calls = rn->cnt_zero = rn->cnt_one = 0; + if (rn->co_array) { + free(rn->co_array, M_CALLTMP); + rn->co_array = NULL; + } + } + rn->co_number_callouts = u->number_of_callouts; + rn->co_test = u->test_number; + sz = sizeof(struct callout) * rn->co_number_callouts; + rn->co_array = malloc(sz, M_CALLTMP, M_WAITOK); + for(i=0; ico_number_callouts; i++) { + callout_init(&rn->co_array[i], CALLOUT_MPSAFE); + } + execute_the_co_test(rn); +} + +int callout_test_is_loaded=0; + +static void +cocleanup(void) +{ + int i; + for(i=0; ico_array) { + free(comaster[i]->co_array, M_CALLTMP); + comaster[i]->co_array = NULL; + } + free(comaster[i], M_CALLTMP); + comaster[i] = NULL; + } + } +} + +static int +callout_test_modevent(module_t mod, int type, void *data) +{ + int err=0; + + switch (type) { + case MOD_LOAD: + err = kern_testframework_register("callout_test", + run_callout_test); + if (err) { + printf("Can't load callout_test err:%d returned\n", + err); + } else { + memset(comaster, 0, sizeof(comaster)); + callout_test_is_loaded = 1; + } + break; + case MOD_QUIESCE: + err = kern_testframework_deregister("callout_test"); + if (err == 0) { + callout_test_is_loaded = 0; + cocleanup(); + } + break; + case MOD_UNLOAD: + if (callout_test_is_loaded) { + err = kern_testframework_deregister("callout_test"); + if (err == 0) { + cocleanup(); + callout_test_is_loaded = 0; + } + } + break; + default: + return (EOPNOTSUPP); + } + return (err); +} + +static moduledata_t callout_test_mod = { + .name = "callout_test", + .evhand = callout_test_modevent, + .priv = 0 +}; + +MODULE_DEPEND(callout_test, kern_testframework, 1, 1, 1); +DECLARE_MODULE(callout_test, callout_test_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Added: head/sys/tests/framework/kern_testfrwk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/tests/framework/kern_testfrwk.c Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,343 @@ +/*- + * Copyright (c) 2015 + * Netflix Incorporated, 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 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. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#endif + +struct kern_test_list { + TAILQ_ENTRY(kern_test_list) next; + char name[TEST_NAME_LEN]; + kerntfunc func; +}; + +TAILQ_HEAD(ktestlist, kern_test_list); + +struct kern_test_entry { + TAILQ_ENTRY(kern_test_entry) next; + struct kern_test_list *kt_e; + struct kern_test kt_data; +}; +TAILQ_HEAD(ktestqueue, kern_test_entry); + +MALLOC_DEFINE(M_KTFRWK, "kern_tfrwk", "Kernel Test Framework"); +struct kern_totfrwk { + struct taskqueue *kfrwk_tq; + struct task kfrwk_que; + struct ktestlist kfrwk_testlist; + struct ktestqueue kfrwk_testq; + struct mtx kfrwk_mtx; + int kfrwk_waiting; +}; + +struct kern_totfrwk kfrwk; +static int ktest_frwk_inited=0; + +#define KTFRWK_MUTEX_INIT() mtx_init(&kfrwk.kfrwk_mtx, "kern_test_frwk", "tfrwk", MTX_DEF) + +#define KTFRWK_DESTROY() mtx_destroy(&kfrwk.kfrwk_mtx) + +#define KTFRWK_LOCK() mtx_lock(&kfrwk.kfrwk_mtx) + +#define KTFRWK_UNLOCK() mtx_unlock(&kfrwk.kfrwk_mtx) + +static void +kfrwk_task(void *context, int pending) +{ + struct kern_totfrwk *tf; + struct kern_test_entry *wk; + int free_mem=0; + struct kern_test kt_data; + kerntfunc ktf; + + memset(&kt_data, 0, sizeof(kt_data)); + ktf = NULL; + tf = (struct kern_totfrwk *)context; + KTFRWK_LOCK(); + wk = TAILQ_FIRST(&tf->kfrwk_testq); + if (wk) { + wk->kt_data.tot_threads_running--; + tf->kfrwk_waiting--; + memcpy(&kt_data, &wk->kt_data, sizeof(kt_data)); + if (wk->kt_data.tot_threads_running == 0) { + TAILQ_REMOVE(&tf->kfrwk_testq, wk, next); + free_mem = 1; + } else { + /* Wake one of my colleages up to help too */ + taskqueue_enqueue(tf->kfrwk_tq, &tf->kfrwk_que); + } + if (wk->kt_e) { + ktf = wk->kt_e->func; + } + } + KTFRWK_UNLOCK(); + if (wk && free_mem) { + free(wk, M_KTFRWK); + } + /* Execute the test */ + if (ktf){ + (*ktf)(&kt_data); + } + /* We are done */ + atomic_add_int(&tf->kfrwk_waiting, 1); +} + +static int +kerntest_frwk_init(void) +{ + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + + KTFRWK_MUTEX_INIT(); + TAILQ_INIT(&kfrwk.kfrwk_testq); + TAILQ_INIT(&kfrwk.kfrwk_testlist); + /* Now lets start up a number of tasks to do the work */ + TASK_INIT(&kfrwk.kfrwk_que, 0, kfrwk_task, &kfrwk); + kfrwk.kfrwk_tq = taskqueue_create_fast("sbtls_task", M_NOWAIT, + taskqueue_thread_enqueue, &kfrwk.kfrwk_tq); + if (kfrwk.kfrwk_tq == NULL) { + printf("Can't start taskqueue for Kernel Test Framework\n"); + panic("Taskqueue init fails for kfrwk"); + } + taskqueue_start_threads(&kfrwk.kfrwk_tq, ncpus, PI_NET, "[kt_frwk task]"); + kfrwk.kfrwk_waiting = ncpus; + ktest_frwk_inited = 1; + return(0); +} + +static int +kerntest_frwk_fini(void) +{ + KTFRWK_LOCK(); + if (!TAILQ_EMPTY(&kfrwk.kfrwk_testlist)) { + /* Still modules registered */ + KTFRWK_UNLOCK(); + return (EBUSY); + } + ktest_frwk_inited = 0; + KTFRWK_UNLOCK(); + taskqueue_free(kfrwk.kfrwk_tq); + /* Ok lets destroy the mutex on the way outs */ + KTFRWK_DESTROY(); + return (0); +} + + +static int kerntest_execute(SYSCTL_HANDLER_ARGS); + +SYSCTL_DECL(_kern); +SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW, 0, "Kernel Test Framework"); +SYSCTL_PROC(_kern_testfrwk, OID_AUTO, runtest, (CTLTYPE_STRUCT | CTLFLAG_RW), + 0, 0, kerntest_execute, "IU", "Execute a kernel test"); + +int +kerntest_execute(SYSCTL_HANDLER_ARGS) +{ + struct kern_test kt; + struct kern_test_list *li, *te=NULL; + struct kern_test_entry *kte=NULL; + int error = 0; + + if (ktest_frwk_inited == 0) { + return(ENOENT); + } + /* Find the entry if possible */ + error = SYSCTL_IN(req, &kt, sizeof(struct kern_test)); + if (error) { + return(error); + } + if (kt.num_threads <= 0) { + return (EINVAL); + } + /* Grab some memory */ + kte = malloc(sizeof(struct kern_test_entry), M_KTFRWK, M_WAITOK); + if (kte == NULL) { + error = ENOMEM; + goto out; + } + KTFRWK_LOCK(); + TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) { + if (strcmp(li->name, kt.name) == 0) { + te = li; + break; + } + } + if (te == NULL) { + printf("Can't find the test %s\n", kt.name); + error = ENOENT; + free(kte, M_KTFRWK); + goto out; + } + /* Ok we have a test item to run, can we? */ + if (!TAILQ_EMPTY(&kfrwk.kfrwk_testq)) { + /* We don't know if there is enough threads */ + error = EAGAIN; + free(kte, M_KTFRWK); + goto out; + } + if (kfrwk.kfrwk_waiting < kt.num_threads) { + error = E2BIG; + free(kte, M_KTFRWK); + goto out; + } + kt.tot_threads_running = kt.num_threads; + /* Ok it looks like we can do it, lets get an entry */ + kte->kt_e = li; + memcpy(&kte->kt_data, &kt, sizeof(kt)); + TAILQ_INSERT_TAIL(&kfrwk.kfrwk_testq, kte, next); + taskqueue_enqueue(kfrwk.kfrwk_tq, &kfrwk.kfrwk_que); +out: + KTFRWK_UNLOCK(); + return(error); +} + +int +kern_testframework_register(const char *name, kerntfunc func) +{ + int error = 0; + struct kern_test_list *li, *te=NULL; + int len; + + len = strlen(name); + if (len >= TEST_NAME_LEN) { + return (E2BIG); + } + te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK); + if (te == NULL) { + error = ENOMEM; + goto out; + } + KTFRWK_LOCK(); + /* First does it already exist? */ + TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) { + if (strcmp(li->name, name) == 0) { + error = EALREADY; + free(te, M_KTFRWK); + goto out; + } + } + /* Ok we can do it, lets add it to the list */ + te->func = func; + strcpy(te->name, name); + TAILQ_INSERT_TAIL(&kfrwk.kfrwk_testlist, te, next); +out: + KTFRWK_UNLOCK(); + return(error); +} + +int +kern_testframework_deregister(const char *name) +{ + struct kern_test_list *li, *te=NULL; + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + int error = 0; + + KTFRWK_LOCK(); + /* First does it already exist? */ + TAILQ_FOREACH (li, &kfrwk.kfrwk_testlist, next) { + if (strcmp(li->name, name) == 0) { + te = li; + break; + } + } + if (te == NULL) { + /* It is not registered so no problem */ + goto out; + } + if (ncpus != kfrwk.kfrwk_waiting) { + /* We are busy executing something -- can't unload */ + error = EBUSY; + goto out; + } + if (!TAILQ_EMPTY(&kfrwk.kfrwk_testq)) { + /* Something still to execute */ + error = EBUSY; + goto out; + } + /* Ok we can remove the dude safely */ + TAILQ_REMOVE(&kfrwk.kfrwk_testlist, te, next); + memset(te, 0, sizeof(struct kern_test_list)); + free(te, M_KTFRWK); +out: + KTFRWK_UNLOCK(); + return(error); +} + +static int +kerntest_mod_init(module_t mod, int type, void *data) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = kerntest_frwk_init(); + break; + case MOD_QUIESCE: + KTFRWK_LOCK(); + if (TAILQ_EMPTY(&kfrwk.kfrwk_testlist)) { + err = 0; + } else { + err = EBUSY; + } + KTFRWK_UNLOCK(); + break; + case MOD_UNLOAD: + err = kerntest_frwk_fini(); + break; + default: + return (EOPNOTSUPP); + } + return (err); +} + +static moduledata_t kern_test_framework = { + .name = "kernel_testfrwk", + .evhand = kerntest_mod_init, + .priv = 0 +}; + +MODULE_VERSION(kern_testframework, 1); +DECLARE_MODULE(kern_testframework, kern_test_framework, SI_SUB_PSEUDO, SI_ORDER_ANY); Added: head/sys/tests/kern_testfrwk.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/tests/kern_testfrwk.h Tue Nov 10 14:14:41 2015 (r290663) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015 + * Netflix Incorporated, 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 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. + *__FBSDID("$FreeBSD$"); + * + */ +#ifndef _SYS_KERN_TESTFRWKT_H_ +#define _SYS_KERN_TESTFRWKT_H_ + +#define TEST_NAME_LEN 32 +#define TEST_OPTION_SPACE 256 + +struct kern_test { + char name[TEST_NAME_LEN]; + int num_threads; /* Fill in how many threads you want */ + int tot_threads_running; /* For framework */ + uint8_t test_options[TEST_OPTION_SPACE]; +}; + + +typedef void (*kerntfunc)(struct kern_test *); + +#ifdef _KERNEL +int kern_testframework_register(const char *name, kerntfunc); + +int kern_testframework_deregister(const char *name); +#endif +#endif From owner-svn-src-all@freebsd.org Tue Nov 10 14:49:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97505A2A052; Tue, 10 Nov 2015 14:49:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55A8419BC; Tue, 10 Nov 2015 14:49:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAEnXAd065750; Tue, 10 Nov 2015 14:49:33 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAEnXIi065747; Tue, 10 Nov 2015 14:49:33 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511101449.tAAEnXIi065747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 10 Nov 2015 14:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290664 - in head: share/man/man9 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 14:49:34 -0000 Author: rrs Date: Tue Nov 10 14:49:32 2015 New Revision: 290664 URL: https://svnweb.freebsd.org/changeset/base/290664 Log: Add new async_drain to the callout system. This is so-far not used but should be used by TCP for sure in its cleanup of the IN-PCB (will be coming shortly). Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D4076 Modified: head/share/man/man9/timeout.9 head/sys/kern/kern_timeout.c head/sys/sys/callout.h Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 (r290663) +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 (r290664) @@ -35,6 +35,7 @@ .Sh NAME .Nm callout_active , .Nm callout_deactivate , +.Nm callout_async_drain , .Nm callout_drain , .Nm callout_handle_init , .Nm callout_init , @@ -69,6 +70,8 @@ typedef void timeout_t (void *); .Ft void .Fn callout_deactivate "struct callout *c" .Ft int +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" +.Ft int .Fn callout_drain "struct callout *c" .Ft void .Fn callout_handle_init "struct callout_handle *handle" @@ -236,17 +239,42 @@ The function cancels a callout .Fa c if it is currently pending. -If the callout is pending, then +If the callout is pending and successfuly stopped, then .Fn callout_stop -returns a non-zero value. -If the callout is not set, -has already been serviced, -or is currently being serviced, +returns a value of one. +If the callout is not set, or +has already been serviced, then +negative one is returned. +If the callout is currently being serviced and cannot be stopped, 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_async_drain +is identical to +.Fn callout_stop +with one difference. +When +.Fn callout_async_drain +returns zero it will arrange for the function +.Fa drain +to be called using the same argument given to the +.Fn callout_reset +function. +.Fn callout_async_drain +If the callout has an associated lock, +then that lock must be held when this function is called. +Note that when stopping multiple callouts that use the same lock it is possible +to get multiple return's of zero and multiple calls to the +.Fa drain +function, depending upon which CPU's the callouts are running. The +.Fa drain +function itself is called from the context of the completing callout +i.e. softclock or hardclock, just like a callout itself. +p +.Pp +The function .Fn callout_drain is identical to .Fn callout_stop Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; */ struct cc_exec { struct callout *cc_curr; + void (*cc_drain)(void *); #ifdef SMP void (*ce_migration_func)(void *); void *ce_migration_arg; @@ -170,6 +171,7 @@ struct callout_cpu { #define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain #define cc_exec_next(cc) cc->cc_next #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel #define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str cc_exec_curr(cc, direct) = c; cc_exec_cancel(cc, direct) = false; + cc_exec_drain(cc, direct) = NULL; CC_UNLOCK(cc); if (c_lock != NULL) { class->lc_lock(c_lock, lock_status); @@ -744,6 +747,15 @@ skip: CC_LOCK(cc); KASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr")); cc_exec_curr(cc, direct) = NULL; + if (cc_exec_drain(cc, direct)) { + void (*drain)(void *); + + drain = cc_exec_drain(cc, direct); + cc_exec_drain(cc, direct) = NULL; + CC_UNLOCK(cc); + drain(c_arg); + CC_LOCK(cc); + } if (cc_exec_waiting(cc, direct)) { /* * There is someone waiting for the @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int } int -_callout_stop_safe(struct callout *c, int safe) +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void *)) { struct callout_cpu *cc, *old_cc; struct lock_class *class; @@ -1225,19 +1237,22 @@ again: * stop it by other means however. */ if (!(c->c_iflags & CALLOUT_PENDING)) { - c->c_flags &= ~CALLOUT_ACTIVE; - /* * If it wasn't on the queue and it isn't the current * callout, then we can't stop it, so just bail. + * It probably has already been run (if locking + * is properly done). You could get here if the caller + * calls stop twice in a row for example. The second + * call would fall here without CALLOUT_ACTIVE set. */ + c->c_flags &= ~CALLOUT_ACTIVE; if (cc_exec_curr(cc, direct) != c) { CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", c, c->c_func, c->c_arg); CC_UNLOCK(cc); if (sq_locked) sleepq_release(&cc_exec_waiting(cc, direct)); - return (0); + return (-1); } if (safe) { @@ -1298,14 +1313,16 @@ again: CC_LOCK(cc); } } else if (use_lock && - !cc_exec_cancel(cc, direct)) { + !cc_exec_cancel(cc, direct) && (drain == NULL)) { /* * The current callout is waiting for its * lock which we hold. Cancel the callout * and return. After our caller drops the * lock, the callout will be skipped in - * softclock(). + * softclock(). This *only* works with a + * callout_stop() *not* callout_drain() or + * callout_async_drain(). */ cc_exec_cancel(cc, direct) = true; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", @@ -1351,11 +1368,17 @@ again: #endif CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p", c, c->c_func, c->c_arg); + if (drain) { + cc_exec_drain(cc, direct) = drain; + } CC_UNLOCK(cc); return (0); } CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", c, c->c_func, c->c_arg); + if (drain) { + cc_exec_drain(cc, direct) = drain; + } CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain still locked")); return (0); Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) @@ -81,7 +81,7 @@ struct callout_handle { */ #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) -#define callout_drain(c) _callout_stop_safe(c, 1) +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) void callout_init(struct callout *, int); void _callout_init_lock(struct callout *, struct lock_object *, int); #define callout_init_mtx(c, mtx, flags) \ @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i int callout_schedule_on(struct callout *, int, int); #define callout_schedule_curcpu(c, on_tick) \ callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) -#define callout_stop(c) _callout_stop_safe(c, 0) -int _callout_stop_safe(struct callout *, int); +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) +int _callout_stop_safe(struct callout *, int, void (*)(void *)); void callout_process(sbintime_t now); - +#define callout_async_drain(c, d) \ + _callout_stop_safe(c, 0, d) #endif #endif /* _SYS_CALLOUT_H_ */ From owner-svn-src-all@freebsd.org Tue Nov 10 14:57:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDDAA2A359; Tue, 10 Nov 2015 14:57:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF1B1EE7; Tue, 10 Nov 2015 14:57:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 441DA1FE022; Tue, 10 Nov 2015 15:57:17 +0100 (CET) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys To: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511101449.tAAEnXIi065747@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <56420634.5060704@selasky.org> Date: Tue, 10 Nov 2015 15:59:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511101449.tAAEnXIi065747@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 14:57:26 -0000 On 11/10/15 15:49, Randall Stewart wrote: > +#define callout_async_drain(c, d) \ > + _callout_stop_safe(c, 0, d) Hi, Like commented in D4076, I think the callout_async_drain() function should take a second void pointer argument, which is passed to the drain function, instead of re-using the pointer argument passed to callout_reset(), because that will make many to one, N:1, asynchronous drain possible. --HPS From owner-svn-src-all@freebsd.org Tue Nov 10 15:03:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9877EA2A5AC for ; Tue, 10 Nov 2015 15:03:32 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::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 62D1513B7 for ; Tue, 10 Nov 2015 15:03:32 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pasz6 with SMTP id z6so243973283pas.2 for ; Tue, 10 Nov 2015 07:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=pBrtqoz9QurPabOEbEvEbi6nOkFpJYvQQ0NDVzmtlkA=; b=k4BnB36BYcHVo4cEL1kDjMuqdohy1YmzeFVDz6JBFmJ4pP1Z0DDAgX1P3iN8kiaKar ivhPhNXupwOtMT2gVpKZQzPMEg2auFpcE1x7jeQ04wU1JpMKTr3d6V1SnMcyi8ffqH5W GbI4LpCWUB2+xb9PkSCbEA4FinuQQ41RjCFV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=pBrtqoz9QurPabOEbEvEbi6nOkFpJYvQQ0NDVzmtlkA=; b=LpamYNi1pGwGrd05MRFAO/q2h2g4Vs0W6wrTqyxam04Y6CYM6EdRbF4ow3x1yl9OUw RTikWy1ZEOh+dSRAPSM8yGyzphS0kheNMnQAFoRk4EDQ3JGWou2AjEIJT4ES2f4Fs+K8 dkHOBCrvxfB/hp5wsRVxDUcneEoS3QPbotq4EIXh/cMEGMUQ3v+nMZVmSEk8Du7ibhno tXnqggcMmxROGXuYXufH2345yximHZ26dsqSEp/QBbSlWhDV3RphrOVpBvHzxd9XXBoX 0GYNwCdxh6qkbJd/ILbYaHo8QjWa+SebOIlfZu74rHWFsJa6+aIoHxa0zkqSYy7ofnJc EKQA== X-Gm-Message-State: ALoCoQnawVDpij0cw4qnIDVBzidyydW2T+b1UGgRw72tmJ5NkKTQ31dj4TegcOUFQ+9BWPupIMZR X-Received: by 10.66.193.38 with SMTP id hl6mr6440298pac.85.1447167809993; Tue, 10 Nov 2015 07:03:29 -0800 (PST) Received: from [100.127.144.199] ([69.53.245.39]) by smtp.gmail.com with ESMTPSA id d13sm4629012pbu.20.2015.11.10.07.03.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Nov 2015 07:03:29 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <56420634.5060704@selasky.org> Date: Tue, 10 Nov 2015 10:03:28 -0500 Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <19671573-5C8C-4E33-845B-791DA966E4A9@netflix.com> References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <56420634.5060704@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:03:32 -0000 And I disagree here Hans You don=92t need that and it just adds more into the callout system that is not needed. R On Nov 10, 2015, at 9:59 AM, Hans Petter Selasky = wrote: > On 11/10/15 15:49, Randall Stewart wrote: >> +#define callout_async_drain(c, d) = \ >> + _callout_stop_safe(c, 0, d) >=20 > Hi, >=20 > Like commented in D4076, I think the callout_async_drain() function = should take a second void pointer argument, which is passed to the drain = function, instead of re-using the pointer argument passed to = callout_reset(), because that will make many to one, N:1, asynchronous = drain possible. >=20 > --HPS -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Tue Nov 10 15:08:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE67A2A8DC for ; Tue, 10 Nov 2015 15:08:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC6E18BB for ; Tue, 10 Nov 2015 15:08:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 10 Nov 2015 15:08:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tAAF82w5003524; Tue, 10 Nov 2015 08:08:02 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1447168083.91061.2.camel@freebsd.org> Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux From: Ian Lepore To: Hans Petter Selasky , Bruce Evans , "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 10 Nov 2015 08:08:03 -0700 In-Reply-To: <5641A056.2040805@selasky.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:08:06 -0000 On Tue, 2015-11-10 at 08:44 +0100, Hans Petter Selasky wrote: > On 11/09/15 22:17, Bruce Evans wrote: > > On Mon, 9 Nov 2015, Conrad E. Meyer wrote: > > > > > Log: > > > linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC > > > warning > > > > > > The code compiles fine under Clang, but GCC on PPC is less > > > permissive > > > about > > > integer and pointer sizes. (An intmax_t is clearly *large > > > enough* to > > > hold a > > > pointer value.) > > > > > > Another follow-up to r290475. > > > > This shouldn't compile either. > > > > Hi Conrad, > > > > static int > > -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, > > intptr_t arg2, > > +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, > > intmax_t arg2, > > struct sysctl_req *req, struct rm_priotracker *tracker) > > Given that the second argument is sometimes used for pointers, maybe > we > should keep it intptr_t. Or add a compile time assert that > sizeof(intmax) >= sizeof(intptr_t) which I think doesn't hold? > > --HPS > If intmax_t is the "maximum width integer type" and intptr_t is "integer type capable of holding a pointer", I think by definition sizeof(intmax_t) must be >= sizeof(intptr_t). On the other hand, given the perverse way standards-writers think, I'm not sure "big enough" is all it takes to qualify as "capable of holding a pointer". But I think in reality it'll work out right anyway. -- Ian From owner-svn-src-all@freebsd.org Tue Nov 10 15:18:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00DEFA2AC1F; Tue, 10 Nov 2015 15:18:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC0AE1F1F; Tue, 10 Nov 2015 15:18:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7BEC11FE022; Tue, 10 Nov 2015 16:18:27 +0100 (CET) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys To: Randall Stewart References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <56420634.5060704@selasky.org> <19671573-5C8C-4E33-845B-791DA966E4A9@netflix.com> Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56420B2B.50301@selasky.org> Date: Tue, 10 Nov 2015 16:20:11 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <19671573-5C8C-4E33-845B-791DA966E4A9@netflix.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:18:30 -0000 On 11/10/15 16:03, Randall Stewart wrote: > And I disagree here Hans > > You don’t need that and it just adds more into the > callout system that is not needed. Hi, It also makes debugging more easy, that you can see the last function call and argument. I.E. You should not have to clear the drain function pointer before calling the drain function. Something else. Maybe you should bump the FreeBSD version, because callout_stop() is a macro, and you've changed its API by adding another argument to _callout_stop_safe(), to force a recompilation of KLD's. Else garbage will be passed into "drain" ... --HPS From owner-svn-src-all@freebsd.org Tue Nov 10 15:29:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97158A2AED2; Tue, 10 Nov 2015 15:29:46 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A340164F; Tue, 10 Nov 2015 15:29:46 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-147-115-187.hsd1.va.comcast.net [73.147.115.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 21202F8016E; Tue, 10 Nov 2015 10:20:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1447168858; bh=jU9lBGmjlLjm+Y/dbCYYW+aK+9roAqQfqZQB239tBj8=; h=Subject:To:From:Date; b=dKB11uGM+Rtd2UMe3Gd9EdJO0kDEGou15kwhTlyv9lIUvcMkwkptHuUALGhHQiVrJ 326FVe18JLU09mM+9PRjBZryB7wtdTg9VJAah/TZYcswKAnJVdpa6A9PmG3sl+HUF5 socz4uDInzqaVfUJijza/d1GMYqTFULprBsPc5CNZZ+s0n1zJaEjUAuSQh819f20Ux sQW2YVqtPlrNnpZ1CBNEHx5hqR3fANEn1BjJvYMzkEHW06EuYP1HnxRrAuTmbQPt/6 lq0X8Y12qBX2qG36ItYm1/flzaXNU8C8LpJiCiMHifLdaiNJ32Tc6vZKgfLsD4awxO OJdNvjsSXza5A== Subject: Re: svn commit: r290650 - in head/sys: dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 modules/mlx5en To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511101220.tAACKMpn022738@repo.freebsd.org> From: Andrew Gallatin Message-ID: <56420B58.3080504@cs.duke.edu> Date: Tue, 10 Nov 2015 10:20:56 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511101220.tAACKMpn022738@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:29:46 -0000 On 11/10/2015 07:20, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Nov 10 12:20:22 2015 > New Revision: 290650 > URL: https://svnweb.freebsd.org/changeset/base/290650 > > Log: > Add mlx5 and mlx5en driver(s) for ConnectX-4 and ConnectX-4LX cards > from Mellanox Technologies. The current driver supports ethernet > speeds up to and including 100 GBit/s. Infiniband support will be > done later. > > The code added is not compiled by default, which will be done by a > separate commit. > > Sponsored by: Mellanox Technologies > MFC after: 2 weeks This has been extensively tested at high load here at Netflix, and we have had several internet facing machines serving well over 70Gb/s each across these NICs for the last few months. Drew From owner-svn-src-all@freebsd.org Tue Nov 10 15:42:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48BF6A2B1EF; Tue, 10 Nov 2015 15:42:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com [209.85.160.175]) (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 0B5BF1E6B; Tue, 10 Nov 2015 15:42:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykdv3 with SMTP id v3so819900ykd.0; Tue, 10 Nov 2015 07:42:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=JZe8XkkpSJUGsarenOS0qzfoilPyYsNKG+6/0iNqJbM=; b=QgIva4F1QUZ+WNlrNEq7+yqc2te/7K1QWSX1KdYyiS+Q//hR1Xj23/1wfs5VIRt6/F s9fKtkkm+yqZ/MgNgHubu5XVdovLJJYa1CZGHS7jhBq3ORzevoWMJm0JpvWv8a640+3P 66mxZh0bkE8RSy0lO6k9IXIdgHE5zIGq/UPi3QNGb7KPlh7gQHJL16qT8cwlRsDVyn1C rKteHP9E24AEdBxndP9jNdNYskeVT4qja/T56YBTVFlKwFvx3KEc7BssSrfLq6FN+T+E vE3KzHOtOvdmgD1rTQg+A9c1rLdnEIA3bBqm+pw8GcSqx9b9mYf+2dZvapi9Uv7vzGBg Sduw== X-Received: by 10.129.33.198 with SMTP id h189mr3465881ywh.287.1447170131171; Tue, 10 Nov 2015 07:42:11 -0800 (PST) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id n186sm4797519ywb.7.2015.11.10.07.42.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 07:42:11 -0800 (PST) Received: by ykfs79 with SMTP id s79so752122ykf.1; Tue, 10 Nov 2015 07:42:10 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.102.5 with SMTP id a5mr3928637ywc.9.1447170130673; Tue, 10 Nov 2015 07:42:10 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.17.2 with HTTP; Tue, 10 Nov 2015 07:42:10 -0800 (PST) In-Reply-To: <1447168083.91061.2.camel@freebsd.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> <1447168083.91061.2.camel@freebsd.org> Date: Tue, 10 Nov 2015 07:42:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux From: Conrad Meyer To: Hans Petter Selasky , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:42:18 -0000 On Tue, Nov 10, 2015 at 7:08 AM, Ian Lepore wrote: > On Tue, 2015-11-10 at 08:44 +0100, Hans Petter Selasky wrote: >> > -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >> > intptr_t arg2, >> > +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >> > intmax_t arg2, >> > struct sysctl_req *req, struct rm_priotracker *tracker) >> >> Given that the second argument is sometimes used for pointers, maybe >> we >> should keep it intptr_t. Or add a compile time assert that >> sizeof(intmax) >=3D sizeof(intptr_t) which I think doesn't hold? > > If intmax_t is the "maximum width integer type" and intptr_t is > "integer type capable of holding a pointer", I think by definition > sizeof(intmax_t) must be >=3D sizeof(intptr_t). On the other hand, given > the perverse way standards-writers think, I'm not sure "big enough" is > all it takes to qualify as "capable of holding a pointer". But I think > in reality it'll work out right anyway. +1 to what Ian said. In any C99 implementation where intptr_t is defined, I believe intmax_t must be at least as big. See =C2=A7 7.18.1.5, "Greatest-width integer types," and =C2=A7 7.18.1.4, "Integer types capable of holding object pointers." > The following type designates a signed integer type with the property tha= t any valid pointer to void can be converted to this type, then converted b= ack to pointer to void, and the result will compare equal to the original p= ointer: intptr_t > > The following type designates a signed integer type capable of representi= ng any value of any signed integer type: intmax_t Given that intptr_t exists in our implementation and is a signed integer type, I see no reason why intmax_t could possibly not represent any such value. Same argument for the unsigned variants. Best, Conrad From owner-svn-src-all@freebsd.org Tue Nov 10 16:07:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B088A2B889 for ; Tue, 10 Nov 2015 16:07:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 C6F741DAF for ; Tue, 10 Nov 2015 16:07:30 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so701362lfs.3 for ; Tue, 10 Nov 2015 08:07:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=WiopZ85Xf1/fpwM9XbLw5axSvlJK4AlO651CWwtXdGA=; b=ZnzBe80JrI0yBkXUkkWv1Yi2vkm4xlbchoKyZrny8xW4krNO4is6ni5KJ3p/UtV5Aa RnJpIGkuAdrlNXZt3mHIDg1h5rx+guOuenIu+zO863bMvasUZ6ggQ7eO/uenbMq1vhG1 IIRp3SQsMizQPolEV7QYkASjj1Eo6BWzObhlGE1fJQR4oohcHdfSj7YeUuuJefxdCGsc pgE0t0qKGo0hLXFQQwmbWwkcd/x1l4npEqQneOyKuVZRcTxyItFMzAP48HDw4Io+15ux svrhDhoblRmTdxs44zAXwQgfGgHsfFAsNJjr7NIeajyIu+jd8NKXhyD5SybLUF5NgJdU 0R9Q== X-Gm-Message-State: ALoCoQn+ezb4heYfxeDr9GSVAUry2Gbx5C7pu8B46QS8qOeX2IcCxOv242oc0AgMg+c62qKpIfw2 X-Received: by 10.25.170.11 with SMTP id t11mr1976559lfe.20.1447171648290; Tue, 10 Nov 2015 08:07:28 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id ai8sm641446lbd.11.2015.11.10.08.07.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 08:07:27 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin , tcltk@FreeBSD.org References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> <20151110133615.GL10134@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov X-Enigmail-Draft-Status: N1110 Message-ID: <5642163E.1050405@freebsd.org> Date: Tue, 10 Nov 2015 19:07:26 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151110133615.GL10134@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7eBmxXoclN9i9Gr1lbf6o14rJp3IvHNmN" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:07:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7eBmxXoclN9i9Gr1lbf6o14rJp3IvHNmN Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 10.11.2015 16:36, Baptiste Daroussin wrote: > On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: >> On 10.11.2015 16:04, Baptiste Daroussin wrote: >>> On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: >>>> On 10.11.2015 11:11, Baptiste Daroussin wrote: >>>>> Author: bapt >>>>> Date: Tue Nov 10 08:11:27 2015 >>>>> New Revision: 290637 >>>>> URL: https://svnweb.freebsd.org/changeset/base/290637 >>>>> >>>>> Log: >>>>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales >>>>> as it used to be in previous version of the locales. Returning >>>>> "POSIX" has too many fallouts. >>>> >>>> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be >>>> different with real US-ASCII. It is what glibc returns for C/POSIX >>>> locale and most ports expected, being linux-oriented. >>>> >>> I thought about it, but in the end it is probably safer for now that = nl_langinfo >>> return US-ASCII as it did in the past, to reduce breakage with FreeBS= D only code >>> that maybe be existing ou there. >> >> All FreeBSD code I know never check locale this way. IMHO probability = of >> potential danger to meet some linux-oriented port with this check is >> much much higher than to meet similar FreeBSD only code in the wild. I= n >> any case, changing collate order from A-Za-z to aA-zZ we do just now >> have much higher probability to break unknown FreeBSD only code, so on= e >> breaking change can go with other one together. >> > That is true, except that the new collation thing is invalidated as soo= n as you > set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a worka= round while > changing the return value of nl_langinfo() is not workaroundable. Well, forget my improper comparison with collate and see this bug in action right now, in our port tcl8.6.4/unix/tclUnixInit.c: See localeTable and comment above it, there is internal "ansi_x3.4-1968" (i.e. POSIX locale), internal "ascii" and even no alias for our "us-ascii" at all. It gets info through nl_langinfo(CODESET), lowercased. I.e. not using "ANSI_X3.4-1968" breaks all tcl ports right now, this is more essential than hypothetical private FreeBSD only code no one see. --=20 http://ache.vniz.net/ --7eBmxXoclN9i9Gr1lbf6o14rJp3IvHNmN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWQhY+AAoJEKUckv0MjfbKqXUH/0uiAxp2+xqp1Z1B8p5JlqBT YRHkQyGWiJRYaw+HceXwhfGFe3LhIpPAgLaND0H7AIPOFjKP5B9kDr4OKwY6CjFI 2ogBIlkJkLJvSshS2DzSICiGrsAbs2hAGx7FHIODtaSEx6jSrlbDX8a/sBETopeT uT0Z95hnBWfut5eEQuymQnrAS0rCr2IcJECuzFInZ57KJ0RmruLdSZtNO/VSCIEU 99YDp5MAMk9/YdQvS9nAWF/mlu/nQSEN0dHSXWt0q507OovOkFtPvihIYUCMFZxe BkbNwYXCSMJ5q4W9FvklGHXz6qJkkOKiwh0EQYklXeMaEBfdbRPItKL/SchFyYg= =mbgi -----END PGP SIGNATURE----- --7eBmxXoclN9i9Gr1lbf6o14rJp3IvHNmN-- From owner-svn-src-all@freebsd.org Tue Nov 10 16:12:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8973FA2BAED; Tue, 10 Nov 2015 16:12:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22A721173; Tue, 10 Nov 2015 16:12:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmww144 with SMTP id w144so7268222wmw.0; Tue, 10 Nov 2015 08:12:08 -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=gPqXue4glG7mR5MmrhGgYJfAs5JqTqWPEuiQk+Yd8Ik=; b=e+T5k1/VblgdQBLkh9Df1JnNq3j9P9qLhgtUPswb87LAohArH/YbjY0CYupJcTtYdE qL9h7Gp7ypUWVzXR1Kn9yJ3d70wG290YwXZ303y1PmYO5dVtDUMWwz7yTiDsEx3vROMD LeI4VJucq7ePI+iWV1SCEO1GujDLAO3tu7PpSN/Z//8tSX/R4A3fdPzCmcJtpmgJDwzx eXSRaCiFaWdcE7vTwUDkWIsmrdSnAnb4RHxW71u77ddN5jDoFB7HDNyi1EZ62Z0in9ek OBq4BjP26A2/bNIOBu9/7S32s6R7rYJ61a+YgnO/v3/WtG/3uJeRDaZ6A7Y76Yt4IQsJ NYZw== X-Received: by 10.28.229.212 with SMTP id c203mr30979745wmh.11.1447171927743; Tue, 10 Nov 2015 08:12:07 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id w66sm4841068wme.11.2015.11.10.08.12.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 08:12:06 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 10 Nov 2015 17:12:04 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: tcltk@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r290637 - head/lib/libc/locale Message-ID: <20151110161204.GM10134@ivaldir.etoilebsd.net> References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> <20151110133615.GL10134@ivaldir.etoilebsd.net> <5642163E.1050405@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OGW1Z2JKiS9bXo17" Content-Disposition: inline In-Reply-To: <5642163E.1050405@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:12:10 -0000 --OGW1Z2JKiS9bXo17 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2015 at 07:07:26PM +0300, Andrey Chernov wrote: > On 10.11.2015 16:36, Baptiste Daroussin wrote: > > On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: > >> On 10.11.2015 16:04, Baptiste Daroussin wrote: > >>> On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: > >>>> On 10.11.2015 11:11, Baptiste Daroussin wrote: > >>>>> Author: bapt > >>>>> Date: Tue Nov 10 08:11:27 2015 > >>>>> New Revision: 290637 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/290637 > >>>>> > >>>>> Log: > >>>>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales > >>>>> as it used to be in previous version of the locales. Returning > >>>>> "POSIX" has too many fallouts. > >>>> > >>>> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be > >>>> different with real US-ASCII. It is what glibc returns for C/POSIX > >>>> locale and most ports expected, being linux-oriented. > >>>> > >>> I thought about it, but in the end it is probably safer for now that = nl_langinfo > >>> return US-ASCII as it did in the past, to reduce breakage with FreeBS= D only code > >>> that maybe be existing ou there. > >> > >> All FreeBSD code I know never check locale this way. IMHO probability = of > >> potential danger to meet some linux-oriented port with this check is > >> much much higher than to meet similar FreeBSD only code in the wild. In > >> any case, changing collate order from A-Za-z to aA-zZ we do just now > >> have much higher probability to break unknown FreeBSD only code, so one > >> breaking change can go with other one together. > >> > > That is true, except that the new collation thing is invalidated as soo= n as you > > set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a worka= round while > > changing the return value of nl_langinfo() is not workaroundable. >=20 > Well, forget my improper comparison with collate and see this bug in > action right now, in our port tcl8.6.4/unix/tclUnixInit.c: >=20 > See localeTable and comment above it, there is internal "ansi_x3.4-1968" > (i.e. POSIX locale), internal "ascii" and even no alias for our > "us-ascii" at all. >=20 > It gets info through nl_langinfo(CODESET), lowercased. I.e. not using > "ANSI_X3.4-1968" breaks all tcl ports right now, this is more essential > than hypothetical private FreeBSD only code no one see. That one is a valid point, that also means that is is broken right now on FreeBSD 10 and below? Best regards, Bapt --OGW1Z2JKiS9bXo17 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZCF1QACgkQ8kTtMUmk6EyP/QCfWiV1aNhs9KSkUD9jju/7ms0L KXYAnRYIik2hzCtx9XwqnBHg1Tzl4GG/ =ZF+g -----END PGP SIGNATURE----- --OGW1Z2JKiS9bXo17-- From owner-svn-src-all@freebsd.org Tue Nov 10 16:15:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4E5A2BD8B; Tue, 10 Nov 2015 16:15:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 37BE01869; Tue, 10 Nov 2015 16:15:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 0A55C25D385E; Tue, 10 Nov 2015 16:15:36 +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 4FC7EC77037; Tue, 10 Nov 2015 16:15:36 +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 9YJxd8TIHLjX; Tue, 10 Nov 2015 16:15:34 +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 9160FC76FDB; Tue, 10 Nov 2015 16:15:34 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290663 - in head/sys: modules modules/tests modules/tests/callout_test modules/tests/framework tests tests/callout_test tests/framework From: "Bjoern A. Zeeb" In-Reply-To: <201511101414.tAAEEfPI057133@repo.freebsd.org> Date: Tue, 10 Nov 2015 16:15:32 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201511101414.tAAEEfPI057133@repo.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:15:45 -0000 > On 10 Nov 2015, at 14:14 , Randall Stewart wrote: >=20 > Author: rrs > Date: Tue Nov 10 14:14:41 2015 > New Revision: 290663 > URL: https://svnweb.freebsd.org/changeset/base/290663 >=20 > Log: > Add a kernel test framework. The callout_test is a demonstration and = will only > work with the upcoming async-drain functionality. Tests can be added > to the tests directory and then the framework can be used to launch > those tests. >=20 > MFC after: 1 month > Sponsored by: Netflix Inc. > Differential Revision: https://reviews.freebsd.org/D1755 >=20 = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:75: warning: function declaration isn't a = prototype [-Wstrict-prototypes] = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:133: warning: no previous prototype for = =E2=80=98execute_the_co_test' [-Wmissing-prototypes] = /scratch/tmp/bz/head.svn/sys/modules/tests/framework/../../../tests/framew= ork/kern_testfrwk.c:171: warning: redundant redeclaration of = 'sysctl___kern' [-Wredundant-decls] /scratch/tmp/bz/head.svn/sys/sys/sysctl.h:918: warning: previous = declaration of =E2=80=98sysctl___kern' was here This is on sparc64 but I guess that=E2=80=99s just one of my early = kernel compiles. > Added: > head/sys/modules/tests/ > head/sys/modules/tests/callout_test/ > head/sys/modules/tests/callout_test/Makefile (contents, props = changed) > head/sys/modules/tests/framework/ > head/sys/modules/tests/framework/Makefile (contents, props changed) > head/sys/tests/ > head/sys/tests/callout_test/ > head/sys/tests/callout_test.h (contents, props changed) > head/sys/tests/callout_test/callout_test.c (contents, props = changed) > head/sys/tests/framework/ > head/sys/tests/framework/kern_testfrwk.c (contents, props changed) > head/sys/tests/kern_testfrwk.h (contents, props changed) > Modified: > head/sys/modules/Makefile From owner-svn-src-all@freebsd.org Tue Nov 10 16:19:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F09F0A2BF00 for ; Tue, 10 Nov 2015 16:19:57 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (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 448C41C51 for ; Tue, 10 Nov 2015 16:19:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lffu14 with SMTP id u14so1012085lff.1 for ; Tue, 10 Nov 2015 08:19:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=tjWdaLCu5hj4eQNuZLNiVQBjcgV6Jy+MUNB0yvtZQ5Q=; b=TqHgrBJ3b3bUz879obV71k9fJ9jzt24uDFmCmWeCLCvpSCTuMy9SefbMEQbfqf6j4P nKVW9YzjheUA0k/hNvWNgAYJkuinxqBsflHihg4E090X8B4/OC7k/GrcDcQRu4bn6WV9 KUTFZgmTgF1+jVyrJq9UtAaUpO7iZxqezS8+ow9BxdVJuUIpZ3HcEO4sQoIFrTerGsj0 3twGTOfyXSh9WQXAZuTjqjgPykA8Rw1S8fIjMZwMvybYInNy/JKgrhIAHo4sc/aODhQL 2J8+GEygsGj1TAlhWFBBP41DJOg5BThG3bJmcoqH6xeT0VQN8hkmev/nGQv64x8UP6aS EeHQ== X-Gm-Message-State: ALoCoQmlBx5iU5FOf2xpgWz0+/qhMjjY7xVQS/Qpha1s8QIJUdwgieHLD3+/l+P33dAgtq6S6t/Z X-Received: by 10.25.211.210 with SMTP id k201mr1764310lfg.30.1447172389308; Tue, 10 Nov 2015 08:19:49 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id k1sm655730lfe.23.2015.11.10.08.19.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 08:19:48 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> <20151110133615.GL10134@ivaldir.etoilebsd.net> <5642163E.1050405@freebsd.org> <20151110161204.GM10134@ivaldir.etoilebsd.net> Cc: tcltk@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Andrey Chernov Message-ID: <56421923.7080601@freebsd.org> Date: Tue, 10 Nov 2015 19:19:47 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151110161204.GM10134@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PuKg2eHPNNvjl8UeQ6v8WHta5mjDtdWw2" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:19:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PuKg2eHPNNvjl8UeQ6v8WHta5mjDtdWw2 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 10.11.2015 19:12, Baptiste Daroussin wrote: > On Tue, Nov 10, 2015 at 07:07:26PM +0300, Andrey Chernov wrote: >> On 10.11.2015 16:36, Baptiste Daroussin wrote: >>> On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: >>>> On 10.11.2015 16:04, Baptiste Daroussin wrote: >>>>> On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: >>>>>> On 10.11.2015 11:11, Baptiste Daroussin wrote: >>>>>>> Author: bapt >>>>>>> Date: Tue Nov 10 08:11:27 2015 >>>>>>> New Revision: 290637 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/290637 >>>>>>> >>>>>>> Log: >>>>>>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locale= s >>>>>>> as it used to be in previous version of the locales. Returning >>>>>>> "POSIX" has too many fallouts. >>>>>> >>>>>> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to be= >>>>>> different with real US-ASCII. It is what glibc returns for C/POSIX= >>>>>> locale and most ports expected, being linux-oriented. >>>>>> >>>>> I thought about it, but in the end it is probably safer for now tha= t nl_langinfo >>>>> return US-ASCII as it did in the past, to reduce breakage with Free= BSD only code >>>>> that maybe be existing ou there. >>>> >>>> All FreeBSD code I know never check locale this way. IMHO probabilit= y of >>>> potential danger to meet some linux-oriented port with this check is= >>>> much much higher than to meet similar FreeBSD only code in the wild.= In >>>> any case, changing collate order from A-Za-z to aA-zZ we do just now= >>>> have much higher probability to break unknown FreeBSD only code, so = one >>>> breaking change can go with other one together. >>>> >>> That is true, except that the new collation thing is invalidated as s= oon as you >>> set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a wor= karound while >>> changing the return value of nl_langinfo() is not workaroundable. >> >> Well, forget my improper comparison with collate and see this bug in >> action right now, in our port tcl8.6.4/unix/tclUnixInit.c: >> >> See localeTable and comment above it, there is internal "ansi_x3.4-196= 8" >> (i.e. POSIX locale), internal "ascii" and even no alias for our >> "us-ascii" at all. >> >> It gets info through nl_langinfo(CODESET), lowercased. I.e. not using >> "ANSI_X3.4-1968" breaks all tcl ports right now, this is more essentia= l >> than hypothetical private FreeBSD only code no one see. >=20 > That one is a valid point, that also means that is is broken right now = on > FreeBSD 10 and below? Yes. It can't map our C locale to the some of internal ones and falls back to TCL_DEFAULT_ENCODING "iso8859-1" --=20 http://ache.vniz.net/ --PuKg2eHPNNvjl8UeQ6v8WHta5mjDtdWw2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWQhkjAAoJEKUckv0MjfbKZJ8H/1WmexGjac80HoT4GC1YoiZc 1tHQqlfakh3619HpOTw3biKdWOjVH1wpVxTNin/yelA9REmKhH6IM+T29Wk5MjvV tCM/B+PPDLa5tbgSfH6+V9PdCtSDvSK9U62oBWtgdexekYv3Pvno0e0e9vkbVm0H 34mGw/w6uyUVtrMtTrIG9xr9O5RK3BL7xJV9heTstI4vyeVrQcb4Sl4VmSEny8y0 wRhqBbPfgzejv9sS4Df00hdvZ8TSLxirrGkPwSi64KOfhJBub9U6HIlvm98ePgcc Gfwf2yDjLA4jvqe2Eemd7fTTJPBvThJCcFdEOUWtweGNWjlhFGdjRqPjrjLLB3M= =c9LU -----END PGP SIGNATURE----- --PuKg2eHPNNvjl8UeQ6v8WHta5mjDtdWw2-- From owner-svn-src-all@freebsd.org Tue Nov 10 16:33:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC900A2B43E for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (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 749DD15E8 for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfdo63 with SMTP id o63so1223649lfd.2 for ; Tue, 10 Nov 2015 08:33:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=p2Xvq55U3ghXzeS+OTEGgxnXwVx1z8DO1HegHhTspFc=; b=j2hflxvXcqiYOdwe/QB2pDDrZ5s19Cm8NDNC+cFqn66dvsQEzgBAJ6sAp2lNczd8KB DH7jmjlLDC/BhxdeXovuS2Wso8QNXOr6am31eRsDHTPigMwbQa1MDW0qdjTQUct3kgxf AOi01cbX73QmAhIZ83iqqUbpjnpUa2KxAPg8A3j5Ap/Ohd1tj74+PgtPphy5bzs1Ux/1 cammOOnNmbrgapLdZriqKLCBfG754Sgyixh3Ibo9MZMj+EC5h9npS7SkTjAiPb1l8qn9 oDWvOTXmiKTqk11F4xv8h+s14XMKdP+0g8dmZX0bDwkT98+Ac5t9r9FA4zUozVRhL3fT VuvQ== X-Gm-Message-State: ALoCoQkHMijizh3FgytQQ1NjDWXJnxq8MeSvNjdgXbcYvQ1tjWORIIuQi5ABqiXyVqXIRPyhccY9 X-Received: by 10.25.39.135 with SMTP id n129mr2122847lfn.60.1447173205374; Tue, 10 Nov 2015 08:33:25 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id yp7sm651697lbb.47.2015.11.10.08.33.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 08:33:24 -0800 (PST) Subject: Re: svn commit: r290637 - head/lib/libc/locale To: Baptiste Daroussin References: <201511100811.tAA8BR0R034338@repo.freebsd.org> <5641E7B4.2070508@freebsd.org> <20151110130430.GK10134@ivaldir.etoilebsd.net> <5641EF26.8060600@freebsd.org> <20151110133615.GL10134@ivaldir.etoilebsd.net> <5642163E.1050405@freebsd.org> <20151110161204.GM10134@ivaldir.etoilebsd.net> <56421923.7080601@freebsd.org> Cc: tcltk@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Andrey Chernov Message-ID: <56421C53.8080508@freebsd.org> Date: Tue, 10 Nov 2015 19:33:23 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56421923.7080601@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:33:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 10.11.2015 19:19, Andrey Chernov wrote: > On 10.11.2015 19:12, Baptiste Daroussin wrote: >> On Tue, Nov 10, 2015 at 07:07:26PM +0300, Andrey Chernov wrote: >>> On 10.11.2015 16:36, Baptiste Daroussin wrote: >>>> On Tue, Nov 10, 2015 at 04:20:38PM +0300, Andrey Chernov wrote: >>>>> On 10.11.2015 16:04, Baptiste Daroussin wrote: >>>>>> On Tue, Nov 10, 2015 at 03:48:52PM +0300, Andrey Chernov wrote: >>>>>>> On 10.11.2015 11:11, Baptiste Daroussin wrote: >>>>>>>> Author: bapt >>>>>>>> Date: Tue Nov 10 08:11:27 2015 >>>>>>>> New Revision: 290637 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/290637 >>>>>>>> >>>>>>>> Log: >>>>>>>> return "US-ASCII" instead of "POSIX" for "C" and "POSIX" local= es >>>>>>>> as it used to be in previous version of the locales. Returning= >>>>>>>> "POSIX" has too many fallouts. >>>>>>> >>>>>>> You can return "ANSI_X3.4-1968" (another name of "US-ASCII") to b= e >>>>>>> different with real US-ASCII. It is what glibc returns for C/POSI= X >>>>>>> locale and most ports expected, being linux-oriented. >>>>>>> >>>>>> I thought about it, but in the end it is probably safer for now th= at nl_langinfo >>>>>> return US-ASCII as it did in the past, to reduce breakage with Fre= eBSD only code >>>>>> that maybe be existing ou there. >>>>> >>>>> All FreeBSD code I know never check locale this way. IMHO probabili= ty of >>>>> potential danger to meet some linux-oriented port with this check i= s >>>>> much much higher than to meet similar FreeBSD only code in the wild= =2E In >>>>> any case, changing collate order from A-Za-z to aA-zZ we do just no= w >>>>> have much higher probability to break unknown FreeBSD only code, so= one >>>>> breaking change can go with other one together. >>>>> >>>> That is true, except that the new collation thing is invalidated as = soon as you >>>> set LC_COLLATE=3DC which bring your back to A-Za-z. So you have a wo= rkaround while >>>> changing the return value of nl_langinfo() is not workaroundable. >>> >>> Well, forget my improper comparison with collate and see this bug in >>> action right now, in our port tcl8.6.4/unix/tclUnixInit.c: >>> >>> See localeTable and comment above it, there is internal "ansi_x3.4-19= 68" >>> (i.e. POSIX locale), internal "ascii" and even no alias for our >>> "us-ascii" at all. >>> >>> It gets info through nl_langinfo(CODESET), lowercased. I.e. not using= >>> "ANSI_X3.4-1968" breaks all tcl ports right now, this is more essenti= al >>> than hypothetical private FreeBSD only code no one see. >> >> That one is a valid point, that also means that is is broken right now= on >> FreeBSD 10 and below? >=20 > Yes. It can't map our C locale to the some of internal ones and falls > back to TCL_DEFAULT_ENCODING "iso8859-1" >=20 BTW, for pure ASCII locale readded we should return "ASCII" instead of "US-ASCII". I search lots of Linux code and see many checks for "ASCII" and no checks for "US-ASCII" (like in tcl too). --=20 http://ache.vniz.net/ --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWQhxTAAoJEKUckv0MjfbKnbYIAMLfjFCut/E4y6+HFpN4NLfs Id/m+XiHOKHbb65aUBBpu0a5OzlMbYpD1d51QASWFb1gKaqR3TQ4bh8ybmMueWLM MZvS7BIvPnwhdi5/u6MaiLS0+H5TpiSp6QkkHn1Mxx9k1iZiTqIIAsGAWor13Wje DoHZM5Jrdqn4YG9G/RgtfrgsoAsJGqEKFChWNBktzh8ykvdTH/OSaBkcZowqptsq wYdHGxABS6+RuB0Zfvjs/v/iu5rCLnqj+oaXY/QVZUH6wmJ16+fkIKPeXEDiD+M5 vF0/UaWivd7V5a9CHL9lgZdEZoE3W40vfkUcIEFBh606jDgYHhvDwfzkaebrjOk= =CK2Q -----END PGP SIGNATURE----- --am5Kka7H6VhIIcTiKgWO1ApUdUOSSaPkD-- From owner-svn-src-all@freebsd.org Tue Nov 10 16:35:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBBD7A2B4D5; Tue, 10 Nov 2015 16:35:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id AE2BF1893; Tue, 10 Nov 2015 16:35:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id DFB6E1043142; Wed, 11 Nov 2015 03:35:29 +1100 (AEDT) Date: Wed, 11 Nov 2015 03:35:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: <5641A056.2040805@selasky.org> Message-ID: <20151111033159.O2914@besplex.bde.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=W74xX4CpOI2vpzQXT_kA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:35:40 -0000 On Tue, 10 Nov 2015, Hans Petter Selasky wrote: > On 11/09/15 22:17, Bruce Evans wrote: >> ... >> This shouldn't compile either. > >> static int >> -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intptr_t >> arg2, >> +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intmax_t >> arg2, >> struct sysctl_req *req, struct rm_priotracker *tracker) > > Given that the second argument is sometimes used for pointers, maybe we > should keep it intptr_t. Or add a compile time assert that sizeof(intmax) >= > sizeof(intptr_t) which I think doesn't hold? Then it wouldn't be large enough to hold int64_t on i386 or intmax_t on all arches. intmax_t is already not large enough to hold uintmax_t. intmax_t can hold more than intptr_t, but its size and rank may be smaller. See another reply. Bruce From owner-svn-src-all@freebsd.org Tue Nov 10 17:15:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF93A2C23B; Tue, 10 Nov 2015 17:15:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3671EF1; Tue, 10 Nov 2015 17:15:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAAHFb36009519; Tue, 10 Nov 2015 17:15:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAAHFarR009514; Tue, 10 Nov 2015 17:15:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511101715.tAAHFarR009514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 10 Nov 2015 17:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290665 - in head/sys/modules: . drm2 drm2/radeonkmsfw netgraph usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 17:15:38 -0000 Author: bdrewery Date: Tue Nov 10 17:15:36 2015 New Revision: 290665 URL: https://svnweb.freebsd.org/changeset/base/290665 Log: Build all of sys/modules with SUBDIR_PARALLEL. Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks Modified: head/sys/modules/Makefile.inc head/sys/modules/drm2/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile head/sys/modules/netgraph/Makefile head/sys/modules/usb/Makefile Modified: head/sys/modules/Makefile.inc ============================================================================== --- head/sys/modules/Makefile.inc Tue Nov 10 14:49:32 2015 (r290664) +++ head/sys/modules/Makefile.inc Tue Nov 10 17:15:36 2015 (r290665) @@ -4,3 +4,4 @@ CFLAGS+= -DPC98 .endif +SUBDIR_PARALLEL= yes Modified: head/sys/modules/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/Makefile Tue Nov 10 14:49:32 2015 (r290664) +++ head/sys/modules/drm2/Makefile Tue Nov 10 17:15:36 2015 (r290665) @@ -3,8 +3,6 @@ SYSDIR?=${.CURDIR}/../.. .include "${SYSDIR}/conf/kern.opts.mk" -SUBDIR_PARALLEL= - .if ${MACHINE_CPUARCH} == "amd64" _i915kms= i915kms _radeonkms= radeonkms Modified: head/sys/modules/drm2/radeonkmsfw/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkmsfw/Makefile Tue Nov 10 14:49:32 2015 (r290664) +++ head/sys/modules/drm2/radeonkmsfw/Makefile Tue Nov 10 17:15:36 2015 (r290665) @@ -1,7 +1,5 @@ # $FreeBSD$ -SUBDIR_PARALLEL= - SUBDIR= \ ARUBA_me \ ARUBA_pfp \ Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Tue Nov 10 14:49:32 2015 (r290664) +++ head/sys/modules/netgraph/Makefile Tue Nov 10 17:15:36 2015 (r290665) @@ -62,6 +62,4 @@ _bluetooth= bluetooth _mppc= mppc .endif -SUBDIR_PARALLEL= - .include Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Tue Nov 10 14:49:32 2015 (r290664) +++ head/sys/modules/usb/Makefile Tue Nov 10 17:15:36 2015 (r290665) @@ -29,11 +29,6 @@ SYSDIR?=${.CURDIR}/../.. .include "${SYSDIR}/conf/kern.opts.mk" # -# Allow USB modules to be built in parallel -# -SUBDIR_PARALLEL= - -# # Check for common USB debug flags to pass when building the USB # modules in this directory: # From owner-svn-src-all@freebsd.org Tue Nov 10 17:25:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE7BA2C550; Tue, 10 Nov 2015 17:25:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C86F91599; Tue, 10 Nov 2015 17:25:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA13662; Tue, 10 Nov 2015 19:25:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZwCg2-000FD9-1L; Tue, 10 Nov 2015 19:25:50 +0200 Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux To: Bruce Evans , Hans Petter Selasky References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> <20151111033159.O2914@besplex.bde.org> Cc: "Conrad E. Meyer" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: <56422865.5010606@FreeBSD.org> Date: Tue, 10 Nov 2015 19:24:53 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151111033159.O2914@besplex.bde.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 17:25:55 -0000 On 10/11/2015 18:35, Bruce Evans wrote: > intmax_t can hold more than intptr_t, but its size and rank may be smaller. > See another reply. I think that that's the case on middle-endian architectures. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Nov 10 17:29:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA8CA2C5E9; Tue, 10 Nov 2015 17:29:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::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 1F43318AF; Tue, 10 Nov 2015 17:29:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by iodd200 with SMTP id d200so8348776iod.0; Tue, 10 Nov 2015 09:29: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:content-transfer-encoding; bh=zlQS2WLcuN8AL4IyW1EYFjGLVY1PvcMdxtIPAotF/4M=; b=FSgN5S8QrdFBNbEr3aRYWHECqwD8fg1QFmbPnV46luPrRhbb6ZIHqct93xVizZ3yFm OthAeag9gJ+nIC66kSYMZpv/Glq2ONfPiqvauQUV7hIsZTFh4LL51xMSi6eS/WoVoljI 4tSNHlkHyOQym6YaWxWO2fGj2b0MC0S0rd/f1nzzeqaaiYI0XRLjCtSW0M8vKpjbrEoC yUz0AHwUv+96mddHLoCtB6KRnrw/oBV8Me1BwzbcBU8frZo89JtBmZJ+944kZIqJ2KLh n9/B2LE4BTa1kZjG1cKt71odHjHGFMTeYM5LXxnJbC0l/R/L9fYFZm07gl087y7D55R4 /Xiw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni_cwru_edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=zlQS2WLcuN8AL4IyW1EYFjGLVY1PvcMdxtIPAotF/4M=; b=Cqcjx0xq0/fHe+StjiVq8Ha0qbedvcFDdvoxFVfOpelS7DOoOZVgd43cjk6MSXFehf wzK50Eb1wK8x430mIA4e55lMzq6D5T3KN1gN7+3QdvGp4l32lUg3ZnYmeV4nDiOkaD/8 efWKVPaB16/wRA0VLUbUjKJyzzPa3JBEok6EXj7tuOrkuBDscY52Usn+y4cOZ/LFsfHn kaZybskvNhHXKYB9boaMqAxWEPsHYeiCaoVjopeT5yOCQdEAn49Cy7+INly6dKYMqtf6 gB947aMLgO6JRxv31cPX9JYwCpYqp8zfBF3Q16hhXq5GKBkM68iqlEaym1s98ClT8P7g TM8g== MIME-Version: 1.0 X-Received: by 10.107.150.196 with SMTP id y187mr5132106iod.13.1447176587146; Tue, 10 Nov 2015 09:29:47 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.36.41.138 with HTTP; Tue, 10 Nov 2015 09:29:47 -0800 (PST) In-Reply-To: References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> <1447168083.91061.2.camel@freebsd.org> Date: Tue, 10 Nov 2015 11:29:47 -0600 X-Google-Sender-Auth: U_Nl-hLk2JBAjuD8wvxxpfzGph4 Message-ID: Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux From: Justin Hibbits To: cem@freebsd.org Cc: Hans Petter Selasky , Ian Lepore , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 17:29:48 -0000 On Tue, Nov 10, 2015 at 9:42 AM, Conrad Meyer wrote: > On Tue, Nov 10, 2015 at 7:08 AM, Ian Lepore wrote: >> On Tue, 2015-11-10 at 08:44 +0100, Hans Petter Selasky wrote: >>> > -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >>> > intptr_t arg2, >>> > +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >>> > intmax_t arg2, >>> > struct sysctl_req *req, struct rm_priotracker *tracker) >>> >>> Given that the second argument is sometimes used for pointers, maybe >>> we >>> should keep it intptr_t. Or add a compile time assert that >>> sizeof(intmax) >=3D sizeof(intptr_t) which I think doesn't hold? >> >> If intmax_t is the "maximum width integer type" and intptr_t is >> "integer type capable of holding a pointer", I think by definition >> sizeof(intmax_t) must be >=3D sizeof(intptr_t). On the other hand, give= n >> the perverse way standards-writers think, I'm not sure "big enough" is >> all it takes to qualify as "capable of holding a pointer". But I think >> in reality it'll work out right anyway. > > +1 to what Ian said. > > In any C99 implementation where intptr_t is defined, I believe > intmax_t must be at least as big. See =C2=A7 7.18.1.5, "Greatest-width > integer types," and =C2=A7 7.18.1.4, "Integer types capable of holding > object pointers." > >> The following type designates a signed integer type with the property th= at any valid pointer to void can be converted to this type, then converted = back to pointer to void, and the result will compare equal to the original = pointer: intptr_t >> >> The following type designates a signed integer type capable of represent= ing any value of any signed integer type: intmax_t > > Given that intptr_t exists in our implementation and is a signed > integer type, I see no reason why intmax_t could possibly not > represent any such value. Same argument for the unsigned variants. > > Best, > Conrad > I may be wrong on this, but I *think* uintptr_t/intptr_t are required to be *precisely* the same size as a pointer, which explains why you can't cast directly from uintmax_t on 32-bit architectures. - Justin From owner-svn-src-all@freebsd.org Tue Nov 10 17:50:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12A15A2CB96; Tue, 10 Nov 2015 17:50:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id C40CE1306; Tue, 10 Nov 2015 17:50:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id EA952781041; Wed, 11 Nov 2015 04:50:52 +1100 (AEDT) Date: Wed, 11 Nov 2015 04:50:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Hans Petter Selasky , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: Message-ID: <20151111033555.P2914@besplex.bde.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> <1447168083.91061.2.camel@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=qW0Wa05-ZPK7qB2RKggA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 17:50:58 -0000 On Tue, 10 Nov 2015, Conrad Meyer wrote: > On Tue, Nov 10, 2015 at 7:08 AM, Ian Lepore wrote: >> On Tue, 2015-11-10 at 08:44 +0100, Hans Petter Selasky wrote: >>>> -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >>>> intptr_t arg2, >>>> +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, >>>> intmax_t arg2, >>>> struct sysctl_req *req, struct rm_priotracker *tracker) >>> >>> Given that the second argument is sometimes used for pointers, maybe >>> we >>> should keep it intptr_t. Or add a compile time assert that >>> sizeof(intmax) >=3D sizeof(intptr_t) which I think doesn't hold? >> >> If intmax_t is the "maximum width integer type" and intptr_t is >> "integer type capable of holding a pointer", I think by definition >> sizeof(intmax_t) must be >=3D sizeof(intptr_t). intmax_t isn't the "maximum width integer type". It is a "signed integer type capable of representing any value of any signed integer type (includin= g extended ones). This imples that INTMAX_MAX >=3D INTPTR_MAX but not that sizeof(intmax_t) >=3D sizeof(intptr_t) or that rankof(intmax_t) >=3D rankof(intptr_t). intptr_t may have more padding bit= s than intmax_t. In FreeBSD, rankof(intmax_t) >=3D rankof(intptr_t), but rankof(intmax_t) doesn't have maximum rank. It is smaller than the long long abomination in rank on all 64-bit arches All arches declare intmax_t as int64_t, and this has to be long_long_abomination_t on 32-bit arches (except I made it a magic gcc type in old versions of FreeBSD and C where long long was a syntax error), but intmax_t is always plain long on 64 bit arches. In terms of rank, intptr_t =3D=3D int64_t =3D=3D intmax_t < long_long_abomination_t on 64-bit arches, and intptr_t < int64_t =3D=3D intmax_t =3D=3D long_long_abomination_t on 32-bit= arches. >> On the other hand, given >> the perverse way standards-writers think, I'm not sure "big enough" is >> all it takes to qualify as "capable of holding a pointer". But I think >> in reality it'll work out right anyway. Only on vaxes, unless you write correct code. E.g., consider the following reasonable implementation: - pointers have 64 bits, consisting of 32 high address bits and 32 low low type bits - the type bits for void have value 1=20 - intmax_t is also 64 bits - intptr_t is 32 bits (the type bits need not be represented because they are always 1) - conversion from void * to intmax_t then can and should be to copy all the bits. The void * pointer kernbase with bits 0xc000000000000001 gives the same bit when converted to intmax_t. The reversion conversion also copies the bits. - conversion from void * to intmax_t must reduce to 32 bits. It can and should do this in the obvious way by discarding the low type bits and shifting the top bits to the low bits. The kernbase becomes 0xc00000000 when converted to intptr_t. The reverse conversion shifts the addres bits back and sets the type bits to their known value for void *. Then wrong code breaks nicely. (intptr_t)(intmax_t)kernbase gives 1 and there is obviously no way to convert this back to kernbase. To use intmax_t for kernbase, you have write (intmax_t)(intptr_t)kernbase. This has value 0xc0000000. Then to get back to void *, first cast back to intptr_t. Qualified pointers to void are required to work too. In the above implementation, they should have different type bits and some only difference is that casting back must restore different type bits. Conversions of other pointers are not required to work, but would work accidentally. All the type info needed to recover the original type bits is in the cast back (provided it is really back to the same type). > +1 to what Ian said. > > In any C99 implementation where intptr_t is defined, I believe > intmax_t must be at least as big. See =C2=A7 7.18.1.5, "Greatest-width > integer types," and =C2=A7 7.18.1.4, "Integer types capable of holding > object pointers." >=20 >> The following type designates a signed integer type with the property th= at any valid pointer to void can be converted to this type, then converted = back to pointer to void, and the result will compare equal to the original = pointer: intptr_t Note that it only requires working when the conversion is to this type. Any conversion from a pointer to int may involve some reduction or reordering of the bits. The conversion might depend on the type of both the integer and the pointer in more complicated ways than the above. The requirement that the conversions are not required to work for all "large enough" types makes things simpler for everyone. >> The following type designates a signed integer type capable of represent= ing any value of any signed integer type: intmax_t > > Given that intptr_t exists in our implementation and is a signed > integer type, I see no reason why intmax_t could possibly not > represent any such value. Same argument for the unsigned variants. It can only represent integers directly. intptr_t is only required to represent pointers with some unique encoding. Other integer types are only required to represent (via conversion) pointers with some encoding. The encoding is not required to be unique. 0 for everything is a valid encoding and might be used to detect bugs or just accidentally for optimization. Bruce From owner-svn-src-all@freebsd.org Tue Nov 10 18:23:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A954A2B4C0; Tue, 10 Nov 2015 18:23:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 370561B4E; Tue, 10 Nov 2015 18:23:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id CEBC4D641AE; Wed, 11 Nov 2015 05:23:05 +1100 (AEDT) Date: Wed, 11 Nov 2015 05:23:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits cc: cem@freebsd.org, Hans Petter Selasky , Ian Lepore , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: Message-ID: <20151111051325.S3235@besplex.bde.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> <1447168083.91061.2.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8_tSZztaHGgigfQZgVQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 18:23:14 -0000 On Tue, 10 Nov 2015, Justin Hibbits wrote: > On Tue, Nov 10, 2015 at 9:42 AM, Conrad Meyer wrote: >> ... >> Given that intptr_t exists in our implementation and is a signed >> integer type, I see no reason why intmax_t could possibly not >> represent any such value. Same argument for the unsigned variants. > > I may be wrong on this, but I *think* uintptr_t/intptr_t are required > to be *precisely* the same size as a pointer, which explains why you > can't cast directly from uintmax_t on 32-bit architectures. Good compilers use the size for a simple portability check. They should also complain if the types are different but have the same size, as is done for int vs long format mismatches on i386. Bruce From owner-svn-src-all@freebsd.org Tue Nov 10 20:20:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168C0A2B2E0; Tue, 10 Nov 2015 20:20:04 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 BD6A01455; Tue, 10 Nov 2015 20:20:03 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgea14 with SMTP id a14so7963933qge.0; Tue, 10 Nov 2015 12:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=C8Eg/GCFH34a6qF+tirgG7Bo4UIGcT04SM+k654mKhw=; b=oYrLlrqYIAfjUj8txzPVciIc+z7E6n6qGUtj8xYI6h7EhdY2qc8ahRQrlrzONlAeiY +FnwhlNhDTL442TsLSrVr3DcziPyZ8WQP+VYcmJTn0CHpODsnJC8Wd0yS1QjZ+hKrv3Z AXKtbc7He0557dgQvJim3rq3YJK7JyvtwRHtFPYbFlV2qOThkqnBzLVFDbs+TPADJcZa MfOMLinY1W9vUA4EiBSVX5sncMZEN3Q8vnd2kqtbPbP1StWTI5o59NP/w708kIAxrjUI JoJ4M9ZID632Nns0Bff8PLPzMzC0fcVY76H+ZbEVXdSUt1RZL1ORmiRTha9vt6tGGPkq PA6Q== X-Received: by 10.140.235.143 with SMTP id g137mr7441189qhc.11.1447186802730; Tue, 10 Nov 2015 12:20:02 -0800 (PST) Received: from mbp.home (179-125-138-101.desktop.com.br. [179.125.138.101]) by smtp.gmail.com with ESMTPSA id 22sm1947244qhq.39.2015.11.10.12.20.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Nov 2015 12:20:02 -0800 (PST) Sender: Renato Botelho Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: svn commit: r290651 - head/sys/dev/usb/wlan From: Renato Botelho In-Reply-To: <201511101252.tAACqQrE033782@repo.freebsd.org> Date: Tue, 10 Nov 2015 18:19:59 -0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2D6627A5-D455-424C-8A9E-0A18754CFE11@FreeBSD.org> References: <201511101252.tAACqQrE033782@repo.freebsd.org> To: Andriy Voskoboinyk X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 20:20:04 -0000 > On Nov 10, 2015, at 10:52, Andriy Voskoboinyk = wrote: >=20 > Author: avos > Date: Tue Nov 10 12:52:26 2015 > New Revision: 290651 > URL: https://svnweb.freebsd.org/changeset/base/290651 >=20 > Log: > urtwn(4): add IBSS mode support >=20 > Tested with RTL8188EU, IBSS and STA modes. >=20 > Reviewed by: kevlo > Approved by: adrian (mentor) > Differential Revision: https://reviews.freebsd.org/D4038 >=20 > Modified: > head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/usb/wlan/if_urtwnvar.h >=20 > Modified: head/sys/dev/usb/wlan/if_urtwn.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:20:22 2015 = (r290650) > +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:52:26 2015 = (r290651) > @@ -228,10 +228,14 @@ static int = urtwn_setup_beacon(struct ur > static void urtwn_update_beacon(struct ieee80211vap *, int); > static int urtwn_tx_beacon(struct urtwn_softc *sc, > struct urtwn_vap *); > +static void urtwn_tsf_task_adhoc(void *, int); > static void urtwn_tsf_sync_enable(struct urtwn_softc *, > struct ieee80211vap *); > static void urtwn_set_led(struct urtwn_softc *, int, int); > static void urtwn_set_mode(struct urtwn_softc *, uint8_t); > +static void urtwn_ibss_recv_mgmt(struct ieee80211_node *, > + struct mbuf *, int, > + const struct ieee80211_rx_stats *, int, = int); > static int urtwn_newstate(struct ieee80211vap *, > enum ieee80211_state, int); > static void urtwn_watchdog(void *); > @@ -449,6 +453,7 @@ urtwn_attach(device_t self) > ic->ic_caps =3D > IEEE80211_C_STA /* station mode */ > | IEEE80211_C_MONITOR /* monitor mode */ > + | IEEE80211_C_IBSS /* adhoc mode */ > | IEEE80211_C_HOSTAP /* hostap mode */ > | IEEE80211_C_SHPREAMBLE /* short preamble = supported */ > | IEEE80211_C_SHSLOT /* short slot time = supported */ > @@ -592,13 +597,18 @@ urtwn_vap_create(struct ieee80211com *ic > return (NULL); > } >=20 > - if (opmode =3D=3D IEEE80211_M_HOSTAP) > + if (opmode =3D=3D IEEE80211_M_HOSTAP || opmode =3D=3D = IEEE80211_M_IBSS) > urtwn_init_beacon(sc, uvp); >=20 > /* override state transition machine */ > uvp->newstate =3D vap->iv_newstate; > vap->iv_newstate =3D urtwn_newstate; > vap->iv_update_beacon =3D urtwn_update_beacon; > + if (opmode =3D=3D IEEE80211_M_IBSS) { > + uvp->recv_mgmt =3D vap->iv_recv_mgmt; > + vap->iv_recv_mgmt =3D urtwn_ibss_recv_mgmt; > + TASK_INIT(&uvp->tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, = vap); > + } >=20 > /* complete setup */ > ieee80211_vap_attach(vap, ieee80211_media_change, > @@ -610,13 +620,13 @@ urtwn_vap_create(struct ieee80211com *ic > static void > urtwn_vap_delete(struct ieee80211vap *vap) > { > + struct ieee80211com *ic =3D vap->iv_ic; > struct urtwn_vap *uvp =3D URTWN_VAP(vap); > - enum ieee80211_opmode opmode =3D vap->iv_opmode; >=20 > - if (opmode =3D=3D IEEE80211_M_HOSTAP) { > - if (uvp->bcn_mbuf !=3D NULL) > - m_freem(uvp->bcn_mbuf); > - } > + if (uvp->bcn_mbuf !=3D NULL) > + m_freem(uvp->bcn_mbuf); > + if (vap->iv_opmode =3D=3D IEEE80211_M_IBSS) > + ieee80211_draintask(ic, &uvp->tsf_task_adhoc); > ieee80211_vap_detach(vap); > free(uvp, M_80211_VAP); > } > @@ -1611,8 +1621,50 @@ urtwn_tx_beacon(struct urtwn_softc *sc,=20 > } >=20 > static void > +urtwn_tsf_task_adhoc(void *arg, int pending) > +{ > + struct ieee80211vap *vap =3D arg; > + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; > + struct ieee80211_node *ni; > + uint32_t reg; > + > + URTWN_LOCK(sc); > + ni =3D ieee80211_ref_node(vap->iv_bss); > + reg =3D urtwn_read_1(sc, R92C_BCN_CTRL); > + > + /* Accept beacons with the same BSSID. */ > + urtwn_set_rx_bssid_all(sc, 0); > + > + /* Enable synchronization. */ > + reg &=3D ~R92C_BCN_CTRL_DIS_TSF_UDT0; > + urtwn_write_1(sc, R92C_BCN_CTRL, reg); > + > + /* Synchronize. */ > + usb_pause_mtx(&sc->sc_mtx, hz * ni->ni_intval * 5 / 1000); > + > + /* Disable synchronization. */ > + reg |=3D R92C_BCN_CTRL_DIS_TSF_UDT0; > + urtwn_write_1(sc, R92C_BCN_CTRL, reg); > + > + /* Remove beacon filter. */ > + urtwn_set_rx_bssid_all(sc, 1); > + > + /* Enable beaconing. */ > + urtwn_write_1(sc, R92C_MBID_NUM, > + urtwn_read_1(sc, R92C_MBID_NUM) | R92C_MBID_TXBCN_RPT0); > + reg |=3D R92C_BCN_CTRL_EN_BCN; > + > + urtwn_write_1(sc, R92C_BCN_CTRL, reg); > + ieee80211_free_node(ni); > + URTWN_UNLOCK(sc); > +} > + > +static void > urtwn_tsf_sync_enable(struct urtwn_softc *sc, struct ieee80211vap = *vap) > { > + struct ieee80211com *ic =3D &sc->sc_ic; > + struct urtwn_vap *uvp =3D URTWN_VAP(vap); > + > /* Reset TSF. */ > urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); >=20 > @@ -1623,6 +1675,9 @@ urtwn_tsf_sync_enable(struct urtwn_softc > urtwn_read_1(sc, R92C_BCN_CTRL) & > ~R92C_BCN_CTRL_DIS_TSF_UDT0); > break; > + case IEEE80211_M_IBSS: > + ieee80211_runtask(ic, &uvp->tsf_task_adhoc); > + break; > case IEEE80211_M_HOSTAP: > /* Enable beaconing. */ > urtwn_write_1(sc, R92C_MBID_NUM, > @@ -1674,6 +1729,37 @@ urtwn_set_mode(struct urtwn_softc *sc, u > urtwn_write_1(sc, R92C_MSR, reg); > } >=20 > +static void > +urtwn_ibss_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int = subtype, > + const struct ieee80211_rx_stats *rxs, > + int rssi, int nf) > +{ > + struct ieee80211vap *vap =3D ni->ni_vap; > + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; > + struct urtwn_vap *uvp =3D URTWN_VAP(vap); > + uint64_t ni_tstamp, curr_tstamp; > + > + uvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); > + > + if (vap->iv_state =3D=3D IEEE80211_S_RUN && > + (subtype =3D=3D IEEE80211_FC0_SUBTYPE_BEACON || > + subtype =3D=3D IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { > + ni_tstamp =3D le64toh(ni->ni_tstamp.tsf); > +#ifdef D3831 > + URTWN_LOCK(sc); > + urtwn_get_tsf(sc, &curr_tstamp); > + URTWN_UNLOCK(sc); > + curr_tstamp =3D le64toh(curr_tstamp); > + > + if (ni_tstamp >=3D curr_tstamp) > + (void) ieee80211_ibss_merge(ni); > +#else > + (void) sc; > + (void) curr_tstamp; > +#endif > + } > +} > + > static int > urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, = int arg) > { > @@ -1757,6 +1843,9 @@ urtwn_newstate(struct ieee80211vap *vap, > case IEEE80211_M_STA: > mode =3D R92C_MSR_INFRA; > break; > + case IEEE80211_M_IBSS: > + mode =3D R92C_MSR_ADHOC; > + break; > case IEEE80211_M_HOSTAP: > mode =3D R92C_MSR_AP; > break; > @@ -1794,13 +1883,14 @@ urtwn_newstate(struct ieee80211vap *vap, >=20 > if (vap->iv_opmode !=3D IEEE80211_M_HOSTAP) > reg |=3D R92C_RCR_CBSSID_DATA; > - > - reg |=3D R92C_RCR_CBSSID_BCN; > + if (vap->iv_opmode !=3D IEEE80211_M_IBSS) > + reg |=3D R92C_RCR_CBSSID_BCN; >=20 > urtwn_write_4(sc, R92C_RCR, reg); > } >=20 > - if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP) { > + if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP || > + vap->iv_opmode =3D=3D IEEE80211_M_IBSS) { > error =3D urtwn_setup_beacon(sc, ni); > if (error !=3D 0) { > device_printf(sc->sc_dev, > @@ -3007,6 +3097,7 @@ urtwn_rxfilter_init(struct urtwn_softc * > = R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_BEACON)); > break; > case IEEE80211_M_MONITOR: > + case IEEE80211_M_IBSS: > break; > default: > device_printf(sc->sc_dev, "%s: undefined opmode %d\n", > @@ -3335,7 +3426,9 @@ urtwn_scan_start(struct ieee80211com *ic >=20 > URTWN_LOCK(sc); > /* Receive beacons / probe responses from any BSSID. */ > - urtwn_set_rx_bssid_all(sc, 1); > + if (ic->ic_opmode !=3D IEEE80211_M_IBSS) > + urtwn_set_rx_bssid_all(sc, 1); > + > /* Set gain for scanning. */ > urtwn_set_gain(sc, 0x20); > URTWN_UNLOCK(sc); > @@ -3348,8 +3441,9 @@ urtwn_scan_end(struct ieee80211com *ic) >=20 > URTWN_LOCK(sc); > /* Restore limitations. */ > - if (ic->ic_promisc =3D=3D 0) > + if (ic->ic_promisc =3D=3D 0 && ic->ic_opmode !=3D = IEEE80211_M_IBSS) > urtwn_set_rx_bssid_all(sc, 0); > + > /* Set gain under link. */ > urtwn_set_gain(sc, 0x32); > URTWN_UNLOCK(sc); > @@ -3393,6 +3487,9 @@ urtwn_set_promisc(struct urtwn_softc *sc > case IEEE80211_M_HOSTAP: > mask2 |=3D R92C_RCR_CBSSID_BCN; > break; > + case IEEE80211_M_IBSS: > + mask2 |=3D R92C_RCR_CBSSID_DATA; > + break; > default: > device_printf(sc->sc_dev, "%s: undefined opmode = %d\n", > __func__, vap->iv_opmode); >=20 > Modified: head/sys/dev/usb/wlan/if_urtwnvar.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:20:22 2015 = (r290650) > +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:52:26 2015 = (r290651) > @@ -87,13 +87,18 @@ struct urtwn_fw_info { > }; >=20 > struct urtwn_vap { > - struct ieee80211vap vap; > + struct ieee80211vap vap; >=20 > - struct r92c_tx_desc bcn_desc; > - struct mbuf *bcn_mbuf; > - > - int (*newstate)(struct ieee80211vap = *, > - enum ieee80211_state, int); > + struct r92c_tx_desc bcn_desc; > + struct mbuf *bcn_mbuf; > + struct task tsf_task_adhoc; > + > + int (*newstate)(struct ieee80211vap *, > + enum ieee80211_state, int); > + void (*recv_mgmt)(struct ieee80211_node *, > + struct mbuf *, int, > + const struct ieee80211_rx_stats *, > + int, int); > }; > #define URTWN_VAP(vap) ((struct urtwn_vap *)(vap)) >=20 After this revision, every time I insert my urtwn card into USB port I = get this panic [1]. Moving back to 290650 fixed the problem. [1] http://imgur.com/6p78GIT -- Renato Botelho From owner-svn-src-all@freebsd.org Tue Nov 10 21:50:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DB25A2C6AF; Tue, 10 Nov 2015 21:50:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5719A1049; Tue, 10 Nov 2015 21:50:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 4D6AB1892; Tue, 10 Nov 2015 21:50:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E455515B55; Tue, 10 Nov 2015 21:50:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0KSI18CVlQzr; Tue, 10 Nov 2015 21:50:23 +0000 (UTC) Subject: Re: svn commit: r290626 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EB78F15B4F To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511092336.tA9NakfC086022@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <5642669C.3020902@FreeBSD.org> Date: Tue, 10 Nov 2015 13:50:20 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511092336.tA9NakfC086022@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 21:50:30 -0000 On 11/9/15 3:36 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Nov 9 23:36:46 2015 > New Revision: 290626 > URL: https://svnweb.freebsd.org/changeset/base/290626 > > Log: > Move 'make cleandir' from Makefile to Makefile.inc1. > Obviously I meant 'cleanworld' here. The commit was effectively a NOP too to make the next commit more clear. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Wed Nov 11 00:41:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7756A2CB6D; Wed, 11 Nov 2015 00:41:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C90A1326; Wed, 11 Nov 2015 00:41:03 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB0f2w2084686; Wed, 11 Nov 2015 00:41:02 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB0f2Gp084685; Wed, 11 Nov 2015 00:41:02 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511110041.tAB0f2Gp084685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 Nov 2015 00:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290666 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 00:41:03 -0000 Author: gonzo Date: Wed Nov 11 00:41:02 2015 New Revision: 290666 URL: https://svnweb.freebsd.org/changeset/base/290666 Log: - Set have_message in interrupt to handle "response before READ" case - Serialize access to property channel when using bcm2835_mbox_property Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Tue Nov 10 17:15:36 2015 (r290665) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Nov 11 00:41:02 2015 (r290666) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,6 +84,7 @@ struct bcm_mbox_softc { bus_space_handle_t bsh; int msg[BCM2835_MBOX_CHANS]; int have_message[BCM2835_MBOX_CHANS]; + struct sx property_chan_lock; }; #define mbox_read_4(sc, reg) \ @@ -122,8 +124,10 @@ bcm_mbox_intr(void *arg) MBOX_LOCK(sc); while (!(mbox_read_4(sc, REG_STATUS) & STATUS_EMPTY)) - if (bcm_mbox_read_msg(sc, &chan) == 0) + if (bcm_mbox_read_msg(sc, &chan) == 0) { + sc->have_message[chan] = 1; wakeup(&sc->have_message[chan]); + } MBOX_UNLOCK(sc); } @@ -179,6 +183,8 @@ bcm_mbox_attach(device_t dev) sc->have_message[i] = 0; } + sx_init(&sc->property_chan_lock, "mboxprop"); + /* Read all pending messages */ while ((mbox_read_4(sc, REG_STATUS) & STATUS_EMPTY) == 0) (void)mbox_read_4(sc, REG_READ); @@ -366,6 +372,7 @@ bcm2835_mbox_err(device_t dev, bus_addr_ int bcm2835_mbox_property(void *msg, size_t msg_size) { + struct bcm_mbox_softc *sc; struct msg_set_power_state *buf; bus_dma_tag_t msg_tag; bus_dmamap_t msg_map; @@ -379,11 +386,16 @@ bcm2835_mbox_property(void *msg, size_t if (mbox == NULL) return (ENXIO); + sc = device_get_softc(mbox); + sx_xlock(&sc->property_chan_lock); + /* Allocate memory for the message */ buf = bcm2835_mbox_init_dma(mbox, msg_size, &msg_tag, &msg_map, &msg_phys); - if (buf == NULL) - return (ENOMEM); + if (buf == NULL) { + err = ENOMEM; + goto out; + } memcpy(buf, msg, msg_size); @@ -404,7 +416,8 @@ bcm2835_mbox_property(void *msg, size_t bus_dmamap_unload(msg_tag, msg_map); bus_dmamem_free(msg_tag, buf, msg_map); bus_dma_tag_destroy(msg_tag); - +out: + sx_xunlock(&sc->property_chan_lock); return (err); } From owner-svn-src-all@freebsd.org Wed Nov 11 00:45:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DC9A2CD4E; Wed, 11 Nov 2015 00:45:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B18E1983; Wed, 11 Nov 2015 00:45:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB0jfRc087416; Wed, 11 Nov 2015 00:45:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB0jfQh087415; Wed, 11 Nov 2015 00:45:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511110045.tAB0jfQh087415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 Nov 2015 00:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290667 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 00:45:42 -0000 Author: gonzo Date: Wed Nov 11 00:45:41 2015 New Revision: 290667 URL: https://svnweb.freebsd.org/changeset/base/290667 Log: Refactor bcm2835_cpufreq to use bcm2835_mbox_property API Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Wed Nov 11 00:41:02 2015 (r290666) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Wed Nov 11 00:45:41 2015 (r290667) @@ -115,13 +115,6 @@ struct bcm2835_cpufreq_softc { int voltage_sdram_p; int turbo_mode; - /* mbox buffer (physical address) */ - bus_dma_tag_t dma_tag; - bus_dmamap_t dma_map; - bus_size_t dma_size; - void *dma_buf; - bus_addr_t dma_phys; - /* initial hook for waiting mbox intr */ struct intr_config_hook init_hook; }; @@ -151,84 +144,10 @@ bcm2835_dump(const void *data, int len) #endif static int -bcm2835_mbox_call_prop(struct bcm2835_cpufreq_softc *sc) -{ - struct bcm2835_mbox_hdr *msg = (struct bcm2835_mbox_hdr *)sc->dma_buf; - struct bcm2835_mbox_tag_hdr *tag, *last; - uint8_t *up; - device_t mbox; - size_t hdr_size; - int idx; - int err; - - /* - * For multiple calls, locking is not here. The caller must have - * VC semaphore. - */ - - /* get mbox device */ - mbox = devclass_get_device(devclass_find("mbox"), 0); - if (mbox == NULL) { - device_printf(sc->dev, "can't find mbox\n"); - return (-1); - } - - /* go mailbox property */ -#ifdef PROP_DEBUG - bcm2835_dump(msg, 64); -#endif - bus_dmamap_sync(sc->dma_tag, sc->dma_map, - BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); - MBOX_WRITE(mbox, BCM2835_MBOX_CHAN_PROP, (uint32_t)sc->dma_phys); - MBOX_READ(mbox, BCM2835_MBOX_CHAN_PROP, &err); - bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_POSTREAD); -#ifdef PROP_DEBUG - bcm2835_dump(msg, 64); -#endif - - /* check response code */ - if (msg->code != BCM2835_MBOX_CODE_RESP_SUCCESS) { - device_printf(sc->dev, "mbox response error\n"); - return (-1); - } - - /* tag = first tag */ - up = (uint8_t *)msg; - hdr_size = sizeof(struct bcm2835_mbox_hdr); - tag = (struct bcm2835_mbox_tag_hdr *)(up + hdr_size); - /* last = end of buffer specified by header */ - last = (struct bcm2835_mbox_tag_hdr *)(up + msg->buf_size); - - /* loop unitl end tag (=0x0) */ - hdr_size = sizeof(struct bcm2835_mbox_tag_hdr); - for (idx = 0; tag->tag != 0; idx++) { - if ((tag->val_len & BCM2835_MBOX_TAG_VAL_LEN_RESPONSE) == 0) { - device_printf(sc->dev, "tag%d response error\n", idx); - return (-1); - } - /* clear response bit */ - tag->val_len &= ~BCM2835_MBOX_TAG_VAL_LEN_RESPONSE; - - /* get next tag */ - up = (uint8_t *)tag; - tag = (struct bcm2835_mbox_tag_hdr *)(up + hdr_size + - tag->val_buf_size); - - /* check buffer size of header */ - if (tag > last) { - device_printf(sc->dev, "mbox buffer size error\n"); - return (-1); - } - } - - return (0); -} - -static int bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_clock_rate *msg; + struct msg_get_clock_rate msg; int rate; int err; @@ -246,26 +165,18 @@ bcm2835_cpufreq_get_clock_rate(struct bc * u32: rate (in Hz) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_clock_rate *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_CLOCK_RATE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.clock_id = clock_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_CLOCK_RATE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.clock_id = clock_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get clock rate (id=%u)\n", clock_id); @@ -273,7 +184,7 @@ bcm2835_cpufreq_get_clock_rate(struct bc } /* result (Hz) */ - rate = (int)msg->body.resp.rate_hz; + rate = (int)msg.body.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -282,7 +193,7 @@ static int bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_max_clock_rate *msg; + struct msg_get_max_clock_rate msg; int rate; int err; @@ -300,26 +211,18 @@ bcm2835_cpufreq_get_max_clock_rate(struc * u32: rate (in Hz) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_max_clock_rate *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_CLOCK_RATE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.clock_id = clock_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_CLOCK_RATE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.clock_id = clock_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get max clock rate (id=%u)\n", clock_id); @@ -327,7 +230,7 @@ bcm2835_cpufreq_get_max_clock_rate(struc } /* result (Hz) */ - rate = (int)msg->body.resp.rate_hz; + rate = (int)msg.body.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -336,7 +239,7 @@ static int bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_min_clock_rate *msg; + struct msg_get_min_clock_rate msg; int rate; int err; @@ -354,26 +257,18 @@ bcm2835_cpufreq_get_min_clock_rate(struc * u32: rate (in Hz) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_min_clock_rate *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_CLOCK_RATE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.clock_id = clock_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_CLOCK_RATE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.clock_id = clock_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get min clock rate (id=%u)\n", clock_id); @@ -381,7 +276,7 @@ bcm2835_cpufreq_get_min_clock_rate(struc } /* result (Hz) */ - rate = (int)msg->body.resp.rate_hz; + rate = (int)msg.body.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -390,7 +285,7 @@ static int bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id, uint32_t rate_hz) { - struct msg_set_clock_rate *msg; + struct msg_set_clock_rate msg; int rate; int err; @@ -409,27 +304,19 @@ bcm2835_cpufreq_set_clock_rate(struct bc * u32: rate (in Hz) */ - /* using DMA buffer for VC */ - msg = (struct msg_set_clock_rate *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.clock_id = clock_id; - msg->body.req.rate_hz = rate_hz; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.clock_id = clock_id; + msg.body.req.rate_hz = rate_hz; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set clock rate (id=%u)\n", clock_id); @@ -447,18 +334,18 @@ bcm2835_cpufreq_set_clock_rate(struct bc */ /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.clock_id = clock_id; - msg->body.req.rate_hz = rate_hz; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.clock_id = clock_id; + msg.body.req.rate_hz = rate_hz; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set clock rate (id=%u)\n", clock_id); @@ -467,7 +354,7 @@ bcm2835_cpufreq_set_clock_rate(struct bc } /* result (Hz) */ - rate = (int)msg->body.resp.rate_hz; + rate = (int)msg.body.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -475,7 +362,7 @@ bcm2835_cpufreq_set_clock_rate(struct bc static int bcm2835_cpufreq_get_turbo(struct bcm2835_cpufreq_softc *sc) { - struct msg_get_turbo *msg; + struct msg_get_turbo msg; int level; int err; @@ -493,33 +380,25 @@ bcm2835_cpufreq_get_turbo(struct bcm2835 * u32: level */ - /* using DMA buffer for VC */ - msg = (struct msg_get_turbo *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_TURBO; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.id = 0; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_TURBO; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.id = 0; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get turbo\n"); return (MSG_ERROR); } /* result 0=non-turbo, 1=turbo */ - level = (int)msg->body.resp.level; + level = (int)msg.body.resp.level; DPRINTF("level = %d\n", level); return (level); } @@ -527,7 +406,7 @@ bcm2835_cpufreq_get_turbo(struct bcm2835 static int bcm2835_cpufreq_set_turbo(struct bcm2835_cpufreq_softc *sc, uint32_t level) { - struct msg_set_turbo *msg; + struct msg_set_turbo msg; int value; int err; @@ -546,38 +425,30 @@ bcm2835_cpufreq_set_turbo(struct bcm2835 * u32: level */ - /* using DMA buffer for VC */ - msg = (struct msg_set_turbo *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* replace unknown value to OFF */ if (level != BCM2835_MBOX_TURBO_ON && level != BCM2835_MBOX_TURBO_OFF) level = BCM2835_MBOX_TURBO_OFF; /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_TURBO; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.id = 0; - msg->body.req.level = level; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_TURBO; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.id = 0; + msg.body.req.level = level; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set turbo\n"); return (MSG_ERROR); } /* result 0=non-turbo, 1=turbo */ - value = (int)msg->body.resp.level; + value = (int)msg.body.resp.level; DPRINTF("level = %d\n", value); return (value); } @@ -586,7 +457,7 @@ static int bcm2835_cpufreq_get_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_voltage *msg; + struct msg_get_voltage msg; int value; int err; @@ -604,33 +475,25 @@ bcm2835_cpufreq_get_voltage(struct bcm28 * u32: value (offset from 1.2V in units of 0.025V) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_voltage *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_VOLTAGE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.voltage_id = voltage_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_VOLTAGE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.voltage_id = voltage_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg->body.resp.value; + value = (int)msg.body.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -639,7 +502,7 @@ static int bcm2835_cpufreq_get_max_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_max_voltage *msg; + struct msg_get_max_voltage msg; int value; int err; @@ -657,33 +520,25 @@ bcm2835_cpufreq_get_max_voltage(struct b * u32: value (offset from 1.2V in units of 0.025V) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_max_voltage *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_VOLTAGE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.voltage_id = voltage_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_VOLTAGE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.voltage_id = voltage_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get max voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg->body.resp.value; + value = (int)msg.body.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -691,7 +546,7 @@ static int bcm2835_cpufreq_get_min_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_min_voltage *msg; + struct msg_get_min_voltage msg; int value; int err; @@ -709,33 +564,25 @@ bcm2835_cpufreq_get_min_voltage(struct b * u32: value (offset from 1.2V in units of 0.025V) */ - /* using DMA buffer for VC */ - msg = (struct msg_get_min_voltage *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_VOLTAGE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.voltage_id = voltage_id; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_VOLTAGE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.voltage_id = voltage_id; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get min voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg->body.resp.value; + value = (int)msg.body.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -744,7 +591,7 @@ static int bcm2835_cpufreq_set_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id, int32_t value) { - struct msg_set_voltage *msg; + struct msg_set_voltage msg; int err; /* @@ -773,34 +620,26 @@ bcm2835_cpufreq_set_voltage(struct bcm28 return (MSG_ERROR); } - /* using DMA buffer for VC */ - msg = (struct msg_set_voltage *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_VOLTAGE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.voltage_id = voltage_id; - msg->body.req.value = (uint32_t)value; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_VOLTAGE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.voltage_id = voltage_id; + msg.body.req.value = (uint32_t)value; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg->body.resp.value; + value = (int)msg.body.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -808,7 +647,7 @@ bcm2835_cpufreq_set_voltage(struct bcm28 static int bcm2835_cpufreq_get_temperature(struct bcm2835_cpufreq_softc *sc) { - struct msg_get_temperature *msg; + struct msg_get_temperature msg; int value; int err; @@ -826,33 +665,25 @@ bcm2835_cpufreq_get_temperature(struct b * u32: value */ - /* using DMA buffer for VC */ - msg = (struct msg_get_temperature *)sc->dma_buf; - if (sizeof(*msg) > sc->dma_size) { - device_printf(sc->dev, "DMA size overflow (%zu>%lu)\n", - sizeof(*msg), sc->dma_size); - return (MSG_ERROR); - } - /* setup single tag buffer */ - memset(msg, 0, sizeof(*msg)); - msg->hdr.buf_size = sizeof(*msg); - msg->hdr.code = BCM2835_MBOX_CODE_REQ; - msg->tag_hdr.tag = BCM2835_MBOX_TAG_GET_TEMPERATURE; - msg->tag_hdr.val_buf_size = sizeof(msg->body); - msg->tag_hdr.val_len = sizeof(msg->body.req); - msg->body.req.temperature_id = 0; - msg->end_tag = 0; + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_TEMPERATURE; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.temperature_id = 0; + msg.end_tag = 0; /* call mailbox property */ - err = bcm2835_mbox_call_prop(sc); + err = bcm2835_mbox_property(&msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get temperature\n"); return (MSG_ERROR); } /* result (temperature of degree C) */ - value = (int)msg->body.resp.value; + value = (int)msg.body.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -1432,23 +1263,11 @@ bcm2835_cpufreq_probe(device_t dev) return (0); } -static void -bcm2835_cpufreq_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) -{ - bus_addr_t *addr; - - if (err) - return; - addr = (bus_addr_t *)arg; - *addr = PHYS_TO_VCBUS(segs[0].ds_addr); -} - static int bcm2835_cpufreq_attach(device_t dev) { struct bcm2835_cpufreq_softc *sc; struct sysctl_oid *oid; - int err; /* set self dev */ sc = device_get_softc(dev); @@ -1464,41 +1283,6 @@ bcm2835_cpufreq_attach(device_t dev) sc->max_voltage_core = 0; sc->min_voltage_core = 0; - /* create VC mbox buffer */ - sc->dma_size = PAGE_SIZE; - err = bus_dma_tag_create( - bus_get_dma_tag(sc->dev), - PAGE_SIZE, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sc->dma_size, 1, /* maxsize, nsegments */ - sc->dma_size, 0, /* maxsegsize, flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->dma_tag); - if (err) { - device_printf(dev, "can't create DMA tag\n"); - return (ENXIO); - } - - err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->dma_buf, 0, - &sc->dma_map); - if (err) { - bus_dma_tag_destroy(sc->dma_tag); - device_printf(dev, "can't allocate dmamem\n"); - return (ENXIO); - } - - err = bus_dmamap_load(sc->dma_tag, sc->dma_map, sc->dma_buf, - sc->dma_size, bcm2835_cpufreq_cb, &sc->dma_phys, 0); - if (err) { - bus_dmamem_free(sc->dma_tag, sc->dma_buf, sc->dma_map); - bus_dma_tag_destroy(sc->dma_tag); - device_printf(dev, "can't load DMA map\n"); - return (ENXIO); - } - /* OK, ready to use VC buffer */ - /* setup sysctl at first device */ if (device_get_unit(dev) == 0) { sysctl_ctx_init(&bcm2835_sysctl_ctx); @@ -1568,9 +1352,6 @@ bcm2835_cpufreq_attach(device_t dev) sc->init_hook.ich_arg = sc; if (config_intrhook_establish(&sc->init_hook) != 0) { - bus_dmamap_unload(sc->dma_tag, sc->dma_map); - bus_dmamem_free(sc->dma_tag, sc->dma_buf, sc->dma_map); - bus_dma_tag_destroy(sc->dma_tag); device_printf(dev, "config_intrhook_establish failed\n"); return (ENOMEM); } @@ -1590,13 +1371,6 @@ bcm2835_cpufreq_detach(device_t dev) sema_destroy(&vc_sema); - if (sc->dma_phys != 0) - bus_dmamap_unload(sc->dma_tag, sc->dma_map); - if (sc->dma_buf != NULL) - bus_dmamem_free(sc->dma_tag, sc->dma_buf, sc->dma_map); - if (sc->dma_tag != NULL) - bus_dma_tag_destroy(sc->dma_tag); - return (cpufreq_unregister(dev)); } From owner-svn-src-all@freebsd.org Wed Nov 11 01:32:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A42A2A498; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5897D1AFE; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZ8m001533; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZVK001531; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZVK001531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:36 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: Use movw instead of movl (or plain mov) when moving segment registers into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/i386/i386/exception.s ============================================================================== --- stable/10/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/10/sys/i386/include/asmacros.h ============================================================================== --- stable/10/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-all@freebsd.org Wed Nov 11 01:32:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6177A2A49F; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6A41AFF; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZIp001540; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZLu001538; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZLu001538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:37 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: Use movw instead of movl (or plain mov) when moving segment registers into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/i386/i386/exception.s ============================================================================== --- stable/9/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/9/sys/i386/include/asmacros.h ============================================================================== --- stable/9/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-all@freebsd.org Wed Nov 11 08:30:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B57A1FB8B; Wed, 11 Nov 2015 08:30:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31F8E1FC9; Wed, 11 Nov 2015 08:30:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 98A881FE022; Wed, 11 Nov 2015 09:30:48 +0100 (CET) Subject: Re: svn commit: r290663 - in head/sys: modules modules/tests modules/tests/callout_test modules/tests/framework tests tests/callout_test tests/framework To: "Bjoern A. Zeeb" , Randall Stewart References: <201511101414.tAAEEfPI057133@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <5642FD1F.2040201@selasky.org> Date: Wed, 11 Nov 2015 09:32:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 08:30:51 -0000 On 11/10/15 17:15, Bjoern A. Zeeb wrote: > >> On 10 Nov 2015, at 14:14 , Randall Stewart wrote: >> >> Author: rrs >> Date: Tue Nov 10 14:14:41 2015 >> New Revision: 290663 >> URL: https://svnweb.freebsd.org/changeset/base/290663 >> >> Log: >> Add a kernel test framework. The callout_test is a demonstration and will only >> work with the upcoming async-drain functionality. Tests can be added >> to the tests directory and then the framework can be used to launch >> those tests. >> >> MFC after: 1 month >> Sponsored by: Netflix Inc. >> Differential Revision: https://reviews.freebsd.org/D1755 >> > > > /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/callout_test/callout_test.c:75: warning: function declaration isn't a prototype [-Wstrict-prototypes] > /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/callout_test/callout_test.c:133: warning: no previous prototype for ‘execute_the_co_test' [-Wmissing-prototypes] > > > /scratch/tmp/bz/head.svn/sys/modules/tests/framework/../../../tests/framework/kern_testfrwk.c:171: warning: redundant redeclaration of 'sysctl___kern' [-Wredundant-decls] > /scratch/tmp/bz/head.svn/sys/sys/sysctl.h:918: warning: previous declaration of ‘sysctl___kern' was here > > This is on sparc64 but I guess that’s just one of my early kernel compiles. > > >> Added: >> head/sys/modules/tests/ >> head/sys/modules/tests/callout_test/ >> head/sys/modules/tests/callout_test/Makefile (contents, props changed) >> head/sys/modules/tests/framework/ >> head/sys/modules/tests/framework/Makefile (contents, props changed) >> head/sys/tests/ >> head/sys/tests/callout_test/ >> head/sys/tests/callout_test.h (contents, props changed) >> head/sys/tests/callout_test/callout_test.c (contents, props changed) >> head/sys/tests/framework/ >> head/sys/tests/framework/kern_testfrwk.c (contents, props changed) >> head/sys/tests/kern_testfrwk.h (contents, props changed) >> Modified: >> head/sys/modules/Makefile > Breaks here too on amd64: > /usr/img/freebsd/sys/modules/tests/callout_test/../../../tests/callout_test/callout_test.c:52:9: error: > 'cpu_spinwait' macro redefined [-Werror] > #define cpu_spinwait() > ^ > ./machine/cpu.h:50:9: note: previous definition is here > #define cpu_spinwait() ia32_pause() > ^ > 1 error generated. > /usr/img/freebsd/sys/modules/tests/framework/../../../sys/bus.h:655:10: fatal error: > 'device_if.h' file not found > #include "device_if.h" > ^ > 1 error generated. > *** Error code 1 --HPS From owner-svn-src-all@freebsd.org Wed Nov 11 09:38:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F0B9A2A0AE; Wed, 11 Nov 2015 09:38:18 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d: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 DB59A155F; Wed, 11 Nov 2015 09:38:17 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgad10 with SMTP id d10so19360856qga.3; Wed, 11 Nov 2015 01:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GWSwIGJT7kZpRNH/yqOhrJo3L2E3iuiAwziq0flaNYI=; b=TYNrxghOUNUtfJJuICaMeusXTy/7HmWtryJucsPd+V5VNGLAbNfUQj2p1GUGr3my0E H9VLcf5X8rpJioGoji6B6kCW0UZZe9YfPxGenYD8/C/no0FAvxvEWNEcbyslxrwI4Btl Azx2lfqE6FJXWKLlssDVYN5EEgps9m00W4HmZb876hTqFZD8RidXfsgjIORNsLV9ZvJa Vi//HhGs3c+lhp2ExQv+gWZFn02QX3H4ivW91d5PO/+kxZABb19odHbO/eIetX/tS3cE ZjQ94WUfecNUUGh6vJPfonwUaaHTXsE+KGzbWIi10s7wuescaoUsEusKileTmtdAp0sO m/8g== X-Received: by 10.140.18.172 with SMTP id 41mr9209032qgf.99.1447234696874; Wed, 11 Nov 2015 01:38:16 -0800 (PST) Received: from mbp.home (179-125-138-101.desktop.com.br. [179.125.138.101]) by smtp.gmail.com with ESMTPSA id y14sm2665714qky.4.2015.11.11.01.38.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Nov 2015 01:38:16 -0800 (PST) Sender: Renato Botelho Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: svn commit: r290663 - in head/sys: modules modules/tests modules/tests/callout_test modules/tests/framework tests tests/callout_test tests/framework From: Renato Botelho In-Reply-To: <5642FD1F.2040201@selasky.org> Date: Wed, 11 Nov 2015 07:38:12 -0200 Cc: "Bjoern A. Zeeb" , Randall Stewart , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201511101414.tAAEEfPI057133@repo.freebsd.org> <5642FD1F.2040201@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 09:38:18 -0000 > On Nov 11, 2015, at 06:32, Hans Petter Selasky = wrote: >=20 > On 11/10/15 17:15, Bjoern A. Zeeb wrote: >>=20 >>> On 10 Nov 2015, at 14:14 , Randall Stewart wrote: >>>=20 >>> Author: rrs >>> Date: Tue Nov 10 14:14:41 2015 >>> New Revision: 290663 >>> URL: https://svnweb.freebsd.org/changeset/base/290663 >>>=20 >>> Log: >>> Add a kernel test framework. The callout_test is a demonstration = and will only >>> work with the upcoming async-drain functionality. Tests can be = added >>> to the tests directory and then the framework can be used to launch >>> those tests. >>>=20 >>> MFC after: 1 month >>> Sponsored by: Netflix Inc. >>> Differential Revision: https://reviews.freebsd.org/D1755 >>>=20 >>=20 >>=20 >> = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:75: warning: function declaration isn't a = prototype [-Wstrict-prototypes] >> = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:133: warning: no previous prototype for = =E2=80=98execute_the_co_test' [-Wmissing-prototypes] >>=20 >>=20 >> = /scratch/tmp/bz/head.svn/sys/modules/tests/framework/../../../tests/framew= ork/kern_testfrwk.c:171: warning: redundant redeclaration of = 'sysctl___kern' [-Wredundant-decls] >> /scratch/tmp/bz/head.svn/sys/sys/sysctl.h:918: warning: previous = declaration of =E2=80=98sysctl___kern' was here >>=20 >> This is on sparc64 but I guess that=E2=80=99s just one of my early = kernel compiles. >>=20 >>=20 >>> Added: >>> head/sys/modules/tests/ >>> head/sys/modules/tests/callout_test/ >>> head/sys/modules/tests/callout_test/Makefile (contents, props = changed) >>> head/sys/modules/tests/framework/ >>> head/sys/modules/tests/framework/Makefile (contents, props = changed) >>> head/sys/tests/ >>> head/sys/tests/callout_test/ >>> head/sys/tests/callout_test.h (contents, props changed) >>> head/sys/tests/callout_test/callout_test.c (contents, props = changed) >>> head/sys/tests/framework/ >>> head/sys/tests/framework/kern_testfrwk.c (contents, props = changed) >>> head/sys/tests/kern_testfrwk.h (contents, props changed) >>> Modified: >>> head/sys/modules/Makefile >>=20 >=20 > Breaks here too on amd64: >=20 >> = /usr/img/freebsd/sys/modules/tests/callout_test/../../../tests/callout_tes= t/callout_test.c:52:9: error: >> 'cpu_spinwait' macro redefined [-Werror] >> #define cpu_spinwait() >> ^ >> ./machine/cpu.h:50:9: note: previous definition is here >> #define cpu_spinwait() ia32_pause() >> ^ >> 1 error generated. >=20 >> = /usr/img/freebsd/sys/modules/tests/framework/../../../sys/bus.h:655:10: = fatal error: >> 'device_if.h' file not found >> #include "device_if.h" >> ^ >> 1 error generated. >> *** Error code 1 +1 -- Renato Botelho From owner-svn-src-all@freebsd.org Wed Nov 11 09:55:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A21BA2A461; Wed, 11 Nov 2015 09:55:02 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 4057F1CE8; Wed, 11 Nov 2015 09:55:02 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgad10 with SMTP id d10so19575362qga.3; Wed, 11 Nov 2015 01:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=d2WxnWyhne1HDZCyfQbh/X9g3kc9aQmTRt9jK81zNnQ=; b=0S8+7EV4mxtqbEqggJNzkRfmvDThGPc7sYWVtuPLEfpjP6wTNFsmQFQXFd14GHLxQ9 427D7z8GhMxj4CWdYeYbrH1u75etvv7lpz1/+2fX1CmTtLlU1TMSRM36mwYeVO/eE/ir ox83f6k0bNmX160xcy38erhNCVeyqKgJ9BGO2y7b43npIJLWVv3t9V6hL1/C+a+j74jb 6iA1qxr4xjUWJwCT4E0T1df5O0Wxj4wQEEFY0pqhXTq3ih6gUcH9yz388GZKrsQMuN5r 1ekuuGvQ8Li9a+E/z4Cb3slECarYMOAZsB+VSxiermDAZSC7tzynlCs9wqUljkUAhZmS x/9Q== X-Received: by 10.140.171.197 with SMTP id r188mr10421246qhr.93.1447235701280; Wed, 11 Nov 2015 01:55:01 -0800 (PST) Received: from mbp.home (179-125-138-101.desktop.com.br. [179.125.138.101]) by smtp.gmail.com with ESMTPSA id x44sm2638298qgx.44.2015.11.11.01.54.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Nov 2015 01:55:00 -0800 (PST) Sender: Renato Botelho Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: svn commit: r290651 - head/sys/dev/usb/wlan From: Renato Botelho In-Reply-To: <2D6627A5-D455-424C-8A9E-0A18754CFE11@FreeBSD.org> Date: Wed, 11 Nov 2015 07:54:58 -0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201511101252.tAACqQrE033782@repo.freebsd.org> <2D6627A5-D455-424C-8A9E-0A18754CFE11@FreeBSD.org> To: Andriy Voskoboinyk X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 09:55:02 -0000 > On Nov 10, 2015, at 18:19, Renato Botelho wrote: >=20 >> On Nov 10, 2015, at 10:52, Andriy Voskoboinyk = wrote: >>=20 >> Author: avos >> Date: Tue Nov 10 12:52:26 2015 >> New Revision: 290651 >> URL: https://svnweb.freebsd.org/changeset/base/290651 >>=20 >> Log: >> urtwn(4): add IBSS mode support >>=20 >> Tested with RTL8188EU, IBSS and STA modes. >>=20 >> Reviewed by: kevlo >> Approved by: adrian (mentor) >> Differential Revision: https://reviews.freebsd.org/D4038 >>=20 >> Modified: >> head/sys/dev/usb/wlan/if_urtwn.c >> head/sys/dev/usb/wlan/if_urtwnvar.h >>=20 >> Modified: head/sys/dev/usb/wlan/if_urtwn.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:20:22 2015 = (r290650) >> +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:52:26 2015 = (r290651) >> @@ -228,10 +228,14 @@ static int = urtwn_setup_beacon(struct ur >> static void urtwn_update_beacon(struct ieee80211vap *, int); >> static int urtwn_tx_beacon(struct urtwn_softc *sc, >> struct urtwn_vap *); >> +static void urtwn_tsf_task_adhoc(void *, int); >> static void urtwn_tsf_sync_enable(struct urtwn_softc *, >> struct ieee80211vap *); >> static void urtwn_set_led(struct urtwn_softc *, int, int); >> static void urtwn_set_mode(struct urtwn_softc *, uint8_t); >> +static void urtwn_ibss_recv_mgmt(struct ieee80211_node *, >> + struct mbuf *, int, >> + const struct ieee80211_rx_stats *, int, = int); >> static int urtwn_newstate(struct ieee80211vap *, >> enum ieee80211_state, int); >> static void urtwn_watchdog(void *); >> @@ -449,6 +453,7 @@ urtwn_attach(device_t self) >> ic->ic_caps =3D >> IEEE80211_C_STA /* station mode */ >> | IEEE80211_C_MONITOR /* monitor mode */ >> + | IEEE80211_C_IBSS /* adhoc mode */ >> | IEEE80211_C_HOSTAP /* hostap mode */ >> | IEEE80211_C_SHPREAMBLE /* short preamble = supported */ >> | IEEE80211_C_SHSLOT /* short slot time = supported */ >> @@ -592,13 +597,18 @@ urtwn_vap_create(struct ieee80211com *ic >> return (NULL); >> } >>=20 >> - if (opmode =3D=3D IEEE80211_M_HOSTAP) >> + if (opmode =3D=3D IEEE80211_M_HOSTAP || opmode =3D=3D = IEEE80211_M_IBSS) >> urtwn_init_beacon(sc, uvp); >>=20 >> /* override state transition machine */ >> uvp->newstate =3D vap->iv_newstate; >> vap->iv_newstate =3D urtwn_newstate; >> vap->iv_update_beacon =3D urtwn_update_beacon; >> + if (opmode =3D=3D IEEE80211_M_IBSS) { >> + uvp->recv_mgmt =3D vap->iv_recv_mgmt; >> + vap->iv_recv_mgmt =3D urtwn_ibss_recv_mgmt; >> + TASK_INIT(&uvp->tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, = vap); >> + } >>=20 >> /* complete setup */ >> ieee80211_vap_attach(vap, ieee80211_media_change, >> @@ -610,13 +620,13 @@ urtwn_vap_create(struct ieee80211com *ic >> static void >> urtwn_vap_delete(struct ieee80211vap *vap) >> { >> + struct ieee80211com *ic =3D vap->iv_ic; >> struct urtwn_vap *uvp =3D URTWN_VAP(vap); >> - enum ieee80211_opmode opmode =3D vap->iv_opmode; >>=20 >> - if (opmode =3D=3D IEEE80211_M_HOSTAP) { >> - if (uvp->bcn_mbuf !=3D NULL) >> - m_freem(uvp->bcn_mbuf); >> - } >> + if (uvp->bcn_mbuf !=3D NULL) >> + m_freem(uvp->bcn_mbuf); >> + if (vap->iv_opmode =3D=3D IEEE80211_M_IBSS) >> + ieee80211_draintask(ic, &uvp->tsf_task_adhoc); >> ieee80211_vap_detach(vap); >> free(uvp, M_80211_VAP); >> } >> @@ -1611,8 +1621,50 @@ urtwn_tx_beacon(struct urtwn_softc *sc,=20 >> } >>=20 >> static void >> +urtwn_tsf_task_adhoc(void *arg, int pending) >> +{ >> + struct ieee80211vap *vap =3D arg; >> + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; >> + struct ieee80211_node *ni; >> + uint32_t reg; >> + >> + URTWN_LOCK(sc); >> + ni =3D ieee80211_ref_node(vap->iv_bss); >> + reg =3D urtwn_read_1(sc, R92C_BCN_CTRL); >> + >> + /* Accept beacons with the same BSSID. */ >> + urtwn_set_rx_bssid_all(sc, 0); >> + >> + /* Enable synchronization. */ >> + reg &=3D ~R92C_BCN_CTRL_DIS_TSF_UDT0; >> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >> + >> + /* Synchronize. */ >> + usb_pause_mtx(&sc->sc_mtx, hz * ni->ni_intval * 5 / 1000); >> + >> + /* Disable synchronization. */ >> + reg |=3D R92C_BCN_CTRL_DIS_TSF_UDT0; >> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >> + >> + /* Remove beacon filter. */ >> + urtwn_set_rx_bssid_all(sc, 1); >> + >> + /* Enable beaconing. */ >> + urtwn_write_1(sc, R92C_MBID_NUM, >> + urtwn_read_1(sc, R92C_MBID_NUM) | R92C_MBID_TXBCN_RPT0); >> + reg |=3D R92C_BCN_CTRL_EN_BCN; >> + >> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >> + ieee80211_free_node(ni); >> + URTWN_UNLOCK(sc); >> +} >> + >> +static void >> urtwn_tsf_sync_enable(struct urtwn_softc *sc, struct ieee80211vap = *vap) >> { >> + struct ieee80211com *ic =3D &sc->sc_ic; >> + struct urtwn_vap *uvp =3D URTWN_VAP(vap); >> + >> /* Reset TSF. */ >> urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); >>=20 >> @@ -1623,6 +1675,9 @@ urtwn_tsf_sync_enable(struct urtwn_softc >> urtwn_read_1(sc, R92C_BCN_CTRL) & >> ~R92C_BCN_CTRL_DIS_TSF_UDT0); >> break; >> + case IEEE80211_M_IBSS: >> + ieee80211_runtask(ic, &uvp->tsf_task_adhoc); >> + break; >> case IEEE80211_M_HOSTAP: >> /* Enable beaconing. */ >> urtwn_write_1(sc, R92C_MBID_NUM, >> @@ -1674,6 +1729,37 @@ urtwn_set_mode(struct urtwn_softc *sc, u >> urtwn_write_1(sc, R92C_MSR, reg); >> } >>=20 >> +static void >> +urtwn_ibss_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int = subtype, >> + const struct ieee80211_rx_stats *rxs, >> + int rssi, int nf) >> +{ >> + struct ieee80211vap *vap =3D ni->ni_vap; >> + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; >> + struct urtwn_vap *uvp =3D URTWN_VAP(vap); >> + uint64_t ni_tstamp, curr_tstamp; >> + >> + uvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); >> + >> + if (vap->iv_state =3D=3D IEEE80211_S_RUN && >> + (subtype =3D=3D IEEE80211_FC0_SUBTYPE_BEACON || >> + subtype =3D=3D IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { >> + ni_tstamp =3D le64toh(ni->ni_tstamp.tsf); >> +#ifdef D3831 >> + URTWN_LOCK(sc); >> + urtwn_get_tsf(sc, &curr_tstamp); >> + URTWN_UNLOCK(sc); >> + curr_tstamp =3D le64toh(curr_tstamp); >> + >> + if (ni_tstamp >=3D curr_tstamp) >> + (void) ieee80211_ibss_merge(ni); >> +#else >> + (void) sc; >> + (void) curr_tstamp; >> +#endif >> + } >> +} >> + >> static int >> urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, = int arg) >> { >> @@ -1757,6 +1843,9 @@ urtwn_newstate(struct ieee80211vap *vap, >> case IEEE80211_M_STA: >> mode =3D R92C_MSR_INFRA; >> break; >> + case IEEE80211_M_IBSS: >> + mode =3D R92C_MSR_ADHOC; >> + break; >> case IEEE80211_M_HOSTAP: >> mode =3D R92C_MSR_AP; >> break; >> @@ -1794,13 +1883,14 @@ urtwn_newstate(struct ieee80211vap *vap, >>=20 >> if (vap->iv_opmode !=3D IEEE80211_M_HOSTAP) >> reg |=3D R92C_RCR_CBSSID_DATA; >> - >> - reg |=3D R92C_RCR_CBSSID_BCN; >> + if (vap->iv_opmode !=3D IEEE80211_M_IBSS) >> + reg |=3D R92C_RCR_CBSSID_BCN; >>=20 >> urtwn_write_4(sc, R92C_RCR, reg); >> } >>=20 >> - if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP) { >> + if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP || >> + vap->iv_opmode =3D=3D IEEE80211_M_IBSS) { >> error =3D urtwn_setup_beacon(sc, ni); >> if (error !=3D 0) { >> device_printf(sc->sc_dev, >> @@ -3007,6 +3097,7 @@ urtwn_rxfilter_init(struct urtwn_softc * >> = R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_BEACON)); >> break; >> case IEEE80211_M_MONITOR: >> + case IEEE80211_M_IBSS: >> break; >> default: >> device_printf(sc->sc_dev, "%s: undefined opmode %d\n", >> @@ -3335,7 +3426,9 @@ urtwn_scan_start(struct ieee80211com *ic >>=20 >> URTWN_LOCK(sc); >> /* Receive beacons / probe responses from any BSSID. */ >> - urtwn_set_rx_bssid_all(sc, 1); >> + if (ic->ic_opmode !=3D IEEE80211_M_IBSS) >> + urtwn_set_rx_bssid_all(sc, 1); >> + >> /* Set gain for scanning. */ >> urtwn_set_gain(sc, 0x20); >> URTWN_UNLOCK(sc); >> @@ -3348,8 +3441,9 @@ urtwn_scan_end(struct ieee80211com *ic) >>=20 >> URTWN_LOCK(sc); >> /* Restore limitations. */ >> - if (ic->ic_promisc =3D=3D 0) >> + if (ic->ic_promisc =3D=3D 0 && ic->ic_opmode !=3D = IEEE80211_M_IBSS) >> urtwn_set_rx_bssid_all(sc, 0); >> + >> /* Set gain under link. */ >> urtwn_set_gain(sc, 0x32); >> URTWN_UNLOCK(sc); >> @@ -3393,6 +3487,9 @@ urtwn_set_promisc(struct urtwn_softc *sc >> case IEEE80211_M_HOSTAP: >> mask2 |=3D R92C_RCR_CBSSID_BCN; >> break; >> + case IEEE80211_M_IBSS: >> + mask2 |=3D R92C_RCR_CBSSID_DATA; >> + break; >> default: >> device_printf(sc->sc_dev, "%s: undefined opmode = %d\n", >> __func__, vap->iv_opmode); >>=20 >> Modified: head/sys/dev/usb/wlan/if_urtwnvar.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:20:22 2015 = (r290650) >> +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:52:26 2015 = (r290651) >> @@ -87,13 +87,18 @@ struct urtwn_fw_info { >> }; >>=20 >> struct urtwn_vap { >> - struct ieee80211vap vap; >> + struct ieee80211vap vap; >>=20 >> - struct r92c_tx_desc bcn_desc; >> - struct mbuf *bcn_mbuf; >> - >> - int (*newstate)(struct ieee80211vap = *, >> - enum ieee80211_state, int); >> + struct r92c_tx_desc bcn_desc; >> + struct mbuf *bcn_mbuf; >> + struct task tsf_task_adhoc; >> + >> + int (*newstate)(struct ieee80211vap *, >> + enum ieee80211_state, int); >> + void (*recv_mgmt)(struct ieee80211_node *, >> + struct mbuf *, int, >> + const struct ieee80211_rx_stats *, >> + int, int); >> }; >> #define URTWN_VAP(vap) ((struct urtwn_vap *)(vap)) >>=20 >=20 > After this revision, every time I insert my urtwn card into USB port I = get this panic [1]. Moving back to 290650 fixed the problem. >=20 > [1] http://imgur.com/6p78GIT FYI, after talk with adrian, I updated src to latest rev (r290668) and = manually reverted this commit and also 290663 (that broke the build) and = system is still working as expected. This is the hardware I=E2=80=99m = using: urtwn0: = on usbus1 urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R -- Renato Botelho From owner-svn-src-all@freebsd.org Wed Nov 11 12:36:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE9EAA2B9F9; Wed, 11 Nov 2015 12:36:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788F014CB; Wed, 11 Nov 2015 12:36:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABCagB9091016; Wed, 11 Nov 2015 12:36:42 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABCagb8091015; Wed, 11 Nov 2015 12:36:42 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201511111236.tABCagb8091015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 11 Nov 2015 12:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290669 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 12:36:43 -0000 Author: kp Date: Wed Nov 11 12:36:42 2015 New Revision: 290669 URL: https://svnweb.freebsd.org/changeset/base/290669 Log: MFC r290161: pf: Fix IPv6 checksums with route-to. When using route-to (or reply-to) pf sends the packet directly to the output interface. If that interface doesn't support checksum offloading the checksum has to be calculated in software. That was already done in the IPv4 case, but not for the IPv6 case. As a result we'd emit packets with pseudo-header checksums (i.e. incorrect checksums). This issue was exposed by the changes in r289316 when pf stopped performing full checksum calculations for all packets. Submitted by: Luoqi Chen Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Wed Nov 11 01:32:35 2015 (r290668) +++ stable/10/sys/netpfil/pf/pf.c Wed Nov 11 12:36:42 2015 (r290669) @@ -5576,6 +5576,13 @@ pf_route6(struct mbuf **m, struct pf_rul if (ifp->if_flags & IFF_LOOPBACK) m0->m_flags |= M_SKIP_FIREWALL; + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~ifp->if_hwassist) { + uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); + in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); + m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } + /* * If the packet is too large for the outgoing interface, * send back an icmp6 error. From owner-svn-src-all@freebsd.org Wed Nov 11 13:18:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61E53A2C407; Wed, 11 Nov 2015 13:18:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39ABC1D3C; Wed, 11 Nov 2015 13:18:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABDIdqw004074; Wed, 11 Nov 2015 13:18:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABDIcHd004070; Wed, 11 Nov 2015 13:18:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511111318.tABDIcHd004070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Nov 2015 13:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290670 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 13:18:40 -0000 Author: mav Date: Wed Nov 11 13:18:38 2015 New Revision: 290670 URL: https://svnweb.freebsd.org/changeset/base/290670 Log: Modify target port groups logic in CTL. - Introduce "ha_shared" port option, which being set to "on" moves the port into separate port group, shared between HA nodes. This allows to better handle cases when iSCSI portals are bound to CARP address that can dynamically move between nodes. Some initiators (at least VMware) don't detect that after iSCSI reconnect they've attached to different SCSI port from different port group, that totally breakes ALUA status parsing. In theory, I believe, it should be enough to have different iSCSI portal group tags on different nodes to make initiators detect this condition, but it seems like VMware ignores those values, and even full LUN retaste forced by UA does not help. - Make CTL report up to three port groups: 1 -- non-HA mode or ports with "ha_shared" option set, 2 -- HA node 1, 3 -- HA node 2. - Report Transitioning state for all port groups when HA interlink is connected, but neither of nodes is primary for the LUN. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Nov 11 12:36:42 2015 (r290669) +++ head/sys/cam/ctl/ctl.c Wed Nov 11 13:18:38 2015 (r290670) @@ -1819,13 +1819,13 @@ ctl_init(void) SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "ha_id", CTLFLAG_RDTUN, &softc->ha_id, 0, "HA head ID (0 - no HA)"); - if (softc->ha_id == 0 || softc->ha_id > NUM_TARGET_PORT_GROUPS) { + if (softc->ha_id == 0 || softc->ha_id > NUM_HA_SHELVES) { softc->flags |= CTL_FLAG_ACTIVE_SHELF; softc->is_single = 1; softc->port_cnt = CTL_MAX_PORTS; softc->port_min = 0; } else { - softc->port_cnt = CTL_MAX_PORTS / NUM_TARGET_PORT_GROUPS; + softc->port_cnt = CTL_MAX_PORTS / NUM_HA_SHELVES; softc->port_min = (softc->ha_id - 1) * softc->port_cnt; } softc->port_max = softc->port_min + softc->port_cnt; @@ -7137,8 +7137,8 @@ ctl_report_tagret_port_groups(struct ctl { struct scsi_maintenance_in *cdb; int retval; - int alloc_len, ext, total_len = 0, g, pc, pg, gs, os; - int num_target_port_groups, num_target_ports; + int alloc_len, ext, total_len = 0, g, pc, pg, ts, os; + int num_ha_groups, num_target_ports, shared_group; struct ctl_lun *lun; struct ctl_softc *softc; struct ctl_port *port; @@ -7172,11 +7172,8 @@ ctl_report_tagret_port_groups(struct ctl return(retval); } - if (softc->is_single) - num_target_port_groups = 1; - else - num_target_port_groups = NUM_TARGET_PORT_GROUPS; num_target_ports = 0; + shared_group = (softc->is_single != 0); mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) @@ -7184,15 +7181,18 @@ ctl_report_tagret_port_groups(struct ctl if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) continue; num_target_ports++; + if (port->status & CTL_PORT_STATUS_HA_SHARED) + shared_group = 1; } mtx_unlock(&softc->ctl_lock); + num_ha_groups = (softc->is_single) ? 0 : NUM_HA_SHELVES; if (ext) total_len = sizeof(struct scsi_target_group_data_extended); else total_len = sizeof(struct scsi_target_group_data); total_len += sizeof(struct scsi_target_port_group_descriptor) * - num_target_port_groups + + (shared_group + num_ha_groups) + sizeof(struct scsi_target_port_descriptor) * num_target_ports; alloc_len = scsi_4btoul(cdb->length); @@ -7229,24 +7229,62 @@ ctl_report_tagret_port_groups(struct ctl mtx_lock(&softc->ctl_lock); pg = softc->port_min / softc->port_cnt; - if (softc->ha_link == CTL_HA_LINK_OFFLINE) - gs = TPG_ASYMMETRIC_ACCESS_UNAVAILABLE; - else if (softc->ha_link == CTL_HA_LINK_UNKNOWN) - gs = TPG_ASYMMETRIC_ACCESS_TRANSITIONING; - else if (softc->ha_mode == CTL_HA_MODE_ACT_STBY) - gs = TPG_ASYMMETRIC_ACCESS_STANDBY; - else - gs = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - if (lun->flags & CTL_LUN_PRIMARY_SC) { - os = gs; - gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; - } else - os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; - for (g = 0; g < num_target_port_groups; g++) { - tpg_desc->pref_state = (g == pg) ? gs : os; + if (lun->flags & (CTL_LUN_PRIMARY_SC | CTL_LUN_PEER_SC_PRIMARY)) { + /* Some shelf is known to be primary. */ + if (softc->ha_link == CTL_HA_LINK_OFFLINE) + os = TPG_ASYMMETRIC_ACCESS_UNAVAILABLE; + else if (softc->ha_link == CTL_HA_LINK_UNKNOWN) + os = TPG_ASYMMETRIC_ACCESS_TRANSITIONING; + else if (softc->ha_mode == CTL_HA_MODE_ACT_STBY) + os = TPG_ASYMMETRIC_ACCESS_STANDBY; + else + os = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + if (lun->flags & CTL_LUN_PRIMARY_SC) { + ts = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } else { + ts = os; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } + } else { + /* No known primary shelf. */ + if (softc->ha_link == CTL_HA_LINK_OFFLINE) { + ts = TPG_ASYMMETRIC_ACCESS_UNAVAILABLE; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } else if (softc->ha_link == CTL_HA_LINK_UNKNOWN) { + ts = TPG_ASYMMETRIC_ACCESS_TRANSITIONING; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } else { + ts = os = TPG_ASYMMETRIC_ACCESS_TRANSITIONING; + } + } + if (shared_group) { + tpg_desc->pref_state = ts; tpg_desc->support = TPG_AO_SUP | TPG_AN_SUP | TPG_S_SUP | TPG_U_SUP | TPG_T_SUP; - scsi_ulto2b(g + 1, tpg_desc->target_port_group); + scsi_ulto2b(1, tpg_desc->target_port_group); + tpg_desc->status = TPG_IMPLICIT; + pc = 0; + STAILQ_FOREACH(port, &softc->port_list, links) { + if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) + continue; + if (!softc->is_single && + (port->status & CTL_PORT_STATUS_HA_SHARED) == 0) + continue; + if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + continue; + scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. + relative_target_port_identifier); + pc++; + } + tpg_desc->target_port_count = pc; + tpg_desc = (struct scsi_target_port_group_descriptor *) + &tpg_desc->descriptors[pc]; + } + for (g = 0; g < num_ha_groups; g++) { + tpg_desc->pref_state = (g == pg) ? ts : os; + tpg_desc->support = TPG_AO_SUP | TPG_AN_SUP | TPG_S_SUP | + TPG_U_SUP | TPG_T_SUP; + scsi_ulto2b(2 + g, tpg_desc->target_port_group); tpg_desc->status = TPG_IMPLICIT; pc = 0; STAILQ_FOREACH(port, &softc->port_list, links) { @@ -7255,6 +7293,8 @@ ctl_report_tagret_port_groups(struct ctl continue; if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; + if (port->status & CTL_PORT_STATUS_HA_SHARED) + continue; if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. @@ -9626,7 +9666,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio struct ctl_softc *softc; struct ctl_lun *lun; struct ctl_port *port; - int data_len; + int data_len, g; uint8_t proto; softc = control_softc; @@ -9720,8 +9760,11 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_TPORTGRP; desc->length = 4; - scsi_ulto2b(ctsio->io_hdr.nexus.targ_port / softc->port_cnt + 1, - &desc->identifier[2]); + if (softc->is_single || port->status & CTL_PORT_STATUS_HA_SHARED) + g = 1; + else + g = 2 + ctsio->io_hdr.nexus.targ_port / softc->port_cnt; + scsi_ulto2b(g, &desc->identifier[2]); desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + sizeof(struct scsi_vpd_id_trgt_port_grp_id)); Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Wed Nov 11 12:36:42 2015 (r290669) +++ head/sys/cam/ctl/ctl_frontend.c Wed Nov 11 13:18:38 2015 (r290670) @@ -310,6 +310,7 @@ ctl_port_online(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; struct ctl_lun *lun; + const char *value; uint32_t l; if (port->lun_enable != NULL) { @@ -328,6 +329,13 @@ ctl_port_online(struct ctl_port *port) if (port->port_online != NULL) port->port_online(port->onoff_arg); mtx_lock(&softc->ctl_lock); + if (softc->is_single == 0) { + value = ctl_get_opt(&port->options, "ha_shared"); + if (value != NULL && strcmp(value, "on") == 0) + port->status |= CTL_PORT_STATUS_HA_SHARED; + else + port->status &= ~CTL_PORT_STATUS_HA_SHARED; + } port->status |= CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Wed Nov 11 12:36:42 2015 (r290669) +++ head/sys/cam/ctl/ctl_frontend.h Wed Nov 11 13:18:38 2015 (r290670) @@ -41,7 +41,8 @@ typedef enum { CTL_PORT_STATUS_NONE = 0x00, - CTL_PORT_STATUS_ONLINE = 0x01 + CTL_PORT_STATUS_ONLINE = 0x01, + CTL_PORT_STATUS_HA_SHARED = 0x02 } ctl_port_status; typedef int (*fe_init_t)(void); Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Nov 11 12:36:42 2015 (r290669) +++ head/sys/cam/ctl/ctl_private.h Wed Nov 11 13:18:38 2015 (r290670) @@ -356,10 +356,7 @@ struct ctl_devid { uint8_t data[]; }; -/* - * For report target port groups. - */ -#define NUM_TARGET_PORT_GROUPS 2 +#define NUM_HA_SHELVES 2 #define CTL_WRITE_BUFFER_SIZE 262144 From owner-svn-src-all@freebsd.org Wed Nov 11 13:23:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65AAEA2C585; Wed, 11 Nov 2015 13:23:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1FB1149; Wed, 11 Nov 2015 13:23:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABDN9vq006720; Wed, 11 Nov 2015 13:23:09 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABDN773006706; Wed, 11 Nov 2015 13:23:07 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511111323.tABDN773006706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 11 Nov 2015 13:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290671 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 13:23:10 -0000 Author: des Date: Wed Nov 11 13:23:07 2015 New Revision: 290671 URL: https://svnweb.freebsd.org/changeset/base/290671 Log: Now that we have mandoc, we can leave $Mdocdate$ tags as-is. Unfortunately, there is (currently) no way to make Subversion generate correct $Mdocdate$ tags, but perhas we can teach mandoc to read Subversion's %d format. Modified: head/crypto/openssh/moduli.5 head/crypto/openssh/scp.1 head/crypto/openssh/sftp-server.8 head/crypto/openssh/sftp.1 head/crypto/openssh/ssh-add.1 head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keyscan.1 head/crypto/openssh/ssh-keysign.8 head/crypto/openssh/ssh-pkcs11-helper.8 head/crypto/openssh/ssh.1 head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshd.8 head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/moduli.5 ============================================================================== --- head/crypto/openssh/moduli.5 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/moduli.5 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: moduli.5,v 1.17 2012/09/26 17:34:38 jmc Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2008 Damien Miller .\" @@ -14,7 +13,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd September 26, 2012 +.Dd $Mdocdate: September 26 2012 $ .Dt MODULI 5 .Os .Sh NAME Modified: head/crypto/openssh/scp.1 ============================================================================== --- head/crypto/openssh/scp.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/scp.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -9,9 +9,8 @@ .\" Created: Sun May 7 00:14:37 1995 ylo .\" .\" $OpenBSD: scp.1,v 1.61 2013/10/20 09:51:26 djm Exp $ -.\" $FreeBSD$ .\" -.Dd October 20, 2013 +.Dd $Mdocdate: October 20 2013 $ .Dt SCP 1 .Os .Sh NAME Modified: head/crypto/openssh/sftp-server.8 ============================================================================== --- head/crypto/openssh/sftp-server.8 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/sftp-server.8 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: sftp-server.8,v 1.25 2013/10/14 14:18:56 jmc Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2000 Markus Friedl. All rights reserved. .\" @@ -23,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 14, 2013 +.Dd $Mdocdate: October 14 2013 $ .Dt SFTP-SERVER 8 .Os .Sh NAME Modified: head/crypto/openssh/sftp.1 ============================================================================== --- head/crypto/openssh/sftp.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/sftp.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: sftp.1,v 1.97 2013/10/20 09:51:26 djm Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2001 Damien Miller. All rights reserved. .\" @@ -23,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 20, 2013 +.Dd $Mdocdate: October 20 2013 $ .Dt SFTP 1 .Os .Sh NAME Modified: head/crypto/openssh/ssh-add.1 ============================================================================== --- head/crypto/openssh/ssh-add.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh-add.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-add.1,v 1.59 2013/12/07 11:58:46 naddy Exp $ -.\" $FreeBSD$ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH-ADD 1 .Os .Sh NAME Modified: head/crypto/openssh/ssh-keygen.1 ============================================================================== --- head/crypto/openssh/ssh-keygen.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh-keygen.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-keygen.1,v 1.120 2014/02/05 20:13:25 naddy Exp $ -.\" $FreeBSD$ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 5, 2014 +.Dd $Mdocdate: February 5 2014 $ .Dt SSH-KEYGEN 1 .Os .Sh NAME Modified: head/crypto/openssh/ssh-keyscan.1 ============================================================================== --- head/crypto/openssh/ssh-keyscan.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh-keyscan.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-keyscan.1,v 1.34 2014/01/28 14:13:39 jmc Exp $ -.\" $FreeBSD$ .\" .\" Copyright 1995, 1996 by David Mazieres . .\" @@ -7,7 +6,7 @@ .\" permitted provided that due credit is given to the author and the .\" OpenBSD project by leaving this copyright notice intact. .\" -.Dd January 28, 2014 +.Dd $Mdocdate: January 28 2014 $ .Dt SSH-KEYSCAN 1 .Os .Sh NAME Modified: head/crypto/openssh/ssh-keysign.8 ============================================================================== --- head/crypto/openssh/ssh-keysign.8 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh-keysign.8 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-keysign.8,v 1.14 2013/12/07 11:58:46 naddy Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2002 Markus Friedl. All rights reserved. .\" @@ -23,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH-KEYSIGN 8 .Os .Sh NAME Modified: head/crypto/openssh/ssh-pkcs11-helper.8 ============================================================================== --- head/crypto/openssh/ssh-pkcs11-helper.8 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh-pkcs11-helper.8 Wed Nov 11 13:23:07 2015 (r290671) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-pkcs11-helper.8,v 1.4 2013/07/16 00:07:52 schwarze Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2010 Markus Friedl. All rights reserved. .\" @@ -15,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 16, 2013 +.Dd $Mdocdate: July 16 2013 $ .Dt SSH-PKCS11-HELPER 8 .Os .Sh NAME Modified: head/crypto/openssh/ssh.1 ============================================================================== --- head/crypto/openssh/ssh.1 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh.1 Wed Nov 11 13:23:07 2015 (r290671) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: ssh.1,v 1.343 2013/12/07 11:58:46 naddy Exp $ .\" $FreeBSD$ -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH 1 .Os .Sh NAME Modified: head/crypto/openssh/ssh_config.5 ============================================================================== --- head/crypto/openssh/ssh_config.5 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/ssh_config.5 Wed Nov 11 13:23:07 2015 (r290671) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: ssh_config.5,v 1.185 2014/02/23 20:11:36 djm Exp $ .\" $FreeBSD$ -.Dd March 22, 2015 +.Dd $Mdocdate: February 23 2014 $ .Dt SSH_CONFIG 5 .Os .Sh NAME Modified: head/crypto/openssh/sshd.8 ============================================================================== --- head/crypto/openssh/sshd.8 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/sshd.8 Wed Nov 11 13:23:07 2015 (r290671) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd.8,v 1.273 2013/12/07 11:58:46 naddy Exp $ .\" $FreeBSD$ -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSHD 8 .Os .Sh NAME Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Wed Nov 11 13:18:38 2015 (r290670) +++ head/crypto/openssh/sshd_config.5 Wed Nov 11 13:23:07 2015 (r290671) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.172 2014/02/27 22:47:07 djm Exp $ .\" $FreeBSD$ -.Dd March 22, 2015 +.Dd $Mdocdate: February 27 2014 $ .Dt SSHD_CONFIG 5 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Nov 11 13:26:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE143A2C618; Wed, 11 Nov 2015 13:26:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81BA012EC; Wed, 11 Nov 2015 13:26:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABDQoJb006904; Wed, 11 Nov 2015 13:26:50 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABDQmK4006879; Wed, 11 Nov 2015 13:26:48 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511111326.tABDQmK4006879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 11 Nov 2015 13:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290672 - in head/crypto/openssh: . openbsd-compat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 13:26:51 -0000 Author: des Date: Wed Nov 11 13:26:47 2015 New Revision: 290672 URL: https://svnweb.freebsd.org/changeset/base/290672 Log: Remove /* $FreeBSD$ */ from files that already have __RCSID("$FreeBSD$"). Modified: head/crypto/openssh/auth.c head/crypto/openssh/auth2.c head/crypto/openssh/buffer.c head/crypto/openssh/channels.c head/crypto/openssh/cipher.c head/crypto/openssh/clientloop.c head/crypto/openssh/compat.c head/crypto/openssh/kex.c head/crypto/openssh/misc.c head/crypto/openssh/mux.c head/crypto/openssh/openbsd-compat/blowfish.c head/crypto/openssh/openbsd-compat/bsd-misc.h head/crypto/openssh/packet.c head/crypto/openssh/readconf.c head/crypto/openssh/schnorr.c head/crypto/openssh/servconf.c head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp-common.c head/crypto/openssh/sftp.c head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh.c head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.c Modified: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/auth.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: auth.c,v 1.103 2013/05/19 02:42:42 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/auth2.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: auth2.c,v 1.130 2014/01/29 06:18:35 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/buffer.c ============================================================================== --- head/crypto/openssh/buffer.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/buffer.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: buffer.c,v 1.35 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/channels.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/cipher.c ============================================================================== --- head/crypto/openssh/cipher.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/cipher.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: cipher.c,v 1.97 2014/02/07 06:55:54 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/clientloop.c ============================================================================== --- head/crypto/openssh/clientloop.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/clientloop.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: clientloop.c,v 1.258 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/compat.c ============================================================================== --- head/crypto/openssh/compat.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/compat.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: compat.c,v 1.82 2013/12/30 23:52:27 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/kex.c ============================================================================== --- head/crypto/openssh/kex.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/kex.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: kex.c,v 1.98 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/misc.c ============================================================================== --- head/crypto/openssh/misc.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/misc.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: misc.c,v 1.92 2013/10/14 23:28:23 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. Modified: head/crypto/openssh/mux.c ============================================================================== --- head/crypto/openssh/mux.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/mux.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: mux.c,v 1.44 2013/07/12 00:19:58 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2002-2008 Damien Miller * Modified: head/crypto/openssh/openbsd-compat/blowfish.c ============================================================================== --- head/crypto/openssh/openbsd-compat/blowfish.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/openbsd-compat/blowfish.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: blowfish.c,v 1.18 2004/11/02 17:23:26 hshoexer Exp $ */ -/* $FreeBSD$ */ /* * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos Modified: head/crypto/openssh/openbsd-compat/bsd-misc.h ============================================================================== --- head/crypto/openssh/openbsd-compat/bsd-misc.h Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/openbsd-compat/bsd-misc.h Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $Id: bsd-misc.h,v 1.25 2013/08/04 11:48:41 dtucker Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1999-2004 Damien Miller Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/packet.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: packet.c,v 1.192 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/readconf.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: readconf.c,v 1.218 2014/02/23 20:11:36 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/schnorr.c ============================================================================== --- head/crypto/openssh/schnorr.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/schnorr.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: schnorr.c,v 1.9 2014/01/09 23:20:00 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2008 Damien Miller. All rights reserved. * Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/servconf.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,6 +1,5 @@ /* $OpenBSD: servconf.c,v 1.249 2014/01/29 06:18:35 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved Modified: head/crypto/openssh/serverloop.c ============================================================================== --- head/crypto/openssh/serverloop.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/serverloop.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: serverloop.c,v 1.170 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/session.c ============================================================================== --- head/crypto/openssh/session.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/session.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: session.c,v 1.270 2014/01/31 16:39:19 tedu Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved Modified: head/crypto/openssh/sftp-common.c ============================================================================== --- head/crypto/openssh/sftp-common.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/sftp-common.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: sftp-common.c,v 1.26 2014/01/09 03:26:00 guenther Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Damien Miller. All rights reserved. Modified: head/crypto/openssh/sftp.c ============================================================================== --- head/crypto/openssh/sftp.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/sftp.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: sftp.c,v 1.158 2013/11/20 20:54:10 deraadt Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2001-2004 Damien Miller * Modified: head/crypto/openssh/ssh-agent.c ============================================================================== --- head/crypto/openssh/ssh-agent.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/ssh-agent.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: ssh-agent.c,v 1.183 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/ssh.c ============================================================================== --- head/crypto/openssh/ssh.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/ssh.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: ssh.c,v 1.401 2014/02/26 20:18:37 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/sshconnect.c ============================================================================== --- head/crypto/openssh/sshconnect.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/sshconnect.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: sshconnect.c,v 1.246 2014/02/06 22:21:01 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/sshconnect2.c ============================================================================== --- head/crypto/openssh/sshconnect2.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/sshconnect2.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: sshconnect2.c,v 1.204 2014/02/02 03:44:32 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Wed Nov 11 13:23:07 2015 (r290671) +++ head/crypto/openssh/sshd.c Wed Nov 11 13:26:47 2015 (r290672) @@ -1,5 +1,4 @@ /* $OpenBSD: sshd.c,v 1.420 2014/02/26 21:53:37 markus Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland From owner-svn-src-all@freebsd.org Wed Nov 11 13:28:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519D7A2C680; Wed, 11 Nov 2015 13:28:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16A2A14CB; Wed, 11 Nov 2015 13:28:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABDRxh0006986; Wed, 11 Nov 2015 13:27:59 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABDRxhM006985; Wed, 11 Nov 2015 13:27:59 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511111327.tABDRxhM006985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 11 Nov 2015 13:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290673 - head/crypto/openssh/contrib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 13:28:00 -0000 Author: des Date: Wed Nov 11 13:27:58 2015 New Revision: 290673 URL: https://svnweb.freebsd.org/changeset/base/290673 Log: One more $Mdocdate$ Modified: head/crypto/openssh/contrib/ssh-copy-id.1 Modified: head/crypto/openssh/contrib/ssh-copy-id.1 ============================================================================== --- head/crypto/openssh/contrib/ssh-copy-id.1 Wed Nov 11 13:26:47 2015 (r290672) +++ head/crypto/openssh/contrib/ssh-copy-id.1 Wed Nov 11 13:27:58 2015 (r290673) @@ -21,7 +21,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .. -.Dd June 17, 2010 +.Dd $Mdocdate: June 17 2010 $ .Dt SSH-COPY-ID 1 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Nov 11 13:47:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3306BA2CB37; Wed, 11 Nov 2015 13:47:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D29301F49; Wed, 11 Nov 2015 13:47:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABDlNVl012966; Wed, 11 Nov 2015 13:47:23 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABDlNFX012965; Wed, 11 Nov 2015 13:47:23 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511111347.tABDlNFX012965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 11 Nov 2015 13:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290674 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 13:47:25 -0000 Author: des Date: Wed Nov 11 13:47:23 2015 New Revision: 290674 URL: https://svnweb.freebsd.org/changeset/base/290674 Log: Remove dead code. Deleted: head/crypto/openssh/schnorr.c From owner-svn-src-all@freebsd.org Wed Nov 11 16:23:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFC8A2C031; Wed, 11 Nov 2015 16:23:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF0F818A6; Wed, 11 Nov 2015 16:23:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABGN7cV059275; Wed, 11 Nov 2015 16:23:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABGN7cb059274; Wed, 11 Nov 2015 16:23:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511111623.tABGN7cb059274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 Nov 2015 16:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290675 - head/sys/tests/callout_test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 16:23:09 -0000 Author: bdrewery Date: Wed Nov 11 16:23:07 2015 New Revision: 290675 URL: https://svnweb.freebsd.org/changeset/base/290675 Log: Use a proper prototype. This was a failure in the GCC build. MFC after: 1 month X-MFC-With: r290663 Modified: head/sys/tests/callout_test/callout_test.c Modified: head/sys/tests/callout_test/callout_test.c ============================================================================== --- head/sys/tests/callout_test/callout_test.c Wed Nov 11 13:47:23 2015 (r290674) +++ head/sys/tests/callout_test/callout_test.c Wed Nov 11 16:23:07 2015 (r290675) @@ -72,7 +72,7 @@ static struct callout_run *comaster[MAXC uint64_t callout_total=0; -static void execute_the_co_test(); +static void execute_the_co_test(struct callout_run *rn); static void co_saydone(void *arg) From owner-svn-src-all@freebsd.org Wed Nov 11 16:24:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A86A2C095; Wed, 11 Nov 2015 16:24:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A53E01A55; Wed, 11 Nov 2015 16:24:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABGOqCL059368; Wed, 11 Nov 2015 16:24:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABGOqNY059367; Wed, 11 Nov 2015 16:24:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511111624.tABGOqNY059367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 Nov 2015 16:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290676 - head/sys/tests/framework X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 16:24:53 -0000 Author: bdrewery Date: Wed Nov 11 16:24:52 2015 New Revision: 290676 URL: https://svnweb.freebsd.org/changeset/base/290676 Log: Remove redundant declaration for sysctl kern. This is trying to fix the GCC build. MFC after: 1 month X-MFC-With: r290663 Modified: head/sys/tests/framework/kern_testfrwk.c Modified: head/sys/tests/framework/kern_testfrwk.c ============================================================================== --- head/sys/tests/framework/kern_testfrwk.c Wed Nov 11 16:23:07 2015 (r290675) +++ head/sys/tests/framework/kern_testfrwk.c Wed Nov 11 16:24:52 2015 (r290676) @@ -168,7 +168,6 @@ kerntest_frwk_fini(void) static int kerntest_execute(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_kern); SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW, 0, "Kernel Test Framework"); SYSCTL_PROC(_kern_testfrwk, OID_AUTO, runtest, (CTLTYPE_STRUCT | CTLFLAG_RW), 0, 0, kerntest_execute, "IU", "Execute a kernel test"); From owner-svn-src-all@freebsd.org Wed Nov 11 18:45:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 647ECA2C5F4; Wed, 11 Nov 2015 18:45:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB121D49; Wed, 11 Nov 2015 18:45:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIjn35004910; Wed, 11 Nov 2015 18:45:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIjmwQ004902; Wed, 11 Nov 2015 18:45:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511111845.tABIjmwQ004902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 Nov 2015 18:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290677 - in head: share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:45:50 -0000 Author: bdrewery Date: Wed Nov 11 18:45:48 2015 New Revision: 290677 URL: https://svnweb.freebsd.org/changeset/base/290677 Log: Use explicit filename when creating locale symlinks to avoid creating a directory symlink when the target directory does not exist. This will cause an error instead of a broken setup. Sponsored by: EMC / Isilon Storage Division Modified: head/share/colldef/Makefile head/share/ctypedef/Makefile head/share/monetdef/Makefile head/share/msgdef/Makefile head/share/numericdef/Makefile head/share/timedef/Makefile head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/colldef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -175,7 +175,8 @@ FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/ctypedef/Makefile ============================================================================== --- head/share/ctypedef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/ctypedef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -176,7 +176,8 @@ FILES= ${LOCALES:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/monetdef/Makefile ============================================================================== --- head/share/monetdef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/monetdef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -173,7 +173,8 @@ FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/msgdef/Makefile ============================================================================== --- head/share/msgdef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/msgdef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -173,7 +173,8 @@ FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/numericdef/Makefile ============================================================================== --- head/share/numericdef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/numericdef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -173,7 +173,8 @@ FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Wed Nov 11 16:24:52 2015 (r290676) +++ head/share/timedef/Makefile Wed Nov 11 18:45:48 2015 (r290677) @@ -173,7 +173,8 @@ FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} .for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} ${LOCALEDIR}/${f:C/^.*://} +SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ + ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Wed Nov 11 16:24:52 2015 (r290676) +++ head/tools/tools/locale/tools/cldr2def.pl Wed Nov 11 18:45:48 2015 (r290677) @@ -946,7 +946,8 @@ FILES= \${LOCALES:S/\$/.${SRCOUT2}/} CLEANFILES= \${FILES} .for f in \${SAME} -SYMLINKS+= ../\${f:C/:.*\$//}/\${FILESNAME} \${LOCALEDIR}/\${f:C/^.*://} +SYMLINKS+= ../\${f:C/:.*\$//}/\${FILESNAME} \\ + \${LOCALEDIR}/\${f:C/^.*://}/\${FILESNAME} .endfor .for f in \${LOCALES} From owner-svn-src-all@freebsd.org Wed Nov 11 18:54:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93FDEA2C8A4; Wed, 11 Nov 2015 18:54:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 437251331; Wed, 11 Nov 2015 18:54:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIsnpH007765; Wed, 11 Nov 2015 18:54:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIsnb8007764; Wed, 11 Nov 2015 18:54:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111854.tABIsnb8007764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290678 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:54:50 -0000 Author: cem Date: Wed Nov 11 18:54:49 2015 New Revision: 290678 URL: https://svnweb.freebsd.org/changeset/base/290678 Log: NTB: Skip db_valid validation writing DB link bit In ntb_poll_link, we are intentionally writing the link bit, which is absent from db_valid_mask. Don't panic on a kassert when we do so. The Linux version of this (dual BSD/GPL) driver has the db_valid_mask assertions in callers of db_iowrite() rather than db_iowrite() itself; it skips the assertions in the equivalent of ntb_poll_link(). Rather than duplicating the assertions in every caller, add a db_iowrite_raw() that doesn't check and use it from ntb_poll_link(). Suggested by: kassert_panic Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:45:48 2015 (r290677) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:54:49 2015 (r290678) @@ -283,7 +283,8 @@ static void ntb_interrupt(struct ntb_sof static void ndev_vec_isr(void *arg); static void ndev_irq_isr(void *arg); static inline uint64_t db_ioread(struct ntb_softc *, uint64_t regoff); -static inline void db_iowrite(struct ntb_softc *, uint64_t regoff, uint64_t val); +static inline void db_iowrite(struct ntb_softc *, uint64_t regoff, uint64_t); +static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); static void ntb_free_msix_vec(struct ntb_softc *ntb); static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); @@ -994,6 +995,12 @@ db_iowrite(struct ntb_softc *ntb, uint64 if (regoff == ntb->self_reg->db_mask) DB_MASK_ASSERT(ntb, MA_OWNED); + db_iowrite_raw(ntb, regoff, val); +} + +static inline void +db_iowrite_raw(struct ntb_softc *ntb, uint64_t regoff, uint64_t val) +{ if (ntb->type == NTB_ATOM) { ntb_reg_write(8, regoff, val); @@ -1875,7 +1882,7 @@ ntb_poll_link(struct ntb_softc *ntb) ntb->ntb_ctl = ntb_cntl; ntb->lnk_sta = ntb_reg_read(4, ntb->reg->lnk_sta); } else { - db_iowrite(ntb, ntb->self_reg->db_bell, ntb->db_link_mask); + db_iowrite_raw(ntb, ntb->self_reg->db_bell, ntb->db_link_mask); reg_val = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); if (reg_val == ntb->lnk_sta) From owner-svn-src-all@freebsd.org Wed Nov 11 18:54:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2CA8A2C8D4; Wed, 11 Nov 2015 18:54:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718B714DE; Wed, 11 Nov 2015 18:54:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIswFB007816; Wed, 11 Nov 2015 18:54:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIswqH007813; Wed, 11 Nov 2015 18:54:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111854.tABIswqH007813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290679 - in head/sys/dev/ntb: if_ntb ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:54:59 -0000 Author: cem Date: Wed Nov 11 18:54:58 2015 New Revision: 290679 URL: https://svnweb.freebsd.org/changeset/base/290679 Log: ntb: Use caddr_t to simplify pointer arithmetic Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_hw.h Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:54:49 2015 (r290678) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:54:58 2015 (r290679) @@ -143,7 +143,7 @@ struct ntb_transport_qp { void *data, int len); struct ntb_queue_list tx_free_q; struct mtx ntb_tx_free_q_lock; - void *tx_mw; + caddr_t tx_mw; bus_addr_t tx_mw_phys; ntb_q_idx_t tx_index; ntb_q_idx_t tx_max_entry; @@ -158,7 +158,7 @@ struct ntb_transport_qp { struct mtx ntb_rx_q_lock; struct task rx_completion_task; struct task rxc_db_work; - void *rx_buff; + caddr_t rx_buff; ntb_q_idx_t rx_index; ntb_q_idx_t rx_max_entry; uint64_t rx_max_frame; @@ -197,11 +197,11 @@ struct ntb_transport_mw { size_t xlat_align; size_t xlat_align_size; /* Tx buff is off vbase / phys_addr */ - void *vbase; + caddr_t vbase; size_t xlat_size; size_t buff_size; /* Rx buff is off virt_addr / dma_addr */ - void *virt_addr; + caddr_t virt_addr; bus_addr_t dma_addr; }; @@ -560,7 +560,7 @@ ntb_transport_init(struct ntb_softc *ntb mw->buff_size = 0; mw->xlat_size = 0; - mw->virt_addr = 0; + mw->virt_addr = NULL; mw->dma_addr = 0; } @@ -665,7 +665,7 @@ ntb_transport_init_queue(struct ntb_tran tx_size = mw_size / num_qps_mw; qp_offset = tx_size * qp_num / mw_count; - qp->tx_mw = (char *)mw->vbase + qp_offset; + qp->tx_mw = mw->vbase + qp_offset; KASSERT(qp->tx_mw != NULL, ("uh oh?")); /* XXX Assumes that a vm_paddr_t is equivalent to bus_addr_t */ @@ -673,7 +673,7 @@ ntb_transport_init_queue(struct ntb_tran KASSERT(qp->tx_mw_phys != 0, ("uh oh?")); tx_size -= sizeof(struct ntb_rx_info); - qp->rx_info = (void *)((char *)qp->tx_mw + tx_size); + qp->rx_info = (void *)(qp->tx_mw + tx_size); /* Due to house-keeping, there must be at least 2 buffs */ qp->tx_max_frame = qmin(tx_size / 2, @@ -1356,10 +1356,10 @@ ntb_transport_setup_qp_mw(struct ntb_tra num_qps_mw = nt->qp_count / mw_count; rx_size = mw->xlat_size / num_qps_mw; - qp->rx_buff = (char *)mw->virt_addr + rx_size * qp_num / mw_count; + qp->rx_buff = mw->virt_addr + rx_size * qp_num / mw_count; rx_size -= sizeof(struct ntb_rx_info); - qp->remote_rx_info = (void*)((char *)qp->rx_buff + rx_size); + qp->remote_rx_info = (void*)(qp->rx_buff + rx_size); /* Due to house-keeping, there must be at least 2 buffs */ qp->rx_max_frame = qmin(rx_size / 2, @@ -1371,8 +1371,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra /* Set up the hdr offsets with 0s */ for (i = 0; i < qp->rx_max_entry; i++) { - offset = (void *)((uint8_t *)qp->rx_buff + - qp->rx_max_frame * (i + 1) - + offset = (void *)(qp->rx_buff + qp->rx_max_frame * (i + 1) - sizeof(struct ntb_payload_header)); memset(offset, 0, sizeof(struct ntb_payload_header)); } Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:54:49 2015 (r290678) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:54:58 2015 (r290679) @@ -111,8 +111,8 @@ struct ntb_pci_bar_info { int pci_resource_id; struct resource *pci_resource; vm_paddr_t pbase; - void *vbase; - u_long size; + caddr_t vbase; + vm_size_t size; /* Configuration register offsets */ uint32_t psz_off; @@ -2404,7 +2404,7 @@ ntb_peer_spad_read(struct ntb_softc *ntb */ int ntb_mw_get_range(struct ntb_softc *ntb, unsigned mw_idx, vm_paddr_t *base, - void **vbase, size_t *size, size_t *align, size_t *align_size) + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size) { struct ntb_pci_bar_info *bar; size_t bar_b2b_off; @@ -2423,7 +2423,7 @@ ntb_mw_get_range(struct ntb_softc *ntb, if (base != NULL) *base = bar->pbase + bar_b2b_off; if (vbase != NULL) - *vbase = (char *)bar->vbase + bar_b2b_off; + *vbase = bar->vbase + bar_b2b_off; if (size != NULL) *size = bar->size - bar_b2b_off; if (align != NULL) Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.h Wed Nov 11 18:54:49 2015 (r290678) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.h Wed Nov 11 18:54:58 2015 (r290679) @@ -77,7 +77,7 @@ void ntb_clear_ctx(struct ntb_softc *); uint8_t ntb_mw_count(struct ntb_softc *); int ntb_mw_get_range(struct ntb_softc *, unsigned mw_idx, vm_paddr_t *base, - void **vbase, size_t *size, size_t *align, size_t *align_size); + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size); int ntb_mw_set_trans(struct ntb_softc *, unsigned mw_idx, bus_addr_t, size_t); int ntb_mw_clear_trans(struct ntb_softc *, unsigned mw_idx); From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B06A2C905; Wed, 11 Nov 2015 18:55:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B922175C; Wed, 11 Nov 2015 18:55:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIt7Bs007889; Wed, 11 Nov 2015 18:55:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIt7GF007887; Wed, 11 Nov 2015 18:55:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABIt7GF007887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290680 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:08 -0000 Author: cem Date: Wed Nov 11 18:55:07 2015 New Revision: 290680 URL: https://svnweb.freebsd.org/changeset/base/290680 Log: ntb_hw: In INTx fallback, correct db shift from 15 to 16 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_regs.h Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:54:58 2015 (r290679) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:07 2015 (r290680) @@ -905,7 +905,7 @@ ntb_init_isr(struct ntb_softc *ntb) if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { ntb->db_vec_count = 1; - ntb->db_vec_shift = ntb->db_count; + ntb->db_vec_shift = XEON_DB_TOTAL_SHIFT; rc = ntb_setup_legacy_interrupt(ntb); } else { ntb_create_msix_vec(ntb, num_vectors); Modified: head/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_regs.h Wed Nov 11 18:54:58 2015 (r290679) +++ head/sys/dev/ntb/ntb_hw/ntb_regs.h Wed Nov 11 18:55:07 2015 (r290680) @@ -39,6 +39,7 @@ #define XEON_HSX_SPLIT_MW_COUNT 3 /* Reserve the uppermost bit for link interrupt */ #define XEON_DB_COUNT 15 +#define XEON_DB_TOTAL_SHIFT 16 #define XEON_DB_LINK 15 #define XEON_DB_MSIX_VECTOR_COUNT 4 #define XEON_DB_MSIX_VECTOR_SHIFT 5 From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF214A2C952; Wed, 11 Nov 2015 18:55:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CAC18CA; Wed, 11 Nov 2015 18:55:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABItGTV007938; Wed, 11 Nov 2015 18:55:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABItGoT007937; Wed, 11 Nov 2015 18:55:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABItGoT007937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290681 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:17 -0000 Author: cem Date: Wed Nov 11 18:55:16 2015 New Revision: 290681 URL: https://svnweb.freebsd.org/changeset/base/290681 Log: ntb_hw: Correctly detect DSD/USD Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:07 2015 (r290680) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:16 2015 (r290681) @@ -1168,9 +1168,9 @@ ntb_detect_xeon(struct ntb_softc *ntb) ntb->ppd = ppd; if ((ppd & XEON_PPD_DEV_TYPE) != 0) - ntb->dev_type = NTB_DEV_USD; - else ntb->dev_type = NTB_DEV_DSD; + else + ntb->dev_type = NTB_DEV_USD; if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED84A2C998; Wed, 11 Nov 2015 18:55:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 290741A3E; Wed, 11 Nov 2015 18:55:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABItQ44007988; Wed, 11 Nov 2015 18:55:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABItPhJ007985; Wed, 11 Nov 2015 18:55:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABItPhJ007985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290682 - in head/sys/dev/ntb: if_ntb ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:27 -0000 Author: cem Date: Wed Nov 11 18:55:25 2015 New Revision: 290682 URL: https://svnweb.freebsd.org/changeset/base/290682 Log: NTB: Diff reduce with Linux No functional change. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_regs.h Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:16 2015 (r290681) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:25 2015 (r290682) @@ -273,7 +273,7 @@ static void ntb_net_tx_handler(struct nt static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_event_handler(void *data, enum ntb_link_event status); -static int ntb_transport_init(struct ntb_softc *ntb); +static int ntb_transport_probe(struct ntb_softc *ntb); static void ntb_transport_free(struct ntb_transport_ctx *); static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num); @@ -368,7 +368,7 @@ ntb_setup_interface(void) return (ENXIO); } - rc = ntb_transport_init(net_softc.ntb); + rc = ntb_transport_probe(net_softc.ntb); if (rc != 0) { printf("ntb: Cannot init transport: %d\n", rc); return (rc); @@ -541,7 +541,7 @@ ntb_net_event_handler(void *data, enum n /* Transport Init and teardown */ static int -ntb_transport_init(struct ntb_softc *ntb) +ntb_transport_probe(struct ntb_softc *ntb) { struct ntb_transport_ctx *nt = &net_softc; struct ntb_transport_mw *mw; @@ -596,6 +596,8 @@ ntb_transport_init(struct ntb_softc *ntb nt->link_is_up = false; ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); ntb_link_event(ntb); + + callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); return (0); err: @@ -693,6 +695,8 @@ ntb_transport_init_queue(struct ntb_tran STAILQ_INIT(&qp->rx_pend_q); STAILQ_INIT(&qp->rx_free_q); STAILQ_INIT(&qp->tx_free_q); + + callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } static void Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:16 2015 (r290681) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:25 2015 (r290682) @@ -518,26 +518,26 @@ ntb_attach(device_t device) error = ntb_detect_atom(ntb); else error = ntb_detect_xeon(ntb); - if (error) + if (error != 0) goto out; ntb_detect_max_mw(ntb); + pci_enable_busmaster(ntb->device); + error = ntb_map_pci_bars(ntb); - if (error) + if (error != 0) goto out; if (ntb->type == NTB_ATOM) error = ntb_atom_init_dev(ntb); else error = ntb_xeon_init_dev(ntb); - if (error) - goto out; - error = ntb_init_isr(ntb); - if (error) + if (error != 0) goto out; - ntb_sysctl_init(ntb); - pci_enable_busmaster(ntb->device); + ntb_poll_link(ntb); + + ntb_sysctl_init(ntb); out: if (error != 0) @@ -556,6 +556,7 @@ ntb_detach(device_t device) ntb_db_set_mask(ntb, ntb->db_valid_mask); callout_drain(&ntb->heartbeat_timer); callout_drain(&ntb->lr_timer); + pci_disable_busmaster(ntb->device); if (ntb->type == NTB_XEON) ntb_teardown_xeon(ntb); ntb_teardown_interrupts(ntb); @@ -1274,18 +1275,22 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) return (rc); /* Enable Bus Master and Memory Space on the secondary side */ - ntb_reg_write(2, XEON_PCICMD_OFFSET, + ntb_reg_write(2, XEON_SPCICMD_OFFSET, PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); - /* Enable link training */ - ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + /* + * Mask all doorbell interrupts. + */ + ntb_db_set_mask(ntb, ntb->db_valid_mask); - return (0); + rc = ntb_init_isr(ntb); + return (rc); } static int ntb_atom_init_dev(struct ntb_softc *ntb) { + int error; KASSERT(ntb->conn_type == NTB_CONN_B2B, ("Unsupported NTB configuration (%d)\n", ntb->conn_type)); @@ -1310,9 +1315,13 @@ ntb_atom_init_dev(struct ntb_softc *ntb) configure_atom_secondary_side_bars(ntb); /* Enable Bus Master and Memory Space on the secondary side */ - ntb_reg_write(2, ATOM_PCICMD_OFFSET, + ntb_reg_write(2, ATOM_SPCICMD_OFFSET, PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + error = ntb_init_isr(ntb); + if (error != 0) + return (error); + /* Initiate PCI-E link training */ ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); @@ -1988,6 +1997,19 @@ ntb_sysctl_init(struct ntb_softc *ntb) CTLFLAG_RD, NULL, "Raw HW registers (big-endian)"); regpar = SYSCTL_CHILDREN(tmptree); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "ntbcntl", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | + ntb->reg->ntb_ctl, sysctl_handle_register, "IU", + "NTB Control register"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnkcap", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | + 0x19c, sysctl_handle_register, "IU", + "NTB Link Capabilities"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnkcon", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | + 0x1a0, sysctl_handle_register, "IU", + "NTB Link Control register"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "db_mask", CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_64 | NTB_DB_READ | ntb->self_reg->db_mask, @@ -2352,7 +2374,7 @@ ntb_peer_spad_write(struct ntb_softc *nt return (EINVAL); if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) - ntb_mw_write(4, XEON_SHADOW_SPAD_OFFSET + idx * 4, val); + ntb_mw_write(4, XEON_SPAD_OFFSET + idx * 4, val); else ntb_reg_write(4, ntb->peer_reg->spad + idx * 4, val); @@ -2378,7 +2400,7 @@ ntb_peer_spad_read(struct ntb_softc *ntb return (EINVAL); if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) - *val = ntb_mw_read(4, XEON_SHADOW_SPAD_OFFSET + idx * 4); + *val = ntb_mw_read(4, XEON_SPAD_OFFSET + idx * 4); else *val = ntb_reg_read(4, ntb->peer_reg->spad + idx * 4); @@ -2564,7 +2586,7 @@ ntb_peer_db_set(struct ntb_softc *ntb, u { if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { - ntb_mw_write(2, XEON_SHADOW_PDOORBELL_OFFSET, bit); + ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); return; } @@ -2600,7 +2622,7 @@ ntb_get_peer_db_addr(struct ntb_softc *n ("invalid b2b idx")); bar = &ntb->bar_info[ntb_mw_to_bar(ntb, ntb->b2b_mw_idx)]; - regoff = XEON_SHADOW_PDOORBELL_OFFSET; + regoff = XEON_PDOORBELL_OFFSET; } KASSERT(bar->pci_bus_tag != X86_BUS_SPACE_IO, ("uh oh")); Modified: head/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_regs.h Wed Nov 11 18:55:16 2015 (r290681) +++ head/sys/dev/ntb/ntb_hw/ntb_regs.h Wed Nov 11 18:55:25 2015 (r290682) @@ -46,7 +46,7 @@ #define XEON_DB_LINK_BIT (1 << XEON_DB_LINK) #define XEON_SPAD_COUNT 16 -#define XEON_PCICMD_OFFSET 0x0504 +#define XEON_SPCICMD_OFFSET 0x0504 #define XEON_DEVCTRL_OFFSET 0x0598 #define XEON_DEVSTS_OFFSET 0x059a #define XEON_LINK_STATUS_OFFSET 0x01a2 @@ -91,7 +91,7 @@ #define ATOM_DB_MSIX_VECTOR_SHIFT 1 #define ATOM_SPAD_COUNT 16 -#define ATOM_PCICMD_OFFSET 0xb004 +#define ATOM_SPCICMD_OFFSET 0xb004 #define ATOM_MBAR23_OFFSET 0xb018 #define ATOM_MBAR45_OFFSET 0xb020 #define ATOM_DEVCTRL_OFFSET 0xb048 @@ -168,8 +168,4 @@ /* The peer ntb secondary config space is 32KB fixed size */ #define XEON_B2B_MIN_SIZE 0x8000 -/* XEON Shadowed MMIO Space */ -#define XEON_SHADOW_PDOORBELL_OFFSET 0x60 -#define XEON_SHADOW_SPAD_OFFSET 0x80 - #endif /* _NTB_REGS_H_ */ From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58C92A2C9D7; Wed, 11 Nov 2015 18:55:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 302581BB5; Wed, 11 Nov 2015 18:55:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABItZGx008037; Wed, 11 Nov 2015 18:55:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABItZZf008035; Wed, 11 Nov 2015 18:55:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABItZZf008035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290683 - in head/sys/dev/ntb: if_ntb ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:36 -0000 Author: cem Date: Wed Nov 11 18:55:34 2015 New Revision: 290683 URL: https://svnweb.freebsd.org/changeset/base/290683 Log: if_ntb: Transport link cleanup needs to be on a taskqueue Because it can sleep drainking link work callout(s). Linux (dual BSD/GPL driver) does something very similar. At the same time, switch the NTB CTX lock to a non-spin mutex, because the taskqueue_swi lock can't be taken after a spin mutex. Suggested by: Witness Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:25 2015 (r290682) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:34 2015 (r290683) @@ -216,6 +216,7 @@ struct ntb_transport_ctx { unsigned qp_count; enum ntb_link_event link_is_up; struct callout link_work; + struct task link_cleanup; uint64_t bufsize; u_char eaddr[ETHER_ADDR_LEN]; struct mtx tx_lock; @@ -304,6 +305,7 @@ static int ntb_transport_setup_qp_mw(str unsigned int qp_num); static void ntb_qp_link_work(void *arg); static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt); +static void ntb_transport_link_cleanup_work(void *, int); static void ntb_qp_link_down(struct ntb_transport_qp *qp); static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp); static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); @@ -588,6 +590,7 @@ ntb_transport_probe(struct ntb_softc *nt } callout_init(&nt->link_work, 0); + TASK_INIT(&nt->link_cleanup, 0, ntb_transport_link_cleanup_work, nt); rc = ntb_set_ctx(ntb, nt, &ntb_transport_ops); if (rc != 0) @@ -614,7 +617,7 @@ ntb_transport_free(struct ntb_transport_ uint8_t i; ntb_transport_link_cleanup(nt); - + taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); @@ -1178,7 +1181,7 @@ ntb_transport_event_callback(void *data) } else { if (bootverbose) if_printf(nt->ifp, "HW link down\n"); - ntb_transport_link_cleanup(nt); + taskqueue_enqueue(taskqueue_swi, &nt->link_cleanup); } } @@ -1448,6 +1451,12 @@ ntb_transport_link_cleanup(struct ntb_tr ntb_spad_write(nt->ntb, i, 0); } +static void +ntb_transport_link_cleanup_work(void *arg, int pending __unused) +{ + + ntb_transport_link_cleanup(arg); +} static void ntb_qp_link_down(struct ntb_transport_qp *qp) Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:25 2015 (r290682) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:34 2015 (r290683) @@ -182,8 +182,8 @@ struct ntb_softc { void *ntb_ctx; const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; -#define CTX_LOCK(sc) mtx_lock_spin(&(sc)->ctx_lock) -#define CTX_UNLOCK(sc) mtx_unlock_spin(&(sc)->ctx_lock) +#define CTX_LOCK(sc) mtx_lock(&(sc)->ctx_lock) +#define CTX_UNLOCK(sc) mtx_unlock(&(sc)->ctx_lock) #define CTX_ASSERT(sc,f) mtx_assert(&(sc)->ctx_lock, (f)) struct mtx ctx_lock; @@ -512,7 +512,7 @@ ntb_attach(device_t device) callout_init(&ntb->heartbeat_timer, 1); callout_init(&ntb->lr_timer, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); - mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_SPIN); + mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); if (ntb->type == NTB_ATOM) error = ntb_detect_atom(ntb); From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E8DEA2CA18; Wed, 11 Nov 2015 18:55:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3FD1D10; Wed, 11 Nov 2015 18:55:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABItiiZ008085; Wed, 11 Nov 2015 18:55:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABItiLj008084; Wed, 11 Nov 2015 18:55:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABItiLj008084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290684 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:45 -0000 Author: cem Date: Wed Nov 11 18:55:44 2015 New Revision: 290684 URL: https://svnweb.freebsd.org/changeset/base/290684 Log: if_ntb: Add module-specific log level Rather than relying on the quite accurately named 'bootverbose'. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:34 2015 (r290683) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:44 2015 (r290684) @@ -90,15 +90,26 @@ enum ntb_link_event { NTB_LINK_UP, }; -static unsigned int transport_mtu = 0x10000 + ETHER_HDR_LEN + ETHER_CRC_LEN; +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); + +static unsigned g_if_ntb_debug_level; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, + &g_if_ntb_debug_level, 0, "if_ntb log level -- higher is more verbose"); +#define ntb_printf(lvl, ...) do { \ + if ((lvl) <= g_if_ntb_debug_level) { \ + if_printf(nt->ifp, __VA_ARGS__); \ + } \ +} while (0) + +static unsigned transport_mtu = 0x10000 + ETHER_HDR_LEN + ETHER_CRC_LEN; static uint64_t max_mw_size; -SYSCTL_UQUAD(_hw_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, +SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, "If enabled (non-zero), limit the size of large memory windows. " "Both sides of the NTB MUST set the same value here."); -static unsigned int max_num_clients; -SYSCTL_UINT(_hw_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, +static unsigned max_num_clients; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, &max_num_clients, 0, "Maximum number of NTB transport clients. " "0 (default) - use all available NTB memory windows; " "positive integer N - Limit to N memory windows."); @@ -370,22 +381,23 @@ ntb_setup_interface(void) return (ENXIO); } - rc = ntb_transport_probe(net_softc.ntb); - if (rc != 0) { - printf("ntb: Cannot init transport: %d\n", rc); - return (rc); - } - ifp = net_softc.ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { ntb_transport_free(&net_softc); printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } + if_initname(ifp, "ntb", 0); + + rc = ntb_transport_probe(net_softc.ntb); + if (rc != 0) { + printf("ntb: Cannot init transport: %d\n", rc); + if_free(net_softc.ifp); + return (rc); + } net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, &handlers); - if_initname(ifp, "ntb", 0); ifp->if_init = ntb_net_init; ifp->if_softc = &net_softc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; @@ -409,17 +421,17 @@ static int ntb_teardown_interface(void) { - if (net_softc.qp != NULL) + if (net_softc.qp != NULL) { ntb_transport_link_down(net_softc.qp); + ntb_transport_free_queue(net_softc.qp); + ntb_transport_free(&net_softc); + } + if (net_softc.ifp != NULL) { ether_ifdetach(net_softc.ifp); if_free(net_softc.ifp); - } - - if (net_softc.qp != NULL) { - ntb_transport_free_queue(net_softc.qp); - ntb_transport_free(&net_softc); + net_softc.ifp = NULL; } return (0); @@ -804,13 +816,15 @@ ntb_transport_create_queue(void *data, s static void ntb_transport_link_up(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt; if (qp == NULL) return; qp->client_ready = true; - if (bootverbose) - if_printf(qp->transport->ifp, "qp client ready\n"); + + nt = qp->transport; + ntb_printf(2, "qp client ready\n"); if (qp->transport->link_is_up) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); @@ -1175,12 +1189,10 @@ ntb_transport_event_callback(void *data) struct ntb_transport_ctx *nt = data; if (ntb_link_is_up(nt->ntb, NULL, NULL)) { - if (bootverbose) - if_printf(nt->ifp, "HW link up\n"); + ntb_printf(1, "HW link up\n"); callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); } else { - if (bootverbose) - if_printf(nt->ifp, "HW link down\n"); + ntb_printf(1, "HW link down\n"); taskqueue_enqueue(taskqueue_swi, &nt->link_cleanup); } } @@ -1242,8 +1254,7 @@ ntb_transport_link_work(void *arg) } nt->link_is_up = true; - if (bootverbose) - if_printf(nt->ifp, "transport link up\n"); + ntb_printf(1, "transport link up\n"); for (i = 0; i < nt->qp_count; i++) { qp = &nt->qp_vec[i]; @@ -1307,7 +1318,7 @@ ntb_set_mw(struct ntb_transport_ctx *nt, * with the Linux driver. */ if (mw->dma_addr % mw->xlat_align != 0) { - if_printf(nt->ifp, + ntb_printf(0, "DMA memory 0x%jx not aligned to BAR size 0x%zx\n", (uintmax_t)mw->dma_addr, size); ntb_free_mw(nt, num_mw); @@ -1317,7 +1328,7 @@ ntb_set_mw(struct ntb_transport_ctx *nt, /* Notify HW the memory location of the receive buffer */ rc = ntb_mw_set_trans(nt->ntb, num_mw, mw->dma_addr, mw->xlat_size); if (rc) { - if_printf(nt->ifp, "Unable to set mw%d translation", num_mw); + ntb_printf(0, "Unable to set mw%d translation\n", num_mw); ntb_free_mw(nt, num_mw); return (rc); } @@ -1407,8 +1418,7 @@ ntb_qp_link_work(void *arg) /* See if the remote side is up */ if ((val & (1ull << qp->qp_num)) != 0) { - if (bootverbose) - if_printf(nt->ifp, "qp link up\n"); + ntb_printf(2, "qp link up\n"); qp->link_is_up = true; if (qp->event_handler != NULL) From owner-svn-src-all@freebsd.org Wed Nov 11 18:55:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CEE4A2CA57; Wed, 11 Nov 2015 18:55:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB8A1E6C; Wed, 11 Nov 2015 18:55:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABItrOI008133; Wed, 11 Nov 2015 18:55:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABItrjR008132; Wed, 11 Nov 2015 18:55:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111855.tABItrjR008132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290685 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:55:55 -0000 Author: cem Date: Wed Nov 11 18:55:53 2015 New Revision: 290685 URL: https://svnweb.freebsd.org/changeset/base/290685 Log: ntb_hw: Similarly, add a debug-leveled macro for ntb_hw Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:44 2015 (r290684) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:53 2015 (r290685) @@ -317,6 +317,15 @@ static int sysctl_handle_features(SYSCTL static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS); static int sysctl_handle_register(SYSCTL_HANDLER_ARGS); +static unsigned g_ntb_hw_debug_level; +SYSCTL_UINT(_hw_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, + &g_ntb_hw_debug_level, 0, "ntb_hw log level -- higher is more verbose"); +#define ntb_printf(lvl, ...) do { \ + if ((lvl) <= g_ntb_hw_debug_level) { \ + device_printf(ntb->device, __VA_ARGS__); \ + } \ +} while (0) + static struct ntb_hw_info pci_ids[] = { /* XXX: PS/SS IDs left out until they are supported. */ { 0x0C4E8086, "BWD Atom Processor S1200 Non-Transparent Bridge B2B", From owner-svn-src-all@freebsd.org Wed Nov 11 18:56:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40DDDA2CAAA; Wed, 11 Nov 2015 18:56:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5EE01FC2; Wed, 11 Nov 2015 18:56:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIu2EF008188; Wed, 11 Nov 2015 18:56:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIu2JC008186; Wed, 11 Nov 2015 18:56:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111856.tABIu2JC008186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290686 - in head/sys/dev/ntb: if_ntb ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:56:04 -0000 Author: cem Date: Wed Nov 11 18:56:02 2015 New Revision: 290686 URL: https://svnweb.freebsd.org/changeset/base/290686 Log: ntb: volatile some members set by interrupt routines Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:55:53 2015 (r290685) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:56:02 2015 (r290686) @@ -144,7 +144,7 @@ struct ntb_transport_qp { void *cb_data; bool client_ready; - bool link_is_up; + volatile bool link_is_up; uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */ struct ntb_rx_info *rx_info; @@ -225,7 +225,7 @@ struct ntb_transport_ctx { struct _qpset qp_bitmap_free; unsigned mw_count; unsigned qp_count; - enum ntb_link_event link_is_up; + volatile bool link_is_up; struct callout link_work; struct task link_cleanup; uint64_t bufsize; Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:55:53 2015 (r290685) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:56:02 2015 (r290686) @@ -209,8 +209,8 @@ struct ntb_softc { #define DB_MASK_ASSERT(sc,f) mtx_assert(&(sc)->db_mask_lock, (f)) struct mtx db_mask_lock; - uint32_t ntb_ctl; - uint32_t lnk_sta; + volatile uint32_t ntb_ctl; + volatile uint32_t lnk_sta; uint64_t db_valid_mask; uint64_t db_link_mask; @@ -1976,9 +1976,11 @@ ntb_sysctl_init(struct ntb_softc *ntb) "Features/errata of this NTB device"); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "ntb_ctl", CTLFLAG_RD, - &ntb->ntb_ctl, 0, "NTB CTL register (cached)"); + __DEVOLATILE(uint32_t *, &ntb->ntb_ctl), 0, + "NTB CTL register (cached)"); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "lnk_sta", CTLFLAG_RD, - &ntb->lnk_sta, 0, "LNK STA register (cached)"); + __DEVOLATILE(uint32_t *, &ntb->lnk_sta), 0, + "LNK STA register (cached)"); SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status", CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status, From owner-svn-src-all@freebsd.org Wed Nov 11 18:56:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F8FA2CAEB; Wed, 11 Nov 2015 18:56:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB90D115E; Wed, 11 Nov 2015 18:56:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIuBf2008237; Wed, 11 Nov 2015 18:56:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIuBiV008236; Wed, 11 Nov 2015 18:56:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111856.tABIuBiV008236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290687 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:56:13 -0000 Author: cem Date: Wed Nov 11 18:56:11 2015 New Revision: 290687 URL: https://svnweb.freebsd.org/changeset/base/290687 Log: NTB: Add more HW registers to device sysctl tree Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:56:02 2015 (r290686) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 11 18:56:11 2015 (r290687) @@ -1961,6 +1961,8 @@ ntb_sysctl_init(struct ntb_softc *ntb) &ntb->conn_type, 0, "0 - Transparent; 1 - B2B; 2 - Root Port"); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "dev_type", CTLFLAG_RD, &ntb->dev_type, 0, "0 - USD; 1 - DSD"); + SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "ppd", CTLFLAG_RD, + &ntb->ppd, 0, "Raw PPD register (cached)"); if (ntb->b2b_mw_idx != B2B_MW_DISABLED) { SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "b2b_idx", CTLFLAG_RD, @@ -2085,14 +2087,50 @@ ntb_sysctl_init(struct ntb_softc *ntb) CTLFLAG_RD, NULL, "Xeon HW errors"); errpar = SYSCTL_CHILDREN(tmptree); - SYSCTL_ADD_PROC(ctx, errpar, OID_AUTO, "devsts", + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "ppd", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | NTB_PPD_OFFSET, + sysctl_handle_register, "CU", "PPD"); + + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar23_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_PBAR23SZ_OFFSET, + sysctl_handle_register, "CU", "PBAR23 SZ (log2)"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar4_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_PBAR4SZ_OFFSET, + sysctl_handle_register, "CU", "PBAR4 SZ (log2)"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar5_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_PBAR5SZ_OFFSET, + sysctl_handle_register, "CU", "PBAR5 SZ (log2)"); + + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar23_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_SBAR23SZ_OFFSET, + sysctl_handle_register, "CU", "SBAR23 SZ (log2)"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar4_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_SBAR4SZ_OFFSET, + sysctl_handle_register, "CU", "SBAR4 SZ (log2)"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar5_sz", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_8 | NTB_PCI_REG | XEON_SBAR5SZ_OFFSET, + sysctl_handle_register, "CU", "SBAR5 SZ (log2)"); + + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "devsts", CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_16 | NTB_PCI_REG | XEON_DEVSTS_OFFSET, sysctl_handle_register, "SU", "DEVSTS"); - SYSCTL_ADD_PROC(ctx, errpar, OID_AUTO, "lnksts", + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnksts", CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_16 | NTB_PCI_REG | XEON_LINK_STATUS_OFFSET, sysctl_handle_register, "SU", "LNKSTS"); + SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "slnksts", + CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + NTB_REG_16 | NTB_PCI_REG | XEON_SLINK_STATUS_OFFSET, + sysctl_handle_register, "SU", "SLNKSTS"); + SYSCTL_ADD_PROC(ctx, errpar, OID_AUTO, "uncerrsts", CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | NTB_PCI_REG | XEON_UNCERRSTS_OFFSET, From owner-svn-src-all@freebsd.org Wed Nov 11 18:56:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D4AA2CB47; Wed, 11 Nov 2015 18:56:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90D5512C0; Wed, 11 Nov 2015 18:56:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABIuLLS008288; Wed, 11 Nov 2015 18:56:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABIuLq0008287; Wed, 11 Nov 2015 18:56:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511111856.tABIuLq0008287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 Nov 2015 18:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290688 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 18:56:22 -0000 Author: cem Date: Wed Nov 11 18:56:21 2015 New Revision: 290688 URL: https://svnweb.freebsd.org/changeset/base/290688 Log: if_ntb: MFV c92ba3c5: invalid buf pointer in multi-MW setups Order of operations issue with the QP Num and MW count, which would result in the receive buffer pointer being invalid if there are more than 1 MW. Corrected with parenthesis to enforce the proper order of operations. Reported by: John I. Kading Reported by: Conrad Meyer Authored by: Jon Mason Obtained from: Linux (Dual BSD/GPL driver) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:56:11 2015 (r290687) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Wed Nov 11 18:56:21 2015 (r290688) @@ -680,7 +680,7 @@ ntb_transport_init_queue(struct ntb_tran mw_size = mw->phys_size; tx_size = mw_size / num_qps_mw; - qp_offset = tx_size * qp_num / mw_count; + qp_offset = tx_size * (qp_num / mw_count); qp->tx_mw = mw->vbase + qp_offset; KASSERT(qp->tx_mw != NULL, ("uh oh?")); @@ -1374,7 +1374,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra num_qps_mw = nt->qp_count / mw_count; rx_size = mw->xlat_size / num_qps_mw; - qp->rx_buff = mw->virt_addr + rx_size * qp_num / mw_count; + qp->rx_buff = mw->virt_addr + rx_size * (qp_num / mw_count); rx_size -= sizeof(struct ntb_rx_info); qp->remote_rx_info = (void*)(qp->rx_buff + rx_size); From owner-svn-src-all@freebsd.org Wed Nov 11 19:29:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F28A2B4DE; Wed, 11 Nov 2015 19:29:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDF7B188D; Wed, 11 Nov 2015 19:29:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by igcph11 with SMTP id ph11so78950443igc.1; Wed, 11 Nov 2015 11:29:12 -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 :content-transfer-encoding:message-id:references:to; bh=DVU6sV+SXfhQNhvOc5qcWUaO9IambrtXEwCEGOPiEvA=; b=uAYSrfd6nAW+k4O6Td6yPqcWYRv7mB6i1U8Kc9f3GEzbP6Yl/mbS5d9w+JhxZc6L4G rk3I2lrq5Ie7QwA9b3BCYL74t2fIPKnb6syW8NLy9IZtupHDrT+qft2/k2jLP4dN9Vhg orwEXsVruVj/TE/tFowkMNvNXqL9qtcZTfvH0OCxS93cCYRPXpnx3aYphqVwdYmXHD/f pPBIm/C0k4uIH8Tj65nFq7YwuhmDaIyEzggjHnZ08fyx2ygEQDTSx7jNDRVssPD1sIN7 8XTY34+nWrVbKwXDX72c2AmMOrRtiATt/kzgj2ILcvUzt8/9QFa2oKnFmmLWEnmPkB7l 2v3Q== X-Received: by 10.50.225.102 with SMTP id rj6mr34473456igc.95.1447270152801; Wed, 11 Nov 2015 11:29:12 -0800 (PST) Received: from [22.35.181.205] ([172.56.9.126]) by smtp.gmail.com with ESMTPSA id np7sm16342igb.0.2015.11.11.11.29.11 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Nov 2015 11:29:12 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r290663 - in head/sys: modules modules/tests modules/tests/callout_test modules/tests/framework tests tests/callout_test tests/framework From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <201511101414.tAAEEfPI057133@repo.freebsd.org> Date: Wed, 11 Nov 2015 11:29:11 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8B50A504-D6A9-49CF-917C-50F667A217A8@gmail.com> References: <201511101414.tAAEEfPI057133@repo.freebsd.org> To: Randall Stewart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 19:29:14 -0000 > On Nov 10, 2015, at 06:14, Randall Stewart wrote: >=20 > Author: rrs > Date: Tue Nov 10 14:14:41 2015 > New Revision: 290663 > URL: https://svnweb.freebsd.org/changeset/base/290663 >=20 > Log: > Add a kernel test framework. The callout_test is a demonstration and will= only > work with the upcoming async-drain functionality. Tests can be added > to the tests directory and then the framework can be used to launch > those tests. >=20 > MFC after: 1 month > Sponsored by: Netflix Inc. > Differential Revision: https://reviews.freebsd.org/D1755 Hi Randall, This code drop is lacking a few things: 1. How can other consumers use this? 2. How does this hook in to ATF/Kyua or Jenkins? There are a bunch of style bugs in the code as well. It seems like based on the lack of documentation, this needed more revie= w/communication and probably should have been put in share/examples or tools= /test until it could be integrated into existing frameworks and used by ever= yone else. Thank you, -NGie From owner-svn-src-all@freebsd.org Wed Nov 11 21:48:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2B7A2C679; Wed, 11 Nov 2015 21:48:08 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (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 8F9A11FAC; Wed, 11 Nov 2015 21:48:07 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by wmww144 with SMTP id w144so176779906wmw.1; Wed, 11 Nov 2015 13:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=content-type:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=JfASOosc6hbAjFtZcW4KyBzzFGdkAfYkL1nMgXzXftk=; b=YDz/HMyRYeIix50uPxv4NOzRTf1icMUFydDFvQbY6FZ4VK2h0DZ1KzOwPQlbDzXRLX cIdZqidiTPJboYnbSjmRql9woIleFngBm6ZLeDCwGvexdk1kIX/26tj232I5jHXko5EE Ts5e+UPPtUKhaPRSMz3c+cWrY14ZOZWMJiZVsnqKeNAmqKtw7LwN7qyq5cv62gqRD4Tc Smv69B0VulcpHXczVj+HFZWbnN4LgFwNZWpYxXa1IUCUwjaWfBcM9sQZIxYNa82sCEWY 9ZCtBZwZAh092CjXy2EjdZyEpXkHbqyLqEXCApqtbMvIF6kHkxOV7d6urdAAonL+B65a xRzg== X-Received: by 10.28.6.12 with SMTP id 12mr38633177wmg.99.1447278020762; Wed, 11 Nov 2015 13:40:20 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id y77sm27280843wme.15.2015.11.11.13.40.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Nov 2015 13:40:20 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Renato Botelho" Subject: Re: svn commit: r290651 - head/sys/dev/usb/wlan References: <201511101252.tAACqQrE033782@repo.freebsd.org> <2D6627A5-D455-424C-8A9E-0A18754CFE11@FreeBSD.org> Date: Wed, 11 Nov 2015 23:40:16 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 21:48:08 -0000 Wed, 11 Nov 2015 11:54:58 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Renato Botelho = : >> On Nov 10, 2015, at 18:19, Renato Botelho wrote: >> >>> On Nov 10, 2015, at 10:52, Andriy Voskoboinyk wro= te: >>> >>> Author: avos >>> Date: Tue Nov 10 12:52:26 2015 >>> New Revision: 290651 >>> URL: https://svnweb.freebsd.org/changeset/base/290651 >>> >>> Log: >>> urtwn(4): add IBSS mode support >>> >>> Tested with RTL8188EU, IBSS and STA modes. >>> >>> Reviewed by: kevlo >>> Approved by: adrian (mentor) >>> Differential Revision: https://reviews.freebsd.org/D4038 >>> >>> Modified: >>> head/sys/dev/usb/wlan/if_urtwn.c >>> head/sys/dev/usb/wlan/if_urtwnvar.h >>> >>> Modified: head/sys/dev/usb/wlan/if_urtwn.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >>> --- head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:20:22 2015 (r2906= 50) >>> +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Nov 10 12:52:26 2015 (r2906= 51) >>> @@ -228,10 +228,14 @@ static int urtwn_setup_beacon(struct ur >>> static void urtwn_update_beacon(struct ieee80211vap *, int); >>> static int urtwn_tx_beacon(struct urtwn_softc *sc, >>> struct urtwn_vap *); >>> +static void urtwn_tsf_task_adhoc(void *, int); >>> static void urtwn_tsf_sync_enable(struct urtwn_softc *, >>> struct ieee80211vap *); >>> static void urtwn_set_led(struct urtwn_softc *, int, int); >>> static void urtwn_set_mode(struct urtwn_softc *, uint8_t); >>> +static void urtwn_ibss_recv_mgmt(struct ieee80211_node *, >>> + struct mbuf *, int, >>> + const struct ieee80211_rx_stats *, int, int); >>> static int urtwn_newstate(struct ieee80211vap *, >>> enum ieee80211_state, int); >>> static void urtwn_watchdog(void *); >>> @@ -449,6 +453,7 @@ urtwn_attach(device_t self) >>> ic->ic_caps =3D >>> IEEE80211_C_STA /* station mode */ >>> | IEEE80211_C_MONITOR /* monitor mode */ >>> + | IEEE80211_C_IBSS /* adhoc mode */ >>> | IEEE80211_C_HOSTAP /* hostap mode */ >>> | IEEE80211_C_SHPREAMBLE /* short preamble supported */ >>> | IEEE80211_C_SHSLOT /* short slot time supported */ >>> @@ -592,13 +597,18 @@ urtwn_vap_create(struct ieee80211com *ic >>> return (NULL); >>> } >>> >>> - if (opmode =3D=3D IEEE80211_M_HOSTAP) >>> + if (opmode =3D=3D IEEE80211_M_HOSTAP || opmode =3D=3D IEEE80211_M_= IBSS) >>> urtwn_init_beacon(sc, uvp); >>> >>> /* override state transition machine */ >>> uvp->newstate =3D vap->iv_newstate; >>> vap->iv_newstate =3D urtwn_newstate; >>> vap->iv_update_beacon =3D urtwn_update_beacon; >>> + if (opmode =3D=3D IEEE80211_M_IBSS) { >>> + uvp->recv_mgmt =3D vap->iv_recv_mgmt; >>> + vap->iv_recv_mgmt =3D urtwn_ibss_recv_mgmt; >>> + TASK_INIT(&uvp->tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, vap); >>> + } >>> >>> /* complete setup */ >>> ieee80211_vap_attach(vap, ieee80211_media_change, >>> @@ -610,13 +620,13 @@ urtwn_vap_create(struct ieee80211com *ic >>> static void >>> urtwn_vap_delete(struct ieee80211vap *vap) >>> { >>> + struct ieee80211com *ic =3D vap->iv_ic; >>> struct urtwn_vap *uvp =3D URTWN_VAP(vap); >>> - enum ieee80211_opmode opmode =3D vap->iv_opmode; >>> >>> - if (opmode =3D=3D IEEE80211_M_HOSTAP) { >>> - if (uvp->bcn_mbuf !=3D NULL) >>> - m_freem(uvp->bcn_mbuf); >>> - } >>> + if (uvp->bcn_mbuf !=3D NULL) >>> + m_freem(uvp->bcn_mbuf); >>> + if (vap->iv_opmode =3D=3D IEEE80211_M_IBSS) >>> + ieee80211_draintask(ic, &uvp->tsf_task_adhoc); >>> ieee80211_vap_detach(vap); >>> free(uvp, M_80211_VAP); >>> } >>> @@ -1611,8 +1621,50 @@ urtwn_tx_beacon(struct urtwn_softc *sc, >>> } >>> >>> static void >>> +urtwn_tsf_task_adhoc(void *arg, int pending) >>> +{ >>> + struct ieee80211vap *vap =3D arg; >>> + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; >>> + struct ieee80211_node *ni; >>> + uint32_t reg; >>> + >>> + URTWN_LOCK(sc); >>> + ni =3D ieee80211_ref_node(vap->iv_bss); >>> + reg =3D urtwn_read_1(sc, R92C_BCN_CTRL); >>> + >>> + /* Accept beacons with the same BSSID. */ >>> + urtwn_set_rx_bssid_all(sc, 0); >>> + >>> + /* Enable synchronization. */ >>> + reg &=3D ~R92C_BCN_CTRL_DIS_TSF_UDT0; >>> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >>> + >>> + /* Synchronize. */ >>> + usb_pause_mtx(&sc->sc_mtx, hz * ni->ni_intval * 5 / 1000); >>> + >>> + /* Disable synchronization. */ >>> + reg |=3D R92C_BCN_CTRL_DIS_TSF_UDT0; >>> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >>> + >>> + /* Remove beacon filter. */ >>> + urtwn_set_rx_bssid_all(sc, 1); >>> + >>> + /* Enable beaconing. */ >>> + urtwn_write_1(sc, R92C_MBID_NUM, >>> + urtwn_read_1(sc, R92C_MBID_NUM) | R92C_MBID_TXBCN_RPT0); >>> + reg |=3D R92C_BCN_CTRL_EN_BCN; >>> + >>> + urtwn_write_1(sc, R92C_BCN_CTRL, reg); >>> + ieee80211_free_node(ni); >>> + URTWN_UNLOCK(sc); >>> +} >>> + >>> +static void >>> urtwn_tsf_sync_enable(struct urtwn_softc *sc, struct ieee80211vap *v= ap) >>> { >>> + struct ieee80211com *ic =3D &sc->sc_ic; >>> + struct urtwn_vap *uvp =3D URTWN_VAP(vap); >>> + >>> /* Reset TSF. */ >>> urtwn_write_1(sc, R92C_DUAL_TSF_RST, R92C_DUAL_TSF_RST0); >>> >>> @@ -1623,6 +1675,9 @@ urtwn_tsf_sync_enable(struct urtwn_softc >>> urtwn_read_1(sc, R92C_BCN_CTRL) & >>> ~R92C_BCN_CTRL_DIS_TSF_UDT0); >>> break; >>> + case IEEE80211_M_IBSS: >>> + ieee80211_runtask(ic, &uvp->tsf_task_adhoc); >>> + break; >>> case IEEE80211_M_HOSTAP: >>> /* Enable beaconing. */ >>> urtwn_write_1(sc, R92C_MBID_NUM, >>> @@ -1674,6 +1729,37 @@ urtwn_set_mode(struct urtwn_softc *sc, u >>> urtwn_write_1(sc, R92C_MSR, reg); >>> } >>> >>> +static void >>> +urtwn_ibss_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int= = >>> subtype, >>> + const struct ieee80211_rx_stats *rxs, >>> + int rssi, int nf) >>> +{ >>> + struct ieee80211vap *vap =3D ni->ni_vap; >>> + struct urtwn_softc *sc =3D vap->iv_ic->ic_softc; >>> + struct urtwn_vap *uvp =3D URTWN_VAP(vap); >>> + uint64_t ni_tstamp, curr_tstamp; >>> + >>> + uvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); >>> + >>> + if (vap->iv_state =3D=3D IEEE80211_S_RUN && >>> + (subtype =3D=3D IEEE80211_FC0_SUBTYPE_BEACON || >>> + subtype =3D=3D IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { >>> + ni_tstamp =3D le64toh(ni->ni_tstamp.tsf); >>> +#ifdef D3831 >>> + URTWN_LOCK(sc); >>> + urtwn_get_tsf(sc, &curr_tstamp); >>> + URTWN_UNLOCK(sc); >>> + curr_tstamp =3D le64toh(curr_tstamp); >>> + >>> + if (ni_tstamp >=3D curr_tstamp) >>> + (void) ieee80211_ibss_merge(ni); >>> +#else >>> + (void) sc; >>> + (void) curr_tstamp; >>> +#endif >>> + } >>> +} >>> + >>> static int >>> urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate= , = >>> int arg) >>> { >>> @@ -1757,6 +1843,9 @@ urtwn_newstate(struct ieee80211vap *vap, >>> case IEEE80211_M_STA: >>> mode =3D R92C_MSR_INFRA; >>> break; >>> + case IEEE80211_M_IBSS: >>> + mode =3D R92C_MSR_ADHOC; >>> + break; >>> case IEEE80211_M_HOSTAP: >>> mode =3D R92C_MSR_AP; >>> break; >>> @@ -1794,13 +1883,14 @@ urtwn_newstate(struct ieee80211vap *vap, >>> >>> if (vap->iv_opmode !=3D IEEE80211_M_HOSTAP) >>> reg |=3D R92C_RCR_CBSSID_DATA; >>> - >>> - reg |=3D R92C_RCR_CBSSID_BCN; >>> + if (vap->iv_opmode !=3D IEEE80211_M_IBSS) >>> + reg |=3D R92C_RCR_CBSSID_BCN; >>> >>> urtwn_write_4(sc, R92C_RCR, reg); >>> } >>> >>> - if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP) { >>> + if (vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP || >>> + vap->iv_opmode =3D=3D IEEE80211_M_IBSS) { >>> error =3D urtwn_setup_beacon(sc, ni); >>> if (error !=3D 0) { >>> device_printf(sc->sc_dev, >>> @@ -3007,6 +3097,7 @@ urtwn_rxfilter_init(struct urtwn_softc * >>> R92C_RXFLTMAP_SUBTYPE(IEEE80211_FC0_SUBTYPE_BEACON)); >>> break; >>> case IEEE80211_M_MONITOR: >>> + case IEEE80211_M_IBSS: >>> break; >>> default: >>> device_printf(sc->sc_dev, "%s: undefined opmode %d\n", >>> @@ -3335,7 +3426,9 @@ urtwn_scan_start(struct ieee80211com *ic >>> >>> URTWN_LOCK(sc); >>> /* Receive beacons / probe responses from any BSSID. */ >>> - urtwn_set_rx_bssid_all(sc, 1); >>> + if (ic->ic_opmode !=3D IEEE80211_M_IBSS) >>> + urtwn_set_rx_bssid_all(sc, 1); >>> + >>> /* Set gain for scanning. */ >>> urtwn_set_gain(sc, 0x20); >>> URTWN_UNLOCK(sc); >>> @@ -3348,8 +3441,9 @@ urtwn_scan_end(struct ieee80211com *ic) >>> >>> URTWN_LOCK(sc); >>> /* Restore limitations. */ >>> - if (ic->ic_promisc =3D=3D 0) >>> + if (ic->ic_promisc =3D=3D 0 && ic->ic_opmode !=3D IEEE80211_M_IBSS= ) >>> urtwn_set_rx_bssid_all(sc, 0); >>> + >>> /* Set gain under link. */ >>> urtwn_set_gain(sc, 0x32); >>> URTWN_UNLOCK(sc); >>> @@ -3393,6 +3487,9 @@ urtwn_set_promisc(struct urtwn_softc *sc >>> case IEEE80211_M_HOSTAP: >>> mask2 |=3D R92C_RCR_CBSSID_BCN; >>> break; >>> + case IEEE80211_M_IBSS: >>> + mask2 |=3D R92C_RCR_CBSSID_DATA; >>> + break; >>> default: >>> device_printf(sc->sc_dev, "%s: undefined opmode %d\n", >>> __func__, vap->iv_opmode); >>> >>> Modified: head/sys/dev/usb/wlan/if_urtwnvar.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >>> --- head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:20:22 = >>> 2015 (r290650) >>> +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Nov 10 12:52:26 = >>> 2015 (r290651) >>> @@ -87,13 +87,18 @@ struct urtwn_fw_info { >>> }; >>> >>> struct urtwn_vap { >>> - struct ieee80211vap vap; >>> + struct ieee80211vap vap; >>> >>> - struct r92c_tx_desc bcn_desc; >>> - struct mbuf *bcn_mbuf; >>> - >>> - int (*newstate)(struct ieee80211vap *, >>> - enum ieee80211_state, int); >>> + struct r92c_tx_desc bcn_desc; >>> + struct mbuf *bcn_mbuf; >>> + struct task tsf_task_adhoc; >>> + >>> + int (*newstate)(struct ieee80211vap *, >>> + enum ieee80211_state, int); >>> + void (*recv_mgmt)(struct ieee80211_node *, >>> + struct mbuf *, int, >>> + const struct ieee80211_rx_stats *, >>> + int, int); >>> }; >>> #define URTWN_VAP(vap) ((struct urtwn_vap *)(vap)) >>> >> >> After this revision, every time I insert my urtwn card into USB port = I = >> get this panic [1]. Moving back to 290650 fixed the problem. >> >> [1] http://imgur.com/6p78GIT > > FYI, after talk with adrian, I updated src to latest rev (r290668) and= = > manually reverted this commit and also 290663 (that broke the build) a= nd = > system is still working as expected. This is the hardware I=E2=80=99m = using: > > urtwn0: = > on usbus1 > urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R > > -- > Renato Botelho > Resolved via IRC (not reproducible). From owner-svn-src-all@freebsd.org Wed Nov 11 23:00:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 496E0A2C642; Wed, 11 Nov 2015 23:00:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F04CB1284; Wed, 11 Nov 2015 23:00:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABN0wlD078126; Wed, 11 Nov 2015 23:00:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABN0wqT078125; Wed, 11 Nov 2015 23:00:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511112300.tABN0wqT078125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 Nov 2015 23:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290689 - head/sbin/init X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 23:00:59 -0000 Author: trasz Date: Wed Nov 11 23:00:57 2015 New Revision: 290689 URL: https://svnweb.freebsd.org/changeset/base/290689 Log: Fix resource leaks in error cases. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed Nov 11 18:56:21 2015 (r290688) +++ head/sbin/init/init.c Wed Nov 11 23:00:57 2015 (r290689) @@ -659,6 +659,7 @@ read_file(const char *path, void **bufp, error = fstat(fd, &sb); if (error != 0) { emergency("fstat: %s", strerror(errno)); + close(fd); return (error); } @@ -666,12 +667,14 @@ read_file(const char *path, void **bufp, buf = malloc(bufsize); if (buf == NULL) { emergency("malloc: %s", strerror(errno)); + close(fd); return (error); } nbytes = read(fd, buf, bufsize); if (nbytes != (ssize_t)bufsize) { emergency("read: %s", strerror(errno)); + close(fd); free(buf); return (error); } @@ -690,7 +693,7 @@ read_file(const char *path, void **bufp, } static int -create_file(const char *path, void *buf, size_t bufsize) +create_file(const char *path, const void *buf, size_t bufsize) { ssize_t nbytes; int error, fd; @@ -704,13 +707,13 @@ create_file(const char *path, void *buf, nbytes = write(fd, buf, bufsize); if (nbytes != (ssize_t)bufsize) { emergency("write: %s", strerror(errno)); + close(fd); return (-1); } error = close(fd); if (error != 0) { emergency("close: %s", strerror(errno)); - free(buf); return (-1); } @@ -756,6 +759,9 @@ reroot(void) size_t bufsize, init_path_len; int error, name[4]; + buf = NULL; + bufsize = 0; + name[0] = CTL_KERN; name[1] = KERN_PROC; name[2] = KERN_PROC_PATHNAME; @@ -781,12 +787,6 @@ reroot(void) } /* - * Pacify GCC. - */ - buf = NULL; - bufsize = 0; - - /* * Copy the init binary into tmpfs, so that we can unmount * the old rootfs without committing suicide. */ @@ -808,6 +808,7 @@ reroot(void) out: emergency("reroot failed; going to single user mode"); + free(buf); return (state_func_t) single_user; } From owner-svn-src-all@freebsd.org Wed Nov 11 23:10:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4936AA2C9C6; Wed, 11 Nov 2015 23:10:11 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 108E71A16; Wed, 11 Nov 2015 23:10:10 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABNAABd081252; Wed, 11 Nov 2015 23:10:10 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABNAA7F081251; Wed, 11 Nov 2015 23:10:10 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511112310.tABNAA7F081251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 11 Nov 2015 23:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290690 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 23:10:11 -0000 Author: rrs Date: Wed Nov 11 23:10:09 2015 New Revision: 290690 URL: https://svnweb.freebsd.org/changeset/base/290690 Log: Add the MLINK for async_drain Thanks Edward for the pointer. MFC after: 1 month Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Nov 11 23:00:57 2015 (r290689) +++ head/share/man/man9/Makefile Wed Nov 11 23:10:09 2015 (r290690) @@ -1714,6 +1714,7 @@ MLINKS+=time.9 boottime.9 \ time.9 time_uptime.9 MLINKS+=timeout.9 callout.9 \ timeout.9 callout_active.9 \ + timeout.9 callout_async_drain.9 \ timeout.9 callout_deactivate.9 \ timeout.9 callout_drain.9 \ timeout.9 callout_handle_init.9 \ From owner-svn-src-all@freebsd.org Wed Nov 11 23:52:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D831A2C56C; Wed, 11 Nov 2015 23:52:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC49213E6; Wed, 11 Nov 2015 23:52:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABNq8AC095631; Wed, 11 Nov 2015 23:52:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABNq86b095629; Wed, 11 Nov 2015 23:52:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511112352.tABNq86b095629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 Nov 2015 23:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290691 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 23:52:10 -0000 Author: bdrewery Date: Wed Nov 11 23:52:08 2015 New Revision: 290691 URL: https://svnweb.freebsd.org/changeset/base/290691 Log: Move META MODE's HOST_CC/CXX/CPP setting to local.meta.sys.mk, which centralizes the handling of CC and HOST_CC. This fixes a bug with WITH_CCACHE_BUILD when using MACHINE=host since CC is overridden in local.init.mk via src.opts.mk long before bsd.compiler.mk is included. Originally the ccache implementation was placed in local.init.mk but moved to bsd.compiler.mk as it seemed more proper and avoided other ordering issues. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.init.mk head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.init.mk ============================================================================== --- head/share/mk/local.init.mk Wed Nov 11 23:10:09 2015 (r290690) +++ head/share/mk/local.init.mk Wed Nov 11 23:52:08 2015 (r290691) @@ -29,12 +29,6 @@ CXXFLAGS_LAST+= -I/usr/include .if ${.MAKE.DEPENDFILE:E} != "host" UPDATE_DEPENDFILE?= no .endif -HOST_CC?= /usr/bin/cc -CC= ${HOST_CC} -HOST_CXX?= /usr/bin/c++ -CXX= ${HOST_CXX} -HOST_CPP?= /usr/bin/cpp -CPP= ${HOST_CPP} HOST_CFLAGS+= -DHOSTPROG CFLAGS+= ${HOST_CFLAGS} .endif Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Nov 11 23:10:09 2015 (r290690) +++ head/share/mk/local.meta.sys.mk Wed Nov 11 23:52:08 2015 (r290691) @@ -218,6 +218,15 @@ CPP?= ${HOST_CPP} .endif .endif +.if ${MACHINE} == "host" +HOST_CC?= /usr/bin/cc +CC= ${HOST_CC} +HOST_CXX?= /usr/bin/c++ +CXX= ${HOST_CXX} +HOST_CPP?= /usr/bin/cpp +CPP= ${HOST_CPP} +.endif + .if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE} # cross-building .if !defined(FREEBSD_REVISION) From owner-svn-src-all@freebsd.org Thu Nov 12 00:26:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C32A2B1F2; Thu, 12 Nov 2015 00:26:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 538671CCF; Thu, 12 Nov 2015 00:26:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC0Qlsu004548; Thu, 12 Nov 2015 00:26:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC0Qlfm004547; Thu, 12 Nov 2015 00:26:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511120026.tAC0Qlfm004547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Nov 2015 00:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290692 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 00:26:49 -0000 Author: imp Date: Thu Nov 12 00:26:47 2015 New Revision: 290692 URL: https://svnweb.freebsd.org/changeset/base/290692 Log: Revisit this old board with 64MB of RAM. Comment out usb entirely, since it isn't used for my application. Add back the md device since it's needed for NanoBSD support. Add in many of the small memory footprint options from the access points. With these changes we go from having ~8MB to having ~20MB free, though free + inactive only goes from ~35MB to ~42MB. We can also boot a nanobsd image mostly (I had to hand tweak what was built to represent the final goal). Move the FDT stuff to the top. We're almost ready to pull the trigger to moving over to FDT, but something in the MCI driver is freaking out when we do and that needs fixing first. Modified: head/sys/arm/conf/SAM9260EK Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Wed Nov 11 23:52:08 2015 (r290691) +++ head/sys/arm/conf/SAM9260EK Thu Nov 12 00:26:47 2015 (r290692) @@ -24,6 +24,15 @@ ident SAM9260EK include "std.arm" include "../at91/std.sam9260ek" +# Coming soon, but not yet +#options FDT +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=sam9260ek.dts + +options EARLY_PRINTF +options SOCDEV_PA=0xfc000000 +options SOCDEV_VA=0xdc000000 + # To statically compile in device wiring instead of /boot/device.hints hints "SAM9260EK.hints" @@ -92,13 +101,14 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 +#options BOOTP_WIRED_TO=macb0 # alternatively, boot from a MMC/SD memory card -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" +# s1 is FAT on this platform. +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s2a\" # Alternatively, boot from a USB card. -options ROOTDEVNAME=\"ufs:/dev/da0s1a\" +#options ROOTDEVNAME=\"ufs:/dev/da0s1a\" # kernel/memory size reduction options MUTEX_NOINLINE @@ -114,7 +124,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet driver +device macb # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface @@ -145,18 +155,18 @@ device random # Entropy device device ether # Ethernet support #device vlan # 802.1Q VLAN support #device tun # Packet tunnel. -#device md # Memory "disks" +device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device firmware # firmware assist module # SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) +#device scbus # SCSI bus (required for ATA/SCSI) #device ch # SCSI media changers -device da # Direct Access (disks) +#device da # Direct Access (disks) #device sa # Sequential Access (tape etc) -device cd # CD/DVD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) +#device cd # CD/DVD +#device pass # Passthrough device (direct ATA/SCSI access) +#device ses # Enclosure Services (SES and SAF-TE) #device ctl # CAM Target Layer # Serial (COM) ports @@ -165,9 +175,9 @@ options ALT_BREAK_TO_DEBUGGER # USB support #options USB_DEBUG # enable debug msgs -device ohci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da +#device ohci # OHCI USB interface +#device usb # USB Bus (required) +#device umass # Disks/Mass storage - Requires scbus and da # watchdog device at91_wdt # Atmel AT91 Watchdog Timer @@ -175,11 +185,18 @@ device at91_wdt # Atmel AT91 Watchdog # NAND Flash - Reference design has Samsung 256MB but others possible device nand # NAND interface on CS3 -# Coming soon, but not yet -#options FDT -#options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=sam9260ek.dts +options NSFBUFS=128 +maxusers 32 -options EARLY_PRINTF -options SOCDEV_PA=0xfc000000 -options SOCDEV_VA=0xdc000000 +# Limit IO size +options NBUF=128 + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# For small memory footprints +options VM_KMEM_SIZE_SCALE=1 From owner-svn-src-all@freebsd.org Thu Nov 12 00:30:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68411A2B36A; Thu, 12 Nov 2015 00:30:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C475105F; Thu, 12 Nov 2015 00:30:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC0UXvK004721; Thu, 12 Nov 2015 00:30:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC0UXOk004720; Thu, 12 Nov 2015 00:30:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201511120030.tAC0UXOk004720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 12 Nov 2015 00:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290693 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 00:30:34 -0000 Author: dteske Date: Thu Nov 12 00:30:33 2015 New Revision: 290693 URL: https://svnweb.freebsd.org/changeset/base/290693 Log: Add support for "rc.conf.d" file(s). Differential Revision: https://reviews.freebsd.org/D3551 Reviewed by: allanjude MFC after: 1 week X-MFC-to: stable/10 X-MFC-with: 290337 Relnotes: yes Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Thu Nov 12 00:26:47 2015 (r290692) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Thu Nov 12 00:30:33 2015 (r290693) @@ -1,6 +1,6 @@ if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -204,6 +204,100 @@ f_sysrc_get() ) } +# f_sysrc_service_configs [-a|-p] $name [$var_to_set] +# +# Get a list of optional `rc.conf.d' entries sourced by system `rc.d' script +# $name (see rc.subr(8) for additional information on `rc.conf.d'). If $name +# exists in `/etc/rc.d' or $local_startup directories and is an rc(8) script +# the result is a space separated list of `rc.conf.d' entries sourced by the +# $name `rc.d' script. Otherwise, if $name exists as a binary `rc.d' script, +# the result is ``/etc/rc.conf.d/$name /usr/local/etc/rc.conf.d/$name''. The +# result is NULL if $name does not exist. +# +# If $var_to_set is missing or NULL, output is to standard out. Returns success +# if $name was found, failure otherwise. +# +# If `-a' flag is given and $var_to_set is non-NULL, append result to value of +# $var_to_set rather than overwriting current contents. +# +# If `-p' flag is given and $var_to_set is non-NULL, prepend result to value of +# $var_to_set rather than overwriting current contents. +# +# NB: The `-a' and `-p' option flags are mutually exclusive. +# +f_sysrc_service_configs() +{ + local OPTIND=1 OPTARG __flag __append= __prepend= + local __local_startup __dir __spath __stype __names= + + while getopts ap __flag; do + case "$__flag" in + a) __append=1 __prepend= ;; + p) __prepend=1 __append= ;; + esac + done + shift $(( $OPTIND - 1 )) + + [ $# -gt 0 ] || return $FAILURE + local __sname="$1" __var_to_set="$2" + + __local_startup=$( f_sysrc_get local_startup ) + for __dir in /etc/rc.d $__local_startup; do + __spath="$__dir/$__sname" + [ -f "$__spath" -a -x "$__spath" ] || __spath= continue + break + done + [ "$__spath" ] || return $FAILURE + + __stype=$( file -b "$__spath" 2> /dev/null ) + case "$__stype" in + *"shell script"*) + __names=$( exec 9<&1 1>&- 2>&- + last_name= + print_name() { + local name="$1" + [ "$name" = "$last_name" ] && return + echo "$name" >&9 + last_name="$name" + } + eval "$( awk '{ + gsub(/load_rc_config /, "print_name ") + gsub(/run_rc_command /, ": ") + print + }' "$__spath" )" + ) ;; + *) + __names="$__sname" + esac + + local __name __test_path __configs= + for __name in $__names; do + for __dir in /etc/rc.d $__local_startup; do + __test_path="${__dir%/rc.d}/rc.conf.d/$__name" + [ -d "$__test_path" ] || + __configs="$__configs $__test_path" continue + for __test_path in "$__test_path"/*; do + [ -f "$__test_path" ] || continue + __configs="$__configs $__test_path" + done + done + done + __configs="${__configs# }" + + if [ "$__var_to_set" ]; then + local __cur= + [ "$__append" -o "$__prepend" ] && + f_getvar "$__var_to_set" __cur + [ "$__append" ] && __configs="$__cur{$__cur:+ }$__configs" + [ "$__prepend" ] && __configs="$__configs${__cur:+ }$__cur" + setvar "$__var_to_set" "$__configs" + else + echo "$__configs" + fi + + return $SUCCESS +} + # f_sysrc_get_default $varname # # Get a system configuration default setting from the default rc.conf(5) file From owner-svn-src-all@freebsd.org Thu Nov 12 01:21:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE25EA2C25B; Thu, 12 Nov 2015 01:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 898D21ED9; Thu, 12 Nov 2015 01:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC1LMtb019947; Thu, 12 Nov 2015 01:21:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC1LMhJ019946; Thu, 12 Nov 2015 01:21:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511120121.tAC1LMhJ019946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Nov 2015 01:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290694 - in stable/10/gnu/usr.bin/binutils: ar ranlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 01:21:24 -0000 Author: bdrewery Date: Thu Nov 12 01:21:22 2015 New Revision: 290694 URL: https://svnweb.freebsd.org/changeset/base/290694 Log: Remove empty directories leftover from r255974. Deleted: stable/10/gnu/usr.bin/binutils/ar/ stable/10/gnu/usr.bin/binutils/ranlib/ From owner-svn-src-all@freebsd.org Thu Nov 12 03:24:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCAD1A2D405; Thu, 12 Nov 2015 03:24:00 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E721393; Thu, 12 Nov 2015 03:24:00 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3NxjO057113; Thu, 12 Nov 2015 03:23:59 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3NxEU057107; Thu, 12 Nov 2015 03:23:59 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120323.tAC3NxEU057107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290695 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:24:00 -0000 Author: edwin Date: Thu Nov 12 03:23:58 2015 New Revision: 290695 URL: https://svnweb.freebsd.org/changeset/base/290695 Log: Vendor import of tzdata2015g: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/europe vendor/tzdata/dist/northamerica vendor/tzdata/dist/zone.tab vendor/tzdata/dist/zone1970.tab Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/asia Thu Nov 12 03:23:58 2015 (r290695) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/australasia Thu Nov 12 03:23:58 2015 (r290695) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/europe Thu Nov 12 03:23:58 2015 (r290695) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/northamerica Thu Nov 12 03:23:58 2015 (r290695) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: vendor/tzdata/dist/zone.tab ============================================================================== --- vendor/tzdata/dist/zone.tab Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/zone.tab Thu Nov 12 03:23:58 2015 (r290695) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: vendor/tzdata/dist/zone1970.tab ============================================================================== --- vendor/tzdata/dist/zone1970.tab Thu Nov 12 01:21:22 2015 (r290694) +++ vendor/tzdata/dist/zone1970.tab Thu Nov 12 03:23:58 2015 (r290695) @@ -126,6 +126,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:24:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CA36A2D42C; Thu, 12 Nov 2015 03:24:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 281811536; Thu, 12 Nov 2015 03:24:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3ODx6057171; Thu, 12 Nov 2015 03:24:13 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3ODak057170; Thu, 12 Nov 2015 03:24:13 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120324.tAC3ODak057170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r290696 - vendor/tzdata/tzdata2015g X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:24:14 -0000 Author: edwin Date: Thu Nov 12 03:24:12 2015 New Revision: 290696 URL: https://svnweb.freebsd.org/changeset/base/290696 Log: Tag of tzdata 2015g Added: vendor/tzdata/tzdata2015g/ - copied from r290695, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Thu Nov 12 03:25:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B2C5A2D475; Thu, 12 Nov 2015 03:25:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2456017C7; Thu, 12 Nov 2015 03:25:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3P5Jg057264; Thu, 12 Nov 2015 03:25:05 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3P4vN057258; Thu, 12 Nov 2015 03:25:04 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120325.tAC3P4vN057258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290697 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:25:06 -0000 Author: edwin Date: Thu Nov 12 03:25:04 2015 New Revision: 290697 URL: https://svnweb.freebsd.org/changeset/base/290697 Log: MFV of 290695,tzdata2015g Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/asia Thu Nov 12 03:25:04 2015 (r290697) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/australasia Thu Nov 12 03:25:04 2015 (r290697) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/europe Thu Nov 12 03:25:04 2015 (r290697) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/northamerica Thu Nov 12 03:25:04 2015 (r290697) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: head/contrib/tzdata/zone.tab ============================================================================== --- head/contrib/tzdata/zone.tab Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/zone.tab Thu Nov 12 03:25:04 2015 (r290697) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: head/contrib/tzdata/zone1970.tab ============================================================================== --- head/contrib/tzdata/zone1970.tab Thu Nov 12 03:24:12 2015 (r290696) +++ head/contrib/tzdata/zone1970.tab Thu Nov 12 03:25:04 2015 (r290697) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:26:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A7EA2D4E6; Thu, 12 Nov 2015 03:26:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C8419A3; Thu, 12 Nov 2015 03:26:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3Q6Qh057360; Thu, 12 Nov 2015 03:26:06 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3Q6dw057354; Thu, 12 Nov 2015 03:26:06 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120326.tAC3Q6dw057354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290698 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:26:08 -0000 Author: edwin Date: Thu Nov 12 03:26:05 2015 New Revision: 290698 URL: https://svnweb.freebsd.org/changeset/base/290698 Log: MFC of 290697,tzdata10: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/asia Thu Nov 12 03:26:05 2015 (r290698) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/australasia Thu Nov 12 03:26:05 2015 (r290698) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/europe Thu Nov 12 03:26:05 2015 (r290698) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/northamerica Thu Nov 12 03:26:05 2015 (r290698) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/10/contrib/tzdata/zone.tab ============================================================================== --- stable/10/contrib/tzdata/zone.tab Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/zone.tab Thu Nov 12 03:26:05 2015 (r290698) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/10/contrib/tzdata/zone1970.tab ============================================================================== --- stable/10/contrib/tzdata/zone1970.tab Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/zone1970.tab Thu Nov 12 03:26:05 2015 (r290698) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:28:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D97A2D548; Thu, 12 Nov 2015 03:28:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECFAF1B33; Thu, 12 Nov 2015 03:28:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3SW0v057491; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3SWgS057483; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120328.tAC3SWgS057483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290699 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:28:34 -0000 Author: edwin Date: Thu Nov 12 03:28:32 2015 New Revision: 290699 URL: https://svnweb.freebsd.org/changeset/base/290699 Log: MFC of 290697,tzdata9: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/zone.tab stable/9/contrib/tzdata/zone1970.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/asia Thu Nov 12 03:28:32 2015 (r290699) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/australasia Thu Nov 12 03:28:32 2015 (r290699) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/9/contrib/tzdata/europe ============================================================================== --- stable/9/contrib/tzdata/europe Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/europe Thu Nov 12 03:28:32 2015 (r290699) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/northamerica Thu Nov 12 03:28:32 2015 (r290699) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/9/contrib/tzdata/zone1970.tab ============================================================================== --- stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:29:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 735A2A2D5C0; Thu, 12 Nov 2015 03:29:38 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7501D81; Thu, 12 Nov 2015 03:29:38 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3TbSk057800; Thu, 12 Nov 2015 03:29:37 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3Tat7057794; Thu, 12 Nov 2015 03:29:36 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120329.tAC3Tat7057794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r290700 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:29:38 -0000 Author: edwin Date: Thu Nov 12 03:29:36 2015 New Revision: 290700 URL: https://svnweb.freebsd.org/changeset/base/290700 Log: MFC of 290697,tzdata8: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/zone.tab stable/8/share/zoneinfo/zone1970.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/asia Thu Nov 12 03:29:36 2015 (r290700) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/australasia Thu Nov 12 03:29:36 2015 (r290700) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/europe Thu Nov 12 03:29:36 2015 (r290700) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/northamerica Thu Nov 12 03:29:36 2015 (r290700) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/8/share/zoneinfo/zone.tab ============================================================================== --- stable/8/share/zoneinfo/zone.tab Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/zone.tab Thu Nov 12 03:29:36 2015 (r290700) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/8/share/zoneinfo/zone1970.tab ============================================================================== --- stable/8/share/zoneinfo/zone1970.tab Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/zone1970.tab Thu Nov 12 03:29:36 2015 (r290700) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:30:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC09A2D624; Thu, 12 Nov 2015 03:30:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 188D01ECF; Thu, 12 Nov 2015 03:30:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3U5tK057893; Thu, 12 Nov 2015 03:30:05 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3U4do057886; Thu, 12 Nov 2015 03:30:04 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120330.tAC3U4do057886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r290701 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:30:06 -0000 Author: edwin Date: Thu Nov 12 03:30:04 2015 New Revision: 290701 URL: https://svnweb.freebsd.org/changeset/base/290701 Log: MFC of 290697,tzdata7: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/northamerica stable/7/share/zoneinfo/zone.tab stable/7/share/zoneinfo/zone1970.tab Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/asia Thu Nov 12 03:30:04 2015 (r290701) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/7/share/zoneinfo/australasia ============================================================================== --- stable/7/share/zoneinfo/australasia Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/australasia Thu Nov 12 03:30:04 2015 (r290701) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/7/share/zoneinfo/europe ============================================================================== --- stable/7/share/zoneinfo/europe Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/europe Thu Nov 12 03:30:04 2015 (r290701) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/7/share/zoneinfo/northamerica ============================================================================== --- stable/7/share/zoneinfo/northamerica Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/northamerica Thu Nov 12 03:30:04 2015 (r290701) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/7/share/zoneinfo/zone.tab ============================================================================== --- stable/7/share/zoneinfo/zone.tab Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/zone.tab Thu Nov 12 03:30:04 2015 (r290701) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/7/share/zoneinfo/zone1970.tab ============================================================================== --- stable/7/share/zoneinfo/zone1970.tab Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:04 2015 (r290701) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:30:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30878A2D678; Thu, 12 Nov 2015 03:30:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E25C21022; Thu, 12 Nov 2015 03:30:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3UWDm057967; Thu, 12 Nov 2015 03:30:32 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3UVG3057961; Thu, 12 Nov 2015 03:30:31 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120330.tAC3UVG3057961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r290702 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:30:33 -0000 Author: edwin Date: Thu Nov 12 03:30:31 2015 New Revision: 290702 URL: https://svnweb.freebsd.org/changeset/base/290702 Log: MFC of 290697,tzdata6: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/australasia stable/6/share/zoneinfo/europe stable/6/share/zoneinfo/northamerica stable/6/share/zoneinfo/zone.tab stable/6/share/zoneinfo/zone1970.tab Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/asia Thu Nov 12 03:30:31 2015 (r290702) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/6/share/zoneinfo/australasia ============================================================================== --- stable/6/share/zoneinfo/australasia Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/australasia Thu Nov 12 03:30:31 2015 (r290702) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/6/share/zoneinfo/europe ============================================================================== --- stable/6/share/zoneinfo/europe Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/europe Thu Nov 12 03:30:31 2015 (r290702) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/6/share/zoneinfo/northamerica ============================================================================== --- stable/6/share/zoneinfo/northamerica Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/northamerica Thu Nov 12 03:30:31 2015 (r290702) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/6/share/zoneinfo/zone.tab ============================================================================== --- stable/6/share/zoneinfo/zone.tab Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/zone.tab Thu Nov 12 03:30:31 2015 (r290702) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/6/share/zoneinfo/zone1970.tab ============================================================================== --- stable/6/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:31 2015 (r290702) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-all@freebsd.org Thu Nov 12 03:37:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FFD5A2D891; Thu, 12 Nov 2015 03:37:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDEFC1637; Thu, 12 Nov 2015 03:37:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3bSnw060924; Thu, 12 Nov 2015 03:37:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3bSug060923; Thu, 12 Nov 2015 03:37:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511120337.tAC3bSug060923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 Nov 2015 03:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290703 - head/sys/modules/dtb/imx6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:37:30 -0000 Author: gonzo Date: Thu Nov 12 03:37:28 2015 New Revision: 290703 URL: https://svnweb.freebsd.org/changeset/base/290703 Log: Add riotboard DTB to dtb/imx6 Modified: head/sys/modules/dtb/imx6/Makefile Modified: head/sys/modules/dtb/imx6/Makefile ============================================================================== --- head/sys/modules/dtb/imx6/Makefile Thu Nov 12 03:30:31 2015 (r290702) +++ head/sys/modules/dtb/imx6/Makefile Thu Nov 12 03:37:28 2015 (r290703) @@ -5,6 +5,7 @@ DTS= \ imx6q-cubox-i.dts \ imx6dl-hummingboard.dts \ imx6q-hummingboard.dts \ + imx6dl-riotboard.dts \ imx6dl-wandboard.dts \ imx6q-wandboard.dts From owner-svn-src-all@freebsd.org Thu Nov 12 05:53:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E012A2C093; Thu, 12 Nov 2015 05:53:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDF217CE; Thu, 12 Nov 2015 05:53:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC5rWIA000535; Thu, 12 Nov 2015 05:53:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC5rWmZ000534; Thu, 12 Nov 2015 05:53:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511120553.tAC5rWmZ000534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Nov 2015 05:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290704 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 05:53:33 -0000 Author: imp Date: Thu Nov 12 05:53:32 2015 New Revision: 290704 URL: https://svnweb.freebsd.org/changeset/base/290704 Log: Make the slice names for root configurable. For embedded platforms, we need s1 to be a FAT partition, s2 to be the config partition and s3 and s4 to be the ping-pong upgrade partitions. NANO_SLICE_ROOT defaults to s1 NANO_SLICE_ALTROOT defaults to s2 NANO_SLICE_CFG defaults to s3 NANO_SLICE_DATA defaults to s4 All can be overridden in the config file. Some basic sanity checking is in place, but is no substitute for being careful. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu Nov 12 03:37:28 2015 (r290703) +++ head/tools/tools/nanobsd/defaults.sh Thu Nov 12 05:53:32 2015 (r290704) @@ -152,6 +152,11 @@ PPLEVEL=3 # /cfg partition will be ${NANO_LABEL}s3 # /data partition will be ${NANO_LABEL}s4 NANO_LABEL="" +NANO_SLICE_ROOT=s1 +NANO_SLICE_ALTROOT=s2 +NANO_SLICE_CFG=s3 +NANO_SLICE_DATA=s4 + ####################################################################### # Architecture to build. Corresponds to TARGET_ARCH in a buildworld. @@ -410,7 +415,6 @@ setup_nanobsd ( ) ( # link /$d under /conf # we use hard links so we have them both places. # the files in /$d will be hidden by the mount. - # XXX: configure /$d ramdisk size mkdir -p conf/base/$d conf/default/$d find $d -print | cpio -dumpl conf/base/ done @@ -419,7 +423,7 @@ setup_nanobsd ( ) ( echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size # pick up config files from the special partition - echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount + echo "mount -o ro /dev/${NANO_DRIVE}${NANO_SLICE_CFG}" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) nano_rm -rf tmp @@ -443,8 +447,8 @@ setup_nanobsd_etc ( ) ( # save config file for scripts echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf - echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab - echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab + echo "/dev/${NANO_DRIVE}${NANO_SLICE_ROOT}a / ufs ro 1 1" > etc/fstab + echo "/dev/${NANO_DRIVE}${NANO_SLICE_CFG} /cfg ufs rw,noauto 2 2" >> etc/fstab mkdir -p cfg ) ) @@ -598,15 +602,15 @@ create_diskimage ( ) ( boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} fi if [ -f ${NANO_WORLDDIR}/boot/boot ]; then - bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}${NANO_SLICE_ROOT} else - bsdlabel -w ${MD}s1 + bsdlabel -w ${MD}${NANO_SLICE_ROOT} fi - bsdlabel ${MD}s1 + bsdlabel ${MD}${NANO_SLICE_ROOT} # Create first image - populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1a" - mount /dev/${MD}s1a ${MNT} + populate_slice /dev/${MD}${NANO_SLICE_ROOT}a ${NANO_WORLDDIR} ${MNT} "${NANO_SLICE_ROOT}a" + mount /dev/${MD}${NANO_SLICE_ROOT}a ${MNT} echo "Generating mtree..." ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du @@ -615,26 +619,31 @@ create_diskimage ( ) ( if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k - mount /dev/${MD}s2a ${MNT} + dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} of=/dev/${MD}${NANO_SLICE_ALTROOT} bs=64k + mount /dev/${MD}${NANO_SLICE_ALTROOT}a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do - sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f + sed -i "" "s=${NANO_DRIVE}${NANO_SLICE_ROOT}=${NANO_DRIVE}${NANO_SLICE_ALTROOT}=g" $f done nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. if [ ! -z ${NANO_LABEL} ]; then - tunefs -L ${NANO_LABEL}"s2a" /dev/${MD}s2a + tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a fi fi # Create Config slice - populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} "s3" + populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} "${NANO_SLICE_CFG}" # Create Data slice, if any. - if [ $NANO_DATASIZE -ne 0 ] ; then - populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} "s4" + if [ ! -z $NANO_SLICE_DATA -a $NANO_SLICE_CFG = $NANO_SLICE_DATA -a \ + $NANO_DATASIZE -ne 0 ]; then + pprint 2 "NANO_SLICE_DATA is the same as NANO_SLICE_CFG, fix." + exit 2 + fi + if [ $NANO_DATASIZE -ne 0 -a ! -z $NANO_SLICE_DATA ] ; then + populate_data_slice /dev/${MD}${NANO_SLICE_DATA} "${NANO_DATADIR}" ${MNT} "${NANO_SLICE_DATA}" fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then @@ -652,7 +661,7 @@ create_diskimage ( ) ( if ${do_copyout_partition} ; then echo "Writing out _.disk.image..." - dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} of=${NANO_DISKIMGDIR}/_.disk.image bs=64k fi mdconfig -d -u $MD From owner-svn-src-all@freebsd.org Thu Nov 12 08:47:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55263A2C680; Thu, 12 Nov 2015 08:47:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E57713DD; Thu, 12 Nov 2015 08:47:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC8lBcR049830; Thu, 12 Nov 2015 08:47:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC8lBZw049829; Thu, 12 Nov 2015 08:47:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120847.tAC8lBZw049829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 08:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290705 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 08:47:12 -0000 Author: hselasky Date: Thu Nov 12 08:47:10 2015 New Revision: 290705 URL: https://svnweb.freebsd.org/changeset/base/290705 Log: MFC r290140: Add missing NULL check in physio(). When destroying a character device the si_devsw field is set to NULL before all references are gone, to indicate the character device is going away. This can cause a NULL-dereference fault inside physio(). The callers of physio() should own a thread reference on the cdev and if si_devsw is seen as non-NULL, it is usable during the execution of the function. Else an ENXIO error code is returned. Reviewed by: kib Modified: stable/10/sys/kern/kern_physio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_physio.c ============================================================================== --- stable/10/sys/kern/kern_physio.c Thu Nov 12 05:53:32 2015 (r290704) +++ stable/10/sys/kern/kern_physio.c Thu Nov 12 08:47:10 2015 (r290705) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); int physio(struct cdev *dev, struct uio *uio, int ioflag) { + struct cdevsw *csw; struct buf *pbuf; struct bio *bp; struct vm_page **pages; @@ -46,6 +47,11 @@ physio(struct cdev *dev, struct uio *uio int error, i, npages, maxpages; vm_prot_t prot; + csw = dev->si_devsw; + /* check if character device is being destroyed */ + if (csw == NULL) + return (ENXIO); + /* XXX: sanity check */ if(dev->si_iosize_max < PAGE_SIZE) { printf("WARNING: %s si_iosize_max=%d, using DFLTPHYS.\n", @@ -165,7 +171,7 @@ physio(struct cdev *dev, struct uio *uio } } - dev->si_devsw->d_strategy(bp); + csw->d_strategy(bp); if (uio->uio_rw == UIO_READ) biowait(bp, "physrd"); else From owner-svn-src-all@freebsd.org Thu Nov 12 09:18:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 422DAA2CF3F; Thu, 12 Nov 2015 09:18:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7FA1178; Thu, 12 Nov 2015 09:18:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9IN26058279; Thu, 12 Nov 2015 09:18:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9IMP8058276; Thu, 12 Nov 2015 09:18:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120918.tAC9IMP8058276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 09:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290706 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:18:24 -0000 Author: hselasky Date: Thu Nov 12 09:18:22 2015 New Revision: 290706 URL: https://svnweb.freebsd.org/changeset/base/290706 Log: Build fixes: - Add some missing I/O functions for non-i386 and amd64 platforms. - Stub ioremap() to NULL using a macro to ensure non-existing memory attributes are not referred when they do not exist. - Add more header files to linux/list.h to resolve driver compilation issues on Sparc64 and PowerPC platforms. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Thu Nov 12 09:18:22 2015 (r290706) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,12 +106,39 @@ iowrite32be(uint32_t v, volatile void *a *(volatile uint32_t *)addr = htobe32(v); } +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + return *(const volatile uint8_t *)addr; +} + +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + return *(const volatile uint16_t *)addr; +} + +#undef readl +static inline uint32_t +readl(const volatile void *addr) +{ + return *(const volatile uint32_t *)addr; +} + +#if defined(__i386__) || defined(__amd64__) void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); +#else +#define _ioremap_attr(...) NULL +#endif + #define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) #define ioremap_wc(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) -#define ioremap ioremap_nocache +#define ioremap(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) void iounmap(void *addr); #define memset_io(a, b, c) memset((a), (b), (c)) Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Thu Nov 12 09:18:22 2015 (r290706) @@ -67,6 +67,8 @@ #include #include +#include +#include #define prefetch(x) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 12 09:18:22 2015 (r290706) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -658,22 +658,20 @@ vmmap_remove(void *addr) return (vmmap); } +#if defined(__i386__) || defined(__amd64__) void * _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr) { void *addr; -#if defined(__i386__) || defined(__amd64__) addr = pmap_mapdev_attr(phys_addr, size, attr); -#else - addr = NULL; -#endif if (addr == NULL) return (NULL); vmmap_add(addr, size); return (addr); } +#endif void iounmap(void *addr) From owner-svn-src-all@freebsd.org Thu Nov 12 09:20:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3AFA2CFA4; Thu, 12 Nov 2015 09:20:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A702912F4; Thu, 12 Nov 2015 09:20:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9KAqk058401; Thu, 12 Nov 2015 09:20:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9KAb6058400; Thu, 12 Nov 2015 09:20:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201511120920.tAC9KAb6058400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2015 09:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290707 - head/sys/tests/callout_test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:20:12 -0000 Author: kib Date: Thu Nov 12 09:20:10 2015 New Revision: 290707 URL: https://svnweb.freebsd.org/changeset/base/290707 Log: Fix UP build. Modified: head/sys/tests/callout_test/callout_test.c Modified: head/sys/tests/callout_test/callout_test.c ============================================================================== --- head/sys/tests/callout_test/callout_test.c Thu Nov 12 09:18:22 2015 (r290706) +++ head/sys/tests/callout_test/callout_test.c Thu Nov 12 09:20:10 2015 (r290707) @@ -46,11 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SMP #include -#else -#define cpu_spinwait() -#endif MALLOC_DEFINE(M_CALLTMP, "Temp callout Memory", "CalloutTest"); From owner-svn-src-all@freebsd.org Thu Nov 12 09:45:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 754AFA2B371; Thu, 12 Nov 2015 09:45:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A58D1EC5; Thu, 12 Nov 2015 09:45:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9jZKb067058; Thu, 12 Nov 2015 09:45:35 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9jZZk067057; Thu, 12 Nov 2015 09:45:35 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511120945.tAC9jZZk067057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 12 Nov 2015 09:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290708 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:45:36 -0000 Author: smh Date: Thu Nov 12 09:45:35 2015 New Revision: 290708 URL: https://svnweb.freebsd.org/changeset/base/290708 Log: Fix ixl debug sysctls panic Remove the use of sbuf_data on drained sbufs from the debug sysctls: * ixl_sysctl_hw_res_alloc * ixl_sysctl_switch_config This prevents a kernel panic when accessing these values under a kernel compiled with INVARIANTS. Sponsored by: Multiplay Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:20:10 2015 (r290707) +++ head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:45:35 2015 (r290708) @@ -5119,17 +5119,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A } error = sbuf_finish(buf); - if (error) { - device_printf(dev, "Error finishing sbuf: %d\n", error); - sbuf_delete(buf); - return error; - } - - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); - if (error) - device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); - return error; + + return (error); } /* @@ -5236,15 +5228,6 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ sbuf_delete(nmbuf); error = sbuf_finish(buf); - if (error) { - device_printf(dev, "Error finishing sbuf: %d\n", error); - sbuf_delete(buf); - return error; - } - - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); - if (error) - device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return (error); From owner-svn-src-all@freebsd.org Thu Nov 12 09:52:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF3CFA2B669; Thu, 12 Nov 2015 09:52:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEA8E15C4; Thu, 12 Nov 2015 09:52:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9qbNZ069922; Thu, 12 Nov 2015 09:52:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9qbtM069921; Thu, 12 Nov 2015 09:52:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120952.tAC9qbtM069921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 09:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290709 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:52:39 -0000 Author: hselasky Date: Thu Nov 12 09:52:37 2015 New Revision: 290709 URL: https://svnweb.freebsd.org/changeset/base/290709 Log: Compile fix for 32-bit platforms: - The Linux timers data field is "unsigned long". Sponsored by: Mellanox Technologies MFC after: 2 weeks Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Nov 12 09:45:35 2015 (r290708) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Nov 12 09:52:37 2015 (r290709) @@ -115,7 +115,7 @@ static void print_health_info(struct mlx printf("mlx5_core: INFO: ""ext_sync 0x%04x\n", read_be16(&h->ext_sync)); } -static void poll_health(uintptr_t data) +static void poll_health(unsigned long data) { struct mlx5_core_dev *dev = (struct mlx5_core_dev *)data; struct mlx5_core_health *health = &dev->priv.health; @@ -155,7 +155,7 @@ void mlx5_start_health_poll(struct mlx5_ health->health = &dev->iseg->health; health->health_counter = &dev->iseg->health_counter; - setup_timer(&health->timer, poll_health, (uintptr_t)dev); + setup_timer(&health->timer, poll_health, (unsigned long)dev); mod_timer(&health->timer, round_jiffies(jiffies + MLX5_HEALTH_POLL_INTERVAL)); } From owner-svn-src-all@freebsd.org Thu Nov 12 09:56:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5112A2B94C; Thu, 12 Nov 2015 09:56:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE1B81BE8; Thu, 12 Nov 2015 09:56:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9uPAC070096; Thu, 12 Nov 2015 09:56:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9uPIC070095; Thu, 12 Nov 2015 09:56:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120956.tAC9uPIC070095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 09:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290710 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:56:27 -0000 Author: hselasky Date: Thu Nov 12 09:56:25 2015 New Revision: 290710 URL: https://svnweb.freebsd.org/changeset/base/290710 Log: Fix print formatting compile warnings for Sparc64 and PowerPC platforms. Sponsored by: Mellanox Technologies MFC after: 2 weeks Modified: head/sys/ofed/drivers/net/mlx4/main.c Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Thu Nov 12 09:52:37 2015 (r290709) +++ head/sys/ofed/drivers/net/mlx4/main.c Thu Nov 12 09:56:25 2015 (r290710) @@ -604,7 +604,7 @@ static int mlx4_dev_cap(struct mlx4_dev if (dev_cap->min_page_sz > PAGE_SIZE) { mlx4_err(dev, "HCA minimum page size of %d bigger than " "kernel PAGE_SIZE of %d, aborting.\n", - dev_cap->min_page_sz, PAGE_SIZE); + dev_cap->min_page_sz, (int)PAGE_SIZE); return -ENODEV; } if (dev_cap->num_ports > MLX4_MAX_PORTS) { @@ -975,7 +975,7 @@ static int mlx4_slave_cap(struct mlx4_de if (page_size > PAGE_SIZE) { mlx4_err(dev, "HCA minimum page size of %d bigger than " "kernel PAGE_SIZE of %d, aborting.\n", - page_size, PAGE_SIZE); + page_size, (int)PAGE_SIZE); return -ENODEV; } @@ -985,7 +985,7 @@ static int mlx4_slave_cap(struct mlx4_de /* TODO: relax this assumption */ if (dev->caps.uar_page_size != PAGE_SIZE) { mlx4_err(dev, "UAR size:%d != kernel PAGE_SIZE of %d\n", - dev->caps.uar_page_size, PAGE_SIZE); + dev->caps.uar_page_size, (int)PAGE_SIZE); return -ENODEV; } From owner-svn-src-all@freebsd.org Thu Nov 12 10:12:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38EF7A2D0D0; Thu, 12 Nov 2015 10:12:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E206C17C9; Thu, 12 Nov 2015 10:12:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACACLSM075145; Thu, 12 Nov 2015 10:12:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACACKTI075143; Thu, 12 Nov 2015 10:12:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511121012.tACACKTI075143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 10:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:12:22 -0000 Author: hselasky Date: Thu Nov 12 10:12:20 2015 New Revision: 290711 URL: https://svnweb.freebsd.org/changeset/base/290711 Log: Fix integer to pointer of different size conversion warnings when using GCC for 32-bit platforms. The integer size in this case is hardcoded 64-bit while the pointer size is 32-bit. Sponsored by: Mellanox Technologies MFC after: 2 weeks Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/uverbs_main.c Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 09:56:25 2015 (r290710) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 10:12:20 2015 (r290711) @@ -1379,7 +1379,8 @@ ssize_t ib_uverbs_create_cq(struct ib_uv return -EFAULT; return create_cq(file, buf, in_len, out_len, &cmd, - IB_USER_VERBS_CMD_BASIC, (void __user *)cmd.response); + IB_USER_VERBS_CMD_BASIC, + (void __user *) (unsigned long) cmd.response); } ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, @@ -1609,7 +1610,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv if (copy_from_user(&cmd_obj, buf, cmd_size)) return -EFAULT; - response = (void __user *)cmd->response; + response = (void __user *) (unsigned long) cmd->response; if (!disable_raw_qp_enforcement && cmd->qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, PRIV_NET_RAW)) Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 09:56:25 2015 (r290710) +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 10:12:20 2015 (r290711) @@ -81,8 +81,8 @@ static struct ib_udata_ops uverbs_copy_e #define INIT_UDATA_EX(udata, ibuf, obuf, ilen, olen) \ do { \ (udata)->ops = &uverbs_copy_ex; \ - (udata)->inbuf = (void __user *)(ibuf); \ - (udata)->outbuf = (void __user *)(obuf); \ + (udata)->inbuf = (void __user *)(unsigned long)(ibuf); \ + (udata)->outbuf = (void __user *)(unsigned long)(obuf); \ (udata)->inlen = (ilen); \ (udata)->outlen = (olen); \ } while (0) From owner-svn-src-all@freebsd.org Thu Nov 12 10:16:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8347CA2D1FF; Thu, 12 Nov 2015 10:16:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2CE1AF7; Thu, 12 Nov 2015 10:16:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAGZsn075944; Thu, 12 Nov 2015 10:16:35 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAGZ3k075943; Thu, 12 Nov 2015 10:16:35 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511121016.tACAGZ3k075943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 12 Nov 2015 10:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290712 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:16:36 -0000 Author: smh Date: Thu Nov 12 10:16:35 2015 New Revision: 290712 URL: https://svnweb.freebsd.org/changeset/base/290712 Log: MFC r290399: Allow zfs_recover to be changed at runtime Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:12:20 2015 (r290711) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:16:35 2015 (r290712) @@ -259,7 +259,7 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, boolean_t zfs_recover = B_FALSE; SYSCTL_DECL(_vfs_zfs); TUNABLE_INT("vfs.zfs.recover", &zfs_recover); -SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, +SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RWTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); /* From owner-svn-src-all@freebsd.org Thu Nov 12 10:20:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55454A2D30F; Thu, 12 Nov 2015 10:20:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD5C1D57; Thu, 12 Nov 2015 10:20:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAKbxw076150; Thu, 12 Nov 2015 10:20:37 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAKb8N076149; Thu, 12 Nov 2015 10:20:37 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511121020.tACAKb8N076149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 12 Nov 2015 10:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290713 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:20:38 -0000 Author: smh Date: Thu Nov 12 10:20:36 2015 New Revision: 290713 URL: https://svnweb.freebsd.org/changeset/base/290713 Log: MFC r290401 & r290466 Provide information about bad DVA Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:16:35 2015 (r290712) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:20:36 2015 (r290713) @@ -1807,7 +1807,13 @@ dva_get_dsize_sync(spa_t *spa, const dva ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); if (asize != 0 && spa->spa_deflate) { - vdev_t *vd = vdev_lookup_top(spa, DVA_GET_VDEV(dva)); + uint64_t vdev = DVA_GET_VDEV(dva); + vdev_t *vd = vdev_lookup_top(spa, vdev); + if (vd == NULL) { + panic( + "dva_get_dsize_sync(): bad DVA %llu:%llu", + (u_longlong_t)vdev, (u_longlong_t)asize); + } dsize = (asize >> SPA_MINBLOCKSHIFT) * vd->vdev_deflate_ratio; } From owner-svn-src-all@freebsd.org Thu Nov 12 10:31:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5E5A2D632; Thu, 12 Nov 2015 10:31:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8757712C5; Thu, 12 Nov 2015 10:31:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAVEDB079804; Thu, 12 Nov 2015 10:31:14 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAVEMb079802; Thu, 12 Nov 2015 10:31:14 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511121031.tACAVEMb079802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 12 Nov 2015 10:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290714 - in head/sys/tests: callout_test framework X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:31:15 -0000 Author: rrs Date: Thu Nov 12 10:31:14 2015 New Revision: 290714 URL: https://svnweb.freebsd.org/changeset/base/290714 Log: Style 9 changes. MFC after: 1 Month Modified: head/sys/tests/callout_test/callout_test.c head/sys/tests/framework/kern_testfrwk.c Modified: head/sys/tests/callout_test/callout_test.c ============================================================================== --- head/sys/tests/callout_test/callout_test.c Thu Nov 12 10:20:36 2015 (r290713) +++ head/sys/tests/callout_test/callout_test.c Thu Nov 12 10:31:14 2015 (r290714) @@ -66,7 +66,7 @@ struct callout_run { static struct callout_run *comaster[MAXCPU]; -uint64_t callout_total=0; +uint64_t callout_total = 0; static void execute_the_co_test(struct callout_run *rn); @@ -74,18 +74,19 @@ static void co_saydone(void *arg) { struct callout_run *rn; + rn = (struct callout_run *)arg; printf("The callout test is now complete for thread %d\n", - rn->index); + rn->index); printf("number_callouts:%d\n", - rn->co_number_callouts); + rn->co_number_callouts); printf("Callouts that bailed (Not PENDING or ACTIVE cleared):%d\n", - rn->co_return_npa); + rn->co_return_npa); printf("Callouts that completed:%d\n", rn->co_completed); printf("Drain calls:%d\n", rn->drain_calls); printf("Zero returns:%d non-zero:%d\n", - rn->cnt_zero, - rn->cnt_one); + rn->cnt_zero, + rn->cnt_one); } @@ -93,6 +94,7 @@ static void drainit(void *arg) { struct callout_run *rn; + rn = (struct callout_run *)arg; mtx_lock(&rn->lock); rn->drain_calls++; @@ -104,7 +106,7 @@ test_callout(void *arg) { struct callout_run *rn; int cpu; - + critical_enter(); cpu = curcpu; critical_exit(); @@ -120,7 +122,7 @@ test_callout(void *arg) } callout_deactivate(&rn->co_array[cpu]); rn->co_completed++; - mtx_unlock(&rn->lock); + mtx_unlock(&rn->lock); atomic_subtract_int(&rn->callout_waiting, 1); } @@ -132,16 +134,16 @@ execute_the_co_test(struct callout_run * mtx_lock(&rn->lock); rn->callout_waiting = 0; - for(i=0; ico_number_callouts; i++) { + for (i = 0; i < rn->co_number_callouts; i++) { if (rn->co_test == 1) { /* start all on spread out cpu's */ cpu = i % mp_ncpus; - callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, - cpu, 0); + callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, + cpu, 0); } else { /* Start all on the same CPU */ - callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, - rn->index, 0); + callout_reset_sbt_on(&rn->co_array[i], 3, 0, test_callout, rn, + rn->index, 0); } } tk_s = ticks; @@ -154,7 +156,7 @@ execute_the_co_test(struct callout_run * } } /* OK everyone is waiting and we have the lock */ - for(i=0; ico_number_callouts; i++) { + for (i = 0; i < rn->co_number_callouts; i++) { ret = callout_async_drain(&rn->co_array[i], drainit); if (ret) { rn->cnt_one++; @@ -191,7 +193,7 @@ run_callout_test(struct kern_test *test) if (comaster[index] == NULL) { rn = comaster[index] = malloc(sizeof(struct callout_run), M_CALLTMP, M_WAITOK); memset(comaster[index], 0, sizeof(struct callout_run)); - mtx_init(&rn->lock, "callouttest", NULL, MTX_DUPOK); + mtx_init(&rn->lock, "callouttest", NULL, MTX_DUPOK); rn->index = index; } else { rn = comaster[index]; @@ -207,19 +209,20 @@ run_callout_test(struct kern_test *test) rn->co_test = u->test_number; sz = sizeof(struct callout) * rn->co_number_callouts; rn->co_array = malloc(sz, M_CALLTMP, M_WAITOK); - for(i=0; ico_number_callouts; i++) { + for (i = 0; i < rn->co_number_callouts; i++) { callout_init(&rn->co_array[i], CALLOUT_MPSAFE); } execute_the_co_test(rn); } -int callout_test_is_loaded=0; +int callout_test_is_loaded = 0; static void cocleanup(void) { int i; - for(i=0; ico_array) { free(comaster[i]->co_array, M_CALLTMP); @@ -234,15 +237,15 @@ cocleanup(void) static int callout_test_modevent(module_t mod, int type, void *data) { - int err=0; + int err = 0; switch (type) { case MOD_LOAD: err = kern_testframework_register("callout_test", - run_callout_test); + run_callout_test); if (err) { printf("Can't load callout_test err:%d returned\n", - err); + err); } else { memset(comaster, 0, sizeof(comaster)); callout_test_is_loaded = 1; Modified: head/sys/tests/framework/kern_testfrwk.c ============================================================================== --- head/sys/tests/framework/kern_testfrwk.c Thu Nov 12 10:20:36 2015 (r290713) +++ head/sys/tests/framework/kern_testfrwk.c Thu Nov 12 10:31:14 2015 (r290714) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2015 * Netflix Incorporated, All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -55,27 +55,28 @@ struct kern_test_list { kerntfunc func; }; -TAILQ_HEAD(ktestlist, kern_test_list); +TAILQ_HEAD(ktestlist, kern_test_list); struct kern_test_entry { TAILQ_ENTRY(kern_test_entry) next; - struct kern_test_list *kt_e; - struct kern_test kt_data; + struct kern_test_list *kt_e; + struct kern_test kt_data; }; -TAILQ_HEAD(ktestqueue, kern_test_entry); + +TAILQ_HEAD(ktestqueue, kern_test_entry); MALLOC_DEFINE(M_KTFRWK, "kern_tfrwk", "Kernel Test Framework"); struct kern_totfrwk { - struct taskqueue *kfrwk_tq; - struct task kfrwk_que; - struct ktestlist kfrwk_testlist; - struct ktestqueue kfrwk_testq; - struct mtx kfrwk_mtx; - int kfrwk_waiting; + struct taskqueue *kfrwk_tq; + struct task kfrwk_que; + struct ktestlist kfrwk_testlist; + struct ktestqueue kfrwk_testq; + struct mtx kfrwk_mtx; + int kfrwk_waiting; }; struct kern_totfrwk kfrwk; -static int ktest_frwk_inited=0; +static int ktest_frwk_inited = 0; #define KTFRWK_MUTEX_INIT() mtx_init(&kfrwk.kfrwk_mtx, "kern_test_frwk", "tfrwk", MTX_DEF) @@ -90,7 +91,7 @@ kfrwk_task(void *context, int pending) { struct kern_totfrwk *tf; struct kern_test_entry *wk; - int free_mem=0; + int free_mem = 0; struct kern_test kt_data; kerntfunc ktf; @@ -113,14 +114,14 @@ kfrwk_task(void *context, int pending) if (wk->kt_e) { ktf = wk->kt_e->func; } - } + } KTFRWK_UNLOCK(); if (wk && free_mem) { free(wk, M_KTFRWK); } /* Execute the test */ - if (ktf){ - (*ktf)(&kt_data); + if (ktf) { + (*ktf) (&kt_data); } /* We are done */ atomic_add_int(&tf->kfrwk_waiting, 1); @@ -135,9 +136,9 @@ kerntest_frwk_init(void) TAILQ_INIT(&kfrwk.kfrwk_testq); TAILQ_INIT(&kfrwk.kfrwk_testlist); /* Now lets start up a number of tasks to do the work */ - TASK_INIT(&kfrwk.kfrwk_que, 0, kfrwk_task, &kfrwk); + TASK_INIT(&kfrwk.kfrwk_que, 0, kfrwk_task, &kfrwk); kfrwk.kfrwk_tq = taskqueue_create_fast("sbtls_task", M_NOWAIT, - taskqueue_thread_enqueue, &kfrwk.kfrwk_tq); + taskqueue_thread_enqueue, &kfrwk.kfrwk_tq); if (kfrwk.kfrwk_tq == NULL) { printf("Can't start taskqueue for Kernel Test Framework\n"); panic("Taskqueue init fails for kfrwk"); @@ -145,16 +146,16 @@ kerntest_frwk_init(void) taskqueue_start_threads(&kfrwk.kfrwk_tq, ncpus, PI_NET, "[kt_frwk task]"); kfrwk.kfrwk_waiting = ncpus; ktest_frwk_inited = 1; - return(0); + return (0); } static int kerntest_frwk_fini(void) { - KTFRWK_LOCK(); + KTFRWK_LOCK(); if (!TAILQ_EMPTY(&kfrwk.kfrwk_testlist)) { /* Still modules registered */ - KTFRWK_UNLOCK(); + KTFRWK_UNLOCK(); return (EBUSY); } ktest_frwk_inited = 0; @@ -168,25 +169,25 @@ kerntest_frwk_fini(void) static int kerntest_execute(SYSCTL_HANDLER_ARGS); -SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW, 0, "Kernel Test Framework"); +SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW, 0, "Kernel Test Framework"); SYSCTL_PROC(_kern_testfrwk, OID_AUTO, runtest, (CTLTYPE_STRUCT | CTLFLAG_RW), - 0, 0, kerntest_execute, "IU", "Execute a kernel test"); + 0, 0, kerntest_execute, "IU", "Execute a kernel test"); -int +int kerntest_execute(SYSCTL_HANDLER_ARGS) { struct kern_test kt; - struct kern_test_list *li, *te=NULL; - struct kern_test_entry *kte=NULL; + struct kern_test_list *li, *te = NULL; + struct kern_test_entry *kte = NULL; int error = 0; if (ktest_frwk_inited == 0) { - return(ENOENT); + return (ENOENT); } /* Find the entry if possible */ error = SYSCTL_IN(req, &kt, sizeof(struct kern_test)); if (error) { - return(error); + return (error); } if (kt.num_threads <= 0) { return (EINVAL); @@ -230,21 +231,21 @@ kerntest_execute(SYSCTL_HANDLER_ARGS) taskqueue_enqueue(kfrwk.kfrwk_tq, &kfrwk.kfrwk_que); out: KTFRWK_UNLOCK(); - return(error); + return (error); } int kern_testframework_register(const char *name, kerntfunc func) { int error = 0; - struct kern_test_list *li, *te=NULL; + struct kern_test_list *li, *te = NULL; int len; len = strlen(name); if (len >= TEST_NAME_LEN) { return (E2BIG); } - te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK); + te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK); if (te == NULL) { error = ENOMEM; goto out; @@ -263,20 +264,20 @@ kern_testframework_register(const char * strcpy(te->name, name); TAILQ_INSERT_TAIL(&kfrwk.kfrwk_testlist, te, next); out: - KTFRWK_UNLOCK(); - return(error); + KTFRWK_UNLOCK(); + return (error); } int kern_testframework_deregister(const char *name) { - struct kern_test_list *li, *te=NULL; + struct kern_test_list *li, *te = NULL; u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; int error = 0; KTFRWK_LOCK(); /* First does it already exist? */ - TAILQ_FOREACH (li, &kfrwk.kfrwk_testlist, next) { + TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) { if (strcmp(li->name, name) == 0) { te = li; break; @@ -301,8 +302,8 @@ kern_testframework_deregister(const char memset(te, 0, sizeof(struct kern_test_list)); free(te, M_KTFRWK); out: - KTFRWK_UNLOCK(); - return(error); + KTFRWK_UNLOCK(); + return (error); } static int @@ -321,7 +322,7 @@ kerntest_mod_init(module_t mod, int type } else { err = EBUSY; } - KTFRWK_UNLOCK(); + KTFRWK_UNLOCK(); break; case MOD_UNLOAD: err = kerntest_frwk_fini(); From owner-svn-src-all@freebsd.org Thu Nov 12 10:48:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B007A2DAB1; Thu, 12 Nov 2015 10:48:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63EF91BF6; Thu, 12 Nov 2015 10:48:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAmVeM084769; Thu, 12 Nov 2015 10:48:31 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAmVZl084768; Thu, 12 Nov 2015 10:48:31 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511121048.tACAmVZl084768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 12 Nov 2015 10:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290715 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:48:32 -0000 Author: rrs Date: Thu Nov 12 10:48:31 2015 New Revision: 290715 URL: https://svnweb.freebsd.org/changeset/base/290715 Log: Bump version number since callout_stop() macro now has new NULL arg. Thanks Hans for spotting this! Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 12 10:31:14 2015 (r290714) +++ head/sys/sys/param.h Thu Nov 12 10:48:31 2015 (r290715) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100089 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100090 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Nov 12 11:42:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6629CA2D76E; Thu, 12 Nov 2015 11:42:03 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 258831624; Thu, 12 Nov 2015 11:42:03 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACBg2xq002158; Thu, 12 Nov 2015 11:42:02 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACBg2tY002156; Thu, 12 Nov 2015 11:42:02 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511121142.tACBg2tY002156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 12 Nov 2015 11:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290716 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 11:42:03 -0000 Author: rrs Date: Thu Nov 12 11:42:01 2015 New Revision: 290716 URL: https://svnweb.freebsd.org/changeset/base/290716 Log: Some basic documentation (a man page) on kern_testfrwk Added: head/share/man/man9/kern_testfrwk.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Nov 12 10:48:31 2015 (r290715) +++ head/share/man/man9/Makefile Thu Nov 12 11:42:01 2015 (r290716) @@ -157,6 +157,7 @@ MAN= accept_filter.9 \ intro.9 \ ithread.9 \ KASSERT.9 \ + kern_testfrwk.9 \ kernacc.9 \ kernel_mount.9 \ khelp.9 \ Added: head/share/man/man9/kern_testfrwk.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/kern_testfrwk.9 Thu Nov 12 11:42:01 2015 (r290716) @@ -0,0 +1,188 @@ +.\" +.\" Copyright (c) 2015 Netflix Inc. +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Novmember 10, 2015 +.Dt KERN_TESTFRWK +.Os +.Sh NAME +.Nm kern_testfrwk +.Sh SYNOPSIS +kld_load kern_testfrwk +.Sh DESCRIPTION +So what is this sys/tests directory in the kernel all about? +.Pp +Have you ever wanted to test a part of the FreeBSD kernel in +some way and you have no real way from user-land to make +what you want to occur happen? Say an error path or +situation where locking occurs in a particular manner +that happens only once in a blue moon? +.Pp +If so then the kernel test framework is just what you are +looking for. Its designed to help you create the situation +you want. +.Pp +There are two components to the system, the test-framework +and your-test. This document will talk about both components +and use the one test submitted with the initial commit of +this code to discuss the test (callout_test). All of the +tests become kernel loadable modules. The test you write +should have a dependancy on the test-framework, that way +it will be loaded automatically with your test. You can see +how to do this in the bottom of the callout_test.c in +sys/tests/callout_test/callout_test.c (thats the example test). +.Pp +The framework itself is in sys/tests/framework/kern_testfrwk.c. Its +job is to manage the test's that are loaded, yes more than +one can be loaded. The idea is pretty simple, you load +the test framework and then load your test. +.Pp +So when your test loads, you register your tests with the +kernel-test framework. You do that through a call to +.Fn kern_testframework_register +.Pp +Usually this is done at the module load event as shown below: +.Pp +.Bd -literal -offset indent + switch (type) { + case MOD_LOAD: + err = kern_testframework_register("callout_test", + run_callout_test); +.Ed +.Pp +Here the test is "callout_test" and is registered to run the function +.Fn run_callout_test +passing it a +.Fa struct kern_test *ptr +The kern_test structure is +a structure as defined in kern_testfrwk.h +.Bd -literal -offset indent +struct kern_test { + char name[TEST_NAME_LEN]; + int num_threads; /* Fill in how many threads you want */ + int tot_threads_running; /* For framework */ + uint8_t test_options[TEST_OPTION_SPACE]; +}; +.Ed +.Pp +The user sends this structure down via a sysctl to start your +test running he or she places the same name you registered, "callout_test" +in our example, in the +.Fa name +field. The user can also set the +number of threads to run by putting that in +.Fa num_threads. +.Pp +The framework will start that many kernel threads all running your test +at the same time. The user does not specify anything in +.Fa tot_threads_running +(the framework uses that). As the framework calls each one of +your tests it will set the +.Fa tot_threads_running +to the index +of the thread that your call is made from. So for example if the user +sets +.Fa num_threads +to two, then the function run_callout_test() will +be called once with +.Fa tot_threads_running +to 0, and a second time with +.Fa tot_threads_running +set to 1. +.Pp +The +.Fa test_options +field is a test-specific set of information that +is an opaque glob that is passed in from user space (a max of 256 bytes) +that you reshape to what input your test wants. +In the case of callout_test we reshape that to: +.Pp +.Bd -literal -offset indent +struct callout_test { + int number_of_callouts; + int test_number; +}; +.Ed +.Pp +So the first lines of +.Fn run_callout_test() +does the following to get at the user specific data: +.Pp +.Bd -literal -offset indent +{ + struct callout_test *u; + size_t sz; + int i; + struct callout_run *rn; + int index = test->tot_threads_running; + + u = (struct callout_test *)test->test_options; +.Ed +.Pp +That way it can access: +.Bd -literal + u->test_number (there are two types of tests provided with this test) +and + u->number_of_callouts (how many simultaneous callouts to run). +.Ed +.Pp +Your test can of course do anything it wants with these bytes, they +may not even use them (they are optional). So the callout_test in +question wants to create a situation where multiple callouts are +all run, thats the +.Fa number_of_callouts +, and it try's to cancel +the callout with the new +.Fn callout_async_drain +feature. The threads do +this by the test executor getting the lock in question, and then +starting each of the callouts waiting for the callouts to +all go off (the executor spins waits). This forces the situation that +the callout's have expired and are all waiting on the lock that +the executor holds. After the callouts are all +blocked, the executor then calls the new function +.Fn callout_async_drain +on each callout and then releases the lock. +.Pp +After all the callouts are done, a total status is printed +showing the results via printf. The human tester then can run dmesg +to see the results. In this case it is expected that if you are +running test 0, all the callouts expire on the same CPU so then +only one callout_drain function would have been called. And +the number of zero_returns should match the number of callout_drains +that were called i.e. 1. The one_returns should be the remainder of the +callouts. If the test number was 1, the callouts were spread +across all CPU's. So that the number of zero_returns will +again match the number of drain calls made which matches the number +of CPU's that were put in use. +.Pp +More than one thread can be used with this test, though in the +example case its probably not necessary. +.Pp +You should not need to change the framework +just add tests and register them after loading. +.Sh AUTHORS +The kernel test framework was written by Randall Stewart rrs@freebsd.org +with help from John Mark Gurney jmg@freebsd.org From owner-svn-src-all@freebsd.org Thu Nov 12 14:42:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448B3A2C458; Thu, 12 Nov 2015 14:42:52 +0000 (UTC) (envelope-from crodr001@gmail.com) 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 0409E1A86; Thu, 12 Nov 2015 14:42:52 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykdv3 with SMTP id v3so96802937ykd.0; Thu, 12 Nov 2015 06:42:51 -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=qu+nUf2lk/JCnLkmCME4rsHOtdARLzehVEjHR/aI8ek=; b=BjVw7v1soVNT/9ta7qvbV/oCwwB2uYsega5XT1CMZpbOawLmrp+Isy5gecxs8HSLpC bZrEI/I51VxqNatrJqJr+RtNCoBvEQcVUuH7k1EhcehN9wJnOJnXYidC0Z+9vACFTKwN ENwivSVHHJsDhAujVhnLR4CxH1d7oew6Y331AEwmLB3erNxFC0u1uEtlXDh0VgWmyyJg t2pJBER2AjilJg5NN6YAjrYe67VGNGxfBYJGy9DYMxkpGRV6/9NvqitI6nrbbfDPnf/v 6jkfWtRSFkaywvmAyO1vGavCN99wvI6pbMdXrmSqH9uF8CraMKJevR4b+Jnr3U9ly6Yl 6MZw== MIME-Version: 1.0 X-Received: by 10.129.0.8 with SMTP id 8mr15173553ywa.81.1447339371093; Thu, 12 Nov 2015 06:42:51 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.37.95.9 with HTTP; Thu, 12 Nov 2015 06:42:51 -0800 (PST) In-Reply-To: <201511092337.tA9Nb19I086123@repo.freebsd.org> References: <201511092337.tA9Nb19I086123@repo.freebsd.org> Date: Thu, 12 Nov 2015 06:42:51 -0800 X-Google-Sender-Auth: rzj82SrdJd_beicO3vYw3I3ZXEA Message-ID: Subject: Re: svn commit: r290628 - in head/etc: . rc.d From: Craig Rodrigues To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 14:42:52 -0000 On Mon, Nov 9, 2015 at 3:37 PM, Bryan Drewery wrote: > > When extracting mtrees, pass -i so schg/sappnd are respected. > > However, if NO_FSCHG is specified in make.conf, this does not do the right thing. -- Craig From owner-svn-src-all@freebsd.org Thu Nov 12 16:08:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF728A2D6EA; Thu, 12 Nov 2015 16:08:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99B461A8D; Thu, 12 Nov 2015 16:08:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACG8nk7080096; Thu, 12 Nov 2015 16:08:49 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACG8nEe080095; Thu, 12 Nov 2015 16:08:49 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201511121608.tACG8nEe080095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Nov 2015 16:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290717 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 16:08:50 -0000 Author: sbruno Date: Thu Nov 12 16:08:49 2015 New Revision: 290717 URL: https://svnweb.freebsd.org/changeset/base/290717 Log: Intel has requested that changes to these driver get a phabricator review before commits to keep conflicts down to a minimum. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Nov 12 11:42:01 2015 (r290716) +++ head/MAINTAINERS Thu Nov 12 16:08:49 2015 (r290717) @@ -65,6 +65,9 @@ tests freebsd-testing,ngie Pre-commit sys/dev/usb hselasky If in doubt, ask. sys/dev/sound/usb hselasky If in doubt, ask. sys/compat/linuxkpi hselasky If in doubt, ask. +sys/dev/e1000 erj Pre-commit phabricator review requested. +sys/dev/ixgbe erj Pre-commit phabricator review requested. +sys/dev/ixl erj Pre-commit phabricator reivew requested. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. From owner-svn-src-all@freebsd.org Thu Nov 12 16:15:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB19A2D8E7; Thu, 12 Nov 2015 16:15:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 82E601FAB; Thu, 12 Nov 2015 16:15:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 7D761159B; Thu, 12 Nov 2015 16:15:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 43C071446A; Thu, 12 Nov 2015 16:15:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id dJuLsivMBmK5; Thu, 12 Nov 2015 16:14:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E8AA714454 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r290628 - in head/etc: . rc.d From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Thu, 12 Nov 2015 08:14:04 -0800 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <0E9B2F68-885C-4BFA-9434-014E6E6C7E15@FreeBSD.org> References: <201511092337.tA9Nb19I086123@repo.freebsd.org> To: Craig Rodrigues Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 16:15:16 -0000 > On Nov 12, 2015, at 06:42, Craig Rodrigues wrote:= >=20 >=20 >=20 >> On Mon, Nov 9, 2015 at 3:37 PM, Bryan Drewery wrot= e: >>=20 >> When extracting mtrees, pass -i so schg/sappnd are respected. >=20 > However, if NO_FSCHG is specified in make.conf, this does not do the right= thing. >=20 >=20 I'm not sure if that ever worked, but I agree it should. I'll fix it.= From owner-svn-src-all@freebsd.org Thu Nov 12 17:01:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F01C0A2C3C9; Thu, 12 Nov 2015 17:01:52 +0000 (UTC) (envelope-from bz@freebsd.org) 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 AB7DC1903; Thu, 12 Nov 2015 17:01:52 +0000 (UTC) (envelope-from bz@freebsd.org) 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 BDE0825D385E; Thu, 12 Nov 2015 17:01:43 +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 CDBD4C76FE5; Thu, 12 Nov 2015 17:01:42 +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 0802mLsooA61; Thu, 12 Nov 2015 17:01:41 +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 2297AC22B9A; Thu, 12 Nov 2015 17:01:40 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290714 - in head/sys/tests: callout_test framework From: "Bjoern A. Zeeb" In-Reply-To: <201511121031.tACAVEMb079802@repo.freebsd.org> Date: Thu, 12 Nov 2015 17:01:39 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> References: <201511121031.tACAVEMb079802@repo.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:01:53 -0000 > On 12 Nov 2015, at 10:31 , Randall Stewart wrote: >=20 > Author: rrs > Date: Thu Nov 12 10:31:14 2015 > New Revision: 290714 > URL: https://svnweb.freebsd.org/changeset/base/290714 >=20 > Log: > Style 9 changes. > MFC after: 1 Month >=20 > Modified: > head/sys/tests/callout_test/callout_test.c > head/sys/tests/framework/kern_testfrwk.c I am just replying to the last commit given despite the efforts of = people it still fails on PC98: = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:52:9: error: 'cpu_spinwait' macro redefined = [-Werror,-Wmacro-redefined] #define cpu_spinwait() ^ ./i386/cpu.h:50:9: note: previous definition is here #define cpu_spinwait() ia32_pause() ^ 1 error generated. --- callout_test.o --- *** [callout_test.o] Error code 1 bmake: stopped in = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test From owner-svn-src-all@freebsd.org Thu Nov 12 17:10:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78975A2C525; Thu, 12 Nov 2015 17:10:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FBF1CD4; Thu, 12 Nov 2015 17:10:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tACHAkNo026817 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 12 Nov 2015 19:10:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tACHAkNo026817 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tACHAkxx026816; Thu, 12 Nov 2015 19:10:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Nov 2015 19:10:46 +0200 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290714 - in head/sys/tests: callout_test framework Message-ID: <20151112171046.GN2257@kib.kiev.ua> References: <201511121031.tACAVEMb079802@repo.freebsd.org> <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:10:55 -0000 On Thu, Nov 12, 2015 at 05:01:39PM +0000, Bjoern A. Zeeb wrote: > > > On 12 Nov 2015, at 10:31 , Randall Stewart wrote: > > > > Author: rrs > > Date: Thu Nov 12 10:31:14 2015 > > New Revision: 290714 > > URL: https://svnweb.freebsd.org/changeset/base/290714 > > > > Log: > > Style 9 changes. > > MFC after: 1 Month > > > > Modified: > > head/sys/tests/callout_test/callout_test.c > > head/sys/tests/framework/kern_testfrwk.c > > > I am just replying to the last commit given despite the efforts of people it still fails on PC98: > > /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/callout_test/callout_test.c:52:9: error: 'cpu_spinwait' macro redefined [-Werror,-Wmacro-redefined] > #define cpu_spinwait() > ^ > ./i386/cpu.h:50:9: note: previous definition is here > #define cpu_spinwait() ia32_pause() > ^ > 1 error generated. > --- callout_test.o --- > *** [callout_test.o] Error code 1 > > bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test > Which version did you checked out ? I removed the redefinition of the cpu_spinwait() for UP in r290707, and it was not reverted. From owner-svn-src-all@freebsd.org Thu Nov 12 17:11:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F34EA2C54B; Thu, 12 Nov 2015 17:11:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 691661E2E; Thu, 12 Nov 2015 17:11:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACHB34e000740; Thu, 12 Nov 2015 17:11:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACHB3Jr000739; Thu, 12 Nov 2015 17:11:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511121711.tACHB3Jr000739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Nov 2015 17:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290718 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:11:04 -0000 Author: bdrewery Date: Thu Nov 12 17:11:03 2015 New Revision: 290718 URL: https://svnweb.freebsd.org/changeset/base/290718 Log: Respect NO_FSCHG for extracting mtrees. PR: 194189 X-MFC-With: r290628 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Nov 12 16:08:49 2015 (r290717) +++ head/etc/Makefile Thu Nov 12 17:11:03 2015 (r290718) @@ -338,6 +338,9 @@ MTREE_FILTER= sed -e 's,\([gu]\)name=,\1 .else MTREE_FILTER= cat .endif +.if !defined(NO_FSCHG) +MTREE_FSCHG= -i +.endif MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ @@ -370,10 +373,11 @@ distrib-dirs: ${MTREES:N/*} d=${DESTDIR}$$1; \ shift; \ test -d $$d || mkdir -p $$d; \ - ${ECHO} ${MTREE_CMD} -deiU ${MTREE_FOLLOWS_SYMLINKS} \ - -f $$m -p $$d; \ + ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \ + ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ ${MTREE_FILTER} $$m | \ - ${MTREE_CMD} -deiU ${MTREE_FOLLOWS_SYMLINKS} -p $$d; \ + ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \ + -p $$d; \ done; true .if defined(NO_ROOT) @set ${MTREES}; \ From owner-svn-src-all@freebsd.org Thu Nov 12 17:11:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4C3A2C59C; Thu, 12 Nov 2015 17:11:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8173D1FBC; Thu, 12 Nov 2015 17:11:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 74A1F1600; Thu, 12 Nov 2015 17:11:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3AB0B14583; Thu, 12 Nov 2015 17:11:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id rZ0kfZ7kMlHX; Thu, 12 Nov 2015 17:11:17 +0000 (UTC) Subject: Re: svn commit: r290628 - in head/etc: . rc.d DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DED791457A To: Craig Rodrigues References: <201511092337.tA9Nb19I086123@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5644C833.2060806@FreeBSD.org> Date: Thu, 12 Nov 2015 09:11:15 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aMMErcXrkU8deqUQp0egWhInLnR9bfnVQ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:11:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aMMErcXrkU8deqUQp0egWhInLnR9bfnVQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/12/2015 6:42 AM, Craig Rodrigues wrote: >=20 >=20 > On Mon, Nov 9, 2015 at 3:37 PM, Bryan Drewery > wrote: >=20 >=20 > When extracting mtrees, pass -i so schg/sappnd are respected. >=20 >=20 > However, if NO_FSCHG is specified in make.conf, this does not do the > right thing. >=20 This is now fixed. --=20 Regards, Bryan Drewery --aMMErcXrkU8deqUQp0egWhInLnR9bfnVQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRMgzAAoJEDXXcbtuRpfPZHIIAMDiiMJNrezSIYkxMpr62yAD iip0vlRweOxdQMwtx1qTKwgrc06moiW8g8Q6KAGkqRXL4d/9mrgsoFI9VSsQStbr KW1Q6wQySTfgWrEDy708U9CHbLsy84Bwl+EFNm//Vl9+caZQ24bYd5llp8CS+oVV ODhTIMSo2esPaZbp3Vy8W814adE1xkcrlWINWiR32+hS3rOPlcpi0SOZxjQ1uYY9 2lvuAqtQ3wFDWD7wuoTe4jQCQhi+M2qnGCjnM2GxIw/q0XjPaTdF5tcnQ98v5E+I Y+JOxpAT8Bz4cDJIC6TffTQ+vXMWYL/uIyRO3ZzirJC/ufew2dohY/lAcfNGzfY= =kKVt -----END PGP SIGNATURE----- --aMMErcXrkU8deqUQp0egWhInLnR9bfnVQ-- From owner-svn-src-all@freebsd.org Thu Nov 12 17:13:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 873C7A2C72C; Thu, 12 Nov 2015 17:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 557EB1362; Thu, 12 Nov 2015 17:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACHDCaF000863; Thu, 12 Nov 2015 17:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACHDCaw000861; Thu, 12 Nov 2015 17:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511121713.tACHDCaw000861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Nov 2015 17:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290719 - in head/targets/pseudo: bootstrap-tools stage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:13:13 -0000 Author: bdrewery Date: Thu Nov 12 17:13:12 2015 New Revision: 290719 URL: https://svnweb.freebsd.org/changeset/base/290719 Log: META MODE: Don't set schg flags in the stagedir for distrib-dirs. This recently started setting /var/empty to schg after r290628. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/bootstrap-tools/Makefile head/targets/pseudo/stage/Makefile Modified: head/targets/pseudo/bootstrap-tools/Makefile ============================================================================== --- head/targets/pseudo/bootstrap-tools/Makefile Thu Nov 12 17:11:03 2015 (r290718) +++ head/targets/pseudo/bootstrap-tools/Makefile Thu Nov 12 17:13:12 2015 (r290719) @@ -43,10 +43,10 @@ BSARGS= DESTDIR= \ legacy: .MAKE .META mkdir -p ${LEGACY_TOOLS} - ${MAKE} -C ${SRCTOP}/etc distrib-dirs DESTDIR=${BTOOLSDIR} \ + ${MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG DESTDIR=${BTOOLSDIR} \ > $@.distrib-dirs_btoolsdir - ${MAKE} -C ${SRCTOP}/etc distrib-dirs DESTDIR=${LEGACY_TOOLS} \ - > $@.distrib-dirs_legacy_tools + ${MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG \ + DESTDIR=${LEGACY_TOOLS} > $@.distrib-dirs_legacy_tools ${BSENV} ${MAKE} -C ${SRCTOP} -f Makefile.inc1 ${BSARGS} $@ touch $@ Modified: head/targets/pseudo/stage/Makefile ============================================================================== --- head/targets/pseudo/stage/Makefile Thu Nov 12 17:11:03 2015 (r290718) +++ head/targets/pseudo/stage/Makefile Thu Nov 12 17:13:12 2015 (r290719) @@ -8,7 +8,7 @@ all: # we don't need to see it. stage-distrib-dirs: .META mkdir -p ${STAGE_OBJTOP} - ${.MAKE} -C ${SRCTOP}/etc distrib-dirs -DWITH_TESTS \ + ${.MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG -DWITH_TESTS \ DESTDIR=${STAGE_OBJTOP} > $@.distrib_dirs touch $@ From owner-svn-src-all@freebsd.org Thu Nov 12 17:15:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C1DA2C7DF; Thu, 12 Nov 2015 17:15:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 2EF601648; Thu, 12 Nov 2015 17:15:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 5B30125D385E; Thu, 12 Nov 2015 17:15:02 +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 8C4B5C770A6; Thu, 12 Nov 2015 17:15:01 +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 pvp4KctF-pIX; Thu, 12 Nov 2015 17:15:00 +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 D4BD1C76FE5; Thu, 12 Nov 2015 17:14:59 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290714 - in head/sys/tests: callout_test framework From: "Bjoern A. Zeeb" In-Reply-To: <20151112171046.GN2257@kib.kiev.ua> Date: Thu, 12 Nov 2015 17:14:58 +0000 Cc: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <93751CDC-3F92-4087-AA6E-63F459F576D8@FreeBSD.org> References: <201511121031.tACAVEMb079802@repo.freebsd.org> <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> <20151112171046.GN2257@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:15:05 -0000 > On 12 Nov 2015, at 17:10 , Konstantin Belousov = wrote: >=20 > On Thu, Nov 12, 2015 at 05:01:39PM +0000, Bjoern A. Zeeb wrote: >>=20 >>> On 12 Nov 2015, at 10:31 , Randall Stewart wrote: >>>=20 >>> Author: rrs >>> Date: Thu Nov 12 10:31:14 2015 >>> New Revision: 290714 >>> URL: https://svnweb.freebsd.org/changeset/base/290714 >>>=20 >>> Log: >>> Style 9 changes. >>> MFC after: 1 Month >>>=20 >>> Modified: >>> head/sys/tests/callout_test/callout_test.c >>> head/sys/tests/framework/kern_testfrwk.c >>=20 >>=20 >> I am just replying to the last commit given despite the efforts of = people it still fails on PC98: >>=20 >> = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:52:9: error: 'cpu_spinwait' macro redefined = [-Werror,-Wmacro-redefined] >> #define cpu_spinwait() >> ^ >> ./i386/cpu.h:50:9: note: previous definition is here >> #define cpu_spinwait() ia32_pause() >> ^ >> 1 error generated. >> --- callout_test.o --- >> *** [callout_test.o] Error code 1 >>=20 >> bmake: stopped in = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test >>=20 >=20 > Which version did you checked out ? I removed the redefinition of > the cpu_spinwait() for UP in r290707, and it was not reverted. Good, this was 705; must have missed your commit. Thanks! /bz= From owner-svn-src-all@freebsd.org Thu Nov 12 17:15:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E989FA2C7E2; Thu, 12 Nov 2015 17:15:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3D05164A; Thu, 12 Nov 2015 17:15:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACHF4Qt001066; Thu, 12 Nov 2015 17:15:04 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACHF4Cp001065; Thu, 12 Nov 2015 17:15:04 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201511121715.tACHF4Cp001065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Nov 2015 17:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290720 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:15:06 -0000 Author: sbruno Date: Thu Nov 12 17:15:04 2015 New Revision: 290720 URL: https://svnweb.freebsd.org/changeset/base/290720 Log: spelling is important. Submitted by: vangyzen@FreeBSD.org Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Nov 12 17:13:12 2015 (r290719) +++ head/MAINTAINERS Thu Nov 12 17:15:04 2015 (r290720) @@ -67,7 +67,7 @@ sys/dev/sound/usb hselasky If in doubt, sys/compat/linuxkpi hselasky If in doubt, ask. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. -sys/dev/ixl erj Pre-commit phabricator reivew requested. +sys/dev/ixl erj Pre-commit phabricator review requested. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. From owner-svn-src-all@freebsd.org Thu Nov 12 17:17:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADEEDA2C91B; Thu, 12 Nov 2015 17:17:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.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 6FF4D1B60; Thu, 12 Nov 2015 17:17:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykdv3 with SMTP id v3so102562435ykd.0; Thu, 12 Nov 2015 09:17:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=pUi5SuiOwXAE58wI9AzC3/ZhSME8eJ887BgePA9N7z8=; b=J/ss3lUGQ58MfrADVTc527kvj4WiY3UrXRn/n1jmBkcvbeDSVKOctIu8TVQm0amAYA 0N+a11KMjPc9WFSjOzRL5mz/T8mGqN3d6dmpL+zfjoZ08ZLuzWt+mvuibaKuyIi+7tMW 6gOIR90OKgVSY/HztJWHrHVLLlKYHkTqiGDkFAVZnwgQCj8lMz9ON8FBCJMncCih8I2D 1yshjZFgYoLMUKPEbx6ePbpGITviSygIBAhAuBptV5bvh+mwlbsI4ZXH8R8t/i+ES4/t 8xQ392AV61dn3NtHIsbTbanjU8PRGLMcUvn259tqWQk/R7NdUJqgC5FF9Iro8/x28b/b jy2g== X-Received: by 10.129.106.193 with SMTP id f184mr17319479ywc.157.1447348627023; Thu, 12 Nov 2015 09:17:07 -0800 (PST) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id f67sm16209756ywd.19.2015.11.12.09.17.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 09:17:06 -0800 (PST) Received: by ykfs79 with SMTP id s79so102711154ykf.1; Thu, 12 Nov 2015 09:17:06 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.13.213 with SMTP id 204mr17056181ywn.281.1447348626505; Thu, 12 Nov 2015 09:17:06 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.17.2 with HTTP; Thu, 12 Nov 2015 09:17:06 -0800 (PST) In-Reply-To: <201511121012.tACACKTI075143@repo.freebsd.org> References: <201511121012.tACACKTI075143@repo.freebsd.org> Date: Thu, 12 Nov 2015 09:17:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core From: Conrad Meyer To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:17:08 -0000 These should cast through (u)intptr_t rather than unsigned long. Best, Conrad On Thu, Nov 12, 2015 at 2:12 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Nov 12 10:12:20 2015 > New Revision: 290711 > URL: https://svnweb.freebsd.org/changeset/base/290711 > > Log: > Fix integer to pointer of different size conversion warnings when > using GCC for 32-bit platforms. The integer size in this case is > hardcoded 64-bit while the pointer size is 32-bit. > > Sponsored by: Mellanox Technologies > MFC after: 2 weeks > > Modified: > head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > head/sys/ofed/drivers/infiniband/core/uverbs_main.c > > Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 09:56:25 2015 (r290710) > +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 10:12:20 2015 (r290711) > @@ -1379,7 +1379,8 @@ ssize_t ib_uverbs_create_cq(struct ib_uv > return -EFAULT; > > return create_cq(file, buf, in_len, out_len, &cmd, > - IB_USER_VERBS_CMD_BASIC, (void __user *)cmd.response); > + IB_USER_VERBS_CMD_BASIC, > + (void __user *) (unsigned long) cmd.response); > } > > ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, > @@ -1609,7 +1610,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv > if (copy_from_user(&cmd_obj, buf, cmd_size)) > return -EFAULT; > > - response = (void __user *)cmd->response; > + response = (void __user *) (unsigned long) cmd->response; > > if (!disable_raw_qp_enforcement && > cmd->qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, PRIV_NET_RAW)) > > Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 09:56:25 2015 (r290710) > +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 10:12:20 2015 (r290711) > @@ -81,8 +81,8 @@ static struct ib_udata_ops uverbs_copy_e > #define INIT_UDATA_EX(udata, ibuf, obuf, ilen, olen) \ > do { \ > (udata)->ops = &uverbs_copy_ex; \ > - (udata)->inbuf = (void __user *)(ibuf); \ > - (udata)->outbuf = (void __user *)(obuf); \ > + (udata)->inbuf = (void __user *)(unsigned long)(ibuf); \ > + (udata)->outbuf = (void __user *)(unsigned long)(obuf); \ > (udata)->inlen = (ilen); \ > (udata)->outlen = (olen); \ > } while (0) > From owner-svn-src-all@freebsd.org Thu Nov 12 17:23:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4790CA2CEF3; Thu, 12 Nov 2015 17:23:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF9F811C0; Thu, 12 Nov 2015 17:23:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACHNWHv005843; Thu, 12 Nov 2015 17:23:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACHNVYu005841; Thu, 12 Nov 2015 17:23:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511121723.tACHNVYu005841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Nov 2015 17:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290721 - in head/share: examples/etc man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:23:33 -0000 Author: imp Date: Thu Nov 12 17:23:31 2015 New Revision: 290721 URL: https://svnweb.freebsd.org/changeset/base/290721 Log: NO_CPU_OPTFLAGS doesn't exist, so don't document it. Modified: head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Thu Nov 12 17:15:04 2015 (r290720) +++ head/share/examples/etc/make.conf Thu Nov 12 17:23:31 2015 (r290721) @@ -52,7 +52,6 @@ # #CPUTYPE?=pentium3 #NO_CPU_CFLAGS= # Don't add -march= to CFLAGS automatically -#NO_CPU_COPTFLAGS= # Don't add -march= to COPTFLAGS automatically # # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Thu Nov 12 17:15:04 2015 (r290720) +++ head/share/man/man5/make.conf.5 Thu Nov 12 17:23:31 2015 (r290721) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2014 +.Dd November 12, 2015 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -165,13 +165,9 @@ to contain the appropriate optimization .Xr cc 1 . The automatic setting of .Va CFLAGS -and -.Va COPTFLAGS may be overridden using the .Va NO_CPU_CFLAGS -and -.Va NO_CPU_COPTFLAGS -variables, respectively. +variable. Refer to .Pa /usr/share/examples/etc/make.conf for a list of recognized @@ -231,12 +227,6 @@ Setting this variable will prevent CPU s from being automatically added to .Va CFLAGS during compile time. -.It Va NO_CPU_COPTFLAGS -.Pq Vt str -Setting this variable will prevent CPU specific compiler flags -from being automatically added to -.Va COPTFLAGS -during compile time. .It Va NO_DOCUPDATE .Pq Vt bool Set this to not update the doc tree during From owner-svn-src-all@freebsd.org Thu Nov 12 17:46:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7341BA2D42C; Thu, 12 Nov 2015 17:46:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41E911076; Thu, 12 Nov 2015 17:46:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACHkvum011677; Thu, 12 Nov 2015 17:46:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACHkvZJ011675; Thu, 12 Nov 2015 17:46:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511121746.tACHkvZJ011675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Nov 2015 17:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290722 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:46:58 -0000 Author: imp Date: Thu Nov 12 17:46:57 2015 New Revision: 290722 URL: https://svnweb.freebsd.org/changeset/base/290722 Log: Move the root to s3a given this kernel will be used with a nanobsd build that defaults there. Modified: head/sys/arm/conf/SAM9260EK Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Thu Nov 12 17:23:31 2015 (r290721) +++ head/sys/arm/conf/SAM9260EK Thu Nov 12 17:46:57 2015 (r290722) @@ -105,7 +105,7 @@ options PRINTF_BUFR_SIZE=128 # Prevent # alternatively, boot from a MMC/SD memory card # s1 is FAT on this platform. -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s2a\" +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s3a\" # Alternatively, boot from a USB card. #options ROOTDEVNAME=\"ufs:/dev/da0s1a\" From owner-svn-src-all@freebsd.org Thu Nov 12 18:10:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28DCA2D9CF; Thu, 12 Nov 2015 18:10:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 815301E95; Thu, 12 Nov 2015 18:10:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACIAYYK017578; Thu, 12 Nov 2015 18:10:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACIAYta017577; Thu, 12 Nov 2015 18:10:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511121810.tACIAYta017577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Nov 2015 18:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290723 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 18:10:35 -0000 Author: bdrewery Date: Thu Nov 12 18:10:34 2015 New Revision: 290723 URL: https://svnweb.freebsd.org/changeset/base/290723 Log: Add note about usr.sbin/pkg -- Please discuss behavior/flag changes with pkg team. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Nov 12 17:46:57 2015 (r290722) +++ head/MAINTAINERS Thu Nov 12 18:10:34 2015 (r290723) @@ -68,6 +68,7 @@ sys/compat/linuxkpi hselasky If in doubt sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. +usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. From owner-svn-src-all@freebsd.org Thu Nov 12 18:42:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D67A2D34E; Thu, 12 Nov 2015 18:42:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21F9F1377; Thu, 12 Nov 2015 18:42:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACIg71M028514; Thu, 12 Nov 2015 18:42:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACIg7hu028513; Thu, 12 Nov 2015 18:42:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511121842.tACIg7hu028513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 Nov 2015 18:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290724 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 18:42:08 -0000 Author: cem Date: Thu Nov 12 18:42:06 2015 New Revision: 290724 URL: https://svnweb.freebsd.org/changeset/base/290724 Log: kern_testfrwk.9: Clean up manual page style Igor has many less complaints now. I think the two remaining are bogus, but I am also not sure why Igor is producing them. The page still needs more work. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/kern_testfrwk.9 Modified: head/share/man/man9/kern_testfrwk.9 ============================================================================== --- head/share/man/man9/kern_testfrwk.9 Thu Nov 12 18:10:34 2015 (r290723) +++ head/share/man/man9/kern_testfrwk.9 Thu Nov 12 18:42:06 2015 (r290724) @@ -24,45 +24,46 @@ .\" .\" $FreeBSD$ .\" -.Dd Novmember 10, 2015 -.Dt KERN_TESTFRWK +.Dd November 12, 2015 +.Dt KERN_TESTFRWK 9 .Os .Sh NAME .Nm kern_testfrwk +.Nd A kernel testing framework .Sh SYNOPSIS kld_load kern_testfrwk .Sh DESCRIPTION +.\" This whole section is not written in manual page style and should be ripped +.\" out and replaced. -CEM So what is this sys/tests directory in the kernel all about? .Pp -Have you ever wanted to test a part of the FreeBSD kernel in -some way and you have no real way from user-land to make -what you want to occur happen? Say an error path or -situation where locking occurs in a particular manner -that happens only once in a blue moon? -.Pp -If so then the kernel test framework is just what you are -looking for. Its designed to help you create the situation -you want. -.Pp -There are two components to the system, the test-framework -and your-test. This document will talk about both components -and use the one test submitted with the initial commit of -this code to discuss the test (callout_test). All of the -tests become kernel loadable modules. The test you write -should have a dependancy on the test-framework, that way -it will be loaded automatically with your test. You can see -how to do this in the bottom of the callout_test.c in -sys/tests/callout_test/callout_test.c (thats the example test). -.Pp -The framework itself is in sys/tests/framework/kern_testfrwk.c. Its -job is to manage the test's that are loaded, yes more than -one can be loaded. The idea is pretty simple, you load -the test framework and then load your test. -.Pp -So when your test loads, you register your tests with the -kernel-test framework. You do that through a call to -.Fn kern_testframework_register -.Pp +Have you ever wanted to test a part of the FreeBSD kernel in some way and you +had no real way from user-land to make what you want to occur happen? +Say an error path or situation where locking occurs in a particular manner that +happens only once in a blue moon? +.Pp +If so, then the kernel test framework is just what you are looking for. +It is designed to help you create the situation you want. +.Pp +There are two components to the system: the test framework and your test. +This document will describe both components and use the test submitted with the +initial commit of this code to discuss the test +.Xr ( callout_test 4 ) . +All of the tests become kernel loadable modules. +The test you write should have a dependency on the test framework. +That way it will be loaded automatically with your test. +For example, you can see how to do this in the bottom of callout_test.c in +.Pa sys/tests/callout_test/callout_test.c . +.Pp +The framework itself is in +.Pa sys/tests/framework/kern_testfrwk.c . +Its job is to manage the tests that are loaded. +(More than one can be loaded.) +The idea is pretty simple; you load the test framework and then load your test. +.Pp +When your test loads, you register your tests with the kernel test framework. +You do that through a call to +.Fn kern_testframework_register . Usually this is done at the module load event as shown below: .Pp .Bd -literal -offset indent @@ -72,51 +73,54 @@ Usually this is done at the module load run_callout_test); .Ed .Pp -Here the test is "callout_test" and is registered to run the function +Here the test is "callout_test" and it is registered to run the function .Fn run_callout_test passing it a -.Fa struct kern_test *ptr -The kern_test structure is -a structure as defined in kern_testfrwk.h +.Fa struct kern_test *ptr . +The +.Vt kern_test +structure is defined in +.Pa kern_testfrwk.h . .Bd -literal -offset indent struct kern_test { char name[TEST_NAME_LEN]; - int num_threads; /* Fill in how many threads you want */ - int tot_threads_running; /* For framework */ + int num_threads; /* Fill in how many threads you want */ + int tot_threads_running; /* Private to framework */ uint8_t test_options[TEST_OPTION_SPACE]; }; .Ed .Pp -The user sends this structure down via a sysctl to start your -test running he or she places the same name you registered, "callout_test" -in our example, in the -.Fa name -field. The user can also set the -number of threads to run by putting that in -.Fa num_threads. -.Pp -The framework will start that many kernel threads all running your test -at the same time. The user does not specify anything in -.Fa tot_threads_running -(the framework uses that). As the framework calls each one of -your tests it will set the -.Fa tot_threads_running -to the index -of the thread that your call is made from. So for example if the user -sets -.Fa num_threads -to two, then the function run_callout_test() will -be called once with -.Fa tot_threads_running +The user sends this structure down via a sysctl to start your test. +He or she places the same name you registered ("callout_test" +in our example) in the +.Va name +field. +The user can also set the number of threads to run with +.Va num_threads . +.Pp +The framework will start the requested number of kernel threads, all running +your test at the same time. +The user does not specify anything in +.Va tot_threads_running ; +it is private to the framework. +As the framework calls each of your tests, it will set the +.Va tot_threads_running +to the index of the thread that your call is made from. +For example, if the user sets +.Va num_threads +to 2, then the function +.Fn run_callout_test +will be called once with +.Va tot_threads_running to 0, and a second time with -.Fa tot_threads_running +.Va tot_threads_running set to 1. .Pp The -.Fa test_options -field is a test-specific set of information that -is an opaque glob that is passed in from user space (a max of 256 bytes) -that you reshape to what input your test wants. +.Va test_options +field is a test-specific set of information that is an opaque blob. +It is passed in from user space and has a maximum size of 256 bytes. +You can pass arbitrary test input in the space. In the case of callout_test we reshape that to: .Pp .Bd -literal -offset indent @@ -127,11 +131,11 @@ struct callout_test { .Ed .Pp So the first lines of -.Fn run_callout_test() +.Fn run_callout_test does the following to get at the user specific data: .Pp +.\" This is a bad example and violates strict aliasing. It should be replaced. .Bd -literal -offset indent -{ struct callout_test *u; size_t sz; int i; @@ -142,47 +146,52 @@ does the following to get at the user sp .Ed .Pp That way it can access: -.Bd -literal - u->test_number (there are two types of tests provided with this test) +.Va u->test_number +(there are two types of tests provided with this test) and - u->number_of_callouts (how many simultaneous callouts to run). -.Ed +.Va u->number_of_callouts +(how many simultaneous callouts to run). .Pp -Your test can of course do anything it wants with these bytes, they -may not even use them (they are optional). So the callout_test in -question wants to create a situation where multiple callouts are -all run, thats the -.Fa number_of_callouts -, and it try's to cancel -the callout with the new -.Fn callout_async_drain -feature. The threads do -this by the test executor getting the lock in question, and then -starting each of the callouts waiting for the callouts to -all go off (the executor spins waits). This forces the situation that -the callout's have expired and are all waiting on the lock that -the executor holds. After the callouts are all -blocked, the executor then calls the new function +Your test can do anything with these bytes. +So the callout_test in question wants to create a situation where multiple +callouts are all run, that is the +.Va number_of_callouts , +and it tries to cancel the callout with the new +.Fn callout_async_drain . +The threads do this by acquiring the lock in question, and then +starting each of the callouts. +It waits for the callouts to all go off (the executor spins waits). +This forces the situation that the callouts have expired and are all waiting on +the lock that the executor holds. +After the callouts are all blocked, the executor calls .Fn callout_async_drain -on each callout and then releases the lock. +on each callout and releases the lock. .Pp +.\" callout_test(4) specific documentation should probably be moved to its own +.\" page. After all the callouts are done, a total status is printed -showing the results via printf. The human tester then can run dmesg -to see the results. In this case it is expected that if you are -running test 0, all the callouts expire on the same CPU so then -only one callout_drain function would have been called. And -the number of zero_returns should match the number of callout_drains -that were called i.e. 1. The one_returns should be the remainder of the -callouts. If the test number was 1, the callouts were spread -across all CPU's. So that the number of zero_returns will -again match the number of drain calls made which matches the number -of CPU's that were put in use. +showing the results via +.Xr printf 9 . +The human tester can run +.Xr dmesg 8 +to see the results. +In this case it is expected that if you are running test 0, all the callouts +expire on the same CPU so only one callout_drain function would have been +called. +the number of zero_returns should match the number of callout_drains that were +called, i.e., 1. +The one_returns should be the remainder of the callouts. +If the test number was 1, the callouts were spread across all CPUs. +The number of zero_returns will again match the number of drain calls made +which matches the number of CPUs that were put in use. .Pp -More than one thread can be used with this test, though in the -example case its probably not necessary. +More than one thread can be used with this test, though in the example case it +is probably not necessary. .Pp -You should not need to change the framework -just add tests and register them after loading. +You should not need to change the framework. +Just add tests and register them after loading. .Sh AUTHORS -The kernel test framework was written by Randall Stewart rrs@freebsd.org -with help from John Mark Gurney jmg@freebsd.org +The kernel test framework was written by +.An Randall Stewart Aq Mt rrs@FreeBSD.org +with help from +.An John Mark Gurney Aq Mt jmg@FreeBSD.org . From owner-svn-src-all@freebsd.org Thu Nov 12 19:07:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64DFA2D722; Thu, 12 Nov 2015 19:07:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9BF1EFA; Thu, 12 Nov 2015 19:07:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACJ73Ax035411; Thu, 12 Nov 2015 19:07:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACJ73tk035409; Thu, 12 Nov 2015 19:07:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511121907.tACJ73tk035409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 Nov 2015 19:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290725 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 19:07:04 -0000 Author: cem Date: Thu Nov 12 19:07:03 2015 New Revision: 290725 URL: https://svnweb.freebsd.org/changeset/base/290725 Log: NTB: MFV 8b782fab: unify translation addresses There is no need for the upstream and downstream addresses to be different for the NTB configs. Go to using a single set of address. It is still possible to configure them differently using module parameter override however (CEM: tunable). Authored by: Dave Jiang Reviewed by: Allen Hubbe Reviewed by: Jon Mason Obtained from: Linux (Dual BSD/GPL driver) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_regs.h Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Nov 12 18:42:06 2015 (r290724) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Nov 12 19:07:03 2015 (r290725) @@ -415,19 +415,19 @@ static const struct ntb_xlat_reg xeon_se }; static struct ntb_b2b_addr xeon_b2b_usd_addr = { - .bar0_addr = XEON_B2B_BAR0_USD_ADDR, - .bar2_addr64 = XEON_B2B_BAR2_USD_ADDR64, - .bar4_addr64 = XEON_B2B_BAR4_USD_ADDR64, - .bar4_addr32 = XEON_B2B_BAR4_USD_ADDR32, - .bar5_addr32 = XEON_B2B_BAR5_USD_ADDR32, + .bar0_addr = XEON_B2B_BAR0_ADDR, + .bar2_addr64 = XEON_B2B_BAR2_ADDR64, + .bar4_addr64 = XEON_B2B_BAR4_ADDR64, + .bar4_addr32 = XEON_B2B_BAR4_ADDR32, + .bar5_addr32 = XEON_B2B_BAR5_ADDR32, }; static struct ntb_b2b_addr xeon_b2b_dsd_addr = { - .bar0_addr = XEON_B2B_BAR0_DSD_ADDR, - .bar2_addr64 = XEON_B2B_BAR2_DSD_ADDR64, - .bar4_addr64 = XEON_B2B_BAR4_DSD_ADDR64, - .bar4_addr32 = XEON_B2B_BAR4_DSD_ADDR32, - .bar5_addr32 = XEON_B2B_BAR5_DSD_ADDR32, + .bar0_addr = XEON_B2B_BAR0_ADDR, + .bar2_addr64 = XEON_B2B_BAR2_ADDR64, + .bar4_addr64 = XEON_B2B_BAR4_ADDR64, + .bar4_addr32 = XEON_B2B_BAR4_ADDR32, + .bar5_addr32 = XEON_B2B_BAR5_ADDR32, }; SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW, 0, @@ -1346,18 +1346,18 @@ configure_atom_secondary_side_bars(struc if (ntb->dev_type == NTB_DEV_USD) { ntb_reg_write(8, ATOM_PBAR2XLAT_OFFSET, - XEON_B2B_BAR2_DSD_ADDR64); + XEON_B2B_BAR2_ADDR64); ntb_reg_write(8, ATOM_PBAR4XLAT_OFFSET, - XEON_B2B_BAR4_DSD_ADDR64); - ntb_reg_write(8, ATOM_MBAR23_OFFSET, XEON_B2B_BAR2_USD_ADDR64); - ntb_reg_write(8, ATOM_MBAR45_OFFSET, XEON_B2B_BAR4_USD_ADDR64); + XEON_B2B_BAR4_ADDR64); + ntb_reg_write(8, ATOM_MBAR23_OFFSET, XEON_B2B_BAR2_ADDR64); + ntb_reg_write(8, ATOM_MBAR45_OFFSET, XEON_B2B_BAR4_ADDR64); } else { ntb_reg_write(8, ATOM_PBAR2XLAT_OFFSET, - XEON_B2B_BAR2_USD_ADDR64); + XEON_B2B_BAR2_ADDR64); ntb_reg_write(8, ATOM_PBAR4XLAT_OFFSET, - XEON_B2B_BAR4_USD_ADDR64); - ntb_reg_write(8, ATOM_MBAR23_OFFSET, XEON_B2B_BAR2_DSD_ADDR64); - ntb_reg_write(8, ATOM_MBAR45_OFFSET, XEON_B2B_BAR4_DSD_ADDR64); + XEON_B2B_BAR4_ADDR64); + ntb_reg_write(8, ATOM_MBAR23_OFFSET, XEON_B2B_BAR2_ADDR64); + ntb_reg_write(8, ATOM_MBAR45_OFFSET, XEON_B2B_BAR4_ADDR64); } } Modified: head/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_regs.h Thu Nov 12 18:42:06 2015 (r290724) +++ head/sys/dev/ntb/ntb_hw/ntb_regs.h Thu Nov 12 19:07:03 2015 (r290725) @@ -154,16 +154,11 @@ #define ATOM_PPD_DEV_TYPE 0x1000 /* All addresses are in low 32-bit space so 32-bit BARs can function */ -#define XEON_B2B_BAR0_USD_ADDR 0x1000000000000000ull -#define XEON_B2B_BAR2_USD_ADDR64 0x2000000000000000ull -#define XEON_B2B_BAR4_USD_ADDR64 0x4000000000000000ull -#define XEON_B2B_BAR4_USD_ADDR32 0x20000000ull -#define XEON_B2B_BAR5_USD_ADDR32 0x40000000ull -#define XEON_B2B_BAR0_DSD_ADDR 0x9000000000000000ull -#define XEON_B2B_BAR2_DSD_ADDR64 0xa000000000000000ull -#define XEON_B2B_BAR4_DSD_ADDR64 0xc000000000000000ull -#define XEON_B2B_BAR4_DSD_ADDR32 0xa0000000ull -#define XEON_B2B_BAR5_DSD_ADDR32 0xc0000000ull +#define XEON_B2B_BAR0_ADDR 0x1000000000000000ull +#define XEON_B2B_BAR2_ADDR64 0x2000000000000000ull +#define XEON_B2B_BAR4_ADDR64 0x4000000000000000ull +#define XEON_B2B_BAR4_ADDR32 0x20000000ull +#define XEON_B2B_BAR5_ADDR32 0x40000000ull /* The peer ntb secondary config space is 32KB fixed size */ #define XEON_B2B_MIN_SIZE 0x8000 From owner-svn-src-all@freebsd.org Thu Nov 12 20:14:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D15A2D70B; Thu, 12 Nov 2015 20:14:26 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3A014ED; Thu, 12 Nov 2015 20:14:26 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACKEPCN056015; Thu, 12 Nov 2015 20:14:25 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACKEPOt056011; Thu, 12 Nov 2015 20:14:25 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201511122014.tACKEPOt056011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 12 Nov 2015 20:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290726 - in head/sys/arm/ti: . am335x omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 20:14:26 -0000 Author: gavin Date: Thu Nov 12 20:14:25 2015 New Revision: 290726 URL: https://svnweb.freebsd.org/changeset/base/290726 Log: Consistently capitalize "TI" as an abbreviation for Texas Instruments. Modified: head/sys/arm/ti/am335x/am335x_gpio.c head/sys/arm/ti/omap4/omap4_gpio.c head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/am335x/am335x_gpio.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_gpio.c Thu Nov 12 19:07:03 2015 (r290725) +++ head/sys/arm/ti/am335x/am335x_gpio.c Thu Nov 12 20:14:25 2015 (r290726) @@ -77,7 +77,7 @@ am335x_gpio_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "Ti AM335x General Purpose I/O (GPIO)"); + device_set_desc(dev, "TI AM335x General Purpose I/O (GPIO)"); return (0); } Modified: head/sys/arm/ti/omap4/omap4_gpio.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_gpio.c Thu Nov 12 19:07:03 2015 (r290725) +++ head/sys/arm/ti/omap4/omap4_gpio.c Thu Nov 12 20:14:25 2015 (r290726) @@ -68,7 +68,7 @@ omap4_gpio_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "Ti OMAP4 General Purpose I/O (GPIO)"); + device_set_desc(dev, "TI OMAP4 General Purpose I/O (GPIO)"); return (0); } Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Thu Nov 12 19:07:03 2015 (r290725) +++ head/sys/arm/ti/ti_i2c.c Thu Nov 12 20:14:25 2015 (r290726) @@ -495,7 +495,7 @@ ti_i2c_reset(struct ti_i2c_softc *sc, u_ break; #endif default: - panic("Unknown Ti SoC, unable to reset the i2c"); + panic("Unknown TI SoC, unable to reset the i2c"); } /* From owner-svn-src-all@freebsd.org Thu Nov 12 21:37:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB19A2D7E0; Thu, 12 Nov 2015 21:37:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99FB1A82; Thu, 12 Nov 2015 21:37:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACLbwXs079285; Thu, 12 Nov 2015 21:37:58 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACLbwuQ079284; Thu, 12 Nov 2015 21:37:58 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511122137.tACLbwuQ079284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 Nov 2015 21:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290727 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 21:38:00 -0000 Author: gonzo Date: Thu Nov 12 21:37:58 2015 New Revision: 290727 URL: https://svnweb.freebsd.org/changeset/base/290727 Log: Enable cloks for all USDHC interfaces, previous value was USDHC 1-3 + USBOH3 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 Thu Nov 12 20:14:25 2015 (r290726) +++ head/sys/arm/freescale/imx/imx6_ccm.c Thu Nov 12 21:37:58 2015 (r290727) @@ -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, 0x0ffc00c0); /* uarts, ssi, sdma */ - WR4(sc, CCM_CCGR6, 0x000000ff); /* usdhc 1-4 */ + WR4(sc, CCM_CCGR6, 0x000003ff); /* usdhc 1-4, usboh3 */ } static int From owner-svn-src-all@freebsd.org Thu Nov 12 22:01:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E596A2D722; Thu, 12 Nov 2015 22:01:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3492F1CCC; Thu, 12 Nov 2015 22:01:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACM10NT091550; Thu, 12 Nov 2015 22:01:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACM0xtq091540; Thu, 12 Nov 2015 22:00:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122200.tACM0xtq091540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290728 - in head/sys: amd64/include i386/include kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:01:01 -0000 Author: jhb Date: Thu Nov 12 22:00:59 2015 New Revision: 290728 URL: https://svnweb.freebsd.org/changeset/base/290728 Log: Export various helper variables describing the layout and size of certain kernel structures for use by debuggers. This mostly aids in examining cores from a kernel without debug symbols as a debugger can infer these values if debug symbols are available. One set of variables describes the layout of 'struct linker_file' to walk the list of loaded kernel modules. A second set of variables describes the layout of 'struct proc' and 'struct thread' to walk the list of processes in the kernel and the threads in each process. The 'pcb_size' variable is used to index into the stoppcbs[] array. The 'vm_maxuser_address' is used to distinguish kernel virtual addresses from user addresses. This doesn't have to be perfect, and 'vm_maxuser_address' is a cheap and simple way to differentiate kernel pointers from simple values like TIDs and PIDs. While here, annotate the fields in struct pcb used by kgdb on amd64 and i386 to note that their ABI should be preserved. Annotations for other platforms will be added in the future. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3773 Modified: head/sys/amd64/include/pcb.h head/sys/i386/include/pcb.h head/sys/kern/kern_linker.c head/sys/kern/kern_mib.c head/sys/kern/kern_proc.c head/sys/vm/vm_kern.c Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/amd64/include/pcb.h Thu Nov 12 22:00:59 2015 (r290728) @@ -44,15 +44,19 @@ #include #ifdef __amd64__ +/* + * NB: The fields marked with (*) are used by kernel debuggers. Their + * ABI should be preserved. + */ struct pcb { - register_t pcb_r15; - register_t pcb_r14; - register_t pcb_r13; - register_t pcb_r12; - register_t pcb_rbp; - register_t pcb_rsp; - register_t pcb_rbx; - register_t pcb_rip; + register_t pcb_r15; /* (*) */ + register_t pcb_r14; /* (*) */ + register_t pcb_r13; /* (*) */ + register_t pcb_r12; /* (*) */ + register_t pcb_rbp; /* (*) */ + register_t pcb_rsp; /* (*) */ + register_t pcb_rbx; /* (*) */ + register_t pcb_rip; /* (*) */ register_t pcb_fsbase; register_t pcb_gsbase; register_t pcb_kgsbase; Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/i386/include/pcb.h Thu Nov 12 22:00:59 2015 (r290728) @@ -44,13 +44,17 @@ #endif #include +/* + * NB: The fields marked with (*) are used by kernel debuggers. Their + * ABI should be preserved. + */ struct pcb { - int pcb_edi; - int pcb_esi; - int pcb_ebp; - int pcb_esp; - int pcb_ebx; - int pcb_eip; + int pcb_edi; /* (*) */ + int pcb_esi; /* (*) */ + int pcb_ebp; /* (*) */ + int pcb_esp; /* (*) */ + int pcb_ebx; /* (*) */ + int pcb_eip; /* (*) */ struct segment_descriptor pcb_fsd; struct segment_descriptor pcb_gsd; int pcb_ds; Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/kern/kern_linker.c Thu Nov 12 22:00:59 2015 (r290728) @@ -70,6 +70,12 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, &kld_debug, 0, "Set various levels of KLD debug"); #endif +/* These variables are used by kernel debuggers to enumerate loaded files. */ +const int kld_off_address = offsetof(struct linker_file, address); +const int kld_off_filename = offsetof(struct linker_file, filename); +const int kld_off_pathname = offsetof(struct linker_file, pathname); +const int kld_off_next = offsetof(struct linker_file, link.tqe_next); + /* * static char *linker_search_path(const char *name, struct mod_depend * *verinfo); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/kern/kern_mib.c Thu Nov 12 22:00:59 2015 (r290728) @@ -580,6 +580,11 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, SYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)"); +/* Used by kernel debuggers. */ +const int pcb_size = sizeof(struct pcb); +SYSCTL_INT(_debug_sizeof, OID_AUTO, pcb, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, sizeof(struct pcb), "sizeof(struct pcb)"); + /* XXX compatibility, remove for 6.0 */ #include #include Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/kern/kern_proc.c Thu Nov 12 22:00:59 2015 (r290728) @@ -139,6 +139,21 @@ struct sx proctree_lock; struct mtx ppeers_lock; uma_zone_t proc_zone; +/* + * The offset of various fields in struct proc and struct thread. + * These are used by kernel debuggers to enumerate kernel threads and + * processes. + */ +const int proc_off_p_pid = offsetof(struct proc, p_pid); +const int proc_off_p_comm = offsetof(struct proc, p_comm); +const int proc_off_p_list = offsetof(struct proc, p_list); +const int proc_off_p_threads = offsetof(struct proc, p_threads); +const int thread_off_td_tid = offsetof(struct thread, td_tid); +const int thread_off_td_name = offsetof(struct thread, td_name); +const int thread_off_td_oncpu = offsetof(struct thread, td_oncpu); +const int thread_off_td_pcb = offsetof(struct thread, td_pcb); +const int thread_off_td_plist = offsetof(struct thread, td_plist); + int kstack_pages = KSTACK_PAGES; SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "Kernel stack size in pages"); Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Thu Nov 12 21:37:58 2015 (r290727) +++ head/sys/vm/vm_kern.c Thu Nov 12 22:00:59 2015 (r290728) @@ -94,6 +94,9 @@ vm_map_t pipe_map; const void *zero_region; CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0); +/* NB: Used by kernel debuggers. */ +const u_long vm_maxuser_address = VM_MAXUSER_ADDRESS; + SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); From owner-svn-src-all@freebsd.org Thu Nov 12 22:09:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5769A2D861 for ; Thu, 12 Nov 2015 22:09:02 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::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 772651097 for ; Thu, 12 Nov 2015 22:09:02 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pasz6 with SMTP id z6so80216293pas.2 for ; Thu, 12 Nov 2015 14:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=yfTalw5nwtxavZzePcjHgC4dB6+dATuvWRN/GNNyAoU=; b=BS3ElNVJrN+ErB6U/esIggKP+EUBteEJGItRo1STyUa7OJszvz0zhP8CfBQPN5Vppf e0U6XYVr+f7ESThv3jz0zqna2CBlXf3sebL2cDOKPlYpcT3e1Dn6pDv5zxfB8aqRt681 Xl3LSdIhYbXqfbRZJ5GYpg8wuXO2M2UGdnUig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=yfTalw5nwtxavZzePcjHgC4dB6+dATuvWRN/GNNyAoU=; b=Ka0Ii2iDHAhxqR8Jq2J3UEZem/3b+fSbZgX9AuO3hA2ofwLMOks0JkqJXNU7cCzBjC ThRwSH0s9YTbLLwqiVTJ9s3zW8Qu84ZF1JBhk6T61StTPhe4mKMOnMqcGF8EcvFg+9eL yMHFQSddjiUOFDq5c72oxD8HMgUQs/zmqUsSoKkjXvrqXczqIH34ebHqxIKOA6vzZbJ5 QFq7ZE694r6Nq38ewS+lniwjMJYLOp6OkZIt0fnoN5XufzxngTuOvbLS0ZS17tdgclCm YO8OmoH3rxm7x5ElT6ritE4ave5CM29+//nqH0Me6eezwMbUIJIV9GJEwxptqSPROAYj 5elQ== X-Gm-Message-State: ALoCoQmdFUD9uzgqpj+fnaGLzvpr6nd9tv05BgervrTYeXuVK/4uvIAF3guMZYwU2jeD25ll0QYW X-Received: by 10.68.139.131 with SMTP id qy3mr26417151pbb.83.1447366141763; Thu, 12 Nov 2015 14:09:01 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id c1sm5460946pap.36.2015.11.12.14.08.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Nov 2015 14:09:00 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290714 - in head/sys/tests: callout_test framework From: Randall Stewart In-Reply-To: <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> Date: Thu, 12 Nov 2015 17:09:00 -0500 Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <9CFD2F6C-B344-46E1-BB5B-E6D6CE075EEB@netflix.com> References: <201511121031.tACAVEMb079802@repo.freebsd.org> <71CD11C2-1A0F-48B3-B9A9-B025676A887C@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:09:02 -0000 I thought Kib fixed that.. I was looking at it this AM and found he had = beat me too it.. R On Nov 12, 2015, at 12:01 PM, Bjoern A. Zeeb wrote: >=20 >> On 12 Nov 2015, at 10:31 , Randall Stewart wrote: >>=20 >> Author: rrs >> Date: Thu Nov 12 10:31:14 2015 >> New Revision: 290714 >> URL: https://svnweb.freebsd.org/changeset/base/290714 >>=20 >> Log: >> Style 9 changes. >> MFC after: 1 Month >>=20 >> Modified: >> head/sys/tests/callout_test/callout_test.c >> head/sys/tests/framework/kern_testfrwk.c >=20 >=20 > I am just replying to the last commit given despite the efforts of = people it still fails on PC98: >=20 > = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test/../../../tests/cal= lout_test/callout_test.c:52:9: error: 'cpu_spinwait' macro redefined = [-Werror,-Wmacro-redefined] > #define cpu_spinwait() > ^ > ./i386/cpu.h:50:9: note: previous definition is here > #define cpu_spinwait() ia32_pause() > ^ > 1 error generated. > --- callout_test.o --- > *** [callout_test.o] Error code 1 >=20 > bmake: stopped in = /scratch/tmp/bz/head.svn/sys/modules/tests/callout_test >=20 >=20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Thu Nov 12 22:24:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C104A2DCD8; Thu, 12 Nov 2015 22:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 345A61BB6; Thu, 12 Nov 2015 22:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACMOdhD000322; Thu, 12 Nov 2015 22:24:39 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMOdUc000321; Thu, 12 Nov 2015 22:24:39 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511122224.tACMOdUc000321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 12 Nov 2015 22:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290729 - head/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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:24:40 -0000 Author: ache Date: Thu Nov 12 22:24:39 2015 New Revision: 290729 URL: https://svnweb.freebsd.org/changeset/base/290729 Log: 1) Remove my overcomplicated error fallback and just return error immediatelly as old code does, now for append modes too. Real use case for such fallback is impossible (unless specially crafted). 2) Remove now unneded include I forgot to remove in prev. commits. MFC after: 1 week Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Thu Nov 12 22:00:59 2015 (r290728) +++ head/lib/libc/stdio/ftell.c Thu Nov 12 22:24:39 2015 (r290729) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include -#include #include #include #include "un-namespace.h" @@ -101,16 +100,9 @@ _ftello(FILE *fp, fpos_t *offset) if (!(fp->_flags & __SRD) && (fp->_flags & __SWR) && fp->_p != NULL && fp->_p - fp->_bf._base > 0 && ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP))) { - if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { - if (errno == ESPIPE || - (fp->_flags & __SOPT) || __sflush(fp) || - (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) - return (1); - else { - *offset = pos; - return (0); - } - } + pos = _sseek(fp, (fpos_t)0, SEEK_END); + if (pos == -1) + return (1); } else if (fp->_flags & __SOFF) pos = fp->_offset; else { From owner-svn-src-all@freebsd.org Thu Nov 12 22:45:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C39A2E15D; Thu, 12 Nov 2015 22:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3BA5180A; Thu, 12 Nov 2015 22:45:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACMjp9e006161; Thu, 12 Nov 2015 22:45:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMjpj8006159; Thu, 12 Nov 2015 22:45:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122245.tACMjpj8006159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290730 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:45:53 -0000 Author: jhb Date: Thu Nov 12 22:45:51 2015 New Revision: 290730 URL: https://svnweb.freebsd.org/changeset/base/290730 Log: MFC 285773,285775,285776: Various fixes for stack unwinding in DDB on x86. 285773: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. 285775: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. 285776: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/i386/i386/db_trace.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/i386/i386/db_trace.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -188,9 +151,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +159,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -357,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -384,17 +294,13 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -418,48 +324,51 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; - } - - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); } - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +382,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { @@ -495,17 +404,19 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: stable/10/sys/i386/i386/db_trace.c ============================================================================== --- stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -390,7 +390,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -447,7 +447,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -475,7 +489,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -522,17 +535,19 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-all@freebsd.org Thu Nov 12 22:45:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45314A2E162; Thu, 12 Nov 2015 22:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224D3180C; Thu, 12 Nov 2015 22:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACMjqYi006168; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMjqkV006166; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122245.tACMjqkV006166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290730 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:45:53 -0000 Author: jhb Date: Thu Nov 12 22:45:51 2015 New Revision: 290730 URL: https://svnweb.freebsd.org/changeset/base/290730 Log: MFC 285773,285775,285776: Various fixes for stack unwinding in DDB on x86. 285773: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. 285775: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. 285776: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/i386/i386/db_trace.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/i386/i386/db_trace.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -188,9 +151,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +159,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -357,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -384,17 +294,13 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -418,48 +324,51 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; - } - - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); } - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +382,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { @@ -495,17 +404,19 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -390,7 +390,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -447,7 +447,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -475,7 +489,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -522,17 +535,19 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-all@freebsd.org Thu Nov 12 23:01:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 922D9A2E4F8; Thu, 12 Nov 2015 23:01:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7701410FC; Thu, 12 Nov 2015 23:01:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6F1471283; Thu, 12 Nov 2015 23:01:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 23B7C14EF2; Thu, 12 Nov 2015 23:01:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id QB1mbB88lhes; Thu, 12 Nov 2015 23:01:27 +0000 (UTC) Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 017C214EEA To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201510261621.t9QGLuL2028872@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56451A45.40605@FreeBSD.org> Date: Thu, 12 Nov 2015 15:01:25 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510261621.t9QGLuL2028872@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:01:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/26/2015 9:21 AM, Eric van Gyzen wrote: > Author: vangyzen > Date: Mon Oct 26 16:21:56 2015 > New Revision: 290014 > URL: https://svnweb.freebsd.org/changeset/base/290014 >=20 > Log: > Disable SSE in libthr Please also mention 'MFC rREV'. Thanks! --=20 Regards, Bryan Drewery --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRRpFAAoJEDXXcbtuRpfPn6AIAJl7iSmKfDHJTvBIW+HhtmhM 0OXAt1ZALbu8Bv3z5zjEEIbW9EQPbEPFiuJZlFB2vbhHo6PWHAisC7/qrlwqt3As UE6JfgX+sO9QxJPGL94zHF7C0RkEw55zHWmc4ohqEJOkmXw24AsSjagxU1MZfMT0 SV052RptKfNw2sTlhEh0Lmw/LfjbcKamyYcxcAQZBRYwgHULNTnHdgHMkXd9Fh3D ZZEhtr5+LQF6gAP1S9DxHhG5Qh50u+zZPb9a1VEbTl2e0kPIn2L2vvKpJ2SsCnlu uSYso4kv0dXcTvoac3wzTgqBoGVRLZbtfBlr5qhGL/LPWsXqhIf/HmPSbK3uYSQ= =ug/I -----END PGP SIGNATURE----- --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9-- From owner-svn-src-all@freebsd.org Thu Nov 12 23:49:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D31EA2EB53; Thu, 12 Nov 2015 23:49:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 591C5180A; Thu, 12 Nov 2015 23:49:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACNnmU9024377; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACNnl3u024372; Thu, 12 Nov 2015 23:49:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122349.tACNnl3u024372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 23:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290731 - in stable: 10/sys/amd64/amd64 10/sys/ddb 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/ddb 9/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:49:49 -0000 Author: jhb Date: Thu Nov 12 23:49:47 2015 New Revision: 290731 URL: https://svnweb.freebsd.org/changeset/base/290731 Log: MFC 285783: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/ddb/db_print.c stable/10/sys/i386/i386/db_trace.c stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/ddb/db_print.c stable/9/sys/i386/i386/db_trace.c stable/9/sys/i386/i386/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/amd64/amd64/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1238,11 +1238,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: stable/10/sys/ddb/db_print.c ============================================================================== --- stable/10/sys/ddb/db_print.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/ddb/db_print.c Thu Nov 12 23:49:47 2015 (r290731) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, boolean_t _2, for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: stable/10/sys/i386/i386/db_trace.c ============================================================================== --- stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/i386/i386/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/i386/i386/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -2043,6 +2043,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-all@freebsd.org Thu Nov 12 23:49:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 331A8A2EB58; Thu, 12 Nov 2015 23:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E32180B; Thu, 12 Nov 2015 23:49:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACNnmcJ024387; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACNnmBo024382; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122349.tACNnmBo024382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 23:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290731 - in stable: 10/sys/amd64/amd64 10/sys/ddb 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/ddb 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:49:50 -0000 Author: jhb Date: Thu Nov 12 23:49:47 2015 New Revision: 290731 URL: https://svnweb.freebsd.org/changeset/base/290731 Log: MFC 285783: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/ddb/db_print.c stable/9/sys/i386/i386/db_trace.c stable/9/sys/i386/i386/machdep.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/ddb/db_print.c stable/10/sys/i386/i386/db_trace.c stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: stable/9/sys/amd64/amd64/machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1215,11 +1215,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: stable/9/sys/ddb/db_print.c ============================================================================== --- stable/9/sys/ddb/db_print.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/ddb/db_print.c Thu Nov 12 23:49:47 2015 (r290731) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, boolean_t _2, for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1962,6 +1962,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-all@freebsd.org Fri Nov 13 00:47:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C35DA2C5EF; Fri, 13 Nov 2015 00:47:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6D118A7; Fri, 13 Nov 2015 00:47:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0lj11050558; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0ljtZ050556; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130047.tAD0ljtZ050556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290733 - in stable/9/sys/i386: i386 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:47:46 -0000 Author: jhb Date: Fri Nov 13 00:47:44 2015 New Revision: 290733 URL: https://svnweb.freebsd.org/changeset/base/290733 Log: Fix i386 build. stable/9 does not have XSAVE support. Pointy hat to: jhb Modified: stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/specialreg.h Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) @@ -1962,8 +1962,6 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); - if (rcr4() & CR4_XSAVE) - db_printf("xcr0\t0x%016llx\n", rxcr(0)); if (amd_feature & (AMDID_NX | AMDID_LM)) db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:47:44 2015 (r290733) @@ -281,6 +281,7 @@ #define MSR_APICBASE 0x01b #define MSR_EBL_CR_POWERON 0x02a #define MSR_TEST_CTL 0x033 +#define MSR_IA32_FEATURE_CONTROL 0x03a #define MSR_BIOS_UPDT_TRIG 0x079 #define MSR_BBL_CR_D0 0x088 #define MSR_BBL_CR_D1 0x089 From owner-svn-src-all@freebsd.org Fri Nov 13 00:48:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F94A2C660; Fri, 13 Nov 2015 00:48:35 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.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 665331A4E; Fri, 13 Nov 2015 00:48:35 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by qkao63 with SMTP id o63so33015869qka.2; Thu, 12 Nov 2015 16:48:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=5/GyjqYe++CQHzbPgWl5vPG2ACrABeOwQXSoAQc8hmQ=; b=T5bJgbf+L+4+UgzelArbM+rm4mosTV6Z7tg0/KdKoQAKE8jdpLKAUilzYKeVi58ieS FZYax4pPueQad7Mu19pSz+olErp4T6M1h7epV4mW6bv8opUR5QtNv7PpS//PeNmeveur G/2QqMZMnqGJ7D7Y4tCc2jM/qGQXxAjoCNUDCwyEmLv3sby9czASheT0VPQP6IMiJ9C2 +LDHD06zPodEGYHlobKUZPcQRB6LXbGmT+HVRYAagEaTmOBGF9aR6e6Mm7UWMbfkyq4v iTD/n1+C9VrdJkuRvvX0/QGgxggYzftGj0ypPXhKBbFPUsry/b6FD5+O1NJvVJ3OQ/UA DE9g== X-Received: by 10.140.82.213 with SMTP id h79mr19521119qgd.26.1447375356944; Thu, 12 Nov 2015 16:42:36 -0800 (PST) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com. [209.85.220.173]) by smtp.gmail.com with ESMTPSA id w18sm4722117qgw.1.2015.11.12.16.42.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 16:42:36 -0800 (PST) Received: by qkfo3 with SMTP id o3so32876284qkf.1; Thu, 12 Nov 2015 16:42:36 -0800 (PST) X-Received: by 10.55.77.71 with SMTP id a68mr19173952qkb.106.1447375356436; Thu, 12 Nov 2015 16:42:36 -0800 (PST) MIME-Version: 1.0 References: <201511120945.tAC9jZZk067057@repo.freebsd.org> In-Reply-To: <201511120945.tAC9jZZk067057@repo.freebsd.org> From: Eric Joyner Date: Fri, 13 Nov 2015 00:42:26 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r290708 - head/sys/dev/ixl To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:48:35 -0000 I guess r280043 got overwritten at some point? - Eric On Thu, Nov 12, 2015 at 1:45 AM Steven Hartland wrote: > Author: smh > Date: Thu Nov 12 09:45:35 2015 > New Revision: 290708 > URL: https://svnweb.freebsd.org/changeset/base/290708 > > Log: > Fix ixl debug sysctls panic > > Remove the use of sbuf_data on drained sbufs from the debug sysctls: > * ixl_sysctl_hw_res_alloc > * ixl_sysctl_switch_config > > This prevents a kernel panic when accessing these values under a kernel > compiled with INVARIANTS. > > Sponsored by: Multiplay > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:20:10 2015 (r290707) > +++ head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:45:35 2015 (r290708) > @@ -5119,17 +5119,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A > } > > error = sbuf_finish(buf); > - if (error) { > - device_printf(dev, "Error finishing sbuf: %d\n", error); > - sbuf_delete(buf); > - return error; > - } > - > - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), > req); > - if (error) > - device_printf(dev, "sysctl error: %d\n", error); > sbuf_delete(buf); > - return error; > + > + return (error); > } > > /* > @@ -5236,15 +5228,6 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ > sbuf_delete(nmbuf); > > error = sbuf_finish(buf); > - if (error) { > - device_printf(dev, "Error finishing sbuf: %d\n", error); > - sbuf_delete(buf); > - return error; > - } > - > - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), > req); > - if (error) > - device_printf(dev, "sysctl error: %d\n", error); > sbuf_delete(buf); > > return (error); > > From owner-svn-src-all@freebsd.org Fri Nov 13 00:50:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205D8A2C6EF; Fri, 13 Nov 2015 00:50:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E50961BFF; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0oZNw053105; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0oZj4053101; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130050.tAD0oZj4053101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290734 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:50:37 -0000 Author: jhb Date: Fri Nov 13 00:50:34 2015 New Revision: 290734 URL: https://svnweb.freebsd.org/changeset/base/290734 Log: MFC 284325: Report the values of x86 segment registers to remote debuggers. While here, also report %eflags from the i386 trapframe. Modified: stable/9/sys/amd64/amd64/gdb_machdep.c stable/9/sys/i386/i386/gdb_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/gdb_machdep.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/gdb_machdep.c stable/10/sys/i386/i386/gdb_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/include/gdb_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); @@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); + case 18: return (&_kcodesel); + case 19: return (&_kdatasel); } return (NULL); } Modified: stable/9/sys/i386/i386/gdb_machdep.c ============================================================================== --- stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); + static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == curthread) { + if (kdb_thread == curthread) { switch (regnum) { case 0: return (&kdb_frame->tf_eax); case 1: return (&kdb_frame->tf_ecx); case 2: return (&kdb_frame->tf_edx); + case 9: return (&kdb_frame->tf_eflags); + case 10: return (&kdb_frame->tf_cs); + case 12: return (&kdb_frame->tf_ds); + case 13: return (&kdb_frame->tf_es); + case 14: return (&kdb_frame->tf_fs); } } switch (regnum) { @@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 6: return (&kdb_thrctx->pcb_esi); case 7: return (&kdb_thrctx->pcb_edi); case 8: return (&kdb_thrctx->pcb_eip); + case 10: return (&_kcodesel); + case 11: return (&_kdatasel); + case 12: return (&_kdatasel); + case 13: return (&_kdatasel); + case 14: return (&_kprivsel); + case 15: return (&kdb_thrctx->pcb_gs); } return (NULL); } Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -3172,6 +3172,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_ebx = tf->tf_ebx; pcb->pcb_eip = tf->tf_eip; pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; + pcb->pcb_gs = rgs(); } int Modified: stable/9/sys/i386/include/gdb_machdep.h ============================================================================== --- stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:50:34 2015 (r290734) @@ -30,7 +30,7 @@ #define _MACHINE_GDB_MACHDEP_H_ #define GDB_BUFSZ 400 -#define GDB_NREGS 14 +#define GDB_NREGS 16 #define GDB_REG_PC 8 static __inline size_t From owner-svn-src-all@freebsd.org Fri Nov 13 00:50:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749F4A2C6EB; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0F71BFD; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0oZgn053091; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0oZuX053082; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130050.tAD0oZuX053082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290734 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:50:36 -0000 Author: jhb Date: Fri Nov 13 00:50:34 2015 New Revision: 290734 URL: https://svnweb.freebsd.org/changeset/base/290734 Log: MFC 284325: Report the values of x86 segment registers to remote debuggers. While here, also report %eflags from the i386 trapframe. Modified: stable/10/sys/amd64/amd64/gdb_machdep.c stable/10/sys/i386/i386/gdb_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/include/gdb_machdep.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/gdb_machdep.c stable/9/sys/i386/i386/gdb_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/gdb_machdep.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); @@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); + case 18: return (&_kcodesel); + case 19: return (&_kdatasel); } return (NULL); } Modified: stable/10/sys/i386/i386/gdb_machdep.c ============================================================================== --- stable/10/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); + static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == curthread) { + if (kdb_thread == curthread) { switch (regnum) { case 0: return (&kdb_frame->tf_eax); case 1: return (&kdb_frame->tf_ecx); case 2: return (&kdb_frame->tf_edx); + case 9: return (&kdb_frame->tf_eflags); + case 10: return (&kdb_frame->tf_cs); + case 12: return (&kdb_frame->tf_ds); + case 13: return (&kdb_frame->tf_es); + case 14: return (&kdb_frame->tf_fs); } } switch (regnum) { @@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 6: return (&kdb_thrctx->pcb_esi); case 7: return (&kdb_thrctx->pcb_edi); case 8: return (&kdb_thrctx->pcb_eip); + case 10: return (&_kcodesel); + case 11: return (&_kdatasel); + case 12: return (&_kdatasel); + case 13: return (&_kdatasel); + case 14: return (&_kprivsel); + case 15: return (&kdb_thrctx->pcb_gs); } return (NULL); } Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/i386/machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -3616,6 +3616,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_ebx = tf->tf_ebx; pcb->pcb_eip = tf->tf_eip; pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; + pcb->pcb_gs = rgs(); } int Modified: stable/10/sys/i386/include/gdb_machdep.h ============================================================================== --- stable/10/sys/i386/include/gdb_machdep.h Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/include/gdb_machdep.h Fri Nov 13 00:50:34 2015 (r290734) @@ -30,7 +30,7 @@ #define _MACHINE_GDB_MACHDEP_H_ #define GDB_BUFSZ 400 -#define GDB_NREGS 14 +#define GDB_NREGS 16 #define GDB_REG_PC 8 static __inline size_t From owner-svn-src-all@freebsd.org Fri Nov 13 01:01:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8022FA2C902; Fri, 13 Nov 2015 01:01:17 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7BA1165; Fri, 13 Nov 2015 01:01:17 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD11GQ2057796; Fri, 13 Nov 2015 01:01:16 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD11Gr1057794; Fri, 13 Nov 2015 01:01:16 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511130101.tAD11Gr1057794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 13 Nov 2015 01:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290735 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:01:17 -0000 Author: smh Date: Fri Nov 13 01:01:16 2015 New Revision: 290735 URL: https://svnweb.freebsd.org/changeset/base/290735 Log: MFC r290440: Correct posix_openpt reference in pty(3) Sponsored by: Multiplay Modified: stable/10/lib/libutil/pty.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/pty.3 ============================================================================== --- stable/10/lib/libutil/pty.3 Fri Nov 13 00:50:34 2015 (r290734) +++ stable/10/lib/libutil/pty.3 Fri Nov 13 01:01:16 2015 (r290735) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd December 29, 1996 +.Dd November 11, 2015 .Dt PTY 3 .Os .Sh NAME @@ -120,7 +120,7 @@ function may fail and set the global var .Dv errno for any of the errors specified for the .Xr grantpt 3 , -.Xr posix_openpt 3 , +.Xr posix_openpt 2 , .Xr ptsname 3 , and .Xr unlockpt 3 From owner-svn-src-all@freebsd.org Fri Nov 13 01:04:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67311A2CADE; Fri, 13 Nov 2015 01:04:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE6215CE; Fri, 13 Nov 2015 01:04:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD140qS058995; Fri, 13 Nov 2015 01:04:00 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD140e7058989; Fri, 13 Nov 2015 01:04:00 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511130104.tAD140e7058989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 13 Nov 2015 01:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290736 - in stable/10: sbin/ifconfig share/man/man4 sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:04:01 -0000 Author: smh Date: Fri Nov 13 01:03:59 2015 New Revision: 290736 URL: https://svnweb.freebsd.org/changeset/base/290736 Log: MFC r290450: Add sysctl to control LACP strict compliance default Sponsored by: Multiplay Modified: stable/10/sbin/ifconfig/ifconfig.8 stable/10/share/man/man4/lagg.4 stable/10/sys/net/ieee8023ad_lacp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.8 Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/sbin/ifconfig/ifconfig.8 Fri Nov 13 01:03:59 2015 (r290736) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 12, 2015 +.Dd November 6, 2015 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2449,6 +2449,21 @@ which are shifted by the number of this Enable lacp fast-timeout on the interface. .It Cm -lacp_fast_timeout Disable lacp fast-timeout on the interface. +.It Cm lacp_strict +Enable lacp strict compliance on the interface. +The default value can be set via the +.Va net.link.lagg.lacp.default_strict_mode +.Xr sysctl 8 +variable. +.Li 0 +means +.Dq disabled +and +.Li 1 +means +.Dq enabled . +.It Cm -lacp_strict +Disable lacp strict compliance on the interface. .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/10/share/man/man4/lagg.4 ============================================================================== --- stable/10/share/man/man4/lagg.4 Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/share/man/man4/lagg.4 Fri Nov 13 01:03:59 2015 (r290736) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2014 +.Dd November 6, 2015 .Dt LAGG 4 .Os .Sh NAME @@ -156,6 +156,7 @@ Gigabit Ethernet interfaces: .Bd -literal -offset indent # ifconfig bge0 up # ifconfig bge1 up +# ifconfig lagg0 create # ifconfig lagg0 laggproto lacp laggport bge0 laggport bge1 \e 192.168.1.1 netmask 255.255.255.0 .Ed @@ -168,6 +169,7 @@ device will be used: # ifconfig em0 up # ifconfig ath0 ether 00:11:22:33:44:55 # ifconfig create wlan0 wlandev ath0 ssid my_net up +# ifconfig lagg0 create # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/sys/net/ieee8023ad_lacp.c Fri Nov 13 01:03:59 2015 (r290736) @@ -193,6 +193,11 @@ SYSCTL_NODE(_net_link_lagg, OID_AUTO, la SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)"); +static VNET_DEFINE(int, lacp_default_strict_mode) = 1; +SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, default_strict_mode, CTLFLAG_RWTUN, + &VNET_NAME(lacp_default_strict_mode), 0, + "LACP strict protocol compliance default"); + #define LACP_DPRINTF(a) if (V_lacp_debug & 0x01) { lacp_dprintf a ; } #define LACP_TRACE(a) if (V_lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } #define LACP_TPRINTF(a) if (V_lacp_debug & 0x04) { lacp_dprintf a ; } @@ -765,7 +770,7 @@ lacp_attach(struct lagg_softc *sc) lsc->lsc_hashkey = arc4random(); lsc->lsc_active_aggregator = NULL; - lsc->lsc_strict_mode = 1; + lsc->lsc_strict_mode = VNET(lacp_default_strict_mode); LACP_LOCK_INIT(lsc); TAILQ_INIT(&lsc->lsc_aggregators); LIST_INIT(&lsc->lsc_ports); @@ -1703,7 +1708,7 @@ lacp_sm_rx_record_default(struct lacp_po if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner = lacp_partner_admin_strict; else - lp->lp_partner = lacp_partner_admin_optimistic;; + lp->lp_partner = lacp_partner_admin_optimistic; lp->lp_state |= LACP_STATE_DEFAULTED; lacp_sm_ptx_update_timeout(lp, oldpstate); } From owner-svn-src-all@freebsd.org Fri Nov 13 01:11:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D02DA2CDC0 for ; Fri, 13 Nov 2015 01:11:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 DF0841A2F for ; Fri, 13 Nov 2015 01:11:28 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmdw130 with SMTP id w130so10118529wmd.0 for ; Thu, 12 Nov 2015 17:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay_co_uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=12wpQ+cgJKaazQMoiqSOyHicXPjWKJuQmKPtPcvChb4=; b=0khGN1OYfiVJpJuz2thjXwbjl0pKr24h28/vtELn5BTwoJxUapeqq8lJNS+YO2ks2p BFk+fEhZAcIIZRad1E1G1XSeofYIODzF2S0xXAOiQ3WbXZl2iK3+A/XNZO7doD1NGaMk WTFnYZ6JDInnjrccxka3Je8R5FhyftCD63XiYzd9vHXstZlDfPdseDc+K58kvgruGi38 scSf7+iWgbP3NhBmFCG9DOMOIesZBcZIFwdnX8bpYVO4ApeZm32QhDiXmQY1xgTdQIzX Ls/CvhB3e1eYpwb5PrNB7HPzvUCX/Ngb1zACMPwK1qiS5ccXw8tkOJzxLVPFoujRVavV EW+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=12wpQ+cgJKaazQMoiqSOyHicXPjWKJuQmKPtPcvChb4=; b=jSIAoGUIepv2TxOr36x2y+O+mhYPwzQt0CRY4sFzgwJMkfHera6nD4rO+uduom4PSh sFEZHnGbu2a7zs7xO5MLIpWni1bb7fyijBwAC66nwiF9j4MxzzMXZBrm7udvIrIk8mMA v9gGH7Zgm2evrflds1PPv6QUOdlucrGosHVXYFbgf+bjN0MALTqgFmy4umXm/eLPWu5R Y+0zbd+wNZwKH2DsERO2rD1vJCL4DkPYdKe42hGlcCQy44JFyYf/tfatQBTsQmIdnRly 0tpwzZl0KyZqCIj6hXrj3G3Z8gFVTxivFpwzrLsL75B5t+tmSbb+MJtXDRWkP+QJsfs2 pkHA== X-Gm-Message-State: ALoCoQlDocVEyk3jYfM6JOdXGGkRyk/EMUgZ5epmizk24eu1wxC/ySTF8qdZxcD5xhrqaEaI+SYR X-Received: by 10.194.209.195 with SMTP id mo3mr18623832wjc.16.1447377086979; Thu, 12 Nov 2015 17:11:26 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id he3sm17189970wjc.48.2015.11.12.17.11.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Nov 2015 17:11:25 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r290708 - head/sys/dev/ixl To: Eric Joyner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511120945.tAC9jZZk067057@repo.freebsd.org> Message-ID: <564538CA.6020708@freebsd.org> Date: Fri, 13 Nov 2015 01:11:38 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:11:29 -0000 Oh gosh yes, looks like this was lost by r284049 :( I'm guessing that's one of the reasons for r290717 which should help ensure changes get merged into Intel's upstream repo and hence don't get lost. On 13/11/2015 00:42, Eric Joyner wrote: > I guess r280043 got overwritten at some point? > > - Eric > > On Thu, Nov 12, 2015 at 1:45 AM Steven Hartland > wrote: > > Author: smh > Date: Thu Nov 12 09:45:35 2015 > New Revision: 290708 > URL: https://svnweb.freebsd.org/changeset/base/290708 > > Log: > Fix ixl debug sysctls panic > > Remove the use of sbuf_data on drained sbufs from the debug sysctls: > * ixl_sysctl_hw_res_alloc > * ixl_sysctl_switch_config > > This prevents a kernel panic when accessing these values under a > kernel > compiled with INVARIANTS. > > Sponsored by: Multiplay > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:20:10 2015 > (r290707) > +++ head/sys/dev/ixl/if_ixl.c Thu Nov 12 09:45:35 2015 > (r290708) > @@ -5119,17 +5119,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A > } > > error = sbuf_finish(buf); > - if (error) { > - device_printf(dev, "Error finishing sbuf: %d\n", > error); > - sbuf_delete(buf); > - return error; > - } > - > - error = sysctl_handle_string(oidp, sbuf_data(buf), > sbuf_len(buf), req); > - if (error) > - device_printf(dev, "sysctl error: %d\n", error); > sbuf_delete(buf); > - return error; > + > + return (error); > } > > /* > @@ -5236,15 +5228,6 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ > sbuf_delete(nmbuf); > > error = sbuf_finish(buf); > - if (error) { > - device_printf(dev, "Error finishing sbuf: %d\n", > error); > - sbuf_delete(buf); > - return error; > - } > - > - error = sysctl_handle_string(oidp, sbuf_data(buf), > sbuf_len(buf), req); > - if (error) > - device_printf(dev, "sysctl error: %d\n", error); > sbuf_delete(buf); > > return (error); > From owner-svn-src-all@freebsd.org Fri Nov 13 01:25:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C80DAA2D1CA; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9522B12A2; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1P2Zh068036; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1P2kH068035; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130125.tAD1P2kH068035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290737 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:25:03 -0000 Author: markj Date: Fri Nov 13 01:25:02 2015 New Revision: 290737 URL: https://svnweb.freebsd.org/changeset/base/290737 Log: MFC r290320: Have elf_lookup() return an error if the specified non-weak symbol could not be found. Otherwise, relocations against such symbols will be silently ignored instead of causing an error to be raised. Modified: stable/10/sys/kern/link_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/link_elf.c ============================================================================== --- stable/10/sys/kern/link_elf.c Fri Nov 13 01:03:59 2015 (r290736) +++ stable/10/sys/kern/link_elf.c Fri Nov 13 01:25:02 2015 (r290737) @@ -1544,6 +1544,10 @@ elf_lookup(linker_file_t lf, Elf_Size sy } addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + if (addr == 0 && ELF_ST_BIND(sym->st_info) != STB_WEAK) { + *res = 0; + return (EINVAL); + } if (elf_set_find(&set_pcpu_list, addr, &start, &base)) addr = addr - start + base; From owner-svn-src-all@freebsd.org Fri Nov 13 01:27:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 865EBA2D248; Fri, 13 Nov 2015 01:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B69F14B2; Fri, 13 Nov 2015 01:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1RKRD068527; Fri, 13 Nov 2015 01:27:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1RKrd068526; Fri, 13 Nov 2015 01:27:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130127.tAD1RKrd068526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290738 - stable/10/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:27:21 -0000 Author: markj Date: Fri Nov 13 01:27:20 2015 New Revision: 290738 URL: https://svnweb.freebsd.org/changeset/base/290738 Log: MFC r289866: DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that array type sizes are encoded correctly. PR: 203772 Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Fri Nov 13 01:25:02 2015 (r290737) +++ stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Fri Nov 13 01:27:20 2015 (r290738) @@ -675,6 +675,10 @@ tdesc_array_create(dwarf_t *dw, Dwarf_Di ar->ad_nelems = uval + 1; else if (die_signed(dw, dim, DW_AT_upper_bound, &sval, 0)) ar->ad_nelems = sval + 1; + else if (die_unsigned(dw, dim, DW_AT_count, &uval, 0)) + ar->ad_nelems = uval; + else if (die_signed(dw, dim, DW_AT_count, &sval, 0)) + ar->ad_nelems = sval; else ar->ad_nelems = 0; From owner-svn-src-all@freebsd.org Fri Nov 13 01:37:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DA0A2D467; Fri, 13 Nov 2015 01:37:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5091AED; Fri, 13 Nov 2015 01:37:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1b8ZP073025; Fri, 13 Nov 2015 01:37:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1b8DW073024; Fri, 13 Nov 2015 01:37:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130137.tAD1b8DW073024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290739 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:37:09 -0000 Author: markj Date: Fri Nov 13 01:37:08 2015 New Revision: 290739 URL: https://svnweb.freebsd.org/changeset/base/290739 Log: MFC r289867: Remove an erroneous semicolon. Modified: stable/10/sys/sys/_bitset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/_bitset.h ============================================================================== --- stable/10/sys/sys/_bitset.h Fri Nov 13 01:27:20 2015 (r290738) +++ stable/10/sys/sys/_bitset.h Fri Nov 13 01:37:08 2015 (r290739) @@ -50,7 +50,7 @@ #define BITSET_DEFINE(t, _s) \ struct t { \ long __bits[__bitset_words((_s))]; \ -}; +} #define BITSET_T_INITIALIZER(x) \ { .__bits = { x } } From owner-svn-src-all@freebsd.org Fri Nov 13 01:47:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCEF1A2D65E; Fri, 13 Nov 2015 01:47:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 841451ED7; Fri, 13 Nov 2015 01:47:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1lu7B076014; Fri, 13 Nov 2015 01:47:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1luMo076013; Fri, 13 Nov 2015 01:47:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511130147.tAD1luMo076013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 Nov 2015 01:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290740 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:47:57 -0000 Author: bdrewery Date: Fri Nov 13 01:47:56 2015 New Revision: 290740 URL: https://svnweb.freebsd.org/changeset/base/290740 Log: META MODE: Don't double stage SYMLINKS for libraries. meta.stage.mk is handling ${SYMLINKS:T} for stage_libs already. The logic in bsd.sys.mk to handle ${SYMLINKS} was brought in r247817 when it was moved out of bsd.prog.mk and bsd.lib.mk into bsd.sys.mk. The logic previously was limited to bsd.prog.mk. This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created by both stage_libs and stage_symlinks resulting in 'ln: File exists'. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Nov 13 01:37:08 2015 (r290739) +++ head/share/mk/bsd.sys.mk Fri Nov 13 01:47:56 2015 (r290740) @@ -276,7 +276,8 @@ STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif -.if !empty(SYMLINKS) +# Don't handle SYMLINKS for libraries since stage_libs is already doing so. +.if !empty(SYMLINKS) && empty(_LIBS) STAGE_TARGETS+= stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} From owner-svn-src-all@freebsd.org Fri Nov 13 02:05:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36DA0A2D9B6; Fri, 13 Nov 2015 02:05:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDC71775; Fri, 13 Nov 2015 02:05:55 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from coconut.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 07D695648F; Thu, 12 Nov 2015 20:05:53 -0600 (CST) Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201510261621.t9QGLuL2028872@repo.freebsd.org> <56451A45.40605@FreeBSD.org> From: Eric van Gyzen Message-ID: <5645457E.9070303@FreeBSD.org> Date: Thu, 12 Nov 2015 20:05:50 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56451A45.40605@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 02:05:56 -0000 On 11/12/15 5:01 PM, Bryan Drewery wrote: > On 10/26/2015 9:21 AM, Eric van Gyzen wrote: >> Author: vangyzen >> Date: Mon Oct 26 16:21:56 2015 >> New Revision: 290014 >> URL: https://svnweb.freebsd.org/changeset/base/290014 >> >> Log: >> Disable SSE in libthr > > Please also mention 'MFC rREV'. Thanks! Will do. On this commit, I remembered it about 17 ms after I typed :x. :-/ Eric From owner-svn-src-all@freebsd.org Fri Nov 13 02:16:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1BFA2DB90; Fri, 13 Nov 2015 02:16:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317BD1B9A; Fri, 13 Nov 2015 02:16:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD2G9n3084471; Fri, 13 Nov 2015 02:16:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD2G9BI084469; Fri, 13 Nov 2015 02:16:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130216.tAD2G9BI084469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 02:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290741 - in stable/10/sys: sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 02:16:10 -0000 Author: markj Date: Fri Nov 13 02:16:08 2015 New Revision: 290741 URL: https://svnweb.freebsd.org/changeset/base/290741 Log: MFC r287235: Remove weighted page handling from vm_page_advise(). Modified: stable/10/sys/sys/pcpu.h stable/10/sys/vm/vm_page.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/pcpu.h ============================================================================== --- stable/10/sys/sys/pcpu.h Fri Nov 13 01:47:56 2015 (r290740) +++ stable/10/sys/sys/pcpu.h Fri Nov 13 02:16:08 2015 (r290741) @@ -162,7 +162,7 @@ struct pcpu { long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; void *pc_netisr; /* netisr SWI cookie */ - int pc_dnweight; /* vm_page_dontneed() */ + int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Fri Nov 13 01:47:56 2015 (r290740) +++ stable/10/sys/vm/vm_page.c Fri Nov 13 02:16:08 2015 (r290741) @@ -2430,19 +2430,26 @@ _vm_page_deactivate(vm_page_t m, int ath struct vm_pagequeue *pq; int queue; - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); /* - * Ignore if already inactive. + * Ignore if the page is already inactive, unless it is unlikely to be + * reactivated. */ - if ((queue = m->queue) == PQ_INACTIVE) + if ((queue = m->queue) == PQ_INACTIVE && !athead) return; if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - if (queue != PQ_NONE) - vm_page_dequeue(m); - m->flags &= ~PG_WINATCFLS; pq = &vm_phys_domain(m)->vmd_pagequeues[PQ_INACTIVE]; - vm_pagequeue_lock(pq); + /* Avoid multiple acquisitions of the inactive queue lock. */ + if (queue == PQ_INACTIVE) { + vm_pagequeue_lock(pq); + vm_page_dequeue_locked(m); + } else { + if (queue != PQ_NONE) + vm_page_dequeue(m); + m->flags &= ~PG_WINATCFLS; + vm_pagequeue_lock(pq); + } m->queue = PQ_INACTIVE; if (athead) TAILQ_INSERT_HEAD(&pq->pq_pl, m, plinks.q); @@ -2618,34 +2625,18 @@ vm_page_cache(vm_page_t m) /* * vm_page_advise * - * Cache, deactivate, or do nothing as appropriate. This routine - * is used by madvise(). - * - * Generally speaking we want to move the page into the cache so - * it gets reused quickly. However, this can result in a silly syndrome - * due to the page recycling too quickly. Small objects will not be - * fully cached. On the other hand, if we move the page to the inactive - * queue we wind up with a problem whereby very large objects - * unnecessarily blow away our inactive and cache queues. - * - * The solution is to move the pages based on a fixed weighting. We - * either leave them alone, deactivate them, or move them to the cache, - * where moving them to the cache has the highest weighting. - * By forcing some pages into other queues we eventually force the - * system to balance the queues, potentially recovering other unrelated - * space from active. The idea is to not force this to happen too - * often. + * Deactivate or do nothing, as appropriate. This routine is used + * by madvise() and vop_stdadvise(). * * The object and page must be locked. */ void vm_page_advise(vm_page_t m, int advice) { - int dnw, head; vm_page_assert_locked(m); VM_OBJECT_ASSERT_WLOCKED(m->object); - if (advice == MADV_FREE) { + if (advice == MADV_FREE) /* * Mark the page clean. This will allow the page to be freed * up by the system. However, such pages are often reused @@ -2656,24 +2647,12 @@ vm_page_advise(vm_page_t m, int advice) * nor do we try to put it in the cache (which would cause a * page fault on reuse). * - * But we do make the page is freeable as we can without + * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ m->dirty = 0; - m->act_count = 0; - } else if (advice != MADV_DONTNEED) + else if (advice != MADV_DONTNEED) return; - dnw = PCPU_GET(dnweight); - PCPU_INC(dnweight); - - /* - * Occasionally leave the page alone. - */ - if ((dnw & 0x01F0) == 0 || m->queue == PQ_INACTIVE) { - if (m->act_count >= ACT_INIT) - --m->act_count; - return; - } /* * Clear any references to the page. Otherwise, the page daemon will @@ -2684,20 +2663,12 @@ vm_page_advise(vm_page_t m, int advice) if (advice != MADV_FREE && m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m); - if (m->dirty || (dnw & 0x0070) == 0) { - /* - * Deactivate the page 3 times out of 32. - */ - head = 0; - } else { - /* - * Cache the page 28 times out of every 32. Note that - * the page is deactivated instead of cached, but placed - * at the head of the queue instead of the tail. - */ - head = 1; - } - _vm_page_deactivate(m, head); + /* + * Place clean pages at the head of the inactive queue rather than the + * tail, thus defeating the queue's LRU operation and ensuring that the + * page will be reused quickly. + */ + _vm_page_deactivate(m, m->dirty == 0); } /* From owner-svn-src-all@freebsd.org Fri Nov 13 05:06:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2893A2DC26; Fri, 13 Nov 2015 05:06:40 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x235.google.com (mail-yk0-x235.google.com [IPv6:2607:f8b0:4002:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0C1D1584; Fri, 13 Nov 2015 05:06:40 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykfs79 with SMTP id s79so130507234ykf.1; Thu, 12 Nov 2015 21:06: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=4B4DPasoOqX69Cq65GU9MI/63yYSyRqJGaKks81oRZY=; b=GBqtbnrvqDNf7ZYiHOZBC5m/CaYsrWUW1/VUyx5Rj/NmkWdC+eFhLpqQSTiQk5Sk7I qeHiTzi55Bz3S1wOkW/hSmaBp8Rio6wFK9BN3ISiONqtwAnAL6GTbgYi4GKRTdZtp3HM rMXWQ75Nbaxo64MBh7QW75ayg0DDy5PsJle7scXNh0WMHypwrYKYTIiWjTvc/qol32m6 TQgLraz0ye+k3WWwe+a4NlJ4S/ynmT9n75J9lmWfyo0HEvCMmMbNSg/FPGPjsYXBpx27 55PVK8jy/epHMiJa0HpyUIcvM6NxM0m19kHK8grHjSTYKezd/qDgAS00CBQRwtszey2m xIaQ== MIME-Version: 1.0 X-Received: by 10.13.250.69 with SMTP id k66mr19081332ywf.107.1447391199859; Thu, 12 Nov 2015 21:06:39 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.37.95.9 with HTTP; Thu, 12 Nov 2015 21:06:39 -0800 (PST) In-Reply-To: <5644C833.2060806@FreeBSD.org> References: <201511092337.tA9Nb19I086123@repo.freebsd.org> <5644C833.2060806@FreeBSD.org> Date: Thu, 12 Nov 2015 21:06:39 -0800 X-Google-Sender-Auth: tW09owAZnDDVZv_26z9n3kn-FXs Message-ID: Subject: Re: svn commit: r290628 - in head/etc: . rc.d From: Craig Rodrigues To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 05:06:41 -0000 On Thu, Nov 12, 2015 at 9:11 AM, Bryan Drewery wrote: > On 11/12/2015 6:42 AM, Craig Rodrigues wrote: > > However, if NO_FSCHG is specified in make.conf, this does not do the > > right thing. > > > > This is now fixed. > Thank you. -- Craig From owner-svn-src-all@freebsd.org Fri Nov 13 06:16:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE19A2E6A0; Fri, 13 Nov 2015 06:16:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2C761D3B; Fri, 13 Nov 2015 06:16:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD6GCQG053618; Fri, 13 Nov 2015 06:16:12 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD6GCwf053616; Fri, 13 Nov 2015 06:16:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511130616.tAD6GCwf053616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 13 Nov 2015 06:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290742 - head/usr.bin/locate/locate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 06:16:14 -0000 Author: des Date: Fri Nov 13 06:16:12 2015 New Revision: 290742 URL: https://svnweb.freebsd.org/changeset/base/290742 Log: There is no more point in indexing /var/db/freebsd-update than there is in indexing /var/db/portsnap, which was already in PRUNEPATHS. MFC after: 1 week Modified: head/usr.bin/locate/locate/locate.rc head/usr.bin/locate/locate/updatedb.sh Modified: head/usr.bin/locate/locate/locate.rc ============================================================================== --- head/usr.bin/locate/locate/locate.rc Fri Nov 13 02:16:08 2015 (r290741) +++ head/usr.bin/locate/locate/locate.rc Fri Nov 13 06:16:12 2015 (r290742) @@ -16,7 +16,7 @@ #SEARCHPATHS="/" # paths unwanted in output -#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update" # directories unwanted in output #PRUNEDIRS=".zfs" Modified: head/usr.bin/locate/locate/updatedb.sh ============================================================================== --- head/usr.bin/locate/locate/updatedb.sh Fri Nov 13 02:16:08 2015 (r290741) +++ head/usr.bin/locate/locate/updatedb.sh Fri Nov 13 06:16:12 2015 (r290742) @@ -51,7 +51,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS="/"} # directories to be put in the database -: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"} # unwanted directories : ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ From owner-svn-src-all@freebsd.org Fri Nov 13 06:20:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1037A2E701; Fri, 13 Nov 2015 06:20:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD331EC9; Fri, 13 Nov 2015 06:20:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD6KRFs053809; Fri, 13 Nov 2015 06:20:27 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD6KRR3053808; Fri, 13 Nov 2015 06:20:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201511130620.tAD6KRR3053808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 13 Nov 2015 06:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290743 - head/etc/periodic/daily X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 06:20:29 -0000 Author: des Date: Fri Nov 13 06:20:27 2015 New Revision: 290743 URL: https://svnweb.freebsd.org/changeset/base/290743 Log: Allow admins to specify a regex which is applied (in the negative) to the output from df, similar to what security/200.chkmounts does. This can be useful to avoid listing automounted ZFS snapshots, for instance. MFC after: 1 week Modified: head/etc/periodic/daily/400.status-disks Modified: head/etc/periodic/daily/400.status-disks ============================================================================== --- head/etc/periodic/daily/400.status-disks Fri Nov 13 06:16:12 2015 (r290742) +++ head/etc/periodic/daily/400.status-disks Fri Nov 13 06:20:27 2015 (r290743) @@ -16,7 +16,12 @@ case "$daily_status_disks_enable" in echo "" echo "Disk status:" - df $daily_status_disks_df_flags && rc=1 || rc=3 + if [ -n "${daily_status_disks_ignore}" ] ; then + ignore="egrep -v ${daily_status_disks_ignore}" + else + ignore="cat" + fi + (df $daily_status_disks_df_flags | ${ignore}) && rc=1 || rc=3 # display which filesystems need backing up if [ -s /etc/dumpdates ]; then From owner-svn-src-all@freebsd.org Fri Nov 13 08:17:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61CFA2DE43; Fri, 13 Nov 2015 08:17:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BCD11081; Fri, 13 Nov 2015 08:17:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5A0811FE022; Fri, 13 Nov 2015 09:17:11 +0100 (CET) Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core To: cem@FreeBSD.org References: <201511121012.tACACKTI075143@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56459CEE.4090007@selasky.org> Date: Fri, 13 Nov 2015 09:18:54 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 08:17:20 -0000 Hi, On 11/12/15 18:17, Conrad Meyer wrote: > These should cast through (u)intptr_t rather than unsigned long. > This is Linux code, and they use "unsigned long" for pointer casts everywhere, trying to not break their style. BTW: I added to linux_compat.c: CTASSERT(sizeof(unsigned long) == sizeof(uintptr_t)); And it survived my "tinderbox" build and I was surprised! --HPS From owner-svn-src-all@freebsd.org Fri Nov 13 08:35:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B327CA2B4D6; Fri, 13 Nov 2015 08:35:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45BB71DC2; Fri, 13 Nov 2015 08:35:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tAD8ZhkA062233 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 13 Nov 2015 10:35:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tAD8ZhkA062233 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tAD8ZhV1062230; Fri, 13 Nov 2015 10:35:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Nov 2015 10:35:43 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: cem@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core Message-ID: <20151113083543.GV2257@kib.kiev.ua> References: <201511121012.tACACKTI075143@repo.freebsd.org> <56459CEE.4090007@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56459CEE.4090007@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 08:35:53 -0000 On Fri, Nov 13, 2015 at 09:18:54AM +0100, Hans Petter Selasky wrote: > Hi, > > On 11/12/15 18:17, Conrad Meyer wrote: > > These should cast through (u)intptr_t rather than unsigned long. > > > > This is Linux code, and they use "unsigned long" for pointer casts > everywhere, trying to not break their style. > > BTW: I added to linux_compat.c: > > CTASSERT(sizeof(unsigned long) == sizeof(uintptr_t)); > > And it survived my "tinderbox" build and I was surprised! FreeBSD (at least currently) runs on two kinds of ABIs: ILP32 and LP64. ILP32 means that sizeof(int) == sizeof(long) == sizeof(void *) == 4. For LP64, sizeof(long) == sizeof(void *) == 8, while sizeof(int) == 4. We do not support anything else. From owner-svn-src-all@freebsd.org Fri Nov 13 09:00:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1BEAA2BE43; Fri, 13 Nov 2015 09:00:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD611C63; Fri, 13 Nov 2015 09:00:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD90d8L000686; Fri, 13 Nov 2015 09:00:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD90dlW000685; Fri, 13 Nov 2015 09:00:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511130900.tAD90dlW000685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 Nov 2015 09:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290744 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:00:41 -0000 Author: hselasky Date: Fri Nov 13 09:00:39 2015 New Revision: 290744 URL: https://svnweb.freebsd.org/changeset/base/290744 Log: Add assert and note about the size of "unsigned long" inside the LinuxKPI for the future. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Nov 13 06:20:27 2015 (r290743) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Nov 13 09:00:39 2015 (r290744) @@ -950,3 +950,11 @@ linux_compat_uninit(void *arg) kobject_kfree_name(&miscclass.kobj); } SYSUNINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_uninit, NULL); + +/* + * NOTE: Linux frequently uses "unsigned long" for pointer to integer + * conversion and vice versa, where in FreeBSD "uintptr_t" would be + * used. Assert these types have the same size, else some parts of the + * LinuxKPI may not work like expected: + */ +CTASSERT(sizeof(unsigned long) == sizeof(uintptr_t)); From owner-svn-src-all@freebsd.org Fri Nov 13 09:09:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B418A2C0D8; Fri, 13 Nov 2015 09:09:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFEB120D; Fri, 13 Nov 2015 09:09:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD990Oh003919; Fri, 13 Nov 2015 09:09:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD990FD003916; Fri, 13 Nov 2015 09:09:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130909.tAD990FD003916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290745 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: fs/zfs sys/sysevent X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:09:01 -0000 Author: mav Date: Fri Nov 13 09:08:59 2015 New Revision: 290745 URL: https://svnweb.freebsd.org/changeset/base/290745 Log: MFC r287745: 5997 FRU field not set during pool creation and never updated ZFS already supports storing the vdev FRU in a vdev property. There is code in libzfs to work with this property, and there is code in the zfs-retire FMA module that looks for that information. But there is no code actually setting or updating the FRU. To address this, ZFS is changed to send a handful of new events whenever a vdev is added, attached, cleared, or onlined, as well as when a pool is created or imported. Note that syseventd is not currently available on FreeBSD and thus some work is needed to actually support the new ZFS events (e.g. in zfsd) to actually use this capability, this changeset is mostly a diff reduction from upstream. illumos/illumos-gate@1437283407f89cab03860accf49408f94559bc34 Illumos issues: 5997 FRU field not set during pool creation and never updated https://www.illumos.org/issues/5997 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:08:59 2015 (r290745) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013, 2014, Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -3771,6 +3771,7 @@ spa_create(const char *pool, nvlist_t *n txg_wait_synced(spa->spa_dsl_pool, txg); spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_CREATE); spa_history_log_version(spa, "create"); @@ -4234,6 +4235,7 @@ spa_import(const char *pool, nvlist_t *c spa_configfile_set(spa, props, B_FALSE); spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_IMPORT); mutex_exit(&spa_namespace_lock); return (0); @@ -4364,9 +4366,12 @@ spa_import(const char *pool, nvlist_t *c */ spa_async_request(spa, SPA_ASYNC_AUTOEXPAND); - mutex_exit(&spa_namespace_lock); spa_history_log_version(spa, "import"); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_IMPORT); + + mutex_exit(&spa_namespace_lock); + #ifdef __FreeBSD__ #ifdef _KERNEL zvol_create_minors(pool); @@ -4712,6 +4717,7 @@ spa_vdev_add(spa_t *spa, nvlist_t *nvroo mutex_enter(&spa_namespace_lock); spa_config_update(spa, SPA_CONFIG_UPDATE_POOL); + spa_event_notify(spa, NULL, ESC_ZFS_VDEV_ADD); mutex_exit(&spa_namespace_lock); return (0); @@ -4906,6 +4912,11 @@ spa_vdev_attach(spa_t *spa, uint64_t gui */ dsl_resilver_restart(spa->spa_dsl_pool, dtl_max_txg); + if (spa->spa_bootfs) + spa_event_notify(spa, newvd, ESC_ZFS_BOOTFS_VDEV_ATTACH); + + spa_event_notify(spa, newvd, ESC_ZFS_VDEV_ATTACH); + /* * Commit the config */ @@ -4920,9 +4931,6 @@ spa_vdev_attach(spa_t *spa, uint64_t gui spa_strfree(oldvdpath); spa_strfree(newvdpath); - if (spa->spa_bootfs) - spa_event_notify(spa, newvd, ESC_ZFS_BOOTFS_VDEV_ATTACH); - return (0); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:08:59 2015 (r290745) @@ -2503,6 +2503,7 @@ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) { vdev_t *vd, *tvd, *pvd, *rvd = spa->spa_root_vdev; + boolean_t postevent = B_FALSE; spa_vdev_state_enter(spa, SCL_NONE); @@ -2512,6 +2513,10 @@ vdev_online(spa_t *spa, uint64_t guid, u if (!vd->vdev_ops->vdev_op_leaf) return (spa_vdev_state_exit(spa, NULL, ENOTSUP)); + postevent = + (vd->vdev_offline == B_TRUE || vd->vdev_tmpoffline == B_TRUE) ? + B_TRUE : B_FALSE; + tvd = vd->vdev_top; vd->vdev_offline = B_FALSE; vd->vdev_tmpoffline = B_FALSE; @@ -2547,6 +2552,10 @@ vdev_online(spa_t *spa, uint64_t guid, u return (spa_vdev_state_exit(spa, vd, ENOTSUP)); spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); } + + if (postevent) + spa_event_notify(spa, vd, ESC_ZFS_VDEV_ONLINE); + return (spa_vdev_state_exit(spa, vd, 0)); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Fri Nov 13 09:08:59 2015 (r290745) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_SYSEVENT_EVENTDEFS_H @@ -249,9 +249,14 @@ extern "C" { #define ESC_ZFS_RESILVER_START "ESC_ZFS_resilver_start" #define ESC_ZFS_RESILVER_FINISH "ESC_ZFS_resilver_finish" #define ESC_ZFS_VDEV_REMOVE "ESC_ZFS_vdev_remove" +#define ESC_ZFS_POOL_CREATE "ESC_ZFS_pool_create" #define ESC_ZFS_POOL_DESTROY "ESC_ZFS_pool_destroy" +#define ESC_ZFS_POOL_IMPORT "ESC_ZFS_pool_import" +#define ESC_ZFS_VDEV_ADD "ESC_ZFS_vdev_add" +#define ESC_ZFS_VDEV_ATTACH "ESC_ZFS_vdev_attach" #define ESC_ZFS_VDEV_CLEAR "ESC_ZFS_vdev_clear" #define ESC_ZFS_VDEV_CHECK "ESC_ZFS_vdev_check" +#define ESC_ZFS_VDEV_ONLINE "ESC_ZFS_vdev_online" #define ESC_ZFS_CONFIG_SYNC "ESC_ZFS_config_sync" #define ESC_ZFS_SCRUB_START "ESC_ZFS_scrub_start" #define ESC_ZFS_SCRUB_FINISH "ESC_ZFS_scrub_finish" From owner-svn-src-all@freebsd.org Fri Nov 13 09:14:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE4FA2C319; Fri, 13 Nov 2015 09:14:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F87C18C9; Fri, 13 Nov 2015 09:14:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9EU19006960; Fri, 13 Nov 2015 09:14:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9EUu4006959; Fri, 13 Nov 2015 09:14:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130914.tAD9EUu4006959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290746 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:14:31 -0000 Author: mav Date: Fri Nov 13 09:14:30 2015 New Revision: 290746 URL: https://svnweb.freebsd.org/changeset/base/290746 Log: MFC r289190: 6250 zvol_dump_init() can hold txg open Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Albert Lee Reviewed by: Xin Li Approved by: Garrett D'Amore Author: George Wilson illumos/illumos-gate@b10bba72460aeaa53119c76ff5e647fd5585bece Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Nov 13 09:08:59 2015 (r290745) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Nov 13 09:14:30 2015 (r290746) @@ -2336,13 +2336,15 @@ zvol_dump_init(zvol_state_t *zv, boolean vdev_t *vd = spa->spa_root_vdev; nvlist_t *nv = NULL; uint64_t version = spa_version(spa); - enum zio_checksum checksum; + uint64_t checksum, compress, refresrv, vbs, dedup; ASSERT(MUTEX_HELD(&zfsdev_state_lock)); ASSERT(vd->vdev_ops == &vdev_root_ops); error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); + if (error != 0) + return (error); /* wait for dmu_free_long_range to actually free the blocks */ txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); @@ -2366,24 +2368,42 @@ zvol_dump_init(zvol_state_t *zv, boolean 2, ZFS_SPACE_CHECK_RESERVED); } + if (!resize) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL); + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_CHECKSUM), &checksum, + NULL); + } + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_REFRESERVATION), + &refresrv, NULL); + } + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &vbs, + NULL); + } + if (version >= SPA_VERSION_DEDUP && error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_DEDUP), &dedup, NULL); + } + } + if (error != 0) + return (error); + tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); dmu_tx_hold_bonus(tx, ZVOL_OBJ); error = dmu_tx_assign(tx, TXG_WAIT); - if (error) { + if (error != 0) { dmu_tx_abort(tx); return (error); } /* - * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum - * function. Otherwise, use the old default -- OFF. - */ - checksum = spa_feature_is_active(spa, - SPA_FEATURE_MULTI_VDEV_CRASH_DUMP) ? ZIO_CHECKSUM_NOPARITY : - ZIO_CHECKSUM_OFF; - - /* * If we are resizing the dump device then we only need to * update the refreservation to match the newly updated * zvolsize. Otherwise, we save off the original state of the @@ -2394,37 +2414,30 @@ zvol_dump_init(zvol_state_t *zv, boolean zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, &zv->zv_volsize, tx); } else { - uint64_t checksum, compress, refresrv, vbs, dedup; - - error = dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_CHECKSUM), &checksum, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_REFRESERVATION), &refresrv, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &vbs, NULL); - if (version >= SPA_VERSION_DEDUP) { - error = error ? error : - dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_DEDUP), &dedup, NULL); - } - - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, + error = zap_update(os, ZVOL_ZAP_OBJ, zfs_prop_to_name(ZFS_PROP_COMPRESSION), 8, 1, &compress, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_CHECKSUM), 8, 1, &checksum, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, - &refresrv, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), 8, 1, - &vbs, tx); - error = error ? error : dmu_object_set_blocksize( - os, ZVOL_OBJ, SPA_OLD_MAXBLOCKSIZE, 0, tx); - if (version >= SPA_VERSION_DEDUP) { - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_CHECKSUM), 8, 1, + &checksum, tx); + } + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, + &refresrv, tx); + } + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), 8, 1, + &vbs, tx); + } + if (error == 0) { + error = dmu_object_set_blocksize( + os, ZVOL_OBJ, SPA_OLD_MAXBLOCKSIZE, 0, tx); + } + if (version >= SPA_VERSION_DEDUP && error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, zfs_prop_to_name(ZFS_PROP_DEDUP), 8, 1, &dedup, tx); } @@ -2437,7 +2450,15 @@ zvol_dump_init(zvol_state_t *zv, boolean * We only need update the zvol's property if we are initializing * the dump area for the first time. */ - if (!resize) { + if (error == 0 && !resize) { + /* + * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum + * function. Otherwise, use the old default -- OFF. + */ + checksum = spa_feature_is_active(spa, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP) ? ZIO_CHECKSUM_NOPARITY : + ZIO_CHECKSUM_OFF; + VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 0) == 0); @@ -2456,13 +2477,11 @@ zvol_dump_init(zvol_state_t *zv, boolean error = zfs_set_prop_nvlist(zv->zv_name, ZPROP_SRC_LOCAL, nv, NULL); nvlist_free(nv); - - if (error) - return (error); } /* Allocate the space for the dump */ - error = zvol_prealloc(zv); + if (error == 0) + error = zvol_prealloc(zv); return (error); } From owner-svn-src-all@freebsd.org Fri Nov 13 09:16:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B84A2C3BD; Fri, 13 Nov 2015 09:16:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 341FA1A37; Fri, 13 Nov 2015 09:16:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9G7rB007069; Fri, 13 Nov 2015 09:16:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9G7TU007068; Fri, 13 Nov 2015 09:16:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130916.tAD9G7TU007068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290747 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:16:08 -0000 Author: mav Date: Fri Nov 13 09:16:07 2015 New Revision: 290747 URL: https://svnweb.freebsd.org/changeset/base/290747 Log: MFC r289191, r289194: 6251 add tunable to disable free_bpobj processing Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Simon Klinkert Reviewed by: Richard Elling Reviewed by: Albert Lee Reviewed by: Xin Li Approved by: Garrett D'Amore Author: George Wilson illumos/illumos-gate@139510fb6efa97dbe5f5479594b308d940cab8d1 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Nov 13 09:14:30 2015 (r290746) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Nov 13 09:16:07 2015 (r290747) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #include @@ -111,6 +111,14 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, free_ma extern int zfs_txg_timeout; +/* + * Enable/disable the processing of the free_bpobj object. + */ +boolean_t zfs_free_bpobj_enabled = B_TRUE; + +SYSCTL_INT(_vfs_zfs, OID_AUTO, free_bpobj_enabled, CTLFLAG_RWTUN, + &zfs_free_bpobj_enabled, 0, "Enable free_bpobj processing"); + /* the order has to match pool_scan_type */ static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = { NULL, @@ -1460,7 +1468,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * * have to worry about traversing it. It is also faster to free the * blocks than to scrub them. */ - if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { + if (zfs_free_bpobj_enabled && + spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { scn->scn_is_bptree = B_FALSE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); From owner-svn-src-all@freebsd.org Fri Nov 13 09:16:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D0BA2C454; Fri, 13 Nov 2015 09:16:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2070E1BB8; Fri, 13 Nov 2015 09:16:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9GvhC007143; Fri, 13 Nov 2015 09:16:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9GvdF007142; Fri, 13 Nov 2015 09:16:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130916.tAD9GvdF007142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290748 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:16:58 -0000 Author: mav Date: Fri Nov 13 09:16:56 2015 New Revision: 290748 URL: https://svnweb.freebsd.org/changeset/base/290748 Log: MFC r289192: 6281 prefetching should apply to 1MB reads Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Alexander Motin Reviewed by: Dan McDonald Reviewed by: Justin Gibbs Reviewed by: Xin Li Approved by: Gordon Ross Author: George Wilson illumos/illumos-gate@632802744ef6d17e06d6980a95f631615c3b060f Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Nov 13 09:16:07 2015 (r290747) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Nov 13 09:16:56 2015 (r290748) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -49,7 +49,7 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; -/* number of bytes in a array_read at which we stop prefetching (1MB) */ +/* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); From owner-svn-src-all@freebsd.org Fri Nov 13 09:17:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E2A3A2C4E4; Fri, 13 Nov 2015 09:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 679871D04; Fri, 13 Nov 2015 09:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9HmQ4007226; Fri, 13 Nov 2015 09:17:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9HmW9007225; Fri, 13 Nov 2015 09:17:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130917.tAD9HmW9007225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290749 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:17:49 -0000 Author: mav Date: Fri Nov 13 09:17:48 2015 New Revision: 290749 URL: https://svnweb.freebsd.org/changeset/base/290749 Log: MFC r289295: 5219 l2arc_write_buffers() may write beyond target_sz Reviewed by: Matthew Ahrens Reviewed by: Saso Kiselkov Reviewed by: George Wilson Reviewed by: Steven Hartland Reviewed by: Justin Gibbs Approved by: Matthew Ahrens Author: Andriy Gapon illumos/illumos-gate@d7d9a6d919f92d74ea0510a53f8441396048e800 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:16:56 2015 (r290748) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:17:48 2015 (r290749) @@ -6246,7 +6246,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de boolean_t *headroom_boost) { arc_buf_hdr_t *hdr, *hdr_prev, *head; - uint64_t write_asize, write_sz, headroom, buf_compress_minsz; + uint64_t write_asize, write_sz, headroom, + buf_compress_minsz; void *buf_data; boolean_t full; l2arc_write_callback_t *cb; @@ -6408,6 +6409,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * using it to denote the header's state change. */ hdr->b_l2hdr.b_daddr = L2ARC_ADDR_UNSET; + hdr->b_flags |= ARC_FLAG_HAS_L2HDR; mutex_enter(&dev->l2ad_mtx); From owner-svn-src-all@freebsd.org Fri Nov 13 09:18:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEA5A2C53C; Fri, 13 Nov 2015 09:18:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82B681E57; Fri, 13 Nov 2015 09:18:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9IXIU007305; Fri, 13 Nov 2015 09:18:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9IXXl007304; Fri, 13 Nov 2015 09:18:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130918.tAD9IXXl007304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290750 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:18:34 -0000 Author: mav Date: Fri Nov 13 09:18:33 2015 New Revision: 290750 URL: https://svnweb.freebsd.org/changeset/base/290750 Log: MFC r289297: 6288 dmu_buf_will_dirty could be faster Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Justin Gibbs Reviewed by: Richard Elling Approved by: Robert Mustacchi Author: Matthew Ahrens illumos/illumos-gate@0f2e7d03b8f588387cb8dd8dd500cbe5ff4484e0 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:17:48 2015 (r290749) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:18:33 2015 (r290750) @@ -1110,6 +1110,32 @@ dbuf_release_bp(dmu_buf_impl_t *db) (void) arc_release(db->db_buf, db); } +/* + * We already have a dirty record for this TXG, and we are being + * dirtied again. + */ +static void +dbuf_redirty(dbuf_dirty_record_t *dr) +{ + dmu_buf_impl_t *db = dr->dr_dbuf; + + ASSERT(MUTEX_HELD(&db->db_mtx)); + + if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID) { + /* + * If this buffer has already been written out, + * we now need to reset its state. + */ + dbuf_unoverride(dr); + if (db->db.db_object != DMU_META_DNODE_OBJECT && + db->db_state != DB_NOFILL) { + /* Already released on initial dirty, so just thaw. */ + ASSERT(arc_released(db->db_buf)); + arc_buf_thaw(db->db_buf); + } + } +} + dbuf_dirty_record_t * dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) { @@ -1182,16 +1208,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t if (dr && dr->dr_txg == tx->tx_txg) { DB_DNODE_EXIT(db); - if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID) { - /* - * If this buffer has already been written out, - * we now need to reset its state. - */ - dbuf_unoverride(dr); - if (db->db.db_object != DMU_META_DNODE_OBJECT && - db->db_state != DB_NOFILL) - arc_buf_thaw(db->db_buf); - } + dbuf_redirty(dr); mutex_exit(&db->db_mtx); return (dr); } @@ -1495,6 +1512,30 @@ dmu_buf_will_dirty(dmu_buf_t *db_fake, d ASSERT(tx->tx_txg != 0); ASSERT(!refcount_is_zero(&db->db_holds)); + /* + * Quick check for dirtyness. For already dirty blocks, this + * reduces runtime of this function by >90%, and overall performance + * by 50% for some workloads (e.g. file deletion with indirect blocks + * cached). + */ + mutex_enter(&db->db_mtx); + dbuf_dirty_record_t *dr; + for (dr = db->db_last_dirty; + dr != NULL && dr->dr_txg >= tx->tx_txg; dr = dr->dr_next) { + /* + * It's possible that it is already dirty but not cached, + * because there are some calls to dbuf_dirty() that don't + * go through dmu_buf_will_dirty(). + */ + if (dr->dr_txg == tx->tx_txg && db->db_state == DB_CACHED) { + /* This dbuf is already dirty and cached. */ + dbuf_redirty(dr); + mutex_exit(&db->db_mtx); + return; + } + } + mutex_exit(&db->db_mtx); + DB_DNODE_ENTER(db); if (RW_WRITE_HELD(&DB_DNODE(db)->dn_struct_rwlock)) rf |= DB_RF_HAVESTRUCT; From owner-svn-src-all@freebsd.org Fri Nov 13 09:20:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DACFA2C7E2; Fri, 13 Nov 2015 09:20:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CAB42000; Fri, 13 Nov 2015 09:20:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9Kl1j007437; Fri, 13 Nov 2015 09:20:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9Kl3W007436; Fri, 13 Nov 2015 09:20:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130920.tAD9Kl3W007436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290751 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:20:48 -0000 Author: mav Date: Fri Nov 13 09:20:46 2015 New Revision: 290751 URL: https://svnweb.freebsd.org/changeset/base/290751 Log: MFC r289299: 6286 ZFS internal error when set large block on bootfs Reviewed by: Paul Dagnelie Reviewed by: George Wilson Reviewed by: Andriy Gapon Approved by: Robert Mustacchi Author: Matthew Ahrens illumos/illumos-gate@6de9bb5603e65b16816b7ab29e39bac820e2da2b Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:18:33 2015 (r290750) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:20:46 2015 (r290751) @@ -27,7 +27,7 @@ * Copyright 2014 Xin Li . All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -3920,7 +3920,7 @@ zfs_check_settable(const char *dsname, n */ if (zfs_is_bootfs(dsname) && intval > SPA_OLD_MAXBLOCKSIZE) { - return (SET_ERROR(EDOM)); + return (SET_ERROR(ERANGE)); } /* @@ -3929,7 +3929,7 @@ zfs_check_settable(const char *dsname, n */ if (intval > zfs_max_recordsize || intval > SPA_MAXBLOCKSIZE) - return (SET_ERROR(EDOM)); + return (SET_ERROR(ERANGE)); if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); From owner-svn-src-all@freebsd.org Fri Nov 13 09:21:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08381A2C850; Fri, 13 Nov 2015 09:21:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4A0D12C7; Fri, 13 Nov 2015 09:21:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9LVFb009955; Fri, 13 Nov 2015 09:21:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9LVEn009954; Fri, 13 Nov 2015 09:21:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130921.tAD9LVEn009954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290752 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:21:33 -0000 Author: mav Date: Fri Nov 13 09:21:31 2015 New Revision: 290752 URL: https://svnweb.freebsd.org/changeset/base/290752 Log: MFC r289305: 6293 ztest failure: error == 28 (0xc == 0x1c) in ztest_tx_assign() Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Richard Elling Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@8fe00bfb8790ad51653f67b01d5ac14256cbb404 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:20:46 2015 (r290751) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:21:31 2015 (r290752) @@ -5298,6 +5298,16 @@ arc_init(void) arc_c_max = arc_c_min; arc_c_max = MAX(arc_c * 5, arc_c_max); + /* + * In userland, there's only the memory pressure that we artificially + * create (see arc_available_memory()). Don't let arc_c get too + * small, because it can cause transactions to be larger than + * arc_c, causing arc_tempreserve_space() to fail. + */ +#ifndef _KERNEL + arc_c_min = arc_c_max / 2; +#endif + #ifdef _KERNEL /* * Allow the tunables to override our calculations if they are From owner-svn-src-all@freebsd.org Fri Nov 13 09:22:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E3AA2C8FD; Fri, 13 Nov 2015 09:22:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12C1E15EE; Fri, 13 Nov 2015 09:22:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9MsYV010177; Fri, 13 Nov 2015 09:22:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9MsXq010176; Fri, 13 Nov 2015 09:22:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130922.tAD9MsXq010176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290753 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:22:55 -0000 Author: mav Date: Fri Nov 13 09:22:53 2015 New Revision: 290753 URL: https://svnweb.freebsd.org/changeset/base/290753 Log: MFC r289307: 6295 metaslab_condense's dbgmsg should include vdev id Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Xin Li Reviewed by: Justin Gibbs Approved by: Richard Lowe Author: Joe Stein illumos/illumos-gate@daec38ecb4fb5e73e4ca9e99be84f6b8c50c02fa Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Nov 13 09:21:31 2015 (r290752) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Nov 13 09:22:53 2015 (r290753) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -1815,10 +1815,11 @@ metaslab_condense(metaslab_t *msp, uint6 ASSERT(msp->ms_loaded); - spa_dbgmsg(spa, "condensing: txg %llu, msp[%llu] %p, " - "smp size %llu, segments %lu, forcing condense=%s", txg, - msp->ms_id, msp, space_map_length(msp->ms_sm), - avl_numnodes(&msp->ms_tree->rt_root), + spa_dbgmsg(spa, "condensing: txg %llu, msp[%llu] %p, vdev id %llu, " + "spa %s, smp size %llu, segments %lu, forcing condense=%s", txg, + msp->ms_id, msp, msp->ms_group->mg_vd->vdev_id, + msp->ms_group->mg_vd->vdev_spa->spa_name, + space_map_length(msp->ms_sm), avl_numnodes(&msp->ms_tree->rt_root), msp->ms_condense_wanted ? "TRUE" : "FALSE"); msp->ms_condense_wanted = B_FALSE; From owner-svn-src-all@freebsd.org Fri Nov 13 09:23:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57FC2A2C9D8; Fri, 13 Nov 2015 09:23:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 133021869; Fri, 13 Nov 2015 09:23:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9NnfR010267; Fri, 13 Nov 2015 09:23:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9NmIN010262; Fri, 13 Nov 2015 09:23:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130923.tAD9NmIN010262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290754 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:23:50 -0000 Author: mav Date: Fri Nov 13 09:23:48 2015 New Revision: 290754 URL: https://svnweb.freebsd.org/changeset/base/290754 Log: MFC r289309: 6267 dn_bonus evicted too early Reviewed by: Richard Yao Reviewed by: Xin LI Reviewed by: Matthew Ahrens Approved by: Richard Lowe Author: Justin T. Gibbs illumos/illumos-gate@d2058105c61ec61df3a2dd3f839fed8c3fe7bfd6 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:23:48 2015 (r290754) @@ -267,7 +267,7 @@ dbuf_verify_user(dmu_buf_impl_t *db, dbv */ ASSERT3U(holds, >=, db->db_dirtycnt); } else { - if (db->db_immediate_evict == TRUE) + if (db->db_user_immediate_evict == TRUE) ASSERT3U(holds, >=, db->db_dirtycnt); else ASSERT3U(holds, >, 0); @@ -1870,8 +1870,9 @@ dbuf_create(dnode_t *dn, uint8_t level, db->db_blkptr = blkptr; db->db_user = NULL; - db->db_immediate_evict = 0; - db->db_freed_in_flight = 0; + db->db_user_immediate_evict = FALSE; + db->db_freed_in_flight = FALSE; + db->db_pending_evict = FALSE; if (blkid == DMU_BONUS_BLKID) { ASSERT3P(parent, ==, dn->dn_dbuf); @@ -2427,12 +2428,13 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, arc_buf_freeze(db->db_buf); if (holds == db->db_dirtycnt && - db->db_level == 0 && db->db_immediate_evict) + db->db_level == 0 && db->db_user_immediate_evict) dbuf_evict_user(db); if (holds == 0) { if (db->db_blkid == DMU_BONUS_BLKID) { dnode_t *dn; + boolean_t evict_dbuf = db->db_pending_evict; /* * If the dnode moves here, we cannot cross this @@ -2447,7 +2449,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, * Decrementing the dbuf count means that the bonus * buffer's dnode hold is no longer discounted in * dnode_move(). The dnode cannot move until after - * the dnode_rele_and_unlock() below. + * the dnode_rele() below. */ DB_DNODE_EXIT(db); @@ -2457,35 +2459,10 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, */ mutex_exit(&db->db_mtx); - /* - * If the dnode has been freed, evict the bonus - * buffer immediately. The data in the bonus - * buffer is no longer relevant and this prevents - * a stale bonus buffer from being associated - * with this dnode_t should the dnode_t be reused - * prior to being destroyed. - */ - mutex_enter(&dn->dn_mtx); - if (dn->dn_type == DMU_OT_NONE || - dn->dn_free_txg != 0) { - /* - * Drop dn_mtx. It is a leaf lock and - * cannot be held when dnode_evict_bonus() - * acquires other locks in order to - * perform the eviction. - * - * Freed dnodes cannot be reused until the - * last hold is released. Since this bonus - * buffer has a hold, the dnode will remain - * in the free state, even without dn_mtx - * held, until the dnode_rele_and_unlock() - * below. - */ - mutex_exit(&dn->dn_mtx); + if (evict_dbuf) dnode_evict_bonus(dn); - mutex_enter(&dn->dn_mtx); - } - dnode_rele_and_unlock(dn, db); + + dnode_rele(dn, db); } else if (db->db_buf == NULL) { /* * This is a special case: we never associated this @@ -2532,7 +2509,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, } else { dbuf_clear(db); } - } else if (db->db_objset->os_evicting || + } else if (db->db_pending_evict || arc_buf_eviction_needed(db->db_buf)) { dbuf_clear(db); } else { @@ -2580,7 +2557,7 @@ dmu_buf_set_user_ie(dmu_buf_t *db_fake, { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; - db->db_immediate_evict = TRUE; + db->db_user_immediate_evict = TRUE; return (dmu_buf_set_user(db_fake, user)); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Nov 13 09:23:48 2015 (r290754) @@ -686,7 +686,6 @@ dmu_objset_evict(objset_t *os) if (os->os_sa) sa_tear_down(os); - os->os_evicting = B_TRUE; dmu_objset_evict_dbufs(os); mutex_enter(&os->os_lock); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Nov 13 09:23:48 2015 (r290754) @@ -424,6 +424,7 @@ dnode_evict_dbufs(dnode_t *dn) db_next = AVL_NEXT(&dn->dn_dbufs, &db_marker); avl_remove(&dn->dn_dbufs, &db_marker); } else { + db->db_pending_evict = TRUE; mutex_exit(&db->db_mtx); db_next = AVL_NEXT(&dn->dn_dbufs, db); } @@ -437,10 +438,14 @@ void dnode_evict_bonus(dnode_t *dn) { rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (dn->dn_bonus && refcount_is_zero(&dn->dn_bonus->db_holds)) { - mutex_enter(&dn->dn_bonus->db_mtx); - dbuf_evict(dn->dn_bonus); - dn->dn_bonus = NULL; + if (dn->dn_bonus != NULL) { + if (refcount_is_zero(&dn->dn_bonus->db_holds)) { + mutex_enter(&dn->dn_bonus->db_mtx); + dbuf_evict(dn->dn_bonus); + dn->dn_bonus = NULL; + } else { + dn->dn_bonus->db_pending_evict = TRUE; + } } rw_exit(&dn->dn_struct_rwlock); } @@ -492,7 +497,6 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *t dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]); dnode_evict_dbufs(dn); - ASSERT(avl_is_empty(&dn->dn_dbufs)); /* * XXX - It would be nice to assert this, but we may still Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Fri Nov 13 09:23:48 2015 (r290754) @@ -230,9 +230,25 @@ typedef struct dmu_buf_impl { /* User callback information. */ dmu_buf_user_t *db_user; - uint8_t db_immediate_evict; + /* + * Evict user data as soon as the dirty and reference + * counts are equal. + */ + uint8_t db_user_immediate_evict; + + /* + * This block was freed while a read or write was + * active. + */ uint8_t db_freed_in_flight; + /* + * dnode_evict_dbufs() or dnode_evict_bonus() tried to + * evict this dbuf, but couldn't due to outstanding + * references. Evict once the refcount drops to 0. + */ + uint8_t db_pending_evict; + uint8_t db_dirtycnt; } dmu_buf_impl_t; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Nov 13 09:23:48 2015 (r290754) @@ -93,7 +93,6 @@ struct objset { uint8_t os_copies; enum zio_checksum os_dedup_checksum; boolean_t os_dedup_verify; - boolean_t os_evicting; zfs_logbias_op_t os_logbias; zfs_cache_type_t os_primary_cache; zfs_cache_type_t os_secondary_cache; From owner-svn-src-all@freebsd.org Fri Nov 13 09:25:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4488AA2CAA3; Fri, 13 Nov 2015 09:25:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F7B19D8; Fri, 13 Nov 2015 09:25:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9PlPj010414; Fri, 13 Nov 2015 09:25:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9Pl4U010412; Fri, 13 Nov 2015 09:25:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130925.tAD9Pl4U010412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290755 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:25:49 -0000 Author: mav Date: Fri Nov 13 09:25:47 2015 New Revision: 290755 URL: https://svnweb.freebsd.org/changeset/base/290755 Log: MFC r289313: 5764 "zfs send -nv" directs output to stderr Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Basil Crow Reviewed by: Steven Hartland Reviewed by: Bayard Bell Approved by: Dan McDonald Author: Manoj Joseph illumos/illumos-gate@dc5f28a3c341db7c241bba77ddc109c141072f27 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:23:48 2015 (r290754) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:25:47 2015 (r290755) @@ -2630,6 +2630,9 @@ useful in conjunction with the or .Fl P flags to determine what data will be sent. +In this case, the verbose output will be written to +standard output (contrast with a non-dry-run, where the stream is written +to standard output and the verbose output goes to standard error). .It Fl P Print machine-parsable verbose information about the stream package generated. .It Fl v Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:23:48 2015 (r290754) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:25:47 2015 (r290755) @@ -818,7 +818,8 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable, progress, embed_data, large_block; + boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; + boolean_t large_block; int outfd; boolean_t err; nvlist_t *fss; @@ -1047,6 +1048,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + FILE *fout = sdd->std_out ? stdout : stderr; err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; @@ -1121,30 +1123,30 @@ dump_snapshot(zfs_handle_t *zhp, void *a if (sdd->parsable) { if (sdd->prevsnap[0] != '\0') { - (void) fprintf(stderr, "incremental\t%s\t%s", + (void) fprintf(fout, "incremental\t%s\t%s", sdd->prevsnap, zhp->zfs_name); } else { - (void) fprintf(stderr, "full\t%s", + (void) fprintf(fout, "full\t%s", zhp->zfs_name); } } else { - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, "send from @%s to %s"), sdd->prevsnap, zhp->zfs_name); } if (err == 0) { if (sdd->parsable) { - (void) fprintf(stderr, "\t%llu\n", + (void) fprintf(fout, "\t%llu\n", (longlong_t)size); } else { char buf[16]; zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, " estimated size is %s\n"), buf); } sdd->size += size; } else { - (void) fprintf(stderr, "\n"); + (void) fprintf(fout, "\n"); } } @@ -1388,6 +1390,7 @@ zfs_send(zfs_handle_t *zhp, const char * int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; + FILE *fout; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot send '%s'"), zhp->zfs_name); @@ -1515,6 +1518,9 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; + if (sdd.verbose && sdd.dryrun) + sdd.std_out = B_TRUE; + fout = sdd.std_out ? stdout : stderr; /* * Some flags require that we place user holds on the datasets that are @@ -1554,12 +1560,12 @@ zfs_send(zfs_handle_t *zhp, const char * if (flags->verbose) { if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", + (void) fprintf(fout, "size\t%llu\n", (longlong_t)sdd.size); } else { char buf[16]; zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, "total estimated size is %s\n"), buf); } } From owner-svn-src-all@freebsd.org Fri Nov 13 09:30:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F1CA2CB9E; Fri, 13 Nov 2015 09:30:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 704211C6A; Fri, 13 Nov 2015 09:30:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9UIUS010734; Fri, 13 Nov 2015 09:30:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9UHYY010724; Fri, 13 Nov 2015 09:30:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130930.tAD9UHYY010724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290756 - in stable/10: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/com... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:30:20 -0000 Author: mav Date: Fri Nov 13 09:30:17 2015 New Revision: 290756 URL: https://svnweb.freebsd.org/changeset/base/290756 Log: MFC r289362, r289445: 2605 want to resume interrupted zfs send Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Richard Elling Reviewed by: Xin Li Reviewed by: Arne Jansen Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8 For more info, see: - slides http://www.slideshare.net/MatthewAhrens/openzfs-send-and-receive - video https://www.youtube.com/watch?v=iY44jPMvxog - manpage changes (for zfs resume -s and zfs send -t) - upcoming talk at the OpenZFS Developer Summit The TL;DR is: Use "zfs receive -s" to save the partially received state on failure. On failure, get the receive token with "zfs get receive_resume_token " Resume the send with "zfs send -t " Relnotes: yes Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/cddl/lib/libzfs/Makefile stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:30:17 2015 (r290756) @@ -189,17 +189,25 @@ .Op Fl i Ar snapshot Ns | Ns bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm +.Cm send +.Op Fl Penv +.Fl t Ar receive_resume_token +.Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl d | e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem .Nm +.Cm receive Ns | Ns Cm recv +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Nm @@ -597,6 +605,13 @@ For cloned file systems or volumes, the created. See also the .Sy clones property. +.It Sy receive_resume_token +For filesystems or volumes which have saved partially-completed state from +.Sy zfs receive -s , +this opaque token can be provided to +.Sy zfs send -t +to resume and complete the +.Sy zfs receive . .It Sy referenced The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it @@ -2714,15 +2729,28 @@ feature. .El .It Xo .Nm +.Cm send +.Op Fl Penv +.Fl t +.Ar receive_resume_token +.Xc +Creates a send stream which resumes an interrupted receive. The +.Ar receive_resume_token +is the value of this property on the filesystem +or volume that was being received into. See the documentation for +.Sy zfs receive -s +for more details. +.It Xo +.Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl d | e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem @@ -2819,9 +2847,42 @@ performing the receive operation. If rec stream (for example, one generated by .Qq Nm Cm send Fl R Bro Fl i | Fl I Brc ) , destroy snapshots and file systems that do not exist on the sending side. +.It Fl s +If the receive is interrupted, save the partially received state, rather +than deleting it. Interruption may be due to premature termination of +the stream +.Po e.g. due to network failure or failure of the remote system +if the stream is being read over a network connection +.Pc , +a checksum error in the stream, termination of the +.Nm zfs Cm receive +process, or unclean shutdown of the system. +.Pp +The receive can be resumed with a stream generated by +.Nm zfs Cm send Fl t Ar token , +where the +.Ar token +is the value of the +.Sy receive_resume_token +property of the filesystem or volume which is received into. +.Pp +To use this flag, the storage pool must have the +.Sy extensible_dataset +feature enabled. See +.Xr zpool-features 5 +for details on ZFS feature flags. .El .It Xo .Nm +.Cm receive Ns | Ns Cm recv +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Xc +Abort an interrupted +.Nm zfs Cm receive Fl s , +deleting its saved partially received state. +.It Xo +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Xc Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:30:17 2015 (r290756) @@ -263,10 +263,11 @@ get_usage(zfs_help_t idx) case HELP_PROMOTE: return (gettext("\tpromote \n")); case HELP_RECEIVE: - return (gettext("\treceive|recv [-vnFu] \n" - "\treceive|recv [-vnFu] [-o origin=] [-d | -e] " - "\n")); + "\treceive|recv [-vnsFu] [-o origin=] [-d | -e] " + "\n" + "\treceive|recv -A \n")); case HELP_RENAME: return (gettext("\trename [-f] " "\n" @@ -279,7 +280,8 @@ get_usage(zfs_help_t idx) return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " "\n" "\tsend [-Le] [-i snapshot|bookmark] " - "\n")); + "\n" + "\tsend [-nvPe] -t \n")); case HELP_SET: return (gettext("\tset " " ...\n")); @@ -3728,6 +3730,7 @@ zfs_do_send(int argc, char **argv) { char *fromname = NULL; char *toname = NULL; + char *resume_token = NULL; char *cp; zfs_handle_t *zhp; sendflags_t flags = { 0 }; @@ -3736,7 +3739,7 @@ zfs_do_send(int argc, char **argv) boolean_t extraverbose = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPLe")) != -1) { + while ((c = getopt(argc, argv, ":i:I:RDpvnPLet:")) != -1) { switch (c) { case 'i': if (fromname) @@ -3777,6 +3780,9 @@ zfs_do_send(int argc, char **argv) case 'e': flags.embed_data = B_TRUE; break; + case 't': + resume_token = optarg; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -3792,14 +3798,28 @@ zfs_do_send(int argc, char **argv) argc -= optind; argv += optind; - /* check number of arguments */ - if (argc < 1) { - (void) fprintf(stderr, gettext("missing snapshot argument\n")); - usage(B_FALSE); - } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - usage(B_FALSE); + if (resume_token != NULL) { + if (fromname != NULL || flags.replicate || flags.props || + flags.dedup) { + (void) fprintf(stderr, + gettext("invalid flags combined with -t\n")); + usage(B_FALSE); + } + if (argc != 0) { + (void) fprintf(stderr, gettext("no additional " + "arguments are permitted with -t\n")); + usage(B_FALSE); + } + } else { + if (argc < 1) { + (void) fprintf(stderr, + gettext("missing snapshot argument\n")); + usage(B_FALSE); + } + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } } if (!flags.dryrun && isatty(STDOUT_FILENO)) { @@ -3809,6 +3829,11 @@ zfs_do_send(int argc, char **argv) return (1); } + if (resume_token != NULL) { + return (zfs_send_resume(g_zfs, &flags, STDOUT_FILENO, + resume_token)); + } + /* * Special case sending a filesystem, or from a bookmark. */ @@ -3914,8 +3939,6 @@ zfs_do_send(int argc, char **argv) } /* - * zfs receive [-vnFu] [-d | -e] - * * Restore a backup stream from stdin. */ static int @@ -3923,6 +3946,8 @@ zfs_do_receive(int argc, char **argv) { int c, err; recvflags_t flags = { 0 }; + boolean_t abort_resumable = B_FALSE; + nvlist_t *props; nvpair_t *nvp = NULL; @@ -3930,7 +3955,7 @@ zfs_do_receive(int argc, char **argv) nomem(); /* check options */ - while ((c = getopt(argc, argv, ":o:denuvF")) != -1) { + while ((c = getopt(argc, argv, ":o:denuvFsA")) != -1) { switch (c) { case 'o': if (parseprop(props, optarg) != 0) @@ -3952,9 +3977,15 @@ zfs_do_receive(int argc, char **argv) case 'v': flags.verbose = B_TRUE; break; + case 's': + flags.resumable = B_TRUE; + break; case 'F': flags.force = B_TRUE; break; + case 'A': + abort_resumable = B_TRUE; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -3987,6 +4018,44 @@ zfs_do_receive(int argc, char **argv) } } + if (abort_resumable) { + if (flags.isprefix || flags.istail || flags.dryrun || + flags.resumable || flags.nomount) { + (void) fprintf(stderr, gettext("invalid option")); + usage(B_FALSE); + } + + char namebuf[ZFS_MAXNAMELEN]; + (void) snprintf(namebuf, sizeof (namebuf), + "%s/%%recv", argv[0]); + + if (zfs_dataset_exists(g_zfs, namebuf, + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME)) { + zfs_handle_t *zhp = zfs_open(g_zfs, + namebuf, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + return (1); + err = zfs_destroy(zhp, B_FALSE); + } else { + zfs_handle_t *zhp = zfs_open(g_zfs, + argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + usage(B_FALSE); + if (!zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) || + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == -1) { + (void) fprintf(stderr, + gettext("'%s' does not have any " + "resumable receive state to abort\n"), + argv[0]); + return (1); + } + err = zfs_destroy(zhp, B_FALSE); + } + + return (err != 0); + } + if (isatty(STDIN_FILENO)) { (void) fprintf(stderr, gettext("Error: Backup stream can not be read " @@ -3994,7 +4063,6 @@ zfs_do_receive(int argc, char **argv) "You must redirect standard input.\n")); return (1); } - err = zfs_receive(g_zfs, argv[0], props, &flags, STDIN_FILENO, NULL); return (err != 0); @@ -5816,6 +5884,24 @@ share_mount_one(zfs_handle_t *zhp, int o } /* + * If this filesystem is inconsistent and has a receive resume + * token, we can not mount it. + */ + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) && + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == 0) { + if (!explicit) + return (0); + + (void) fprintf(stderr, gettext("cannot %s '%s': " + "Contains partially-completed state from " + "\"zfs receive -r\", which can be resumed with " + "\"zfs send -t\"\n"), + cmdname, zfs_get_name(zhp)); + return (1); + } + + /* * At this point, we have verified that the mountpoint and/or * shareopts are appropriate for auto management. If the * filesystem is already mounted or shared, return (failing Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Fri Nov 13 09:30:17 2015 (r290756) @@ -125,7 +125,7 @@ read_hdr(dmu_replay_record_t *drr, zio_c saved_cksum.zc_word[1], saved_cksum.zc_word[2], saved_cksum.zc_word[3]); - exit(1); + return (0); } return (sizeof (*drr)); } @@ -346,8 +346,7 @@ main(int argc, char *argv[]) if (verbose) (void) printf("\n"); - if ((DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == - DMU_COMPOUNDSTREAM) && drr->drr_payloadlen != 0) { + if (drr->drr_payloadlen != 0) { nvlist_t *nv; int sz = drr->drr_payloadlen; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:30:17 2015 (r290756) @@ -621,6 +621,10 @@ typedef boolean_t (snapfilter_cb_t)(zfs_ extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); +extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd, + const char *); +extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, + const char *token); extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, @@ -661,6 +665,12 @@ typedef struct recvflags { /* set "canmount=off" on all modified filesystems */ boolean_t canmountoff; + /* + * Mark the file systems as "resumable" and do not destroy them if the + * receive is interrupted + */ + boolean_t resumable; + /* byteswap flag is used internally; callers need not specify */ boolean_t byteswap; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Fri Nov 13 09:30:17 2015 (r290756) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_ if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_EDBP: + cflag = ZFS_CMD_COMPAT_EDBP; + break; case ZFS_IOCVER_ZCMD: cflag = ZFS_CMD_COMPAT_ZCMD; break; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:30:17 2015 (r290756) @@ -1772,22 +1772,21 @@ getprop_uint64(zfs_handle_t *zhp, zfs_pr return (value); } -static char * +static const char * getprop_string(zfs_handle_t *zhp, zfs_prop_t prop, char **source) { nvlist_t *nv; - char *value; + const char *value; *source = NULL; if (nvlist_lookup_nvlist(zhp->zfs_props, zfs_prop_to_name(prop), &nv) == 0) { - verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0); + value = fnvlist_lookup_string(nv, ZPROP_VALUE); (void) nvlist_lookup_string(nv, ZPROP_SOURCE, source); } else { verify(!zhp->zfs_props_table || zhp->zfs_props_table[prop] == B_TRUE); - if ((value = (char *)zfs_prop_default_string(prop)) == NULL) - value = ""; + value = zfs_prop_default_string(prop); *source = ""; } @@ -2189,7 +2188,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop { char *source = NULL; uint64_t val; - char *str; + const char *str; const char *strval; boolean_t received = zfs_is_recvd_props_mode(zhp); @@ -2294,14 +2293,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop break; case ZFS_PROP_ORIGIN: - (void) strlcpy(propbuf, getprop_string(zhp, prop, &source), - proplen); - /* - * If there is no parent at all, return failure to indicate that - * it doesn't apply to this dataset. - */ - if (propbuf[0] == '\0') + str = getprop_string(zhp, prop, &source); + if (str == NULL) return (-1); + (void) strlcpy(propbuf, str, proplen); break; case ZFS_PROP_CLONES: @@ -2482,8 +2477,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop break; case PROP_TYPE_STRING: - (void) strlcpy(propbuf, - getprop_string(zhp, prop, &source), proplen); + str = getprop_string(zhp, prop, &source); + if (str == NULL) + return (-1); + (void) strlcpy(propbuf, str, proplen); break; case PROP_TYPE_INDEX: Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Nov 13 09:30:17 2015 (r290756) @@ -1072,6 +1072,17 @@ mount_cb(zfs_handle_t *zhp, void *data) return (0); } + /* + * If this filesystem is inconsistent and has a receive resume + * token, we can not mount it. + */ + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) && + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == 0) { + zfs_close(zhp); + return (0); + } + libzfs_add_handle(cbp, zhp); if (zfs_iter_filesystems(zhp, mount_cb, cbp) != 0) { zfs_close(zhp); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:30:17 2015 (r290756) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. @@ -51,6 +51,7 @@ #include "zfs_prop.h" #include "zfs_fletcher.h" #include "libzfs_impl.h" +#include #include #include #include @@ -67,6 +68,8 @@ extern void zfs_setprop_error(libzfs_han static int zfs_receive_impl(libzfs_handle_t *, const char *, const char *, recvflags_t *, int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *); +static int guid_to_name(libzfs_handle_t *, const char *, + uint64_t, boolean_t, char *); static const zio_cksum_t zero_cksum = { 0 }; @@ -284,8 +287,7 @@ cksummer(void *arg) DMU_BACKUP_FEATURE_DEDUPPROPS); DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags); - if (DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == - DMU_COMPOUNDSTREAM && drr->drr_payloadlen != 0) { + if (drr->drr_payloadlen != 0) { sz = drr->drr_payloadlen; if (sz > SPA_MAXBLOCKSIZE) { @@ -995,17 +997,14 @@ static void * send_progress_thread(void *arg) { progress_arg_t *pa = arg; - zfs_cmd_t zc = { 0 }; zfs_handle_t *zhp = pa->pa_zhp; libzfs_handle_t *hdl = zhp->zfs_hdl; unsigned long long bytes; char buf[16]; - time_t t; struct tm *tm; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); if (!pa->pa_parsable) @@ -1038,6 +1037,51 @@ send_progress_thread(void *arg) } } +static void +send_print_verbose(FILE *fout, const char *tosnap, const char *fromsnap, + uint64_t size, boolean_t parsable) +{ + if (parsable) { + if (fromsnap != NULL) { + (void) fprintf(fout, "incremental\t%s\t%s", + fromsnap, tosnap); + } else { + (void) fprintf(fout, "full\t%s", + tosnap); + } + } else { + if (fromsnap != NULL) { + if (strchr(fromsnap, '@') == NULL && + strchr(fromsnap, '#') == NULL) { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "send from @%s to %s"), + fromsnap, tosnap); + } else { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "send from %s to %s"), + fromsnap, tosnap); + } + } else { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "full send of %s"), + tosnap); + } + } + + if (size != 0) { + if (parsable) { + (void) fprintf(fout, "\t%llu", + (longlong_t)size); + } else { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + " estimated size is %s"), buf); + } + } + (void) fprintf(fout, "\n"); +} + static int dump_snapshot(zfs_handle_t *zhp, void *arg) { @@ -1117,37 +1161,14 @@ dump_snapshot(zfs_handle_t *zhp, void *a (sdd->fromorigin || sdd->replicate); if (sdd->verbose) { - uint64_t size; - err = estimate_ioctl(zhp, sdd->prevsnap_obj, + uint64_t size = 0; + (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, &size); - if (sdd->parsable) { - if (sdd->prevsnap[0] != '\0') { - (void) fprintf(fout, "incremental\t%s\t%s", - sdd->prevsnap, zhp->zfs_name); - } else { - (void) fprintf(fout, "full\t%s", - zhp->zfs_name); - } - } else { - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - "send from @%s to %s"), - sdd->prevsnap, zhp->zfs_name); - } - if (err == 0) { - if (sdd->parsable) { - (void) fprintf(fout, "\t%llu\n", - (longlong_t)size); - } else { - char buf[16]; - zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - " estimated size is %s\n"), buf); - } - sdd->size += size; - } else { - (void) fprintf(fout, "\n"); - } + send_print_verbose(fout, zhp->zfs_name, + sdd->prevsnap[0] ? sdd->prevsnap : NULL, + size, sdd->parsable); + sdd->size += size; } if (!sdd->dryrun) { @@ -1358,6 +1379,233 @@ again: return (0); } +nvlist_t * +zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, const char *token) +{ + unsigned int version; + int nread; + unsigned long long checksum, packed_len; + + /* + * Decode token header, which is: + * -- + * Note that the only supported token version is 1. + */ + nread = sscanf(token, "%u-%llx-%llx-", + &version, &checksum, &packed_len); + if (nread != 3) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (invalid format)")); + return (NULL); + } + + if (version != ZFS_SEND_RESUME_TOKEN_VERSION) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (invalid version %u)"), + version); + return (NULL); + } + + /* convert hexadecimal representation to binary */ + token = strrchr(token, '-') + 1; + int len = strlen(token) / 2; + unsigned char *compressed = zfs_alloc(hdl, len); + for (int i = 0; i < len; i++) { + nread = sscanf(token + i * 2, "%2hhx", compressed + i); + if (nread != 1) { + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt " + "(payload is not hex-encoded)")); + return (NULL); + } + } + + /* verify checksum */ + zio_cksum_t cksum; + fletcher_4_native(compressed, len, &cksum); + if (cksum.zc_word[0] != checksum) { + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (incorrect checksum)")); + return (NULL); + } + + /* uncompress */ + void *packed = zfs_alloc(hdl, packed_len); + uLongf packed_len_long = packed_len; + if (uncompress(packed, &packed_len_long, compressed, len) != Z_OK || + packed_len_long != packed_len) { + free(packed); + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (decompression failed)")); + return (NULL); + } + + /* unpack nvlist */ + nvlist_t *nv; + int error = nvlist_unpack(packed, packed_len, &nv, KM_SLEEP); + free(packed); + free(compressed); + if (error != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (nvlist_unpack failed)")); + return (NULL); + } + return (nv); +} + +int +zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *flags, int outfd, + const char *resume_token) +{ + char errbuf[1024]; + char *toname; + char *fromname = NULL; + uint64_t resumeobj, resumeoff, toguid, fromguid, bytes; + zfs_handle_t *zhp; + int error = 0; + char name[ZFS_MAXNAMELEN]; + enum lzc_send_flags lzc_flags = 0; + + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, + "cannot resume send")); + + nvlist_t *resume_nvl = + zfs_send_resume_token_to_nvlist(hdl, resume_token); + if (resume_nvl == NULL) { + /* + * zfs_error_aux has already been set by + * zfs_send_resume_token_to_nvlist + */ + return (zfs_error(hdl, EZFS_FAULT, errbuf)); + } + if (flags->verbose) { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "resume token contents:\n")); + nvlist_print(stderr, resume_nvl); + } + + if (nvlist_lookup_string(resume_nvl, "toname", &toname) != 0 || + nvlist_lookup_uint64(resume_nvl, "object", &resumeobj) != 0 || + nvlist_lookup_uint64(resume_nvl, "offset", &resumeoff) != 0 || + nvlist_lookup_uint64(resume_nvl, "bytes", &bytes) != 0 || + nvlist_lookup_uint64(resume_nvl, "toguid", &toguid) != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt")); + return (zfs_error(hdl, EZFS_FAULT, errbuf)); + } + fromguid = 0; + (void) nvlist_lookup_uint64(resume_nvl, "fromguid", &fromguid); + + if (flags->embed_data || nvlist_exists(resume_nvl, "embedok")) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + + if (guid_to_name(hdl, toname, toguid, B_FALSE, name) != 0) { + if (zfs_dataset_exists(hdl, toname, ZFS_TYPE_DATASET)) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "'%s' is no longer the same snapshot used in " + "the initial send"), toname); + } else { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "'%s' used in the initial send no longer exists"), + toname); + } + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + zhp = zfs_open(hdl, name, ZFS_TYPE_DATASET); + if (zhp == NULL) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "unable to access '%s'"), name); + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + + if (fromguid != 0) { + if (guid_to_name(hdl, toname, fromguid, B_TRUE, name) != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "incremental source %#llx no longer exists"), + (longlong_t)fromguid); + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + fromname = name; + } + + if (flags->verbose) { + uint64_t size = 0; + error = lzc_send_space(zhp->zfs_name, fromname, &size); + if (error == 0) + size = MAX(0, (int64_t)(size - bytes)); + send_print_verbose(stderr, zhp->zfs_name, fromname, + size, flags->parsable); + } + + if (!flags->dryrun) { + progress_arg_t pa = { 0 }; + pthread_t tid; + /* + * If progress reporting is requested, spawn a new thread to + * poll ZFS_IOC_SEND_PROGRESS at a regular interval. + */ + if (flags->progress) { + pa.pa_zhp = zhp; + pa.pa_fd = outfd; + pa.pa_parsable = flags->parsable; + + error = pthread_create(&tid, NULL, + send_progress_thread, &pa); + if (error != 0) { + zfs_close(zhp); + return (error); + } + } + + error = lzc_send_resume(zhp->zfs_name, fromname, outfd, + lzc_flags, resumeobj, resumeoff); + + if (flags->progress) { + (void) pthread_cancel(tid); + (void) pthread_join(tid, NULL); + } + + char errbuf[1024]; + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, + "warning: cannot send '%s'"), zhp->zfs_name); + + zfs_close(zhp); + + switch (error) { + case 0: + return (0); + case EXDEV: + case ENOENT: + case EDQUOT: + case EFBIG: + case EIO: + case ENOLINK: + case ENOSPC: +#ifdef illumos + case ENOSTR: +#endif + case ENXIO: + case EPIPE: + case ERANGE: + case EFAULT: + case EROFS: + zfs_error_aux(hdl, strerror(errno)); + return (zfs_error(hdl, EZFS_BADBACKUP, errbuf)); + + default: + return (zfs_standard_error(hdl, errno, errbuf)); + } + } + + + zfs_close(zhp); + + return (error); +} + /* * Generate a send stream for the dataset identified by the argument zhp. * @@ -1897,6 +2145,7 @@ recv_destroy(libzfs_handle_t *hdl, const typedef struct guid_to_name_data { uint64_t guid; + boolean_t bookmark_ok; char *name; char *skip; } guid_to_name_data_t; @@ -1905,20 +2154,25 @@ static int guid_to_name_cb(zfs_handle_t *zhp, void *arg) { guid_to_name_data_t *gtnd = arg; + const char *slash; int err; if (gtnd->skip != NULL && - strcmp(zhp->zfs_name, gtnd->skip) == 0) { + (slash = strrchr(zhp->zfs_name, '/')) != NULL && + strcmp(slash + 1, gtnd->skip) == 0) { + zfs_close(zhp); return (0); } - if (zhp->zfs_dmustats.dds_guid == gtnd->guid) { + if (zfs_prop_get_int(zhp, ZFS_PROP_GUID) == gtnd->guid) { (void) strcpy(gtnd->name, zhp->zfs_name); zfs_close(zhp); return (EEXIST); } err = zfs_iter_children(zhp, guid_to_name_cb, gtnd); + if (err != EEXIST && gtnd->bookmark_ok) + err = zfs_iter_bookmarks(zhp, guid_to_name_cb, gtnd); zfs_close(zhp); return (err); } @@ -1932,45 +2186,48 @@ guid_to_name_cb(zfs_handle_t *zhp, void */ static int guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid, - char *name) + boolean_t bookmark_ok, char *name) { - /* exhaustive search all local snapshots */ char pname[ZFS_MAXNAMELEN]; guid_to_name_data_t gtnd; - int err = 0; - zfs_handle_t *zhp; - char *cp; gtnd.guid = guid; + gtnd.bookmark_ok = bookmark_ok; gtnd.name = name; gtnd.skip = NULL; - (void) strlcpy(pname, parent, sizeof (pname)); - /* - * Search progressively larger portions of the hierarchy. This will + * Search progressively larger portions of the hierarchy, starting + * with the filesystem specified by 'parent'. This will * select the "most local" version of the origin snapshot in the case * that there are multiple matching snapshots in the system. */ - while ((cp = strrchr(pname, '/')) != NULL) { - + (void) strlcpy(pname, parent, sizeof (pname)); + char *cp = strrchr(pname, '@'); + if (cp == NULL) + cp = strchr(pname, '\0'); + for (; cp != NULL; cp = strrchr(pname, '/')) { /* Chop off the last component and open the parent */ *cp = '\0'; - zhp = make_dataset_handle(hdl, pname); + zfs_handle_t *zhp = make_dataset_handle(hdl, pname); if (zhp == NULL) continue; - - err = zfs_iter_children(zhp, guid_to_name_cb, >nd); + int err = guid_to_name_cb(zfs_handle_dup(zhp), >nd); + if (err != EEXIST) + err = zfs_iter_children(zhp, guid_to_name_cb, >nd); + if (err != EEXIST && bookmark_ok) + err = zfs_iter_bookmarks(zhp, guid_to_name_cb, >nd); zfs_close(zhp); if (err == EEXIST) return (0); /* - * Remember the dataset that we already searched, so we - * skip it next time through. + * Remember the last portion of the dataset so we skip it next + * time through (as we've already searched that portion of the + * hierarchy). */ - gtnd.skip = pname; + gtnd.skip = strrchr(pname, '/') + 1; } return (ENOENT); @@ -2568,11 +2825,9 @@ recv_skip(libzfs_handle_t *hdl, int fd, switch (drr->drr_type) { case DRR_BEGIN: - /* NB: not to be used on v2 stream packages */ if (drr->drr_payloadlen != 0) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "invalid substream header")); - return (zfs_error(hdl, EZFS_BADSTREAM, errbuf)); + (void) recv_read(hdl, fd, buf, + drr->drr_payloadlen, B_FALSE, NULL); } break; @@ -2633,6 +2888,40 @@ recv_skip(libzfs_handle_t *hdl, int fd, return (-1); } +static void +recv_ecksum_set_aux(libzfs_handle_t *hdl, const char *target_snap, + boolean_t resumable) +{ + char target_fs[ZFS_MAXNAMELEN]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 13 09:32:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA40AA2CD1C; Fri, 13 Nov 2015 09:32:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4EC1EB2; Fri, 13 Nov 2015 09:32:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9W7G0013417; Fri, 13 Nov 2015 09:32:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9W473013391; Fri, 13 Nov 2015 09:32:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130932.tAD9W473013391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290757 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/ut... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:32:08 -0000 Author: mav Date: Fri Nov 13 09:32:04 2015 New Revision: 290757 URL: https://svnweb.freebsd.org/changeset/base/290757 Log: MFC r289422: 4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Saso Kiselkov Reviewed by: Richard Lowe Approved by: Garrett D'Amore Author: Matthew Ahrens illumos/illumos-gate@45818ee124adeaaf947698996b4f4c722afc6d1f This is only a partial merge of respective ZFS infrastructure changes. At this moment FreeBSD kernel has no those crypto algorithms, so the parts of the code to enable them are commented out. When they are implemented, it will be trivial to plug them in. Added: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c - copied unchanged from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c - copied unchanged from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1487,6 +1487,12 @@ zfs_setprop_error(libzfs_handle_t *hdl, "property setting is not allowed on " "bootable datasets")); (void) zfs_error(hdl, EZFS_NOTSUP, errbuf); + } else if (prop == ZFS_PROP_CHECKSUM || + prop == ZFS_PROP_DEDUP) { + (void) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property setting is not allowed on " + "root pools")); + (void) zfs_error(hdl, EZFS_NOTSUP, errbuf); } else { (void) zfs_standard_error(hdl, err, errbuf); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1423,7 +1423,7 @@ zfs_send_resume_token_to_nvlist(libzfs_h /* verify checksum */ zio_cksum_t cksum; - fletcher_4_native(compressed, len, &cksum); + fletcher_4_native(compressed, len, NULL, &cksum); if (cksum.zc_word[0] != checksum) { free(compressed); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:32:04 2015 (r290757) @@ -230,4 +230,19 @@ zpool_feature_init(void) "org.open-zfs:large_blocks", "large_blocks", "Support for blocks larger than 128KB.", ZFEATURE_FLAG_PER_DATASET, large_blocks_deps); + +#ifdef illumos + zfeature_register(SPA_FEATURE_SHA512, + "org.illumos:sha512", "sha512", + "SHA-512/256 hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); + zfeature_register(SPA_FEATURE_SKEIN, + "org.illumos:skein", "skein", + "Skein hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); + zfeature_register(SPA_FEATURE_EDONR, + "org.illumos:edonr", "edonr", + "Edon-R hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); +#endif } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri Nov 13 09:32:04 2015 (r290757) @@ -51,6 +51,11 @@ typedef enum spa_feature { SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURE_LARGE_BLOCKS, +#ifdef illumos + SPA_FEATURE_SHA512, + SPA_FEATURE_SKEIN, + SPA_FEATURE_EDONR, +#endif SPA_FEATURES } spa_feature_t; Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ /* * Fletcher Checksums @@ -131,8 +134,10 @@ #include #include +/*ARGSUSED*/ void -fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -148,8 +153,10 @@ fletcher_2_native(const void *buf, uint6 ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1); } +/*ARGSUSED*/ void -fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -165,8 +172,10 @@ fletcher_2_byteswap(const void *buf, uin ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1); } +/*ARGSUSED*/ void -fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); @@ -182,8 +191,10 @@ fletcher_4_native(const void *buf, uint6 ZIO_SET_CHECKSUM(zcp, a, b, c, d); } +/*ARGSUSED*/ void -fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ #ifndef _ZFS_FLETCHER_H #define _ZFS_FLETCHER_H @@ -37,14 +40,12 @@ extern "C" { * fletcher checksum functions */ -void fletcher_2_native(const void *, uint64_t, zio_cksum_t *); -void fletcher_2_byteswap(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_native(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_byteswap(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_incremental_native(const void *, uint64_t, - zio_cksum_t *); -void fletcher_4_incremental_byteswap(const void *, uint64_t, - zio_cksum_t *); +void fletcher_2_native(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_2_byteswap(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_native(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_byteswap(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_incremental_native(const void *, uint64_t, zio_cksum_t *); +void fletcher_4_incremental_byteswap(const void *, uint64_t, zio_cksum_t *); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri Nov 13 09:32:04 2015 (r290757) @@ -71,6 +71,11 @@ zfs_prop_init(void) { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, { "noparity", ZIO_CHECKSUM_NOPARITY }, +#ifdef illumos + { "sha512", ZIO_CHECKSUM_SHA512 }, + { "skein", ZIO_CHECKSUM_SKEIN }, + { "edonr", ZIO_CHECKSUM_EDONR }, +#endif { NULL } }; @@ -81,6 +86,16 @@ zfs_prop_init(void) { "sha256", ZIO_CHECKSUM_SHA256 }, { "sha256,verify", ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY }, +#ifdef illumos + { "sha512", ZIO_CHECKSUM_SHA512 }, + { "sha512,verify", + ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY }, + { "skein", ZIO_CHECKSUM_SKEIN }, + { "skein,verify", + ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY }, + { "edonr,verify", + ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY }, +#endif { NULL } }; @@ -225,12 +240,12 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_CHECKSUM, "checksum", ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM", - checksum_table); + "on | off | fletcher2 | fletcher4 | sha256 | sha512 | " + "skein | edonr", "CHECKSUM", checksum_table); zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "on | off | verify | sha256[,verify]", "DEDUP", - dedup_table); + "on | off | verify | sha256[,verify], sha512[,verify], " + "skein[,verify], edonr,verify", "DEDUP", dedup_table); zprop_register_index(ZFS_PROP_COMPRESSION, "compression", ZIO_COMPRESS_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1555,7 +1555,7 @@ arc_cksum_verify(arc_buf_t *buf) mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); return; } - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, &zc); + fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); if (!ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc)) panic("buffer modified while frozen!"); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); @@ -1568,7 +1568,7 @@ arc_cksum_equal(arc_buf_t *buf) int equal; mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, &zc); + fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); equal = ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); @@ -1588,7 +1588,7 @@ arc_cksum_compute(arc_buf_t *buf, boolea } buf->b_hdr->b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t), KM_SLEEP); fletcher_2_native(buf->b_data, buf->b_hdr->b_size, - buf->b_hdr->b_freeze_cksum); + NULL, buf->b_hdr->b_freeze_cksum); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); #ifdef illumos arc_buf_watch(buf); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Nov 13 09:32:04 2015 (r290757) @@ -21,7 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #include @@ -65,7 +65,8 @@ ddt_object_create(ddt_t *ddt, enum ddt_t spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; - boolean_t prehash = zio_checksum_table[ddt->ddt_checksum].ci_dedup; + boolean_t prehash = zio_checksum_table[ddt->ddt_checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1494,7 +1494,8 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf ASSERT(BP_EQUAL(bp, bp_orig)); ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); - ASSERT(zio_checksum_table[chksum].ci_dedup); + ASSERT(zio_checksum_table[chksum].ci_flags & + ZCHECKSUM_FLAG_NOPWRITE); } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; @@ -1842,8 +1843,10 @@ dmu_write_policy(objset_t *os, dnode_t * * as well. Otherwise, the metadata checksum defaults * to fletcher4. */ - if (zio_checksum_table[checksum].ci_correctable < 1 || - zio_checksum_table[checksum].ci_eck) + if (!(zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_METADATA) || + (zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_EMBEDDED)) checksum = ZIO_CHECKSUM_FLETCHER_4; if (os->os_redundant_metadata == ZFS_REDUNDANT_METADATA_ALL || @@ -1882,17 +1885,20 @@ dmu_write_policy(objset_t *os, dnode_t * */ if (dedup_checksum != ZIO_CHECKSUM_OFF) { dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; - if (!zio_checksum_table[checksum].ci_dedup) + if (!(zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP)) dedup_verify = B_TRUE; } /* - * Enable nopwrite if we have a cryptographically secure - * checksum that has no known collisions (i.e. SHA-256) - * and compression is enabled. We don't enable nopwrite if - * dedup is enabled as the two features are mutually exclusive. + * Enable nopwrite if we have secure enough checksum + * algorithm (see comment in zio_nop_write) and + * compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually + * exclusive. */ - nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + nopwrite = (!dedup && (zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_NOPWRITE) && compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Nov 13 09:32:04 2015 (r290757) @@ -292,7 +292,8 @@ dump_write(dmu_sendarg_t *dsp, dmu_objec drrw->drr_checksumtype = ZIO_CHECKSUM_OFF; } else { drrw->drr_checksumtype = BP_GET_CHECKSUM(bp); - if (zio_checksum_table[drrw->drr_checksumtype].ci_dedup) + if (zio_checksum_table[drrw->drr_checksumtype].ci_flags & + ZCHECKSUM_FLAG_DEDUP) drrw->drr_checksumflags |= DRR_CHECKSUM_DEDUP; DDK_SET_LSIZE(&drrw->drr_key, BP_GET_LSIZE(bp)); DDK_SET_PSIZE(&drrw->drr_key, BP_GET_PSIZE(bp)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:32:04 2015 (r290757) @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include #include @@ -133,10 +135,16 @@ dsl_dataset_block_born(dsl_dataset_t *ds dsl_dataset_phys(ds)->ds_compressed_bytes += compressed; dsl_dataset_phys(ds)->ds_uncompressed_bytes += uncompressed; dsl_dataset_phys(ds)->ds_unique_bytes += used; + if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) { ds->ds_feature_activation_needed[SPA_FEATURE_LARGE_BLOCKS] = B_TRUE; } + + spa_feature_t f = zio_checksum_to_feature(BP_GET_CHECKSUM(bp)); + if (f != SPA_FEATURE_NONE) + ds->ds_feature_activation_needed[f] = B_TRUE; + mutex_exit(&ds->ds_lock); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, compressed, uncompressed, tx); @@ -1791,7 +1799,7 @@ get_receive_resume_stats(dsl_dataset_t * packed_size, packed_size, 6); zio_cksum_t cksum; - fletcher_4_native(compressed, compressed_size, &cksum); + fletcher_4_native(compressed, compressed_size, NULL, &cksum); str = kmem_alloc(compressed_size * 2 + 1, KM_SLEEP); for (int i = 0; i < compressed_size; i++) { Copied: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c (from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c Fri Nov 13 09:32:04 2015 (r290757, copy of r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c) @@ -0,0 +1,102 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + * Use is subject to license terms. + */ +#include +#include +#include + +#define EDONR_MODE 512 +#define EDONR_BLOCK_SIZE EdonR512_BLOCK_SIZE + +/* + * Native zio_checksum interface for the Edon-R hash function. + */ +/*ARGSUSED*/ +void +zio_checksum_edonr_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + uint8_t digest[EDONR_MODE / 8]; + EdonRState ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + EdonRUpdate(&ctx, buf, size * 8); + EdonRFinal(&ctx, digest); + bcopy(digest, zcp->zc_word, sizeof (zcp->zc_word)); +} + +/* + * Byteswapped zio_checksum interface for the Edon-R hash function. + */ +void +zio_checksum_edonr_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_edonr_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(zcp->zc_word[0]); + zcp->zc_word[1] = BSWAP_64(zcp->zc_word[1]); + zcp->zc_word[2] = BSWAP_64(zcp->zc_word[2]); + zcp->zc_word[3] = BSWAP_64(zcp->zc_word[3]); +} + +void * +zio_checksum_edonr_tmpl_init(const zio_cksum_salt_t *salt) +{ + EdonRState *ctx; + uint8_t salt_block[EDONR_BLOCK_SIZE]; + + /* + * Edon-R needs all but the last hash invocation to be on full-size + * blocks, but the salt is too small. Rather than simply padding it + * with zeros, we expand the salt into a new salt block of proper + * size by double-hashing it (the new salt block will be composed of + * H(salt) || H(H(salt))). + */ + CTASSERT(EDONR_BLOCK_SIZE == 2 * (EDONR_MODE / 8)); + EdonRHash(EDONR_MODE, salt->zcs_bytes, sizeof (salt->zcs_bytes) * 8, + salt_block); + EdonRHash(EDONR_MODE, salt_block, EDONR_MODE, salt_block + + EDONR_MODE / 8); + + /* + * Feed the new salt block into the hash function - this will serve + * as our MAC key. + */ + ctx = kmem_zalloc(sizeof (*ctx), KM_SLEEP); + EdonRInit(ctx, EDONR_MODE); + EdonRUpdate(ctx, salt_block, sizeof (salt_block) * 8); + return (ctx); +} + +void +zio_checksum_edonr_tmpl_free(void *ctx_template) +{ + EdonRState *ctx = ctx_template; + + bzero(ctx, sizeof (*ctx)); + kmem_free(ctx, sizeof (*ctx)); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ #include #include #ifdef _KERNEL @@ -30,8 +33,10 @@ #include #endif +/*ARGSUSED*/ void -zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) +zio_checksum_SHA256(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { SHA256_CTX ctx; zio_cksum_t tmp; @@ -52,3 +57,31 @@ zio_checksum_SHA256(const void *buf, uin zcp->zc_word[2] = BE_64(tmp.zc_word[2]); zcp->zc_word[3] = BE_64(tmp.zc_word[3]); } + +#ifdef illumos +/*ARGSUSED*/ +void +zio_checksum_SHA512_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + SHA2_CTX ctx; + + SHA2Init(SHA512_256, &ctx); + SHA2Update(&ctx, buf, size); + SHA2Final(zcp, &ctx); +} + +/*ARGSUSED*/ +void +zio_checksum_SHA512_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_SHA512_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} +#endif Copied: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c (from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Fri Nov 13 09:32:04 2015 (r290757, copy of r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c) @@ -0,0 +1,91 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ +#include +#include +#include + +/* + * Computes a native 256-bit skein MAC checksum. Please note that this + * function requires the presence of a ctx_template that should be allocated + * using zio_checksum_skein_tmpl_init. + */ +/*ARGSUSED*/ +void +zio_checksum_skein_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + Skein_512_Ctxt_t ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + (void) Skein_512_Update(&ctx, buf, size); + (void) Skein_512_Final(&ctx, (uint8_t *)zcp); + bzero(&ctx, sizeof (ctx)); +} + +/* + * Byteswapped version of zio_checksum_skein_native. This just invokes + * the native checksum function and byteswaps the resulting checksum (since + * skein is internally endian-insensitive). + */ +void +zio_checksum_skein_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_skein_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} + +/* + * Allocates a skein MAC template suitable for using in skein MAC checksum + * computations and returns a pointer to it. + */ +void * +zio_checksum_skein_tmpl_init(const zio_cksum_salt_t *salt) +{ + Skein_512_Ctxt_t *ctx; + + ctx = kmem_zalloc(sizeof (*ctx), KM_SLEEP); + (void) Skein_512_InitExt(ctx, sizeof (zio_cksum_t) * 8, 0, + salt->zcs_bytes, sizeof (salt->zcs_bytes)); + return (ctx); +} + +/* + * Frees a skein context template previously allocated using + * zio_checksum_skein_tmpl_init. + */ +void +zio_checksum_skein_tmpl_free(void *ctx_template) +{ + Skein_512_Ctxt_t *ctx = ctx_template; + + bzero(ctx, sizeof (*ctx)); + kmem_free(ctx, sizeof (*ctx)); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:32:04 2015 (r290757) @@ -25,6 +25,7 @@ * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ /* @@ -2579,6 +2580,19 @@ spa_load_impl(spa_t *spa, uint64_t pool_ return (spa_load(spa, state, SPA_IMPORT_EXISTING, B_TRUE)); } + /* Grab the secret checksum salt from the MOS. */ + error = zap_lookup(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes); + if (error == ENOENT) { + /* Generate a new salt for subsequent use */ + (void) random_get_pseudo_bytes(spa->spa_cksum_salt.zcs_bytes, + sizeof (spa->spa_cksum_salt.zcs_bytes)); + } else if (error != 0) { + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + } + if (spa_dir_prop(spa, DMU_POOL_SYNC_BPOBJ, &obj) != 0) return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); error = bpobj_open(&spa->spa_deferred_bpobj, spa->spa_meta_objset, obj); @@ -3747,6 +3761,12 @@ spa_create(const char *pool, nvlist_t *n spa_history_create_obj(spa, tx); /* + * Generate some random noise for salted checksums to operate on. + */ + (void) random_get_pseudo_bytes(spa->spa_cksum_salt.zcs_bytes, + sizeof (spa->spa_cksum_salt.zcs_bytes)); + + /* * Set pool properties. */ spa->spa_bootfs = zpool_prop_default_numeric(ZPOOL_PROP_BOOTFS); @@ -6551,6 +6571,20 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t * if (lz4_en && !lz4_ac) spa_feature_incr(spa, SPA_FEATURE_LZ4_COMPRESS, tx); } + + /* + * If we haven't written the salt, do so now. Note that the + * feature may not be activated yet, but that's fine since + * the presence of this ZAP entry is backwards compatible. + */ + if (zap_contains(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_CHECKSUM_SALT) == ENOENT) { + VERIFY0(zap_add(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes, tx)); + } + rrw_exit(&dp->dp_config_rwlock, FTAG); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Nov 13 09:32:04 2015 (r290757) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #include @@ -51,7 +52,7 @@ #include #include #include "zfs_prop.h" -#include "zfeature_common.h" +#include /* * SPA locking @@ -608,6 +609,7 @@ spa_add(const char *name, nvlist_t *conf mutex_init(&spa->spa_history_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_proc_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_props_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_cksum_tmpls_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); @@ -770,6 +772,8 @@ spa_remove(spa_t *spa) for (int t = 0; t < TXG_SIZE; t++) bplist_destroy(&spa->spa_free_bplist[t]); + zio_checksum_templates_free(spa); + cv_destroy(&spa->spa_async_cv); cv_destroy(&spa->spa_evicting_os_cv); cv_destroy(&spa->spa_proc_cv); @@ -783,6 +787,7 @@ spa_remove(spa_t *spa) mutex_destroy(&spa->spa_history_lock); mutex_destroy(&spa->spa_proc_lock); mutex_destroy(&spa->spa_props_lock); + mutex_destroy(&spa->spa_cksum_tmpls_lock); mutex_destroy(&spa->spa_scrub_lock); mutex_destroy(&spa->spa_suspend_lock); mutex_destroy(&spa->spa_vdev_top_lock); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Nov 13 09:32:04 2015 (r290757) @@ -27,6 +27,7 @@ * Copyright 2013 DEY Storage Systems, Inc. * Copyright 2014 HybridCluster. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -320,6 +321,7 @@ typedef struct dmu_buf { #define DMU_POOL_FREE_BPOBJ "free_bpobj" #define DMU_POOL_BPTREE_OBJ "bptree_obj" #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" +#define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" /* * Allocate an object from this objset. The range of object numbers Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Nov 13 09:32:04 2015 (r290757) @@ -23,6 +23,7 @@ * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #ifndef _SYS_SPA_H @@ -163,6 +164,14 @@ typedef struct zio_cksum { } zio_cksum_t; /* + * Some checksums/hashes need a 256-bit initialization salt. This salt is kept + * secret and is suitable for use in MAC algorithms as the key. + */ +typedef struct zio_cksum_salt { + uint8_t zcs_bytes[32]; +} zio_cksum_salt_t; + +/* * Each block is described by its DVAs, time of birth, checksum, etc. * The word-by-word, bit-by-bit layout of the blkptr is as follows: * Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Nov 13 09:32:04 2015 (r290757) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #ifndef _SYS_SPA_IMPL_H @@ -166,6 +167,10 @@ struct spa { uint64_t spa_syncing_txg; /* txg currently syncing */ bpobj_t spa_deferred_bpobj; /* deferred-free bplist */ bplist_t spa_free_bplist[TXG_SIZE]; /* bplist of stuff to free */ + zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ + /* checksum context templates */ + kmutex_t spa_cksum_tmpls_lock; + void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; uberblock_t spa_ubsync; /* last synced uberblock */ uberblock_t spa_uberblock; /* current uberblock */ boolean_t spa_extreme_rewind; /* rewind past deferred frees */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Nov 13 09:32:04 2015 (r290757) @@ -82,6 +82,11 @@ enum zio_checksum { ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, ZIO_CHECKSUM_NOPARITY, +#ifdef illumos + ZIO_CHECKSUM_SHA512, + ZIO_CHECKSUM_SKEIN, + ZIO_CHECKSUM_EDONR, +#endif ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Fri Nov 13 09:32:04 2015 (r290757) @@ -20,13 +20,15 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. + * Copyright Saso Kiselkov 2013, All rights reserved. */ #ifndef _SYS_ZIO_CHECKSUM_H #define _SYS_ZIO_CHECKSUM_H #include +#include #ifdef __cplusplus extern "C" { @@ -35,17 +37,34 @@ extern "C" { /* * Signature for checksum functions. */ -typedef void zio_checksum_func_t(const void *, uint64_t, zio_cksum_t *); +typedef void zio_checksum_t(const void *data, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp); +typedef void *zio_checksum_tmpl_init_t(const zio_cksum_salt_t *salt); +typedef void zio_checksum_tmpl_free_t(void *ctx_template); + +typedef enum zio_checksum_flags { + /* Strong enough for metadata? */ + ZCHECKSUM_FLAG_METADATA = (1 << 1), + /* ZIO embedded checksum */ + ZCHECKSUM_FLAG_EMBEDDED = (1 << 2), + /* Strong enough for dedup (without verification)? */ + ZCHECKSUM_FLAG_DEDUP = (1 << 3), + /* Uses salt value */ + ZCHECKSUM_FLAG_SALTED = (1 << 4), + /* Strong enough for nopwrite? */ + ZCHECKSUM_FLAG_NOPWRITE = (1 << 5) +} zio_checksum_flags_t; /* * Information about each checksum function. */ typedef struct zio_checksum_info { - zio_checksum_func_t *ci_func[2]; /* checksum function per byteorder */ - int ci_correctable; /* number of correctable bits */ - int ci_eck; /* uses zio embedded checksum? */ - boolean_t ci_dedup; /* strong enough for dedup? */ - char *ci_name; /* descriptive name */ + /* checksum function for each byteorder */ + zio_checksum_t *ci_func[2]; + zio_checksum_tmpl_init_t *ci_tmpl_init; + zio_checksum_tmpl_free_t *ci_tmpl_free; + zio_checksum_flags_t ci_flags; + char *ci_name; /* descriptive name */ } zio_checksum_info_t; typedef struct zio_bad_cksum { @@ -62,12 +81,30 @@ extern zio_checksum_info_t zio_checksum_ /* * Checksum routines. */ -extern zio_checksum_func_t zio_checksum_SHA256; +extern zio_checksum_t zio_checksum_SHA256; +#ifdef illumos +extern zio_checksum_t zio_checksum_SHA512_native; +extern zio_checksum_t zio_checksum_SHA512_byteswap; + +/* Skein */ +extern zio_checksum_t zio_checksum_skein_native; +extern zio_checksum_t zio_checksum_skein_byteswap; +extern zio_checksum_tmpl_init_t zio_checksum_skein_tmpl_init; +extern zio_checksum_tmpl_free_t zio_checksum_skein_tmpl_free; + +/* Edon-R */ +extern zio_checksum_t zio_checksum_edonr_native; +extern zio_checksum_t zio_checksum_edonr_byteswap; +extern zio_checksum_tmpl_init_t zio_checksum_edonr_tmpl_init; +extern zio_checksum_tmpl_free_t zio_checksum_edonr_tmpl_free; +#endif extern void zio_checksum_compute(zio_t *zio, enum zio_checksum checksum, void *data, uint64_t size); extern int zio_checksum_error(zio_t *zio, zio_bad_cksum_t *out); extern enum zio_checksum spa_dedup_checksum(spa_t *spa); +extern void zio_checksum_templates_free(spa_t *spa); +extern spa_feature_t zio_checksum_to_feature(enum zio_checksum cksum); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:32:04 2015 (r290757) @@ -185,6 +185,7 @@ #include #include #include +#include #include "zfs_namecheck.h" #include "zfs_prop.h" @@ -3902,11 +3903,6 @@ zfs_check_settable(const char *dsname, n return (SET_ERROR(ENOTSUP)); break; - case ZFS_PROP_DEDUP: - if (zfs_earlier_version(dsname, SPA_VERSION_DEDUP)) - return (SET_ERROR(ENOTSUP)); - break; - case ZFS_PROP_RECORDSIZE: /* Record sizes above 128k need the feature to be enabled */ if (nvpair_value_uint64(pair, &intval) == 0 && @@ -3957,6 +3953,45 @@ zfs_check_settable(const char *dsname, n return (SET_ERROR(ENOTSUP)); } break; + + case ZFS_PROP_CHECKSUM: + case ZFS_PROP_DEDUP: + { + spa_feature_t feature; + spa_t *spa; + + /* dedup feature version checks */ + if (prop == ZFS_PROP_DEDUP && + zfs_earlier_version(dsname, SPA_VERSION_DEDUP)) + return (SET_ERROR(ENOTSUP)); + + if (nvpair_value_uint64(pair, &intval) != 0) + return (SET_ERROR(EINVAL)); + + /* check prop value is enabled in features */ + feature = zio_checksum_to_feature(intval); + if (feature == SPA_FEATURE_NONE) + break; + + if ((err = spa_open(dsname, &spa, FTAG)) != 0) + return (err); + /* + * Salted checksums are not supported on root pools. + */ + if (spa_bootfs(spa) != 0 && + intval < ZIO_CHECKSUM_FUNCTIONS && + (zio_checksum_table[intval].ci_flags & + ZCHECKSUM_FLAG_SALTED)) { + spa_close(spa, FTAG); + return (SET_ERROR(ERANGE)); + } + if (!spa_feature_is_enabled(spa, feature)) { + spa_close(spa, FTAG); + return (SET_ERROR(ENOTSUP)); + } + spa_close(spa, FTAG); + break; + } } return (zfs_secpolicy_setprop(dsname, prop, pair, CRED())); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:32:04 2015 (r290757) @@ -999,7 +999,7 @@ zio_write_phys(zio_t *pio, vdev_t *vd, u zio->io_prop.zp_checksum = checksum; - if (zio_checksum_table[checksum].ci_eck) { + if (zio_checksum_table[checksum].ci_flags & ZCHECKSUM_FLAG_EMBEDDED) { /* * zec checksums are necessarily destructive -- they modify * the end of the write buffer to hold the verifier/checksum. @@ -1211,8 +1211,8 @@ zio_write_bp_init(zio_t *zio) if (BP_IS_HOLE(bp) || !zp->zp_dedup) return (ZIO_PIPELINE_CONTINUE); - ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup || - zp->zp_dedup_verify); + ASSERT((zio_checksum_table[zp->zp_checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP) || zp->zp_dedup_verify); if (BP_GET_CHECKSUM(bp) == zp->zp_checksum) { BP_SET_DEDUP(bp, 1); @@ -2074,12 +2074,22 @@ zio_write_gang_block(zio_t *pio) } /* - * The zio_nop_write stage in the pipeline determines if allocating - * a new bp is necessary. By leveraging a cryptographically secure checksum, - * such as SHA256, we can compare the checksums of the new data and the old - * to determine if allocating a new block is required. The nopwrite - * feature can handle writes in either syncing or open context (i.e. zil - * writes) and as a result is mutually exclusive with dedup. + * The zio_nop_write stage in the pipeline determines if allocating a + * new bp is necessary. The nopwrite feature can handle writes in + * either syncing or open context (i.e. zil writes) and as a result is + * mutually exclusive with dedup. + * + * By leveraging a cryptographically secure checksum, such as SHA256, we + * can compare the checksums of the new data and the old to determine if + * allocating a new block is required. Note that our requirements for + * cryptographic strength are fairly weak: there can't be any accidental + * hash collisions, but we don't need to be secure against intentional + * (malicious) collisions. To trigger a nopwrite, you have to be able + * to write the file to begin with, and triggering an incorrect (hash + * collision) nopwrite is no worse than simply writing to the file. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 13 09:39:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D91DA2CF36; Fri, 13 Nov 2015 09:39:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDABB1377; Fri, 13 Nov 2015 09:39:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9duXi013814; Fri, 13 Nov 2015 09:39:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9dt0S013809; Fri, 13 Nov 2015 09:39:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130939.tAD9dt0S013809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290758 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:39:57 -0000 Author: mav Date: Fri Nov 13 09:39:55 2015 New Revision: 290758 URL: https://svnweb.freebsd.org/changeset/base/290758 Log: MFC r289497: 5745 zfs set allows only one dataset property to be set at a time Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Bayard Bell Reviewed by: Richard PALO Reviewed by: Steven Hartland Approved by: Rich Lowe Author: Chris Williamson illumos/illumos-gate@30925561c223021e91d15899cbe75f80e54d8889 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:39:55 2015 (r290758) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2014 by Delphix. All rights reserved. +.\" Copyright (c) 2011, 2014 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -117,7 +117,7 @@ .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm set -.Ar property Ns = Ns Ar value +.Ar property Ns = Ns Ar value Oc ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Nm .Cm get @@ -2121,14 +2121,14 @@ option, but sorts by property in descend .It Xo .Nm .Cm set -.Ar property Ns = Ns Ar value +.Ar property Ns = Ns Ar value Oc ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .Pp -Sets the property to the given value for each dataset. Only some properties can -be edited. See the "Properties" section for more information on what properties -can be set and acceptable values. Numeric values can be specified as exact -values, or in a human-readable form with a suffix of +Sets the property or list of properties to the given value(s) for each dataset. +Only some properties can be edited. See the "Properties" section for more +information on what properties can be set and acceptable values. Numeric values +can be specified as exact values, or in a human-readable form with a suffix of .Sy B , K , M , G , T , P , E , Z (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). User properties can be set on snapshots. For more Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:39:55 2015 (r290758) @@ -283,7 +283,7 @@ get_usage(zfs_help_t idx) "\n" "\tsend [-nvPe] -t \n")); case HELP_SET: - return (gettext("\tset " + return (gettext("\tset ... " " ...\n")); case HELP_SHARE: return (gettext("\tshare <-a | filesystem>\n")); @@ -498,6 +498,10 @@ usage(boolean_t requested) exit(requested ? 0 : 2); } +/* + * Take a property=value argument string and add it to the given nvlist. + * Modifies the argument inplace. + */ static int parseprop(nvlist_t *props, char *propname) { @@ -505,7 +509,7 @@ parseprop(nvlist_t *props, char *propnam if ((propval = strchr(propname, '=')) == NULL) { (void) fprintf(stderr, gettext("missing " - "'=' for -o option\n")); + "'=' for property=value argument\n")); return (-1); } *propval = '\0'; @@ -632,7 +636,7 @@ zfs_do_clone(int argc, char **argv) while ((c = getopt(argc, argv, "o:p")) != -1) { switch (c) { case 'o': - if (parseprop(props, optarg)) + if (parseprop(props, optarg) != 0) return (1); break; case 'p': @@ -3532,21 +3536,17 @@ out: } /* - * zfs set property=value { fs | snap | vol } ... + * zfs set property=value ... { fs | snap | vol } ... * - * Sets the given property for all datasets specified on the command line. + * Sets the given properties for all datasets specified on the command line. */ -typedef struct set_cbdata { - char *cb_propname; - char *cb_value; -} set_cbdata_t; static int set_callback(zfs_handle_t *zhp, void *data) { - set_cbdata_t *cbp = data; + nvlist_t *props = data; - if (zfs_prop_set(zhp, cbp->cb_propname, cbp->cb_value) != 0) { + if (zfs_prop_set_list(zhp, props) != 0) { switch (libzfs_errno(g_zfs)) { case EZFS_MOUNTFAILED: (void) fprintf(stderr, gettext("property may be set " @@ -3565,7 +3565,8 @@ set_callback(zfs_handle_t *zhp, void *da static int zfs_do_set(int argc, char **argv) { - set_cbdata_t cb; + nvlist_t *props = NULL; + int ds_start = -1; /* argv idx of first dataset arg */ int ret = 0; /* check for options */ @@ -3577,36 +3578,51 @@ zfs_do_set(int argc, char **argv) /* check number of arguments */ if (argc < 2) { - (void) fprintf(stderr, gettext("missing property=value " - "argument\n")); + (void) fprintf(stderr, gettext("missing arguments\n")); usage(B_FALSE); } if (argc < 3) { - (void) fprintf(stderr, gettext("missing dataset name\n")); + if (strchr(argv[1], '=') == NULL) { + (void) fprintf(stderr, gettext("missing property=value " + "argument(s)\n")); + } else { + (void) fprintf(stderr, gettext("missing dataset " + "name(s)\n")); + } usage(B_FALSE); } - /* validate property=value argument */ - cb.cb_propname = argv[1]; - if (((cb.cb_value = strchr(cb.cb_propname, '=')) == NULL) || - (cb.cb_value[1] == '\0')) { - (void) fprintf(stderr, gettext("missing value in " - "property=value argument\n")); + /* validate argument order: prop=val args followed by dataset args */ + for (int i = 1; i < argc; i++) { + if (strchr(argv[i], '=') != NULL) { + if (ds_start > 0) { + /* out-of-order prop=val argument */ + (void) fprintf(stderr, gettext("invalid " + "argument order\n"), i); + usage(B_FALSE); + } + } else if (ds_start < 0) { + ds_start = i; + } + } + if (ds_start < 0) { + (void) fprintf(stderr, gettext("missing dataset name(s)\n")); usage(B_FALSE); } - *cb.cb_value = '\0'; - cb.cb_value++; - - if (*cb.cb_propname == '\0') { - (void) fprintf(stderr, - gettext("missing property in property=value argument\n")); - usage(B_FALSE); + /* Populate a list of property settings */ + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); + for (int i = 1; i < ds_start; i++) { + if ((ret = parseprop(props, argv[i])) != 0) + goto error; } - ret = zfs_for_each(argc - 2, argv + 2, 0, - ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, &cb); + ret = zfs_for_each(argc - ds_start, argv + ds_start, 0, + ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, props); +error: + nvlist_free(props); return (ret); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:39:55 2015 (r290758) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -430,6 +430,7 @@ extern nvlist_t *zfs_valid_proplist(libz extern const char *zfs_prop_to_name(zfs_prop_t); extern int zfs_prop_set(zfs_handle_t *, const char *, const char *); +extern int zfs_prop_set_list(zfs_handle_t *, nvlist_t *); extern int zfs_prop_get(zfs_handle_t *, zfs_prop_t, char *, size_t, zprop_source_t *, char *, size_t, boolean_t); extern int zfs_prop_get_recvd(zfs_handle_t *, const char *, char *, size_t, Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:39:55 2015 (r290758) @@ -1528,15 +1528,10 @@ zfs_setprop_error(libzfs_handle_t *hdl, int zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { 0 }; int ret = -1; - prop_changelist_t *cl = NULL; char errbuf[1024]; libzfs_handle_t *hdl = zhp->zfs_hdl; - nvlist_t *nvl = NULL, *realprops; - zfs_prop_t prop; - boolean_t do_prefix = B_TRUE; - int added_resv; + nvlist_t *nvl = NULL; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot set property for '%s'"), @@ -1548,79 +1543,148 @@ zfs_prop_set(zfs_handle_t *zhp, const ch goto error; } - if ((realprops = zfs_valid_proplist(hdl, zhp->zfs_type, nvl, - zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) - goto error; + ret = zfs_prop_set_list(zhp, nvl); +error: nvlist_free(nvl); - nvl = realprops; + return (ret); +} - prop = zfs_name_to_prop(propname); - /* We don't support those properties on FreeBSD. */ - switch (prop) { - case ZFS_PROP_DEVICES: - case ZFS_PROP_ISCSIOPTIONS: - case ZFS_PROP_XATTR: - case ZFS_PROP_VSCAN: - case ZFS_PROP_NBMAND: - case ZFS_PROP_MLSLABEL: - (void) snprintf(errbuf, sizeof (errbuf), - "property '%s' not supported on FreeBSD", propname); - ret = zfs_error(hdl, EZFS_PERM, errbuf); - goto error; - } - if (prop == ZFS_PROP_VOLSIZE) { - if ((added_resv = zfs_add_synthetic_resv(zhp, nvl)) == -1) - goto error; - } +/* + * Given an nvlist of property names and values, set the properties for the + * given dataset. + */ +int +zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props) +{ + zfs_cmd_t zc = { 0 }; + int ret = -1; + prop_changelist_t **cls = NULL; + int cl_idx; + char errbuf[1024]; + libzfs_handle_t *hdl = zhp->zfs_hdl; + nvlist_t *nvl; + int nvl_len; + int added_resv; - if ((cl = changelist_gather(zhp, prop, 0, 0)) == NULL) - goto error; + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, "cannot set property for '%s'"), + zhp->zfs_name); - if (prop == ZFS_PROP_MOUNTPOINT && changelist_haszonedchild(cl)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "child dataset with inherited mountpoint is used " - "in a non-global zone")); - ret = zfs_error(hdl, EZFS_ZONED, errbuf); + if ((nvl = zfs_valid_proplist(hdl, zhp->zfs_type, props, + zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) goto error; - } /* - * We don't want to unmount & remount the dataset when changing - * its canmount property to 'on' or 'noauto'. We only use - * the changelist logic to unmount when setting canmount=off. - */ - if (prop == ZFS_PROP_CANMOUNT) { - uint64_t idx; - int err = zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET); - if (err == 0 && idx != ZFS_CANMOUNT_OFF) - do_prefix = B_FALSE; + * We have to check for any extra properties which need to be added + * before computing the length of the nvlist. + */ + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + if (zfs_name_to_prop(nvpair_name(elem)) == ZFS_PROP_VOLSIZE && + (added_resv = zfs_add_synthetic_resv(zhp, nvl)) == -1) { + goto error; + } } - - if (do_prefix && (ret = changelist_prefix(cl)) != 0) + /* + * Check how many properties we're setting and allocate an array to + * store changelist pointers for postfix(). + */ + nvl_len = 0; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) + nvl_len++; + if ((cls = calloc(nvl_len, sizeof (prop_changelist_t *))) == NULL) goto error; + cl_idx = 0; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + + zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem)); + + assert(cl_idx < nvl_len); + /* + * We don't want to unmount & remount the dataset when changing + * its canmount property to 'on' or 'noauto'. We only use + * the changelist logic to unmount when setting canmount=off. + */ + if (!(prop == ZFS_PROP_CANMOUNT && + fnvpair_value_uint64(elem) != ZFS_CANMOUNT_OFF)) { + cls[cl_idx] = changelist_gather(zhp, prop, 0, 0); + if (cls[cl_idx] == NULL) + goto error; + } + + if (prop == ZFS_PROP_MOUNTPOINT && + changelist_haszonedchild(cls[cl_idx])) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "child dataset with inherited mountpoint is used " + "in a non-global zone")); + ret = zfs_error(hdl, EZFS_ZONED, errbuf); + goto error; + } + + /* We don't support those properties on FreeBSD. */ + switch (prop) { + case ZFS_PROP_DEVICES: + case ZFS_PROP_ISCSIOPTIONS: + case ZFS_PROP_XATTR: + case ZFS_PROP_VSCAN: + case ZFS_PROP_NBMAND: + case ZFS_PROP_MLSLABEL: + (void) snprintf(errbuf, sizeof (errbuf), + "property '%s' not supported on FreeBSD", + nvpair_name(elem)); + ret = zfs_error(hdl, EZFS_PERM, errbuf); + goto error; + } + + if (cls[cl_idx] != NULL && + (ret = changelist_prefix(cls[cl_idx])) != 0) + goto error; + + cl_idx++; + } + assert(cl_idx == nvl_len); + /* - * Execute the corresponding ioctl() to set this property. + * Execute the corresponding ioctl() to set this list of properties. */ (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (zcmd_write_src_nvlist(hdl, &zc, nvl) != 0) + if ((ret = zcmd_write_src_nvlist(hdl, &zc, nvl)) != 0 || + (ret = zcmd_alloc_dst_nvlist(hdl, &zc, 0)) != 0) goto error; ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc); if (ret != 0) { - zfs_setprop_error(hdl, prop, errno, errbuf); + /* Get the list of unset properties back and report them. */ + nvlist_t *errorprops = NULL; + if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0) + goto error; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem)); + zfs_setprop_error(hdl, prop, errno, errbuf); + } + nvlist_free(errorprops); + if (added_resv && errno == ENOSPC) { /* clean up the volsize property we tried to set */ uint64_t old_volsize = zfs_prop_get_int(zhp, ZFS_PROP_VOLSIZE); nvlist_free(nvl); + nvl = NULL; zcmd_free_nvlists(&zc); + if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0) goto error; if (nvlist_add_uint64(nvl, @@ -1632,8 +1696,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch (void) zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc); } } else { - if (do_prefix) - ret = changelist_postfix(cl); + for (cl_idx = 0; cl_idx < nvl_len; cl_idx++) { + if (cls[cl_idx] != NULL) { + int clp_err = changelist_postfix(cls[cl_idx]); + if (clp_err != 0) + ret = clp_err; + } + } /* * Refresh the statistics so the new property value @@ -1646,8 +1715,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch error: nvlist_free(nvl); zcmd_free_nvlists(&zc); - if (cl) - changelist_free(cl); + if (cls != NULL) { + for (cl_idx = 0; cl_idx < nvl_len; cl_idx++) { + if (cls[cl_idx] != NULL) + changelist_free(cls[cl_idx]); + } + free(cls); + } return (ret); } @@ -4197,7 +4271,7 @@ zfs_smb_acl_mgmt(libzfs_handle_t *hdl, c if (cmd == ZFS_SMB_ACL_RENAME) { if (nvlist_alloc(&nvlist, NV_UNIQUE_NAME, 0) != 0) { (void) no_memory(hdl); - return (NULL); + return (0); } } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:39:55 2015 (r290758) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ /* @@ -782,8 +782,9 @@ zcmd_alloc_dst_nvlist(libzfs_handle_t *h if (len == 0) len = 16 * 1024; zc->zc_nvlist_dst_size = len; - if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0) + zc->zc_nvlist_dst = + (uint64_t)(uintptr_t)zfs_alloc(hdl, zc->zc_nvlist_dst_size); + if (zc->zc_nvlist_dst == 0) return (-1); return (0); @@ -798,9 +799,9 @@ int zcmd_expand_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc) { free((void *)(uintptr_t)zc->zc_nvlist_dst); - if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc->zc_nvlist_dst_size)) - == 0) + zc->zc_nvlist_dst = + (uint64_t)(uintptr_t)zfs_alloc(hdl, zc->zc_nvlist_dst_size); + if (zc->zc_nvlist_dst == 0) return (-1); return (0); @@ -815,6 +816,9 @@ zcmd_free_nvlists(zfs_cmd_t *zc) free((void *)(uintptr_t)zc->zc_nvlist_conf); free((void *)(uintptr_t)zc->zc_nvlist_src); free((void *)(uintptr_t)zc->zc_nvlist_dst); + zc->zc_nvlist_conf = NULL; + zc->zc_nvlist_src = NULL; + zc->zc_nvlist_dst = NULL; } static int From owner-svn-src-all@freebsd.org Fri Nov 13 09:41:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05691A2D1B9; Fri, 13 Nov 2015 09:41:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1AD4182F; Fri, 13 Nov 2015 09:41:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9fY8I015876; Fri, 13 Nov 2015 09:41:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9fYWT015874; Fri, 13 Nov 2015 09:41:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130941.tAD9fYWT015874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290759 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:41:36 -0000 Author: mav Date: Fri Nov 13 09:41:34 2015 New Revision: 290759 URL: https://svnweb.freebsd.org/changeset/base/290759 Log: MFC r289499: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13967:92bec6d87f59 Illumos ZFS issues: 3557 dumpvp_size is not updated correctly when a dump zvol's size is changed 3558 setting the volsize on a dump device does not return back ENOSPC 3559 setting a volsize larger than the space available sometimes succeeds Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:39:55 2015 (r290758) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:41:34 2015 (r290759) @@ -845,10 +845,12 @@ zfs_do_create(int argc, char **argv) if (type == ZFS_TYPE_VOLUME && !noreserve) { zpool_handle_t *zpool_handle; + nvlist_t *real_props; uint64_t spa_version; char *p; zfs_prop_t resv_prop; char *strval; + char msg[1024]; if (p = strchr(argv[0], '/')) *p = '\0'; @@ -864,7 +866,15 @@ zfs_do_create(int argc, char **argv) resv_prop = ZFS_PROP_REFRESERVATION; else resv_prop = ZFS_PROP_RESERVATION; - volsize = zvol_volsize_to_reservation(volsize, props); + + (void) snprintf(msg, sizeof (msg), + gettext("cannot create '%s'"), argv[0]); + if (props && (real_props = zfs_valid_proplist(g_zfs, type, + props, 0, NULL, msg)) == NULL) + goto error; + + volsize = zvol_volsize_to_reservation(volsize, real_props); + nvlist_free(real_props); if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop), &strval) != 0) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:39:55 2015 (r290758) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:41:34 2015 (r290759) @@ -1403,6 +1403,7 @@ zfs_add_synthetic_resv(zfs_handle_t *zhp uint64_t old_reservation; uint64_t new_reservation; zfs_prop_t resv_prop; + nvlist_t *props; /* * If this is an existing volume, and someone is setting the volsize, @@ -1412,16 +1413,25 @@ zfs_add_synthetic_resv(zfs_handle_t *zhp if (zfs_which_resv_prop(zhp, &resv_prop) < 0) return (-1); old_reservation = zfs_prop_get_int(zhp, resv_prop); - if ((zvol_volsize_to_reservation(old_volsize, zhp->zfs_props) != - old_reservation) || nvlist_lookup_uint64(nvl, - zfs_prop_to_name(resv_prop), &new_reservation) != ENOENT) { + + props = fnvlist_alloc(); + fnvlist_add_uint64(props, zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), + zfs_prop_get_int(zhp, ZFS_PROP_VOLBLOCKSIZE)); + + if ((zvol_volsize_to_reservation(old_volsize, props) != + old_reservation) || nvlist_exists(nvl, + zfs_prop_to_name(resv_prop))) { + fnvlist_free(props); return (0); } if (nvlist_lookup_uint64(nvl, zfs_prop_to_name(ZFS_PROP_VOLSIZE), - &new_volsize) != 0) + &new_volsize) != 0) { + fnvlist_free(props); return (-1); - new_reservation = zvol_volsize_to_reservation(new_volsize, - zhp->zfs_props); + } + new_reservation = zvol_volsize_to_reservation(new_volsize, props); + fnvlist_free(props); + if (nvlist_add_uint64(nvl, zfs_prop_to_name(resv_prop), new_reservation) != 0) { (void) no_memory(zhp->zfs_hdl); From owner-svn-src-all@freebsd.org Fri Nov 13 09:43:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B910A2D301; Fri, 13 Nov 2015 09:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 137D11A36; Fri, 13 Nov 2015 09:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9h0G4016595; Fri, 13 Nov 2015 09:43:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9gxfY016587; Fri, 13 Nov 2015 09:42:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130942.tAD9gxfY016587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290760 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:43:01 -0000 Author: mav Date: Fri Nov 13 09:42:59 2015 New Revision: 290760 URL: https://svnweb.freebsd.org/changeset/base/290760 Log: MFC r289500: 6298 zfs_create_008_neg and zpool_create_023_neg need to be updated for large block support. Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Approved by: Robert Mustacchi Author: Joe Stein illumos/illumos-gate@e9316f7696401f3e5e263a5939031cb8d5641a88 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:42:59 2015 (r290760) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . @@ -861,7 +861,6 @@ zfs_do_create(int argc, char **argv) goto error; spa_version = zpool_get_prop_int(zpool_handle, ZPOOL_PROP_VERSION, NULL); - zpool_close(zpool_handle); if (spa_version >= SPA_VERSION_REFRESERVATION) resv_prop = ZFS_PROP_REFRESERVATION; else @@ -870,8 +869,11 @@ zfs_do_create(int argc, char **argv) (void) snprintf(msg, sizeof (msg), gettext("cannot create '%s'"), argv[0]); if (props && (real_props = zfs_valid_proplist(g_zfs, type, - props, 0, NULL, msg)) == NULL) + props, 0, NULL, zpool_handle, msg)) == NULL) { + zpool_close(zpool_handle); goto error; + } + zpool_close(zpool_handle); volsize = zvol_volsize_to_reservation(volsize, real_props); nvlist_free(real_props); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:42:59 2015 (r290760) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -426,7 +426,7 @@ extern const char *zfs_prop_column_name( extern boolean_t zfs_prop_align_right(zfs_prop_t); extern nvlist_t *zfs_valid_proplist(libzfs_handle_t *, zfs_type_t, - nvlist_t *, uint64_t, zfs_handle_t *, const char *); + nvlist_t *, uint64_t, zfs_handle_t *, zpool_handle_t *, const char *); extern const char *zfs_prop_to_name(zfs_prop_t); extern int zfs_prop_set(zfs_handle_t *, const char *, const char *); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:42:59 2015 (r290760) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. @@ -890,7 +890,8 @@ zfs_which_resv_prop(zfs_handle_t *zhp, z */ nvlist_t * zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, - uint64_t zoned, zfs_handle_t *zhp, const char *errbuf) + uint64_t zoned, zfs_handle_t *zhp, zpool_handle_t *zpool_hdl, + const char *errbuf) { nvpair_t *elem; uint64_t intval; @@ -1084,8 +1085,8 @@ zfs_valid_proplist(libzfs_handle_t *hdl, case ZFS_PROP_RECORDSIZE: { int maxbs = SPA_MAXBLOCKSIZE; - if (zhp != NULL) { - maxbs = zpool_get_prop_int(zhp->zpool_hdl, + if (zpool_hdl != NULL) { + maxbs = zpool_get_prop_int(zpool_hdl, ZPOOL_PROP_MAXBLOCKSIZE, NULL); } /* @@ -1584,7 +1585,8 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl zhp->zfs_name); if ((nvl = zfs_valid_proplist(hdl, zhp->zfs_type, props, - zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) + zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, zhp->zpool_hdl, + errbuf)) == NULL) goto error; /* @@ -3248,9 +3250,23 @@ zfs_create(libzfs_handle_t *hdl, const c else ost = DMU_OST_ZFS; + /* open zpool handle for prop validation */ + char pool_path[MAXNAMELEN]; + (void) strlcpy(pool_path, path, sizeof (pool_path)); + + /* truncate pool_path at first slash */ + char *p = strchr(pool_path, '/'); + if (p != NULL) + *p = '\0'; + + zpool_handle_t *zpool_handle = zpool_open(hdl, pool_path); + if (props && (props = zfs_valid_proplist(hdl, type, props, - zoned, NULL, errbuf)) == 0) + zoned, NULL, zpool_handle, errbuf)) == 0) { + zpool_close(zpool_handle); return (-1); + } + zpool_close(zpool_handle); if (type == ZFS_TYPE_VOLUME) { /* @@ -3318,13 +3334,6 @@ zfs_create(libzfs_handle_t *hdl, const c "parent '%s' is not a filesystem"), parent); return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); - case EDOM: - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "volume block size must be power of 2 from " - "512B to 128KB")); - - return (zfs_error(hdl, EZFS_BADPROP, errbuf)); - case ENOTSUP: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool must be upgraded to set this " @@ -3519,7 +3528,7 @@ zfs_clone(zfs_handle_t *zhp, const char type = ZFS_TYPE_FILESYSTEM; } if ((props = zfs_valid_proplist(hdl, type, props, zoned, - zhp, errbuf)) == NULL) + zhp, zhp->zpool_hdl, errbuf)) == NULL) return (-1); } @@ -3663,11 +3672,23 @@ zfs_snapshot_nvl(libzfs_handle_t *hdl, n } } + /* + * get pool handle for prop validation. assumes all snaps are in the + * same pool, as does lzc_snapshot (below). + */ + char pool[MAXNAMELEN]; + elem = nvlist_next_nvpair(snaps, NULL); + (void) strlcpy(pool, nvpair_name(elem), sizeof (pool)); + pool[strcspn(pool, "/@")] = '\0'; + zpool_handle_t *zpool_hdl = zpool_open(hdl, pool); + if (props != NULL && (props = zfs_valid_proplist(hdl, ZFS_TYPE_SNAPSHOT, - props, B_FALSE, NULL, errbuf)) == NULL) { + props, B_FALSE, NULL, zpool_hdl, errbuf)) == NULL) { + zpool_close(zpool_hdl); return (-1); } + zpool_close(zpool_hdl); ret = lzc_snapshot(snaps, props, &errors); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:42:59 2015 (r290760) @@ -1164,8 +1164,8 @@ zpool_create(libzfs_handle_t *hdl, const zfs_prop_to_name(ZFS_PROP_ZONED), &zonestr) == 0) && strcmp(zonestr, "on") == 0); - if ((zc_fsprops = zfs_valid_proplist(hdl, - ZFS_TYPE_FILESYSTEM, fsprops, zoned, NULL, msg)) == NULL) { + if ((zc_fsprops = zfs_valid_proplist(hdl, ZFS_TYPE_FILESYSTEM, + fsprops, zoned, NULL, NULL, msg)) == NULL) { goto create_failed; } if (!zc_props && @@ -1201,6 +1201,21 @@ zpool_create(libzfs_handle_t *hdl, const "one or more vdevs refer to the same device")); return (zfs_error(hdl, EZFS_BADDEV, msg)); + case ERANGE: + /* + * This happens if the record size is smaller or larger + * than the allowed size range, or not a power of 2. + * + * NOTE: although zfs_valid_proplist is called earlier, + * this case may have slipped through since the + * pool does not exist yet and it is therefore + * impossible to read properties e.g. max blocksize + * from the pool. + */ + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "record size invalid")); + return (zfs_error(hdl, EZFS_BADPROP, msg)); + case EOVERFLOW: /* * This occurs when one of the devices is below From owner-svn-src-all@freebsd.org Fri Nov 13 09:45:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE6FA2D38F; Fri, 13 Nov 2015 09:45:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E34E1BF2; Fri, 13 Nov 2015 09:45:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9jXi2016744; Fri, 13 Nov 2015 09:45:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9jXKn016742; Fri, 13 Nov 2015 09:45:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130945.tAD9jXKn016742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290761 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:45:34 -0000 Author: mav Date: Fri Nov 13 09:45:33 2015 New Revision: 290761 URL: https://svnweb.freebsd.org/changeset/base/290761 Log: MFC r289527: 5561 support root pools on EFI/GPT partitioned disks 5125 update zpool/libzfs to manage bootable whole disk pools (EFI/GPT labeled disks) Reviewed by: Jean McCormack Reviewed by: Josef 'Jeff' Sipek Approved by: Dan McDonald Author: Hans Rosenfeld illumos/illumos-gate@1a902ef8628b0dffd6df5442354ab59bb8530962 This is NOP changes for FreeBSD. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:42:59 2015 (r290760) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:45:33 2015 (r290761) @@ -402,29 +402,6 @@ bootfs_name_valid(const char *pool, char return (B_FALSE); } -/* - * Inspect the configuration to determine if any of the devices contain - * an EFI label. - */ -static boolean_t -pool_uses_efi(nvlist_t *config) -{ -#ifdef sun - nvlist_t **child; - uint_t c, children; - - if (nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, - &child, &children) != 0) - return (read_efi_label(config, NULL) >= 0); - - for (c = 0; c < children; c++) { - if (pool_uses_efi(child[c])) - return (B_TRUE); - } -#endif /* sun */ - return (B_FALSE); -} - boolean_t zpool_is_bootable(zpool_handle_t *zhp) { @@ -453,7 +430,6 @@ zpool_valid_proplist(libzfs_handle_t *hd char *slash, *check; struct stat64 statbuf; zpool_handle_t *zhp; - nvlist_t *nvroot; if (nvlist_alloc(&retprops, NV_UNIQUE_NAME, 0) != 0) { (void) no_memory(hdl); @@ -572,23 +548,6 @@ zpool_valid_proplist(libzfs_handle_t *hd (void) zfs_error(hdl, EZFS_OPENFAILED, errbuf); goto error; } - verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL), - ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); - -#ifdef sun - /* - * bootfs property cannot be set on a disk which has - * been EFI labeled. - */ - if (pool_uses_efi(nvroot)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "property '%s' not supported on " - "EFI labeled devices"), propname); - (void) zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf); - zpool_close(zhp); - goto error; - } -#endif /* sun */ zpool_close(zhp); break; @@ -1326,25 +1285,6 @@ zpool_add(zpool_handle_t *zhp, nvlist_t return (zfs_error(hdl, EZFS_BADVERSION, msg)); } - if (zpool_is_bootable(zhp) && nvlist_lookup_nvlist_array(nvroot, - ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0) { - uint64_t s; - - for (s = 0; s < nspares; s++) { - char *path; - - if (nvlist_lookup_string(spares[s], ZPOOL_CONFIG_PATH, - &path) == 0 && pool_uses_efi(spares[s])) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "device '%s' contains an EFI label and " - "cannot be used on root pools."), - zpool_vdev_name(hdl, NULL, spares[s], - B_FALSE)); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg)); - } - } - } - if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) < SPA_VERSION_L2CACHE && nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE, @@ -2365,11 +2305,9 @@ zpool_get_config_physpath(nvlist_t *conf return (EZFS_INVALCONFIG); /* - * root pool can not have EFI labeled disks and can only have - * a single top-level vdev. + * root pool can only have a single top-level vdev. */ - if (strcmp(type, VDEV_TYPE_ROOT) != 0 || count != 1 || - pool_uses_efi(vdev_root)) + if (strcmp(type, VDEV_TYPE_ROOT) != 0 || count != 1) return (EZFS_POOL_INVALARG); (void) vdev_get_physpaths(child[0], physpath, phypath_size, &rsz, @@ -2673,16 +2611,6 @@ zpool_vdev_attach(zpool_handle_t *zhp, (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, "cannot attach %s to %s"), new_disk, old_disk); - /* - * If this is a root pool, make sure that we're not attaching an - * EFI labeled device. - */ - if (rootpool && pool_uses_efi(nvroot)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "EFI labeled devices are not supported on root pools.")); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg)); - } - (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); if ((tgt = zpool_find_vdev(zhp, old_disk, &avail_spare, &l2cache, &islog)) == 0) @@ -3996,13 +3924,6 @@ zpool_label_disk(libzfs_handle_t *hdl, z if (zhp) { nvlist_t *nvroot; - if (zpool_is_bootable(zhp)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "EFI labeled devices are not supported on root " - "pools.")); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf)); - } - verify(nvlist_lookup_nvlist(zhp->zpool_config, ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:42:59 2015 (r290760) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:45:33 2015 (r290761) @@ -3412,8 +3412,6 @@ vdev_is_bootable(vdev_t *vd) strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { return (B_FALSE); } - } else if (vd->vdev_wholedisk == 1) { - return (B_FALSE); } for (int c = 0; c < vd->vdev_children; c++) { From owner-svn-src-all@freebsd.org Fri Nov 13 09:46:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1570AA2D455; Fri, 13 Nov 2015 09:46:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7AE31D53; Fri, 13 Nov 2015 09:46:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9kS2e016828; Fri, 13 Nov 2015 09:46:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9kSR8016827; Fri, 13 Nov 2015 09:46:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130946.tAD9kSR8016827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290762 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:46:30 -0000 Author: mav Date: Fri Nov 13 09:46:28 2015 New Revision: 290762 URL: https://svnweb.freebsd.org/changeset/base/290762 Log: MFC r289528: Reduce diff from upstream. Should be no functional change. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:45:33 2015 (r290761) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:46:28 2015 (r290762) @@ -3729,17 +3729,18 @@ zpool_history_unpack(char *buf, uint64_t int zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) { - char *buf = NULL; - uint64_t bufsize = HIS_BUF_LEN_DEF; + char *buf; + uint64_t buflen = HIS_BUF_LEN_DEF; uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; - if ((buf = malloc(bufsize)) == NULL) + buf = malloc(buflen); + if (buf == NULL) return (ENOMEM); do { - uint64_t bytes_read = bufsize; + uint64_t bytes_read = buflen; uint64_t leftover; if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) @@ -3753,18 +3754,16 @@ zpool_get_history(zpool_handle_t *zhp, n &leftover, &records, &numrecords)) != 0) break; off -= leftover; - - /* - * If the history block is too big, double the buffer - * size and try again. - */ if (leftover == bytes_read) { + /* + * no progress made, because buffer is not big enough + * to hold this record; resize and retry. + */ + buflen *= 2; free(buf); buf = NULL; - - bufsize <<= 1; - if ((bufsize >= HIS_BUF_LEN_MAX) || - ((buf = malloc(bufsize)) == NULL)) { + if ((buflen >= HIS_BUF_LEN_MAX) || + ((buf = malloc(buflen)) == NULL)) { err = ENOMEM; break; } @@ -3772,6 +3771,7 @@ zpool_get_history(zpool_handle_t *zhp, n /* CONSTCOND */ } while (1); + free(buf); if (!err) { From owner-svn-src-all@freebsd.org Fri Nov 13 09:47:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4501EA2D51F; Fri, 13 Nov 2015 09:47:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C01A1EB0; Fri, 13 Nov 2015 09:47:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9lcEA016920; Fri, 13 Nov 2015 09:47:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9lcXT016919; Fri, 13 Nov 2015 09:47:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130947.tAD9lcXT016919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290763 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:47:39 -0000 Author: mav Date: Fri Nov 13 09:47:37 2015 New Revision: 290763 URL: https://svnweb.freebsd.org/changeset/base/290763 Log: MFC r289531: 5847 libzfs_diff should check zfs_prop_get() return Reviewed by: Matthew Ahrens Reviewed by: Albert Lee Approved by: Dan McDonald Author: Alexander Eremin illumos/illumos-gate@8430278980a48338e04c7dd52b495b7f1551367a Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Nov 13 09:46:28 2015 (r290762) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Nov 13 09:47:37 2015 (r290763) @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ /* @@ -624,9 +625,12 @@ get_snapshot_names(differ_info_t *di, co zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM); while (zhp != NULL) { - (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN, - origin, sizeof (origin), &src, NULL, 0, B_FALSE); - + if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, + sizeof (origin), &src, NULL, 0, B_FALSE) != 0) { + (void) zfs_close(zhp); + zhp = NULL; + break; + } if (strncmp(origin, fromsnap, fsnlen) == 0) break; From owner-svn-src-all@freebsd.org Fri Nov 13 09:48:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D128CA2D59A; Fri, 13 Nov 2015 09:48:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A66641015; Fri, 13 Nov 2015 09:48:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9mhE9017008; Fri, 13 Nov 2015 09:48:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9mhiJ017007; Fri, 13 Nov 2015 09:48:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130948.tAD9mhiJ017007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290764 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:48:45 -0000 Author: mav Date: Fri Nov 13 09:48:43 2015 New Revision: 290764 URL: https://svnweb.freebsd.org/changeset/base/290764 Log: MFC r289536: 5767 fix several problems with zfs test suite Reviewed by: Matthew Ahrens Reviewed by: Christopher Siden Approved by: Gordon Ross Author: John Wren Kennedy illumos/illumos-gate@52244c0958bdf281ca42932b449f644b4decfdc2 In fact, only unrelated part of that commit is applicable: 8. zpool list -v doesn't print spares It also doesn't correctly identify log devices. Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:47:37 2015 (r290763) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:48:43 2015 (r290764) @@ -2940,6 +2940,9 @@ print_list_stats(zpool_handle_t *zhp, co uint_t c, children; char *vname; boolean_t scripted = cb->cb_scripted; + uint64_t islog = B_FALSE; + boolean_t haslog = B_FALSE; + char *dashes = "%-*s - - - - - -\n"; verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs, &c) == 0); @@ -2990,24 +2993,47 @@ print_list_stats(zpool_handle_t *zhp, co ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole) continue; + if (nvlist_lookup_uint64(child[c], + ZPOOL_CONFIG_IS_LOG, &islog) == 0 && islog) { + haslog = B_TRUE; + continue; + } + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); print_list_stats(zhp, vname, child[c], cb, depth + 2); free(vname); } - /* - * Include level 2 ARC devices in iostat output - */ + if (haslog == B_TRUE) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "log"); + for (c = 0; c < children; c++) { + if (nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG, + &islog) != 0 || !islog) + continue; + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); + print_list_stats(zhp, vname, child[c], cb, depth + 2); + free(vname); + } + } + if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE, - &child, &children) != 0) - return; + &child, &children) == 0 && children > 0) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "cache"); + for (c = 0; c < children; c++) { + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); + print_list_stats(zhp, vname, child[c], cb, depth + 2); + free(vname); + } + } - if (children > 0) { - (void) printf("%-*s - - - - - " - "-\n", cb->cb_namewidth, "cache"); + if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES, &child, + &children) == 0 && children > 0) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "spare"); for (c = 0; c < children; c++) { - vname = zpool_vdev_name(g_zfs, zhp, child[c], - B_FALSE); + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); print_list_stats(zhp, vname, child[c], cb, depth + 2); free(vname); } From owner-svn-src-all@freebsd.org Fri Nov 13 09:50:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3184A2D65F; Fri, 13 Nov 2015 09:50:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9405C1200; Fri, 13 Nov 2015 09:50:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9oAB1017144; Fri, 13 Nov 2015 09:50:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9o8AU017123; Fri, 13 Nov 2015 09:50:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130950.tAD9o8AU017123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290765 - in stable/10: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/contrib/opensolaris/common/zf... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:50:12 -0000 Author: mav Date: Fri Nov 13 09:50:08 2015 New Revision: 290765 URL: https://svnweb.freebsd.org/changeset/base/290765 Log: MFC r289562: 6328 Fix cstyle errors in zfs codebase Reviewed by: Matthew Ahrens Reviewed by: Alex Reece Reviewed by: Richard Elling Reviewed by: Jorgen Lundman Approved by: Robert Mustacchi Author: Paul Dagnelie illumos/illumos-gate@9a686fbc186e8e2a64e9a5094d44c7d6fa0ea167 Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:50:08 2015 (r290765) @@ -199,7 +199,8 @@ static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * -get_usage(zpool_help_t idx) { +get_usage(zpool_help_t idx) +{ switch (idx) { case HELP_ADD: return (gettext("\tadd [-fn] ...\n")); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Nov 13 09:50:08 2015 (r290765) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. @@ -315,7 +315,8 @@ typedef struct { } snapspec_arg_t; static int -snapspec_cb(zfs_handle_t *zhp, void *arg) { +snapspec_cb(zfs_handle_t *zhp, void *arg) +{ snapspec_arg_t *ssa = arg; char *shortsnapname; int err = 0; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:50:08 2015 (r290765) @@ -22,7 +22,7 @@ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1885,7 +1885,8 @@ zpool_scan(zpool_handle_t *zhp, pool_sca * and the like. */ static int -ctd_check_path(char *str) { +ctd_check_path(char *str) +{ /* * If it starts with a slash, check the last component. */ Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:50:08 2015 (r290765) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ /* Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -523,7 +523,7 @@ vn_openat(char *path, int x1, int flags, /*ARGSUSED*/ int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset, - int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp) + int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp) { ssize_t iolen, split; Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:50:08 2015 (r290765) @@ -117,7 +117,8 @@ zfeature_lookup_name(const char *name, s } boolean_t -zfeature_depends_on(spa_feature_t fid, spa_feature_t check) { +zfeature_depends_on(spa_feature_t fid, spa_feature_t check) +{ zfeature_info_t *feature = &spa_feature_table[fid]; for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:50:08 2015 (r290765) @@ -1740,7 +1740,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s int dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; int err; @@ -1755,7 +1755,7 @@ dmu_object_set_blocksize(objset_t *os, u void dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; @@ -1775,7 +1775,7 @@ dmu_object_set_checksum(objset_t *os, ui void dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; @@ -1946,7 +1946,8 @@ dmu_offset_next(objset_t *os, uint64_t o * ID and wait for that to be synced. */ int -dmu_object_wait_synced(objset_t *os, uint64_t object) { +dmu_object_wait_synced(objset_t *os, uint64_t object) +{ dnode_t *dn; int error, i; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:50:08 2015 (r290765) @@ -3558,7 +3558,7 @@ dsl_dataset_space_wouldfree(dsl_dataset_ */ boolean_t dsl_dataset_is_before(dsl_dataset_t *later, dsl_dataset_t *earlier, - uint64_t earlier_txg) + uint64_t earlier_txg) { dsl_pool_t *dp = later->ds_dir->dd_pool; int error; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Nov 13 09:50:08 2015 (r290765) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -103,7 +103,7 @@ space_reftree_add_node(avl_tree_t *t, ui void space_reftree_add_seg(avl_tree_t *t, uint64_t start, uint64_t end, - int64_t refcnt) + int64_t refcnt) { space_reftree_add_node(t, start, refcnt); space_reftree_add_node(t, end, -refcnt); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h Fri Nov 13 09:50:08 2015 (r290765) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 by Delphix. All rights reserved. */ #ifndef _SYS_ZRLOCK_H @@ -44,12 +45,8 @@ typedef struct zrlock { extern void zrl_init(zrlock_t *); extern void zrl_destroy(zrlock_t *); -#ifdef ZFS_DEBUG -#define zrl_add(_z) zrl_add_debug((_z), __func__) -extern void zrl_add_debug(zrlock_t *, const char *); -#else -extern void zrl_add(zrlock_t *); -#endif +#define zrl_add(_z) zrl_add_impl((_z), __func__) +extern void zrl_add_impl(zrlock_t *, const char *); extern void zrl_remove(zrlock_t *); extern int zrl_tryenter(zrlock_t *); extern void zrl_exit(zrlock_t *); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Nov 13 09:50:08 2015 (r290765) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ /* @@ -185,7 +185,7 @@ vdev_label_number(uint64_t psize, uint64 static void vdev_label_read(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset, - uint64_t size, zio_done_func_t *done, void *private, int flags) + uint64_t size, zio_done_func_t *done, void *private, int flags) { ASSERT(spa_config_held(zio->io_spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); @@ -199,7 +199,7 @@ vdev_label_read(zio_t *zio, vdev_t *vd, static void vdev_label_write(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset, - uint64_t size, zio_done_func_t *done, void *private, int flags) + uint64_t size, zio_done_func_t *done, void *private, int flags) { ASSERT(spa_config_held(zio->io_spa, SCL_ALL, RW_WRITER) == SCL_ALL || (spa_config_held(zio->io_spa, SCL_CONFIG | SCL_STATE, RW_READER) == Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ /* @@ -535,7 +535,7 @@ zap_entry_read_name(zap_t *zap, const za int zap_entry_update(zap_entry_handle_t *zeh, - uint8_t integer_size, uint64_t num_integers, const void *buf) + uint8_t integer_size, uint64_t num_integers, const void *buf) { int delta_chunks; zap_leaf_t *l = zeh->zeh_leaf; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Nov 13 09:50:08 2015 (r290765) @@ -269,7 +269,8 @@ feature_get_refcount_from_disk(spa_t *sp static int -feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) { +feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) +{ uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj; ASSERT(zfeature_depends_on(feature->fi_feature, @@ -493,7 +494,8 @@ spa_feature_is_active(spa_t *spa, spa_fe * Returns B_FALSE otherwise (i.e. if the feature is not enabled). */ boolean_t -spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) { +spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) +{ int err; ASSERT(VALID_FEATURE_FID(fid)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -806,7 +806,7 @@ zfs_dropname(zfs_dirlock_t *dl, znode_t */ int zfs_link_destroy(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag, - boolean_t *unlinkedp) + boolean_t *unlinkedp) { znode_t *dzp = dl->dl_dzp; zfsvfs_t *zfsvfs = dzp->z_zfsvfs; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:50:08 2015 (r290765) @@ -5707,7 +5707,7 @@ zfs_ioctl_register_dataset_read(zfs_ioc_ static void zfs_ioctl_register_dataset_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func, - zfs_secpolicy_func_t *secpolicy) + zfs_secpolicy_func_t *secpolicy) { zfs_ioctl_register_legacy(ioc, func, secpolicy, DATASET_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 by Delphix. All rights reserved. */ #include @@ -348,7 +349,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, char *name, uint64_t foid) + znode_t *dzp, char *name, uint64_t foid) { itx_t *itx; lr_remove_t *lr; @@ -372,7 +373,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, znode_t *zp, char *name) + znode_t *dzp, znode_t *zp, char *name) { itx_t *itx; lr_link_t *lr; @@ -427,7 +428,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) + znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) { itx_t *itx; lr_rename_t *lr; @@ -455,7 +456,7 @@ ssize_t zfs_immediate_write_sz = 32768; void zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, offset_t off, ssize_t resid, int ioflag) + znode_t *zp, offset_t off, ssize_t resid, int ioflag) { itx_wr_state_t write_state; boolean_t slogging; @@ -532,7 +533,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, uint64_t off, uint64_t len) + znode_t *zp, uint64_t off, uint64_t len) { itx_t *itx; lr_truncate_t *lr; @@ -555,7 +556,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) + znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) { itx_t *itx; lr_setattr_t *lr; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -54,7 +54,7 @@ static void zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode, - uint64_t uid, uint64_t gid, uint64_t rdev, uint64_t nodeid) + uint64_t uid, uint64_t gid, uint64_t rdev, uint64_t nodeid) { VATTR_NULL(vap); vap->va_mask = (uint_t)mask; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4505,7 +4505,7 @@ top: /* ARGSUSED */ static int zfs_null_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp, - size_t *lenp, int flags, cred_t *cr) + size_t *lenp, int flags, cred_t *cr) { pvn_write_done(pp, B_INVAL|B_FORCE|B_ERROR); return (0); @@ -4531,7 +4531,7 @@ zfs_null_putapage(vnode_t *vp, page_t *p /* ARGSUSED */ static int zfs_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp, - size_t *lenp, int flags, cred_t *cr) + size_t *lenp, int flags, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:50:08 2015 (r290765) @@ -330,7 +330,7 @@ zio_data_buf_free(void *buf, size_t size */ static void zio_push_transform(zio_t *zio, void *data, uint64_t size, uint64_t bufsize, - zio_transform_func_t *transform) + zio_transform_func_t *transform) { zio_transform_t *zt = kmem_alloc(sizeof (zio_transform_t), KM_SLEEP); @@ -1068,8 +1068,8 @@ zio_vdev_child_io(zio_t *pio, blkptr_t * zio_t * zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size, - int type, zio_priority_t priority, enum zio_flag flags, - zio_done_func_t *done, void *private) + int type, zio_priority_t priority, enum zio_flag flags, + zio_done_func_t *done, void *private) { zio_t *zio; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ @@ -249,7 +249,7 @@ zio_checksum_template_init(enum zio_chec */ void zio_checksum_compute(zio_t *zio, enum zio_checksum checksum, - void *data, uint64_t size) + void *data, uint64_t size) { blkptr_t *bp = zio->io_bp; uint64_t offset = zio->io_offset; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. */ /* @@ -69,11 +69,7 @@ zrl_destroy(zrlock_t *zrl) } void -#ifdef ZFS_DEBUG -zrl_add_debug(zrlock_t *zrl, const char *zc) -#else -zrl_add(zrlock_t *zrl) -#endif +zrl_add_impl(zrlock_t *zrl, const char *zc) { uint32_t n = (uint32_t)zrl->zr_refcount; From owner-svn-src-all@freebsd.org Fri Nov 13 09:52:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A98D5A2D82F; Fri, 13 Nov 2015 09:52:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6626315C8; Fri, 13 Nov 2015 09:52:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9qaPG019813; Fri, 13 Nov 2015 09:52:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9qaMa019812; Fri, 13 Nov 2015 09:52:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130952.tAD9qaMa019812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290766 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:52:37 -0000 Author: mav Date: Fri Nov 13 09:52:36 2015 New Revision: 290766 URL: https://svnweb.freebsd.org/changeset/base/290766 Log: MFC r290191 (by avg): l2arc: do not call trim_map_free() for blocks with zero b_asize b_asize can be zero if the block is compressed into an empty block (ZIO_COMPRESS_EMPTY) and the trim code asserts that meaningless zero-sized trimming is not attempted. The logic for calling trim_map_free() is extracted into a new function l2arc_trim() to minimize code duplication. PR: 203473 Reported by: Willem Jan Withagen Tested by: Willem Jan Withagen Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:50:08 2015 (r290765) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:52:36 2015 (r290766) @@ -1134,6 +1134,24 @@ static boolean_t l2arc_compress_buf(arc_ static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); static void l2arc_release_cdata_buf(arc_buf_hdr_t *); +static void +l2arc_trim(const arc_buf_hdr_t *hdr) +{ + l2arc_dev_t *dev = hdr->b_l2hdr.b_dev; + + ASSERT(HDR_HAS_L2HDR(hdr)); + ASSERT(MUTEX_HELD(&dev->l2ad_mtx)); + + if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) + return; + if (hdr->b_l2hdr.b_asize != 0) { + trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr, + hdr->b_l2hdr.b_asize, 0); + } else { + ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_EMPTY); + } +} + static uint64_t buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) { @@ -2406,10 +2424,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) * want to re-destroy the header's L2 portion. */ if (HDR_HAS_L2HDR(hdr)) { - if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) - trim_map_free(dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, - hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); arc_hdr_l2hdr_destroy(hdr); } @@ -4779,10 +4794,7 @@ arc_release(arc_buf_t *buf, void *tag) * to acquire the l2ad_mtx. */ if (HDR_HAS_L2HDR(hdr)) { - if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) - trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, - hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); arc_hdr_l2hdr_destroy(hdr); } @@ -5969,8 +5981,7 @@ top: * Error - drop L2ARC entry. */ list_remove(buflist, hdr); - trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR; ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize); From owner-svn-src-all@freebsd.org Fri Nov 13 10:04:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD77A2DBB3 for ; Fri, 13 Nov 2015 10:04:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 454EE1CFA; Fri, 13 Nov 2015 10:04:40 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [78.35.180.105] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZxB7M-0003uA-8M; Fri, 13 Nov 2015 10:58:04 +0100 Date: Fri, 13 Nov 2015 10:58:01 +0100 From: Fabian Keil To: Alexander Motin Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r290757 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/ut... Message-ID: <20151113105801.5dea7fab@fabiankeil.de> In-Reply-To: <201511130932.tAD9W473013391@repo.freebsd.org> References: <201511130932.tAD9W473013391@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/3/fVCKt+kRcEFWvW7ewiHtq"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 10:04:40 -0000 --Sig_/3/fVCKt+kRcEFWvW7ewiHtq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Alexander Motin wrote: > Author: mav > Date: Fri Nov 13 09:32:04 2015 > New Revision: 290757 > URL: https://svnweb.freebsd.org/changeset/base/290757 >=20 > Log: > MFC r289422: > 4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R [...] =20 > This is only a partial merge of respective ZFS infrastructure changes. > At this moment FreeBSD kernel has no those crypto algorithms, so the > parts of the code to enable them are commented out. When they are > implemented, it will be trivial to plug them in. [...] > @@ -225,12 +240,12 @@ zfs_prop_init(void) > zprop_register_index(ZFS_PROP_CHECKSUM, "checksum", > ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | > ZFS_TYPE_VOLUME, > - "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM", > - checksum_table); > + "on | off | fletcher2 | fletcher4 | sha256 | sha512 | " > + "skein | edonr", "CHECKSUM", checksum_table); > zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF, > PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, > - "on | off | verify | sha256[,verify]", "DEDUP", > - dedup_table); > + "on | off | verify | sha256[,verify], sha512[,verify], " > + "skein[,verify], edonr,verify", "DEDUP", dedup_table); > zprop_register_index(ZFS_PROP_COMPRESSION, "compression", > ZIO_COMPRESS_DEFAULT, PROP_INHERIT, > ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, This chunk causes confusing error messages: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204055 Fabian --Sig_/3/fVCKt+kRcEFWvW7ewiHtq Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlZFtCkACgkQBYqIVf93VJ1BfQCeNVFbN189PsKO39aEgLzd0R/o fcsAniB2sPqDpTp1DP5JuYzkv8Y3ztlR =mpMH -----END PGP SIGNATURE----- --Sig_/3/fVCKt+kRcEFWvW7ewiHtq-- From owner-svn-src-all@freebsd.org Fri Nov 13 10:32:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2A1A2E39F; Fri, 13 Nov 2015 10:32:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533DC1F3A; Fri, 13 Nov 2015 10:32:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADAWYVK031221; Fri, 13 Nov 2015 10:32:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADAWYXq031220; Fri, 13 Nov 2015 10:32:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131032.tADAWYXq031220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 10:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290767 - stable/10/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 10:32:35 -0000 Author: mav Date: Fri Nov 13 10:32:34 2015 New Revision: 290767 URL: https://svnweb.freebsd.org/changeset/base/290767 Log: Fix build on stable/10. Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:52:36 2015 (r290766) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 10:32:34 2015 (r290767) @@ -3579,7 +3579,7 @@ zfs_do_set(int argc, char **argv) { nvlist_t *props = NULL; int ds_start = -1; /* argv idx of first dataset arg */ - int ret = 0; + int i, ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3605,7 +3605,7 @@ zfs_do_set(int argc, char **argv) } /* validate argument order: prop=val args followed by dataset args */ - for (int i = 1; i < argc; i++) { + for (i = 1; i < argc; i++) { if (strchr(argv[i], '=') != NULL) { if (ds_start > 0) { /* out-of-order prop=val argument */ @@ -3625,7 +3625,7 @@ zfs_do_set(int argc, char **argv) /* Populate a list of property settings */ if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); - for (int i = 1; i < ds_start; i++) { + for (i = 1; i < ds_start; i++) { if ((ret = parseprop(props, argv[i])) != 0) goto error; } From owner-svn-src-all@freebsd.org Fri Nov 13 10:34:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39D2CA2E435; Fri, 13 Nov 2015 10:34:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 037121162; Fri, 13 Nov 2015 10:34:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADAYFOU031343; Fri, 13 Nov 2015 10:34:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADAYEj2031341; Fri, 13 Nov 2015 10:34:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131034.tADAYEj2031341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 10:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290768 - stable/10/sys/cam/ata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 10:34:16 -0000 Author: mav Date: Fri Nov 13 10:34:14 2015 New Revision: 290768 URL: https://svnweb.freebsd.org/changeset/base/290768 Log: MFC r290462: Removed unused malloc types. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/ata/ata_pmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Fri Nov 13 10:32:34 2015 (r290767) +++ stable/10/sys/cam/ata/ata_da.c Fri Nov 13 10:34:14 2015 (r290768) @@ -642,8 +642,6 @@ static struct periph_driver adadriver = PERIPHDRIVER_DECLARE(ada, adadriver); -static MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); - static int adaopen(struct disk *dp) { Modified: stable/10/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/10/sys/cam/ata/ata_pmp.c Fri Nov 13 10:32:34 2015 (r290767) +++ stable/10/sys/cam/ata/ata_pmp.c Fri Nov 13 10:34:14 2015 (r290768) @@ -158,8 +158,6 @@ static struct periph_driver pmpdriver = PERIPHDRIVER_DECLARE(pmp, pmpdriver); -static MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); - static void pmpinit(void) { From owner-svn-src-all@freebsd.org Fri Nov 13 11:16:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E898A2EF5A; Fri, 13 Nov 2015 11:16:21 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward12h.cmail.yandex.net (forward12h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::9d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07BFD1C33; Fri, 13 Nov 2015 11:16:20 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web19h.yandex.ru (web19h.yandex.ru [IPv6:2a02:6b8:0:f05::29]) by forward12h.cmail.yandex.net (Yandex) with ESMTP id 3A38B20F72; Fri, 13 Nov 2015 14:16:07 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web19h.yandex.ru (Yandex) with ESMTP id EA44F2E00E1F; Fri, 13 Nov 2015 14:16:05 +0300 (MSK) Received: by web19h.yandex.ru with HTTP; Fri, 13 Nov 2015 14:16:05 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Randall Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org In-Reply-To: <201511101449.tAAEnXIi065747@repo.freebsd.org> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys MIME-Version: 1.0 Message-Id: <1660421447413365@web19h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 13 Nov 2015 14:16:05 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 11:16:21 -0000 10.11.2015, 17:49, "Randall Stewart" : > Author: rrs > Date: Tue Nov 10 14:49:32 2015 > New Revision: 290664 > URL: https://svnweb.freebsd.org/changeset/base/290664 > > Log: > ššAdd new async_drain to the callout system. This is so-far not used but > ššshould be used by TCP for sure in its cleanup of the IN-PCB (will be coming shortly). Randall, this commit introduced change in callout_stop() which was not mentioned in commit message. This change has broken lltable arp/nd handling: deleting interface address causes immediate panic. I also see other other code/subsystems relying on callout_stop() return value (netgraph, pfsync, iscsi). I was not able to find any discussion/analysis/testing for these in D4076 so this change does not look like being properly tested prior commiting.. > > ššSponsored by: Netflix Inc. > ššDifferential Revision: https://reviews.freebsd.org/D4076 > > Modified: > ššhead/share/man/man9/timeout.9 > ššhead/sys/kern/kern_timeout.c > ššhead/sys/sys/callout.h > > Modified: head/share/man/man9/timeout.9 > ============================================================================== > --- head/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 (r290663) > +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 (r290664) > @@ -35,6 +35,7 @@ > š.Sh NAME > š.Nm callout_active , > š.Nm callout_deactivate , > +.Nm callout_async_drain , > š.Nm callout_drain , > š.Nm callout_handle_init , > š.Nm callout_init , > @@ -69,6 +70,8 @@ typedef void timeout_t (void *); > š.Ft void > š.Fn callout_deactivate "struct callout *c" > š.Ft int > +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" > +.Ft int > š.Fn callout_drain "struct callout *c" > š.Ft void > š.Fn callout_handle_init "struct callout_handle *handle" > @@ -236,17 +239,42 @@ The function > šcancels a callout > š.Fa c > šif it is currently pending. > -If the callout is pending, then > +If the callout is pending and successfuly stopped, then > š.Fn callout_stop > -returns a non-zero value. > -If the callout is not set, > -has already been serviced, > -or is currently being serviced, > +returns a value of one. > +If the callout is not set, or > +has already been serviced, then > +negative one is returned. > +If the callout is currently being serviced and cannot be stopped, > š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_async_drain > +is identical to > +.Fn callout_stop > +with one difference. > +When > +.Fn callout_async_drain > +returns zero it will arrange for the function > +.Fa drain > +to be called using the same argument given to the > +.Fn callout_reset > +function. > +.Fn callout_async_drain > +If the callout has an associated lock, > +then that lock must be held when this function is called. > +Note that when stopping multiple callouts that use the same lock it is possible > +to get multiple return's of zero and multiple calls to the > +.Fa drain > +function, depending upon which CPU's the callouts are running. The > +.Fa drain > +function itself is called from the context of the completing callout > +i.e. softclock or hardclock, just like a callout itself. > +p > +.Pp > +The function > š.Fn callout_drain > šis identical to > š.Fn callout_stop > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) > +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) > @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; > šš*/ > šstruct cc_exec { > šššššššššstruct callout *cc_curr; > + void (*cc_drain)(void *); > š#ifdef SMP > šššššššššvoid (*ce_migration_func)(void *); > šššššššššvoid *ce_migration_arg; > @@ -170,6 +171,7 @@ struct callout_cpu { > š#define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) > > š#define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr > +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain > š#define cc_exec_next(cc) cc->cc_next > š#define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel > š#define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting > @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str > > šššššššššcc_exec_curr(cc, direct) = c; > šššššššššcc_exec_cancel(cc, direct) = false; > + cc_exec_drain(cc, direct) = NULL; > šššššššššCC_UNLOCK(cc); > šššššššššif (c_lock != NULL) { > šššššššššššššššššclass->lc_lock(c_lock, lock_status); > @@ -744,6 +747,15 @@ skip: > šššššššššCC_LOCK(cc); > šššššššššKASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr")); > šššššššššcc_exec_curr(cc, direct) = NULL; > + if (cc_exec_drain(cc, direct)) { > + void (*drain)(void *); > + > + drain = cc_exec_drain(cc, direct); > + cc_exec_drain(cc, direct) = NULL; > + CC_UNLOCK(cc); > + drain(c_arg); > + CC_LOCK(cc); > + } > šššššššššif (cc_exec_waiting(cc, direct)) { > ššššššššššššššššš/* > šššššššššššššššššš* There is someone waiting for the > @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int > š} > > šint > -_callout_stop_safe(struct callout *c, int safe) > +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void *)) > š{ > šššššššššstruct callout_cpu *cc, *old_cc; > šššššššššstruct lock_class *class; > @@ -1225,19 +1237,22 @@ again: > šššššššššš* stop it by other means however. > šššššššššš*/ > šššššššššif (!(c->c_iflags & CALLOUT_PENDING)) { > - c->c_flags &= ~CALLOUT_ACTIVE; > - > ššššššššššššššššš/* > šššššššššššššššššš* If it wasn't on the queue and it isn't the current > šššššššššššššššššš* callout, then we can't stop it, so just bail. > + * It probably has already been run (if locking > + * is properly done). You could get here if the caller > + * calls stop twice in a row for example. The second > + * call would fall here without CALLOUT_ACTIVE set. > šššššššššššššššššš*/ > + c->c_flags &= ~CALLOUT_ACTIVE; > šššššššššššššššššif (cc_exec_curr(cc, direct) != c) { > šššššššššššššššššššššššššCTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", > šššššššššššššššššššššššššššššc, c->c_func, c->c_arg); > šššššššššššššššššššššššššCC_UNLOCK(cc); > šššššššššššššššššššššššššif (sq_locked) > šššššššššššššššššššššššššššššššššsleepq_release(&cc_exec_waiting(cc, direct)); > - return (0); > + return (-1); > ššššššššššššššššš} > > šššššššššššššššššif (safe) { > @@ -1298,14 +1313,16 @@ again: > šššššššššššššššššššššššššššššššššCC_LOCK(cc); > ššššššššššššššššššššššššš} > ššššššššššššššššš} else if (use_lock && > - !cc_exec_cancel(cc, direct)) { > + !cc_exec_cancel(cc, direct) && (drain == NULL)) { > > ššššššššššššššššššššššššš/* > šššššššššššššššššššššššššš* The current callout is waiting for its > šššššššššššššššššššššššššš* lock which we hold. Cancel the callout > šššššššššššššššššššššššššš* and return. After our caller drops the > šššššššššššššššššššššššššš* lock, the callout will be skipped in > - * softclock(). > + * softclock(). This *only* works with a > + * callout_stop() *not* callout_drain() or > + * callout_async_drain(). > šššššššššššššššššššššššššš*/ > šššššššššššššššššššššššššcc_exec_cancel(cc, direct) = true; > šššššššššššššššššššššššššCTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", > @@ -1351,11 +1368,17 @@ again: > š#endif > šššššššššššššššššššššššššCTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p", > šššššššššššššššššššššššššššššc, c->c_func, c->c_arg); > + if (drain) { > + cc_exec_drain(cc, direct) = drain; > + } > šššššššššššššššššššššššššCC_UNLOCK(cc); > šššššššššššššššššššššššššreturn (0); > ššššššššššššššššš} > šššššššššššššššššCTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", > šššššššššššššššššššššc, c->c_func, c->c_arg); > + if (drain) { > + cc_exec_drain(cc, direct) = drain; > + } > šššššššššššššššššCC_UNLOCK(cc); > šššššššššššššššššKASSERT(!sq_locked, ("sleepqueue chain still locked")); > šššššššššššššššššreturn (0); > > Modified: head/sys/sys/callout.h > ============================================================================== > --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) > +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) > @@ -81,7 +81,7 @@ struct callout_handle { > šš*/ > š#define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) > š#define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) > -#define callout_drain(c) _callout_stop_safe(c, 1) > +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) > švoid callout_init(struct callout *, int); > švoid _callout_init_lock(struct callout *, struct lock_object *, int); > š#define callout_init_mtx(c, mtx, flags) \ > @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i > šint callout_schedule_on(struct callout *, int, int); > š#define callout_schedule_curcpu(c, on_tick) \ > šššššcallout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) > -#define callout_stop(c) _callout_stop_safe(c, 0) > -int _callout_stop_safe(struct callout *, int); > +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) > +int _callout_stop_safe(struct callout *, int, void (*)(void *)); > švoid callout_process(sbintime_t now); > - > +#define callout_async_drain(c, d) \ > + _callout_stop_safe(c, 0, d) > š#endif > > š#endif /* _SYS_CALLOUT_H_ */ From owner-svn-src-all@freebsd.org Fri Nov 13 14:10:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD2AA2E996; Fri, 13 Nov 2015 14:10:30 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D181511DB; Fri, 13 Nov 2015 14:10:29 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from c124.sec.cl.cam.ac.uk (c124.sec.cl.cam.ac.uk [128.232.18.124]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id tADEAK5j077058 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Nov 2015 14:10:21 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core From: David Chisnall In-Reply-To: <20151113083543.GV2257@kib.kiev.ua> Date: Fri, 13 Nov 2015 14:10:20 +0000 Cc: Hans Petter Selasky , cem@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0330812D-2FB6-4490-BFB3-67F9E66975A7@FreeBSD.org> References: <201511121012.tACACKTI075143@repo.freebsd.org> <56459CEE.4090007@selasky.org> <20151113083543.GV2257@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 14:10:30 -0000 On 13 Nov 2015, at 08:35, Konstantin Belousov = wrote: >=20 > On Fri, Nov 13, 2015 at 09:18:54AM +0100, Hans Petter Selasky wrote: >> Hi, >>=20 >> On 11/12/15 18:17, Conrad Meyer wrote: >>> These should cast through (u)intptr_t rather than unsigned long. >>>=20 >>=20 >> This is Linux code, and they use "unsigned long" for pointer casts=20 >> everywhere, trying to not break their style. >>=20 >> BTW: I added to linux_compat.c: >>=20 >> CTASSERT(sizeof(unsigned long) =3D=3D sizeof(uintptr_t)); >>=20 >> And it survived my "tinderbox" build and I was surprised! >=20 > FreeBSD (at least currently) runs on two kinds of ABIs: ILP32 and = LP64. > ILP32 means that sizeof(int) =3D=3D sizeof(long) =3D=3D sizeof(void *) = =3D=3D 4. > For LP64, sizeof(long) =3D=3D sizeof(void *) =3D=3D 8, while = sizeof(int) =3D=3D 4. > We do not support anything else. Note that this is not true of all downstreams. We currently have 128 = and 256-bit void*s with 64-bit longs on CHERI, and I believe that = bde=E2=80=99s version has 32-bit longs on all platforms. This kind of = code *is* broken for us and we=E2=80=99d greatly appreciate people not = writing new code that intentionally relies on undefined behaviour (round = tripping a pointer via any integer type other than intptr_t is undefined = in C), when a well-defined mechanism exists, just because Linux decides = to do the wrong thing. David From owner-svn-src-all@freebsd.org Fri Nov 13 14:53:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 360DEA2EFE8; Fri, 13 Nov 2015 14:53:16 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDFC512A5; Fri, 13 Nov 2015 14:53:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 58EA51FE022; Fri, 13 Nov 2015 15:53:09 +0100 (CET) Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core To: David Chisnall , Konstantin Belousov References: <201511121012.tACACKTI075143@repo.freebsd.org> <56459CEE.4090007@selasky.org> <20151113083543.GV2257@kib.kiev.ua> <0330812D-2FB6-4490-BFB3-67F9E66975A7@FreeBSD.org> Cc: cem@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <5645F9BC.8020308@selasky.org> Date: Fri, 13 Nov 2015 15:54:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <0330812D-2FB6-4490-BFB3-67F9E66975A7@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 14:53:16 -0000 On 11/13/15 15:10, David Chisnall wrote: > Note that this is not true of all downstreams. We currently have 128 and 256-bit void*s with 64-bit longs on CHERI, and I believe that bde’s version has 32-bit longs on all platforms. > > David Hi David, Converting the LinuxKPI to use uintptr_t instead of "unsigned long" is possible, though it affects several modules depending on the LinuxKPI which needs auditing, for this kind of issues. For now the LinuxKPI should not be built for CHERI. Sorry about the inconvenience. Will a CHERI build warn if you cast from "long" to "void *"? Then cleaning up the code with this regard might be a very simple and straight forward task. --HPS From owner-svn-src-all@freebsd.org Fri Nov 13 15:36:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2863CA2E878; Fri, 13 Nov 2015 15:36:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFD76179C; Fri, 13 Nov 2015 15:36:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADFaexj018979; Fri, 13 Nov 2015 15:36:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADFaeJD018977; Fri, 13 Nov 2015 15:36:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511131536.tADFaeJD018977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Nov 2015 15:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290769 - in head/sys: arm/conf 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 15:36:42 -0000 Author: imp Date: Fri Nov 13 15:36:40 2015 New Revision: 290769 URL: https://svnweb.freebsd.org/changeset/base/290769 Log: Add support for the Zybo and similar boards to ZEDBOARD kernel. Zybo needs its own DTB and has a different PHY, so add it to the base kernel. Details on building bootable SD images at http://www.thomasskibo.com/zedbsd/ Submitted By: Thomas Skibo Added: head/sys/boot/fdt/dts/arm/zybo.dts (contents, props changed) Modified: head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Fri Nov 13 10:34:14 2015 (r290768) +++ head/sys/arm/conf/ZEDBOARD Fri Nov 13 15:36:40 2015 (r290769) @@ -1,6 +1,6 @@ # # ZEDBOARD -- Custom configuration for the Xilinx Zynq-7000 based -# ZedBoard (www.zedboard.org) +# ZedBoard (www.zedboard.org) and similar Zynq boards. # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -59,6 +59,7 @@ device ether device cgem # Zynq-7000 gig ethernet device device mii device e1000phy +device rgephy # Zybo uses Realtek RTL8211E device pty device uart device gpio Added: head/sys/boot/fdt/dts/arm/zybo.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/zybo.dts Fri Nov 13 15:36:40 2015 (r290769) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * 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$ + */ + +/dts-v1/; + +/ { + model = "zybo"; + compatible = "digilent,zybo"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&GIC>; + + // cpus { + // #address-cells = <1>; + // #size-cells = <0>; + // cpu@0 { + // device-type = "cpu"; + // model = "ARM Cortex-A9"; + // }; + // }; + + memory { + // First megabyte isn't accessible by all interconnect masters. + device_type = "memory"; + reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ + }; + + // Zynq PS System registers. + // + ps7sys@f8000000 { + device_type = "soc"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xf8000000 0xf10000>; + + // SLCR block + slcr: slcr@7000 { + compatible = "xlnx,zy7_slcr"; + reg = <0x0 0x1000>; + clock-frequency = <50000000>; // 50Mhz PS_CLK + }; + + // Interrupt controller + GIC: gic { + compatible = "arm,gic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0xf01000 0x1000>, // distributer registers + <0xf00100 0x0100>; // CPU if registers + }; + + // L2 cache controller + pl310@f02000 { + compatible = "arm,pl310"; + reg = <0xf02000 0x1000>; + interrupts = <34>; + interrupt-parent = <&GIC>; + }; + + // Device Config + devcfg: devcfg@7000 { + compatible = "xlnx,zy7_devcfg"; + reg = <0x7000 0x1000>; + interrupts = <40>; + interrupt-parent = <&GIC>; + }; + + // triple timer counters0,1 + ttc0: ttc@1000 { + compatible = "xlnx,ttc"; + reg = <0x1000 0x1000>; + }; + ttc1: ttc@2000 { + compatible = "xlnx,ttc"; + reg = <0x2000 0x1000>; + }; + + // ARM Cortex A9 TWD Timer + timer@f00600 { + compatible = "arm,mpcore-timers"; + clock-frequency = <325000000>; // 325Mhz + #address-cells = <1>; + #size-cells = <0>; + reg = <0xf00200 0x100>, // Global Timer Regs + <0xf00600 0x20>; // Private Timer Regs + interrupts = < 27 29 >; + interrupt-parent = <&GIC>; + }; + + // system watch-dog timer + swdt@5000 { + device_type = "watchdog"; + compatible = "xlnx,zy7_wdt"; + reg = <0x5000 0x1000>; + interrupts = <41>; + interrupt-parent = <&GIC>; + }; + + scuwdt@f00620 { + device_type = "watchdog"; + compatible = "arm,mpcore_wdt"; + reg = <0xf00620 0x20>; + interrupts = <30>; + interrupt-parent = <&GIC>; + reset = <1>; + }; + }; // pssys@f8000000 + + // Zynq PS I/O Peripheral registers. + // + ps7io@e0000000 { + device_type = "soc"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xe0000000 0x300000>; + + // uart0: uart@0000 { + // device_type = "serial"; + // compatible = "cadence,uart"; + // reg = <0x0000 0x1000>; + // interrupts = <59>; + // interrupt-parent = <&GIC>; + // clock-frequency = <50000000>; + // }; + + uart1: uart@1000 { + device_type = "serial"; + compatible = "cadence,uart"; + reg = <0x1000 0x1000>; + interrupts = <82>; + interrupt-parent = <&GIC>; + clock-frequency = <50000000>; + current-speed = <115200>; + }; + + gpio: gpio@a000 { + compatible = "xlnx,zy7_gpio"; + reg = <0xa000 0x1000>; + interrupts = <52>; + interrupt-parent = <&GIC>; + }; + + // GigE + eth0: eth@b000 { + // device_type = "network"; + + compatible = "cadence,gem"; + reg = <0xb000 0x1000>; + interrupts = <54 55>; + interrupt-parent = <&GIC>; + ref-clock-num = <0>; + }; + + // SDIO + sdhci0: sdhci@100000 { + compatible = "xlnx,zy7_sdhci"; + reg = <0x100000 0x1000>; + interrupts = <56>; + interrupt-parent = <&GIC>; + max-frequency = <50000000>; + }; + + // QSPI + qspi0: qspi@d000 { + compatible = "xlnx,zy7_qspi"; + reg = <0xd000 0x1000>; + interrupts = <51>; + interrupt-parent = <&GIC>; + spi-clock = <50000000>; + ref-clock = <200000000>; + }; + + // USB + ehci0: ehci@2000 { + compatible = "xlnx,zy7_ehci"; + reg = <0x2000 0x1000>; + interrupts = <53>; + interrupt-parent = <&GIC>; + }; + + }; // ps7io@e0000000 + + chosen { + stdin = &uart1; + stdout = &uart1; + }; +}; + From owner-svn-src-all@freebsd.org Fri Nov 13 16:26:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F5AA296A3; Fri, 13 Nov 2015 16:26:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBE51EE7; Fri, 13 Nov 2015 16:26:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id BEF154277FB; Sat, 14 Nov 2015 03:26:31 +1100 (AEDT) Date: Sat, 14 Nov 2015 03:26:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall cc: Konstantin Belousov , Hans Petter Selasky , cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core In-Reply-To: <0330812D-2FB6-4490-BFB3-67F9E66975A7@FreeBSD.org> Message-ID: <20151114024315.Y1146@besplex.bde.org> References: <201511121012.tACACKTI075143@repo.freebsd.org> <56459CEE.4090007@selasky.org> <20151113083543.GV2257@kib.kiev.ua> <0330812D-2FB6-4490-BFB3-67F9E66975A7@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=pGLkceISAAAA:8 a=hA8DVohIdFcsYt2qD64A:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 16:26:42 -0000 On Fri, 13 Nov 2015, David Chisnall wrote: > On 13 Nov 2015, at 08:35, Konstantin Belousov wrote= : >> >> On Fri, Nov 13, 2015 at 09:18:54AM +0100, Hans Petter Selasky wrote: >>> Hi, >>> >>> On 11/12/15 18:17, Conrad Meyer wrote: >>>> These should cast through (u)intptr_t rather than unsigned long. >>> >>> This is Linux code, and they use "unsigned long" for pointer casts >>> everywhere, trying to not break their style. >>> >>> BTW: I added to linux_compat.c: >>> >>> CTASSERT(sizeof(unsigned long) =3D=3D sizeof(uintptr_t)); >>> >>> And it survived my "tinderbox" build and I was surprised! This is not surprising. "long" is broken on all supported systems since no 16-bit systems are supported and misimplementations with longs the same size as int or register_t are not unusable on 32+ bit systems. Longs should actually be long. That means that they should be longer than register_t, so they are also longer than pointers except on systems with large pointers like x86 with far pointers. >> FreeBSD (at least currently) runs on two kinds of ABIs: ILP32 and LP64. >> ILP32 means that sizeof(int) =3D=3D sizeof(long) =3D=3D sizeof(void *) = =3D=3D 4. >> For LP64, sizeof(long) =3D=3D sizeof(void *) =3D=3D 8, while sizeof(int)= =3D=3D 4. >> We do not support anything else. > > Note that this is not true of all downstreams. We currently have 128 and= 256-bit void*s with 64-bit longs on CHERI, and I believe that bde=E2=80=99= s version has 32-bit longs on all platforms. This kind of code *is* broken= for us and we=E2=80=99d greatly appreciate people not writing new code tha= t intentionally relies on undefined behaviour (round tripping a pointer via= any integer type other than intptr_t is undefined in C), when a well-defin= ed mechanism exists, just because Linux decides to do the wrong thing. Does CHERI have far pointers or fat pointers? Does it have newlines? 32-bit longs on all platforms is the last thing that I would have. I have them on 16-bit systems (but I last ran one of those in 2009 after getting it out of the attic). i386 with correctly-sized longs has 64-bit longs (IP32L64). I never finished that. The tiny amount of support for this needed in i386/include/_limits.h was removed in 2011 (r217128). gcc just needed to be configured with -DLONG_TYPE_SIZE=3D64. Other places mostly just need to use the correct type. Often the fix is simply to replace long by int or a typedefed type. i386/include/ _types.h was already correct or fixed (mostly by using fixed-width typedefed types). But sometimes there is an ABI problem. long in an API literally asks for pessimal double-width sizes, but sometimes what it needs is precisely 32 ot 64 bits. Bruce From owner-svn-src-all@freebsd.org Fri Nov 13 17:25:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 841BBA2E3CF; Fri, 13 Nov 2015 17:25:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 417BF1F95; Fri, 13 Nov 2015 17:25:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADHPEv7051508; Fri, 13 Nov 2015 17:25:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADHPEah051507; Fri, 13 Nov 2015 17:25:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201511131725.tADHPEah051507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 13 Nov 2015 17:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290771 - stable/10/release/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 17:25:15 -0000 Author: gjb Date: Fri Nov 13 17:25:14 2015 New Revision: 290771 URL: https://svnweb.freebsd.org/changeset/base/290771 Log: MFC r290550, r290573: r290550: Use tmpfs(5) instead of md(4) for '/tmp' mount. r290573: Remove noatime from tmpfs(5) fstab(5) entry. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/tools/arm.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/release/tools/arm.subr ============================================================================== --- stable/10/release/tools/arm.subr Fri Nov 13 16:35:22 2015 (r290770) +++ stable/10/release/tools/arm.subr Fri Nov 13 17:25:14 2015 (r290771) @@ -110,7 +110,7 @@ arm_install_base() { >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "md /tmp mfs rw,noatime,-s30m 0 0" \ + echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname From owner-svn-src-all@freebsd.org Fri Nov 13 17:25:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB264A2E403; Fri, 13 Nov 2015 17:25:21 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476EB107D; Fri, 13 Nov 2015 17:25:21 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADHPKTk051556; Fri, 13 Nov 2015 17:25:20 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADHPKip051554; Fri, 13 Nov 2015 17:25:20 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201511131725.tADHPKip051554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 13 Nov 2015 17:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290772 - in 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 17:25:21 -0000 Author: brd (doc,ports committer) Date: Fri Nov 13 17:25:20 2015 New Revision: 290772 URL: https://svnweb.freebsd.org/changeset/base/290772 Log: Fix a few files that where being incorrectly installed as one file. This was caused by the nvi upgrade fallout in r281994. So add the missing directories back to the mtree and add distrib-cleanup target to retroactively remove the files that should have been directories. Reviewed by: bdrewery Approved by: bdrewery Modified: head/etc/Makefile head/etc/mtree/BSD.usr.dist Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Nov 13 17:25:14 2015 (r290771) +++ head/etc/Makefile Fri Nov 13 17:25:20 2015 (r290772) @@ -365,7 +365,19 @@ MTREES+= mtree/BSD.sendmail.dist / MTREES+= ../${mtree} / .endfor -distrib-dirs: ${MTREES:N/*} +# Clean up some directories that where mistakenly created as files that +# should not have been as part of the nvi update in r281994. +# This should be removed after 11.0-RELEASE. +DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit +DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref +distrib-cleanup: .PHONY + for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \ + if [ -f ${DESTDIR}/$${file} ]; then \ + rm -f ${DESTDIR}/$${file}; \ + fi; \ + done + +distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY @set ${MTREES}; \ while test $$# -ge 2; do \ m=${.CURDIR}/$$1; \ Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri Nov 13 17:25:14 2015 (r290771) +++ head/etc/mtree/BSD.usr.dist Fri Nov 13 17:25:20 2015 (r290772) @@ -286,6 +286,14 @@ .. 07.mail .. + 10.exref + .. + 11.edit + .. + 12.vi + .. + 13.viref + .. 18.msdiffs .. 19.memacros From owner-svn-src-all@freebsd.org Fri Nov 13 17:27:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80964A2E462; Fri, 13 Nov 2015 17:27:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDB812AA; Fri, 13 Nov 2015 17:27:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADHRNv2051656; Fri, 13 Nov 2015 17:27:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADHRN7H051655; Fri, 13 Nov 2015 17:27:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511131727.tADHRN7H051655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 Nov 2015 17:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290773 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 17:27:24 -0000 Author: bdrewery Date: Fri Nov 13 17:27:23 2015 New Revision: 290773 URL: https://svnweb.freebsd.org/changeset/base/290773 Log: bsd.doc.mk: Similar to r289391, make installing to a missing directory an error. This avoids the problems fixed in r290772. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/share/mk/bsd.doc.mk Modified: head/share/mk/bsd.doc.mk ============================================================================== --- head/share/mk/bsd.doc.mk Fri Nov 13 17:25:20 2015 (r290772) +++ head/share/mk/bsd.doc.mk Fri Nov 13 17:27:23 2015 (r290773) @@ -136,11 +136,11 @@ realinstall: .if ${PRINTERDEVICE:Mhtml} cd ${SRCDIR}; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME} + ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}/ .endif .for _dev in ${PRINTERDEVICE:Nhtml} ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME} + ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}/ .endfor spell: ${SRCS} From owner-svn-src-all@freebsd.org Fri Nov 13 18:51:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4087FA2E4B8; Fri, 13 Nov 2015 18:51:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 196EC1B37; Fri, 13 Nov 2015 18:51:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 211D4B986; Fri, 13 Nov 2015 13:51:23 -0500 (EST) From: John Baldwin To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290743 - head/etc/periodic/daily Date: Fri, 13 Nov 2015 10:38:36 -0800 Message-ID: <2515730.7DRR4ZNBdk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201511130620.tAD6KRR3053808@repo.freebsd.org> References: <201511130620.tAD6KRR3053808@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 Nov 2015 13:51:23 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 18:51:24 -0000 On Friday, November 13, 2015 06:20:27 AM Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Fri Nov 13 06:20:27 2015 > New Revision: 290743 > URL: https://svnweb.freebsd.org/changeset/base/290743 >=20 > Log: > Allow admins to specify a regex which is applied (in the negative) = to the > output from df, similar to what security/200.chkmounts does. This = can be > useful to avoid listing automounted ZFS snapshots, for instance. I almost want a variant of -l that would exclude all synthetic filesyst= ems (procfs, devfs, etc.) as well as nullfs. I think there isn't an easy w= ay for it to auto-detect ZFS snapshots though. --=20 John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 13 18:57:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18D21A2E6A3; Fri, 13 Nov 2015 18:57:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D94AA1F32; Fri, 13 Nov 2015 18:57:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabfh17 with SMTP id fh17so108146437pab.0; Fri, 13 Nov 2015 10:57:42 -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 :content-transfer-encoding:message-id:references:to; bh=hUbCs1AAHYzSzOHb8kOI13JYg3c6KaHEAZFp0ydaD98=; b=A0mjZN2c8TP5SMOYmSwy0KtxIjeLXWvSTn28qk+p63TP2lTQqKiRwyDau4rUSK8D5K JfGtWCegOD7PvOZS5ETytB8NNqzN8QLxCqjC/QNs+GgAm6pzRU1Cu4OdkE2hoDbw5phA tdsGzPZ9ienlfPN+NyDr3C21SWbnjqqP5Xxj6f2IE1kWN0bH/0sXL2g8E64SoeT555jD QQ1ILcGhHm8imE/TB7GtyuJ//aeXGfjmiIKLDLStMu+ICjTIK6zBio+WTSvPYgB1MXVX 6eMTzZL9lHouPcb/LOQRosANY/AeZMw4ayf6g7oJmHy8CqN0nw52xeLFUIPiPWHCxp4T l+AQ== X-Received: by 10.68.241.194 with SMTP id wk2mr33974483pbc.45.1447441062524; Fri, 13 Nov 2015 10:57:42 -0800 (PST) Received: from [100.210.4.8] (m8f0436d0.tmodns.net. [208.54.4.143]) by smtp.gmail.com with ESMTPSA id oi3sm21782230pbb.53.2015.11.13.10.57.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Nov 2015 10:57:40 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r290743 - head/etc/periodic/daily From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <2515730.7DRR4ZNBdk@ralph.baldwin.cx> Date: Fri, 13 Nov 2015 10:57:38 -0800 Cc: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9AA60CC0-E790-4946-B9D9-09C6F5B7E638@gmail.com> References: <201511130620.tAD6KRR3053808@repo.freebsd.org> <2515730.7DRR4ZNBdk@ralph.baldwin.cx> To: John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 18:57:43 -0000 > On Nov 13, 2015, at 10:38, John Baldwin wrote: >=20 >> On Friday, November 13, 2015 06:20:27 AM Dag-Erling Sm=C3=B8rgrav wrote: >> Author: des >> Date: Fri Nov 13 06:20:27 2015 >> New Revision: 290743 >> URL: https://svnweb.freebsd.org/changeset/base/290743 >>=20 >> Log: >> Allow admins to specify a regex which is applied (in the negative) to th= e >> output from df, similar to what security/200.chkmounts does. This can b= e >> useful to avoid listing automounted ZFS snapshots, for instance. >=20 > I almost want a variant of -l that would exclude all synthetic filesystems= > (procfs, devfs, etc.) as well as nullfs. I think there isn't an easy way > for it to auto-detect ZFS snapshots though. Are you referring to file systems mounted from cloned snapshots?= From owner-svn-src-all@freebsd.org Fri Nov 13 19:01:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62001A2E7B3; Fri, 13 Nov 2015 19:01:03 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D92AA127F; Fri, 13 Nov 2015 19:01:02 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: by lfdo63 with SMTP id o63so57725162lfd.2; Fri, 13 Nov 2015 11:01:00 -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=zuOYlYkTq6w1dIyOGxgKbnXdde4vYtnryULLDZJR5jk=; b=AIn30VgyIaJplDwtSmkkPeZExT+B6HOe+tbvcNNM25xsaODG7zby5vAteCyoDNihTV 4yzqKDLDzWiZ1bFtaNXkNh9HUsimMcX4BD6JqlfXDPzayJBFJOMYvb6U2FKAoApRSRLi zLTxGFO2gs+OpHrzSzrdZjraogkSM5Zioy6lXEweMvt/BPdWV+Q/JLJmLbuH8dzUZrBz pBAm21d+/tDSFjt6jCS9y+r0EyqPL6ORuqhId/JEzJsP4q9y70WJv5UaFFFZ6Byg1rJt detvHYEEQ1E81q2F893O+zsTa0pDhdfYv0YDvsJN1BMZ5J0ea+xMigwL1V1//3+JA2bq l7Zw== MIME-Version: 1.0 X-Received: by 10.25.80.137 with SMTP id e131mr11362021lfb.11.1447441260856; Fri, 13 Nov 2015 11:01:00 -0800 (PST) Sender: mahrens@gmail.com Received: by 10.112.139.9 with HTTP; Fri, 13 Nov 2015 11:01:00 -0800 (PST) In-Reply-To: <9AA60CC0-E790-4946-B9D9-09C6F5B7E638@gmail.com> References: <201511130620.tAD6KRR3053808@repo.freebsd.org> <2515730.7DRR4ZNBdk@ralph.baldwin.cx> <9AA60CC0-E790-4946-B9D9-09C6F5B7E638@gmail.com> Date: Fri, 13 Nov 2015 11:01:00 -0800 X-Google-Sender-Auth: 9A2hr-Ihj1G5vn8UPMuP66YJCcI Message-ID: Subject: Re: svn commit: r290743 - head/etc/periodic/daily From: Matthew Ahrens To: Garrett Cooper Cc: John Baldwin , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , "src-committers@freebsd.org" , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:01:03 -0000 On Fri, Nov 13, 2015 at 10:57 AM, Garrett Cooper wrote: > > > On Nov 13, 2015, at 10:38, John Baldwin wrote: > > > >> On Friday, November 13, 2015 06:20:27 AM Dag-Erling Sm=C3=B8rgrav wrot= e: > >> Author: des > >> Date: Fri Nov 13 06:20:27 2015 > >> New Revision: 290743 > >> URL: https://svnweb.freebsd.org/changeset/base/290743 > >> > >> Log: > >> Allow admins to specify a regex which is applied (in the negative) to > the > >> output from df, similar to what security/200.chkmounts does. This ca= n > be > >> useful to avoid listing automounted ZFS snapshots, for instance. > > > > I almost want a variant of -l that would exclude all synthetic > filesystems > > (procfs, devfs, etc.) as well as nullfs. I think there isn't an easy w= ay > > for it to auto-detect ZFS snapshots though. > > Are you referring to file systems mounted from cloned snapshots? > I would guess John is talking about /.zfs/snapshot/, which is typically is not listed by "df" on other platforms. --matt From owner-svn-src-all@freebsd.org Fri Nov 13 19:21:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AC0A2EF68; Fri, 13 Nov 2015 19:21:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8DD01542; Fri, 13 Nov 2015 19:21:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJLjOt086964; Fri, 13 Nov 2015 19:21:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJLjIf086962; Fri, 13 Nov 2015 19:21:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131921.tADJLjIf086962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290774 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:21:47 -0000 Author: mav Date: Fri Nov 13 19:21:45 2015 New Revision: 290774 URL: https://svnweb.freebsd.org/changeset/base/290774 Log: MFC r289702: Make some panic strings mode informative. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 17:27:23 2015 (r290773) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:21:45 2015 (r290774) @@ -3817,7 +3817,7 @@ ctl_expand_number(const char *buf, uint6 static int ctl_init_page_index(struct ctl_lun *lun) { - int i; + int i, page_code; struct ctl_page_index *page_index; const char *value; uint64_t ival; @@ -3838,10 +3838,12 @@ ctl_init_page_index(struct ctl_lun *lun) (page_index->page_flags & CTL_PAGE_FLAG_CDROM) == 0) continue; - switch (page_index->page_code & SMPH_PC_MASK) { + page_code = page_index->page_code & SMPH_PC_MASK; + switch (page_code) { case SMS_RW_ERROR_RECOVERY_PAGE: { - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("subpage is incorrect!"); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT], &rw_er_page_default, sizeof(rw_er_page_default)); @@ -3861,8 +3863,9 @@ ctl_init_page_index(struct ctl_lun *lun) case SMS_FORMAT_DEVICE_PAGE: { struct scsi_format_page *format_page; - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("subpage is incorrect!"); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); /* * Sectors per track are set above. Bytes per @@ -3908,9 +3911,9 @@ ctl_init_page_index(struct ctl_lun *lun) int shift; #endif /* !__XSCALE__ */ - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("invalid subpage value %d", - page_index->subpage); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); /* * Rotation rate and sectors per track are set @@ -3988,9 +3991,9 @@ ctl_init_page_index(struct ctl_lun *lun) case SMS_CACHING_PAGE: { struct scsi_caching_page *caching_page; - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("invalid subpage value %d", - page_index->subpage); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.caching_page[CTL_PAGE_DEFAULT], &caching_page_default, sizeof(caching_page_default)); @@ -4073,6 +4076,9 @@ ctl_init_page_index(struct ctl_lun *lun) page_index->page_data = (uint8_t *)lun->mode_pages.control_ext_page; break; + default: + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); } break; } @@ -4164,10 +4170,18 @@ ctl_init_page_index(struct ctl_lun *lun) sizeof(lbp_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.lbp_page; - }} + break; + } + default: + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); + } break; } case SMS_CDDVD_CAPS_PAGE:{ + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.cddvd_page[CTL_PAGE_DEFAULT], &cddvd_page_default, sizeof(cddvd_page_default)); @@ -4208,17 +4222,14 @@ ctl_init_page_index(struct ctl_lun *lun) break; } default: - panic("invalid subpage value %d", - page_index->subpage); - break; + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); } - break; + break; } default: - panic("invalid page value %d", - page_index->page_code & SMPH_PC_MASK); - break; - } + panic("invalid page code value %#x", page_code); + } } return (CTL_RETVAL_COMPLETE); @@ -6230,8 +6241,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio break; } default: - panic("Invalid CDB type %#x", ctsio->cdb[0]); - break; + panic("%s: Invalid CDB type %#x", __func__, ctsio->cdb[0]); } if (param_len < (header_size + bd_len)) { @@ -6494,8 +6504,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: - panic("invalid CDB type %#x", ctsio->cdb[0]); - break; /* NOTREACHED */ + panic("%s: Invalid CDB type %#x", __func__, ctsio->cdb[0]); } /* @@ -7509,7 +7518,7 @@ retry: lun->pr_key_count; break; default: - panic("Invalid PR type %x", cdb->action); + panic("%s: Invalid PR type %#x", __func__, cdb->action); } mtx_unlock(&lun->lun_lock); @@ -7705,12 +7714,7 @@ retry: break; } default: - /* - * This is a bug, because we just checked for this above, - * and should have returned an error. - */ - panic("Invalid PR type %x", cdb->action); - break; /* NOTREACHED */ + panic("%s: Invalid PR type %#x", __func__, cdb->action); } mtx_unlock(&lun->lun_lock); @@ -8428,7 +8432,7 @@ ctl_persistent_reserve_out(struct ctl_sc break; } default: - panic("Invalid PR type %x", cdb->action); + panic("%s: Invalid PR type %#x", __func__, cdb->action); } done: @@ -11037,8 +11041,9 @@ ctl_check_for_blockage(struct ctl_lun *l case CTL_SER_SKIP: return (CTL_ACTION_SKIP); default: - panic("invalid serialization value %d", - serialize_row[pending_entry->seridx]); + panic("%s: Invalid serialization value %d for %d => %d", + __func__, serialize_row[pending_entry->seridx], + pending_entry->seridx, ooa_entry->seridx); } return (CTL_ACTION_ERROR); @@ -11087,8 +11092,7 @@ ctl_check_ooa(struct ctl_lun *lun, union case CTL_ACTION_PASS: break; default: - panic("invalid action %d", action); - break; /* NOTREACHED */ + panic("%s: Invalid action %d\n", __func__, action); } } @@ -12565,9 +12569,8 @@ ctl_datamove(union ctl_io *io) io->taskio.tag_num, io->taskio.tag_type); break; default: - printf("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - panic("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - break; + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } sbuf_cat(&sb, path_str); sbuf_printf(&sb, "ctl_datamove: %jd seconds\n", @@ -13100,9 +13103,8 @@ ctl_process_done(union ctl_io *io) io->taskio.tag_num, io->taskio.tag_type); break; default: - printf("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - panic("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - break; + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } sbuf_cat(&sb, path_str); sbuf_printf(&sb, "ctl_process_done: %jd seconds\n", @@ -13121,9 +13123,8 @@ ctl_process_done(union ctl_io *io) fe_done(io); return; default: - panic("ctl_process_done: invalid io type %d\n", - io->io_hdr.io_type); - break; /* NOTREACHED */ + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } lun = (struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Nov 13 17:27:23 2015 (r290773) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Nov 13 19:21:45 2015 (r290774) @@ -2113,7 +2113,7 @@ ctl_be_block_close(struct ctl_be_block_l case CTL_BE_BLOCK_NONE: break; default: - panic("Unexpected backend type."); + panic("Unexpected backend type %d", be_lun->dev_type); break; } be_lun->dev_type = CTL_BE_BLOCK_NONE; From owner-svn-src-all@freebsd.org Fri Nov 13 19:23:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB26BA2E0D0; Fri, 13 Nov 2015 19:23:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21D41852; Fri, 13 Nov 2015 19:23:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJNNF9089024; Fri, 13 Nov 2015 19:23:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJNNst089018; Fri, 13 Nov 2015 19:23:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131923.tADJNNst089018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290775 - in stable/10/sys: cam/ctl cam/scsi dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:23:25 -0000 Author: mav Date: Fri Nov 13 19:23:22 2015 New Revision: 290775 URL: https://svnweb.freebsd.org/changeset/base/290775 Log: MFC r289843: Add partial support for QUERY TMF to CAM and isp(4). This change allows to decode respective functions in isp(4) in target mode and pass them through CAM to CTL. Unfortunately neither CAM nor isp(4) support returning response info for those task management functions now. On the other side I just have no initiator to test this functionality. Modified: stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/cam/scsi/scsi_message.h stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_stds.h stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1459,24 +1459,31 @@ ctlfedone(struct cam_periph *periph, uni CTL_TASK_ABORT_TASK_SET; break; case MSG_TARGET_RESET: - io->taskio.task_action = - CTL_TASK_TARGET_RESET; + io->taskio.task_action = CTL_TASK_TARGET_RESET; break; case MSG_ABORT_TASK: - io->taskio.task_action = - CTL_TASK_ABORT_TASK; + io->taskio.task_action = CTL_TASK_ABORT_TASK; break; case MSG_LOGICAL_UNIT_RESET: - io->taskio.task_action = - CTL_TASK_LUN_RESET; + io->taskio.task_action = CTL_TASK_LUN_RESET; break; case MSG_CLEAR_TASK_SET: io->taskio.task_action = - CTL_TASK_CLEAR_TASK_SET; + CTL_TASK_CLEAR_TASK_SET; break; case MSG_CLEAR_ACA: + io->taskio.task_action = CTL_TASK_CLEAR_ACA; + break; + case MSG_QUERY_TASK: + io->taskio.task_action = CTL_TASK_QUERY_TASK; + break; + case MSG_QUERY_TASK_SET: + io->taskio.task_action = + CTL_TASK_QUERY_TASK_SET; + break; + case MSG_QUERY_ASYNC_EVENT: io->taskio.task_action = - CTL_TASK_CLEAR_ACA; + CTL_TASK_QUERY_ASYNC_EVENT; break; case MSG_NOOP: send_ctl_io = 0; Modified: stable/10/sys/cam/scsi/scsi_message.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:23:22 2015 (r290775) @@ -68,3 +68,9 @@ #define MSG_EXT_PPR_QAS_REQ 0x04 #define MSG_EXT_PPR_DT_REQ 0x02 #define MSG_EXT_PPR_IU_REQ 0x01 + +/* Fake messages not defined for SPI, but needed for other transports */ +#define MSG_QUERY_TASK 0x100 +#define MSG_QUERY_TASK_SET 0x101 +#define MSG_QUERY_ASYNC_EVENT 0x102 + Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:23:22 2015 (r290775) @@ -3479,6 +3479,12 @@ isp_handle_platform_target_tmf(ispsoftc_ case NT_TARGET_RESET: inot->arg = MSG_TARGET_RESET; break; + case NT_QUERY_TASK_SET: + inot->arg = MSG_QUERY_TASK_SET; + break; + case NT_QUERY_ASYNC_EVENT: + inot->arg = MSG_QUERY_ASYNC_EVENT; + break; default: isp_prt(isp, ISP_LOGWARN, "%s: unknown TMF code 0x%x for chan %d lun 0x%x", __func__, notify->nt_ncode, notify->nt_channel, lun); goto bad; @@ -5883,6 +5889,8 @@ changed: case NT_CLEAR_TASK_SET: case NT_LUN_RESET: case NT_TARGET_RESET: + case NT_QUERY_TASK_SET: + case NT_QUERY_ASYNC_EVENT: /* * These are task management functions. */ Modified: stable/10/sys/dev/isp/isp_stds.h ============================================================================== --- stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:23:22 2015 (r290775) @@ -97,8 +97,10 @@ typedef struct { #define FCP_CMND_TMF_CLEAR_ACA 0x40 #define FCP_CMND_TMF_TGT_RESET 0x20 #define FCP_CMND_TMF_LUN_RESET 0x10 +#define FCP_CMND_TMF_QUERY_ASYNC_EVENT 0x08 #define FCP_CMND_TMF_CLEAR_TASK_SET 0x04 #define FCP_CMND_TMF_ABORT_TASK_SET 0x02 +#define FCP_CMND_TMF_QUERY_TASK_SET 0x01 /* * Basic CT IU Header Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1024,12 +1024,18 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_sid = sid; notify.nt_did = did; notify.nt_channel = chan; - if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { + if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_TASK_SET) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY TASK SET", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_ABORT_TASK_SET; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_CLEAR_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_CLEAR_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_ASYNC_EVENT) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY ASYNC EVENT", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_ASYNC_EVENT; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_LUN_RESET) { isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_LUN_RESET; Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:23:22 2015 (r290775) @@ -51,7 +51,9 @@ typedef enum { NT_LOGOUT, NT_GLOBAL_LOGOUT, NT_CHANGED, - NT_HBA_RESET + NT_HBA_RESET, + NT_QUERY_TASK_SET, + NT_QUERY_ASYNC_EVENT } isp_ncode_t; typedef struct isp_notify { From owner-svn-src-all@freebsd.org Fri Nov 13 19:24:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF92A2E12B; Fri, 13 Nov 2015 19:24:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1A5019B9; Fri, 13 Nov 2015 19:24:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJOiuR089127; Fri, 13 Nov 2015 19:24:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJOilp089122; Fri, 13 Nov 2015 19:24:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131924.tADJOilp089122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290776 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:24:46 -0000 Author: mav Date: Fri Nov 13 19:24:44 2015 New Revision: 290776 URL: https://svnweb.freebsd.org/changeset/base/290776 Log: MFC r289881: Give CTL support for PIM_EXTLUNS when talking to CAM. CTL itself still lives in flat LUN space, but it can generate extended numbers if CAM SIM reports such capability. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:24:44 2015 (r290776) @@ -3540,6 +3540,67 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); } +uint32_t +ctl_decode_lun(uint64_t encoded) +{ + uint8_t lun[8]; + uint32_t result = 0xffffffff; + + be64enc(lun, encoded); + switch (lun[0] & RPL_LUNDATA_ATYP_MASK) { + case RPL_LUNDATA_ATYP_PERIPH: + if ((lun[0] & 0x3f) == 0 && lun[2] == 0 && lun[3] == 0 && + lun[4] == 0 && lun[5] == 0 && lun[6] == 0 && lun[7] == 0) + result = lun[1]; + break; + case RPL_LUNDATA_ATYP_FLAT: + if (lun[2] == 0 && lun[3] == 0 && lun[4] == 0 && lun[5] == 0 && + lun[6] == 0 && lun[7] == 0) + result = ((lun[0] & 0x3f) << 8) + lun[1]; + break; + case RPL_LUNDATA_ATYP_EXTLUN: + switch (lun[0] & RPL_LUNDATA_EXT_EAM_MASK) { + case 0x02: + switch (lun[0] & RPL_LUNDATA_EXT_LEN_MASK) { + case 0x00: + result = lun[1]; + break; + case 0x10: + result = (lun[1] << 16) + (lun[2] << 8) + + lun[3]; + break; + case 0x20: + if (lun[1] == 0 && lun[6] == 0 && lun[7] == 0) + result = (lun[2] << 24) + + (lun[3] << 16) + (lun[4] << 8) + + lun[5]; + break; + } + break; + case RPL_LUNDATA_EXT_EAM_NOT_SPEC: + result = 0xffffffff; + break; + } + break; + } + return (result); +} + +uint64_t +ctl_encode_lun(uint32_t decoded) +{ + uint64_t l = decoded; + + if (l <= 0xff) + return (((uint64_t)RPL_LUNDATA_ATYP_PERIPH << 56) | (l << 48)); + if (l <= 0x3fff) + return (((uint64_t)RPL_LUNDATA_ATYP_FLAT << 56) | (l << 48)); + if (l <= 0xffffff) + return (((uint64_t)(RPL_LUNDATA_ATYP_EXTLUN | 0x12) << 56) | + (l << 32)); + return ((((uint64_t)RPL_LUNDATA_ATYP_EXTLUN | 0x22) << 56) | (l << 16)); +} + static struct ctl_port * ctl_io_port(struct ctl_io_hdr *io_hdr) { @@ -9063,36 +9124,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio if (lun == NULL) continue; - if (targ_lun_id <= 0xff) { - /* - * Peripheral addressing method, bus number 0. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_PERIPH; - lun_data->luns[num_filled].lundata[1] = targ_lun_id; - num_filled++; - } else if (targ_lun_id <= 0x3fff) { - /* - * Flat addressing method. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); - lun_data->luns[num_filled].lundata[1] = - (targ_lun_id & 0xff); - num_filled++; - } else if (targ_lun_id <= 0xffffff) { - /* - * Extended flat addressing method. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_EXTLUN | 0x12; - scsi_ulto3b(targ_lun_id, - &lun_data->luns[num_filled].lundata[1]); - num_filled++; - } else { - printf("ctl_report_luns: bogus LUN number %jd, " - "skipping\n", (intmax_t)targ_lun_id); - } + be64enc(lun_data->luns[num_filled++].lundata, + ctl_encode_lun(targ_lun_id)); + /* * According to SPC-3, rev 14 section 6.21: * Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl.h Fri Nov 13 19:24:44 2015 (r290776) @@ -191,6 +191,9 @@ void ctl_clr_ua_all(struct ctl_lun *lun, void ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx, ctl_ua_type ua_type); +uint32_t ctl_decode_lun(uint64_t encoded); +uint64_t ctl_encode_lun(uint32_t decoded); + void ctl_isc_announce_lun(struct ctl_lun *lun); void ctl_isc_announce_port(struct ctl_port *port); void ctl_isc_announce_iid(struct ctl_port *port, int iid); Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 13 19:24:44 2015 (r290776) @@ -549,7 +549,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); /* * This tag scheme isn't the best, since we could in theory * have a very long-lived I/O and tag collision, especially @@ -638,7 +639,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); io->taskio.task_action = CTL_TASK_ABORT_TASK; io->taskio.tag_num = abort_ccb->csio.tag_id; switch (abort_ccb->csio.tag_action) { @@ -733,7 +735,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); if (ccb->ccb_h.func_code == XPT_RESET_BUS) io->taskio.task_action = CTL_TASK_BUS_RESET; else @@ -760,7 +763,7 @@ cfcs_action(struct cam_sim *sim, union c cpi->version_num = 0; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = 0; + cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; cpi->max_target = 1; cpi->max_lun = 1024; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 13 19:24:44 2015 (r290776) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -413,62 +414,6 @@ cfiscsi_pdu_queue(struct icl_pdu *respon CFISCSI_SESSION_UNLOCK(cs); } -static uint32_t -cfiscsi_decode_lun(uint64_t encoded) -{ - uint8_t lun[8]; - uint32_t result; - - /* - * The LUN field in iSCSI PDUs may look like an ordinary 64 bit number, - * but is in fact an evil, multidimensional structure defined - * in SCSI Architecture Model 5 (SAM-5), section 4.6. - */ - memcpy(lun, &encoded, sizeof(lun)); - switch (lun[0] & 0xC0) { - case 0x00: - if ((lun[0] & 0x3f) != 0 || lun[2] != 0 || lun[3] != 0 || - lun[4] != 0 || lun[5] != 0 || lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN " - "(peripheral device addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = lun[1]; - break; - case 0x40: - if (lun[2] != 0 || lun[3] != 0 || lun[4] != 0 || lun[5] != 0 || - lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN " - "(flat address space addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = ((lun[0] & 0x3f) << 8) + lun[1]; - break; - case 0xC0: - if (lun[0] != 0xD2 || lun[4] != 0 || lun[5] != 0 || - lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN (extended flat " - "address space addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = (lun[1] << 16) + (lun[2] << 8) + lun[3]; - break; - default: - CFISCSI_WARN("unsupported LUN format 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - - return (result); -} - static void cfiscsi_pdu_handle_nop_out(struct icl_pdu *request) { @@ -563,7 +508,7 @@ cfiscsi_pdu_handle_scsi_command(struct i io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; - io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun); + io->io_hdr.nexus.targ_lun = ctl_decode_lun(be64toh(bhssc->bhssc_lun)); io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag; switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) { case BHSSC_FLAGS_ATTR_UNTAGGED: @@ -619,7 +564,7 @@ cfiscsi_pdu_handle_task_request(struct i io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; - io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun); + io->io_hdr.nexus.targ_lun = ctl_decode_lun(be64toh(bhstmr->bhstmr_lun)); io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ switch (bhstmr->bhstmr_function & ~0x80) { Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:24:44 2015 (r290776) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008, 2009 Silicon Graphics International Corp. + * Copyright (c) 2014-2015 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,13 +74,14 @@ __FBSDID("$FreeBSD$"); #include struct ctlfe_softc { - struct ctl_port port; - path_id_t path_id; - target_id_t target_id; - u_int maxio; + struct ctl_port port; + path_id_t path_id; + target_id_t target_id; + uint32_t hba_misc; + u_int maxio; struct cam_sim *sim; - char port_name[DEV_IDLEN]; - struct mtx lun_softc_mtx; + char port_name[DEV_IDLEN]; + struct mtx lun_softc_mtx; STAILQ_HEAD(, ctlfe_lun_softc) lun_softc_list; STAILQ_ENTRY(ctlfe_softc) links; }; @@ -355,6 +357,7 @@ ctlfeasync(void *callback_arg, uint32_t softc->path_id = cpi->ccb_h.path_id; softc->target_id = cpi->initiator_id; softc->sim = xpt_path_sim(path); + softc->hba_misc = cpi->hba_misc; if (cpi->maxio != 0) softc->maxio = cpi->maxio; else @@ -1166,7 +1169,12 @@ ctlfedone(struct cam_periph *periph, uni io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = atio->init_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; - io->io_hdr.nexus.targ_lun = atio->ccb_h.target_lun; + if (bus_softc->hba_misc & PIM_EXTLUNS) { + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(atio->ccb_h.target_lun)); + } else { + io->io_hdr.nexus.targ_lun = atio->ccb_h.target_lun; + } io->scsiio.tag_num = atio->tag_id; switch (atio->tag_action) { case CAM_TAG_ACTION_NONE: @@ -1440,7 +1448,12 @@ ctlfedone(struct cam_periph *periph, uni inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; - io->io_hdr.nexus.targ_lun = inot->ccb_h.target_lun; + if (bus_softc->hba_misc & PIM_EXTLUNS) { + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(inot->ccb_h.target_lun)); + } else { + io->io_hdr.nexus.targ_lun = inot->ccb_h.target_lun; + } /* XXX KDM should this be the tag_id? */ io->taskio.tag_num = inot->seq_id; @@ -1820,9 +1833,11 @@ ctlfe_lun_enable(void *arg, int lun_id) cam_status status; bus_softc = (struct ctlfe_softc *)arg; + if (bus_softc->hba_misc & PIM_EXTLUNS) + lun_id = CAM_EXTLUN_BYTE_SWIZZLE(ctl_encode_lun(lun_id)); status = xpt_create_path(&path, /*periph*/ NULL, - bus_softc->path_id, bus_softc->target_id, lun_id); + bus_softc->path_id, bus_softc->target_id, lun_id); /* XXX KDM need some way to return status to CTL here? */ if (status != CAM_REQ_CMP) { printf("%s: could not create path, status %#x\n", __func__, @@ -1879,6 +1894,8 @@ ctlfe_lun_disable(void *arg, int lun_id) struct ctlfe_lun_softc *lun_softc; softc = (struct ctlfe_softc *)arg; + if (softc->hba_misc & PIM_EXTLUNS) + lun_id = CAM_EXTLUN_BYTE_SWIZZLE(ctl_encode_lun(lun_id)); mtx_lock(&softc->lun_softc_mtx); STAILQ_FOREACH(lun_softc, &softc->lun_softc_list, links) { From owner-svn-src-all@freebsd.org Fri Nov 13 19:26:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD754A2E1B2; Fri, 13 Nov 2015 19:26:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94D541B22; Fri, 13 Nov 2015 19:26:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJQoFZ089258; Fri, 13 Nov 2015 19:26:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJQoYO089257; Fri, 13 Nov 2015 19:26:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131926.tADJQoYO089257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290777 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:26:51 -0000 Author: mav Date: Fri Nov 13 19:26:50 2015 New Revision: 290777 URL: https://svnweb.freebsd.org/changeset/base/290777 Log: MFC r290387: Extend mask of VMware virtual disks. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Fri Nov 13 19:24:44 2015 (r290776) +++ stable/10/sys/cam/scsi/scsi_da.c Fri Nov 13 19:26:50 2015 (r290777) @@ -368,7 +368,7 @@ static struct da_quirk_entry da_quirk_ta * VMware returns BUSY status when storage has transient * connectivity problems, so better wait. */ - {T_DIRECT, SIP_MEDIA_FIXED, "VMware", "Virtual disk", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, "VMware*", "*", "*"}, /*quirks*/ DA_Q_RETRY_BUSY }, /* USB mass storage devices supported by umass(4) */ From owner-svn-src-all@freebsd.org Fri Nov 13 19:27:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53047A2E220; Fri, 13 Nov 2015 19:27:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 193D71C94; Fri, 13 Nov 2015 19:27:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJRdLo089341; Fri, 13 Nov 2015 19:27:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJRdja089340; Fri, 13 Nov 2015 19:27:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131927.tADJRdja089340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290778 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:27:40 -0000 Author: mav Date: Fri Nov 13 19:27:38 2015 New Revision: 290778 URL: https://svnweb.freebsd.org/changeset/base/290778 Log: MFC r290458: Add two more KASSERTs. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:26:50 2015 (r290777) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:27:38 2015 (r290778) @@ -11044,7 +11044,15 @@ ctl_check_for_blockage(struct ctl_lun *l return (CTL_ACTION_BLOCK); pending_entry = ctl_get_cmd_entry(&pending_io->scsiio, NULL); + KASSERT(pending_entry->seridx < CTL_SERIDX_COUNT, + ("%s: Invalid seridx %d for pending CDB %02x %02x @ %p", + __func__, pending_entry->seridx, pending_io->scsiio.cdb[0], + pending_io->scsiio.cdb[1], pending_io)); ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio, NULL); + KASSERT(ooa_entry->seridx < CTL_SERIDX_COUNT, + ("%s: Invalid seridx %d for ooa CDB %02x %02x @ %p", + __func__, ooa_entry->seridx, ooa_io->scsiio.cdb[0], + ooa_io->scsiio.cdb[1], ooa_io)); serialize_row = ctl_serialize_table[ooa_entry->seridx]; From owner-svn-src-all@freebsd.org Fri Nov 13 19:32:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68156A2E3A6; Fri, 13 Nov 2015 19:32:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 278A31FFF; Fri, 13 Nov 2015 19:32:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJWIN0091623; Fri, 13 Nov 2015 19:32:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJWIwV091621; Fri, 13 Nov 2015 19:32:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131932.tADJWIwV091621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290779 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:32:19 -0000 Author: mav Date: Fri Nov 13 19:32:17 2015 New Revision: 290779 URL: https://svnweb.freebsd.org/changeset/base/290779 Log: MFC r289219: Export bunch of state variables as sysctls. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:27:38 2015 (r290778) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:32:17 2015 (r290779) @@ -205,30 +205,55 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_sim_free(fc->sim, FALSE); return (ENOMEM); } - ISP_FC_PC(isp, chan)->num_threads += 1; + fc->num_threads += 1; #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { ISP_SET_PC(isp, chan, proc_active, 0); isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); } - ISP_FC_PC(isp, chan)->num_threads += 1; + fc->num_threads += 1; #endif if (chan > 0) { snprintf(name, sizeof(name), "chan%d", chan); tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, name, CTLFLAG_RW, 0, "Virtual channel"); } - SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwnn", CTLFLAG_RD, &FCPARAM(isp, chan)->isp_wwnn, "World Wide Node Name"); - SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwpn", CTLFLAG_RD, &FCPARAM(isp, chan)->isp_wwpn, "World Wide Port Name"); - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "loop_down_limit", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->loop_down_limit, 0, "Loop Down Limit"); - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "gone_device_time", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->gone_device_time, 0, "Gone Device Time"); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, &fcp->isp_wwnn, + "World Wide Node Name"); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, &fcp->isp_wwpn, + "World Wide Port Name"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "loop_down_limit", CTLFLAG_RW, &fc->loop_down_limit, 0, + "Loop Down Limit"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "gone_device_time", CTLFLAG_RW, &fc->gone_device_time, 0, + "Gone Device Time"); #if defined(ISP_TARGET_MODE) && defined(DEBUG) - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "inject_lost_data_frame", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->inject_lost_data_frame, 0, "Cause a Lost Frame on a Read"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "inject_lost_data_frame", CTLFLAG_RW, &fc->inject_lost_data_frame, 0, + "Cause a Lost Frame on a Read"); #endif SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "role", CTLTYPE_INT | CTLFLAG_RW, isp, chan, isp_role_sysctl, "I", "Current role"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "speed", CTLFLAG_RD, &fcp->isp_gbspeed, 0, + "Connection speed in gigabits"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "linkstate", CTLFLAG_RD, &fcp->isp_linkstate, 0, + "Link state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "fwstate", CTLFLAG_RD, &fcp->isp_fwstate, 0, + "Firmware state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "loopstate", CTLFLAG_RD, &fcp->isp_loopstate, 0, + "Loop state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "topo", CTLFLAG_RD, &fcp->isp_topo, 0, + "Connection topology"); } return (0); } @@ -5700,7 +5725,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); va_end(ap); - FCPARAM(isp, bus)->link_active = 0; + FCPARAM(isp, bus)->isp_linkstate = 0; fc = ISP_FC_PC(isp, bus); if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) { @@ -5733,7 +5758,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * Change Notify before activating the FC cleanup * thread to look at the state of the loop again. */ - FCPARAM(isp, bus)->link_active = 1; + FCPARAM(isp, bus)->isp_linkstate = 1; fc->loop_dead = 0; fc->loop_down_time = 0; isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus); Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:27:38 2015 (r290778) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:32:17 2015 (r290779) @@ -436,21 +436,19 @@ typedef struct { */ typedef struct { - uint32_t + int isp_gbspeed; /* Connection speed */ + int isp_linkstate; /* Link state */ + int isp_fwstate; /* ISP F/W state */ + int isp_loopstate; /* Loop State */ + int isp_topo; /* Connection Type */ + + uint32_t : 3, fctape_enabled : 1, - link_active : 1, sendmarker : 1, + loop_seen_once : 1, role : 2, - isp_gbspeed : 4, - isp_loopstate : 4, /* Current Loop State */ - isp_fwstate : 4, /* ISP F/W state */ - isp_topo : 3, /* Connection Type */ - loop_seen_once : 1; - - uint32_t : 8, isp_portid : 24; /* S_ID */ - uint16_t isp_fwoptions; uint16_t isp_xfwoptions; uint16_t isp_zfwoptions; From owner-svn-src-all@freebsd.org Fri Nov 13 19:33:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84EB6A2E469; Fri, 13 Nov 2015 19:33:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4641612C7; Fri, 13 Nov 2015 19:33:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJXDdF092330; Fri, 13 Nov 2015 19:33:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJXDpt092328; Fri, 13 Nov 2015 19:33:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131933.tADJXDpt092328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290780 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:33:14 -0000 Author: mav Date: Fri Nov 13 19:33:13 2015 New Revision: 290780 URL: https://svnweb.freebsd.org/changeset/base/290780 Log: MFC r289620: Decode more firmware attributes. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:32:17 2015 (r290779) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:33:13 2015 (r290780) @@ -1090,8 +1090,13 @@ isp_reset(ispsoftc_t *isp, int do_load_d } else { isp->isp_fwattr = mbs.param[6]; } - if (IS_24XX(isp) && (isp->isp_fwattr & ISP2400_FW_ATTR_EXTNDED)) { - isp->isp_fwattr |= (((uint64_t) mbs.param[15]) << 16) | (((uint64_t) mbs.param[16]) << 32) | (((uint64_t) mbs.param[17]) << 48); + if (IS_24XX(isp)) { + isp->isp_fwattr |= ((uint64_t) mbs.param[15]) << 16; + if (isp->isp_fwattr & ISP2400_FW_ATTR_EXTNDED) { + isp->isp_fwattr |= + (((uint64_t) mbs.param[16]) << 32) | + (((uint64_t) mbs.param[17]) << 48); + } } } else if (IS_SCSI(isp)) { #ifndef ISP_TARGET_MODE @@ -1132,6 +1137,18 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt ^=ISP2400_FW_ATTR_VI; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VI", buf); } + if (fwt & ISP2400_FW_ATTR_MQ) { + fwt ^=ISP2400_FW_ATTR_MQ; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s MQ", buf); + } + if (fwt & ISP2400_FW_ATTR_MSIX) { + fwt ^=ISP2400_FW_ATTR_MSIX; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s MSIX", buf); + } + if (fwt & ISP2400_FW_ATTR_FCOE) { + fwt ^=ISP2400_FW_ATTR_FCOE; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s FCOE", buf); + } if (fwt & ISP2400_FW_ATTR_VP0) { fwt ^= ISP2400_FW_ATTR_VP0; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VP0_Decoupling", buf); @@ -1140,7 +1157,43 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt ^= ISP2400_FW_ATTR_EXPFW; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (Experimental)", buf); } + if (fwt & ISP2400_FW_ATTR_HOTFW) { + fwt ^= ISP2400_FW_ATTR_HOTFW; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s HotFW", buf); + } fwt &= ~ISP2400_FW_ATTR_EXTNDED; + if (fwt & ISP2400_FW_ATTR_EXTVP) { + fwt ^= ISP2400_FW_ATTR_EXTVP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ExtVP", buf); + } + if (fwt & ISP2400_FW_ATTR_VN2VN) { + fwt ^= ISP2400_FW_ATTR_VN2VN; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VN2VN", buf); + } + if (fwt & ISP2400_FW_ATTR_EXMOFF) { + fwt ^= ISP2400_FW_ATTR_EXMOFF; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s EXMOFF", buf); + } + if (fwt & ISP2400_FW_ATTR_NPMOFF) { + fwt ^= ISP2400_FW_ATTR_NPMOFF; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s NPMOFF", buf); + } + if (fwt & ISP2400_FW_ATTR_DIFCHOP) { + fwt ^= ISP2400_FW_ATTR_DIFCHOP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s DIFCHOP", buf); + } + if (fwt & ISP2400_FW_ATTR_SRIOV) { + fwt ^= ISP2400_FW_ATTR_SRIOV; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s SRIOV", buf); + } + if (fwt & ISP2400_FW_ATTR_ASICTMP) { + fwt ^= ISP2400_FW_ATTR_ASICTMP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ASICTMP", buf); + } + if (fwt & ISP2400_FW_ATTR_ATIOMQ) { + fwt ^= ISP2400_FW_ATTR_ATIOMQ; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ATIOMQ", buf); + } if (fwt) { ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%08x%08x)", buf, (uint32_t) (fwt >> 32), (uint32_t) fwt); Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:32:17 2015 (r290779) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:33:13 2015 (r290780) @@ -820,9 +820,21 @@ typedef struct { #define ISP2400_FW_ATTR_SB2 0x0008 #define ISP2400_FW_ATTR_T10CRC 0x0010 #define ISP2400_FW_ATTR_VI 0x0020 +#define ISP2400_FW_ATTR_MQ 0x0040 +#define ISP2400_FW_ATTR_MSIX 0x0080 +#define ISP2400_FW_ATTR_FCOE 0x0800 #define ISP2400_FW_ATTR_VP0 0x1000 #define ISP2400_FW_ATTR_EXPFW 0x2000 +#define ISP2400_FW_ATTR_HOTFW 0x4000 #define ISP2400_FW_ATTR_EXTNDED 0x8000 +#define ISP2400_FW_ATTR_EXTVP 0x00010000 +#define ISP2400_FW_ATTR_VN2VN 0x00040000 +#define ISP2400_FW_ATTR_EXMOFF 0x00080000 +#define ISP2400_FW_ATTR_NPMOFF 0x00100000 +#define ISP2400_FW_ATTR_DIFCHOP 0x00400000 +#define ISP2400_FW_ATTR_SRIOV 0x02000000 +#define ISP2400_FW_ATTR_ASICTMP 0x0200000000 +#define ISP2400_FW_ATTR_ATIOMQ 0x0400000000 /* * These are either manifestly true or are dependent on f/w attributes From owner-svn-src-all@freebsd.org Fri Nov 13 19:34:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FDBA2E4E7; Fri, 13 Nov 2015 19:34:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E58D1472; Fri, 13 Nov 2015 19:34:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJYgmu092432; Fri, 13 Nov 2015 19:34:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJYgov092429; Fri, 13 Nov 2015 19:34:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131934.tADJYgov092429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290781 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:34:43 -0000 Author: mav Date: Fri Nov 13 19:34:42 2015 New Revision: 290781 URL: https://svnweb.freebsd.org/changeset/base/290781 Log: MFC r289622: Zero mbox[1] for INIT_FIRMWARE to fix version 7.3 firmware. While there, add new fields to isp_icb_2400_t structure. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:33:13 2015 (r290780) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:34:42 2015 (r290781) @@ -1954,6 +1954,7 @@ isp_fibre_init(ispsoftc_t *isp) * Init the firmware */ MBSINIT(&mbs, MBOX_INIT_FIRMWARE, MBLOGALL, 30000000); + mbs.param[1] = 0; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); @@ -2253,6 +2254,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) } else { mbs.param[0] = MBOX_INIT_FIRMWARE; } + mbs.param[1] = 0; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); @@ -7108,7 +7110,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x00, 0x00), /* 0x45: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x46: */ ISP_FC_OPMAP(0xcf, 0x03), /* 0x47: GET PORT_DATABASE ENHANCED */ - ISP_FC_OPMAP(0xcd, 0x01), /* 0x48: MBOX_INIT_FIRMWARE_MULTI_ID */ + ISP_FC_OPMAP(0xcf, 0x0f), /* 0x48: MBOX_INIT_FIRMWARE_MULTI_ID */ ISP_FC_OPMAP(0xcd, 0x01), /* 0x49: MBOX_GET_VP_DATABASE */ ISP_FC_OPMAP_HALF(0x2, 0xcd, 0x0, 0x01), /* 0x4a: MBOX_GET_VP_DATABASE_ENTRY */ ISP_FC_OPMAP(0x00, 0x00), /* 0x4b: */ @@ -7132,7 +7134,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x07, 0x03), /* 0x5d: MBOX_GET_SET_DATA_RATE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x5e: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x5f: */ - ISP_FC_OPMAP(0xcd, 0x01), /* 0x60: MBOX_INIT_FIRMWARE */ + ISP_FC_OPMAP(0xcf, 0x0f), /* 0x60: MBOX_INIT_FIRMWARE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x61: */ ISP_FC_OPMAP(0x01, 0x01), /* 0x62: MBOX_INIT_LIP */ ISP_FC_OPMAP(0xcd, 0x03), /* 0x63: MBOX_GET_FC_AL_POSITION_MAP */ Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:33:13 2015 (r290780) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:34:42 2015 (r290781) @@ -1055,8 +1055,10 @@ typedef struct { uint16_t icb_prqstqlen; uint16_t icb_rqstaddr[4]; uint16_t icb_respaddr[4]; - uint16_t icb_priaddr[4]; - uint16_t icb_reserved1[4]; + uint16_t icb_priaddr[4]; + uint16_t icb_msixresp; + uint16_t icb_msixatio; + uint16_t icb_reserved1[2]; uint16_t icb_atio_in; uint16_t icb_atioqlen; uint16_t icb_atioqaddr[4]; @@ -1065,7 +1067,11 @@ typedef struct { uint32_t icb_fwoptions1; uint32_t icb_fwoptions2; uint32_t icb_fwoptions3; - uint16_t icb_reserved2[12]; + uint16_t icb_qos; + uint16_t icb_reserved2[3]; + uint16_t icb_enodemac[3]; + uint16_t icb_disctime; + uint16_t icb_reserved3[4]; } isp_icb_2400_t; #define RQRSP_ADDR0015 0 From owner-svn-src-all@freebsd.org Fri Nov 13 19:36:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD18A2E563; Fri, 13 Nov 2015 19:36:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9649D1623; Fri, 13 Nov 2015 19:36:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJahZB092559; Fri, 13 Nov 2015 19:36:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJahtO092556; Fri, 13 Nov 2015 19:36:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131936.tADJahtO092556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290782 - in stable/10/sys: dev/isp dev/ispfw modules/ispfw modules/ispfw/isp_2400_multi modules/ispfw/isp_2500_multi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:36:45 -0000 Author: mav Date: Fri Nov 13 19:36:43 2015 New Revision: 290782 URL: https://svnweb.freebsd.org/changeset/base/290782 Log: MFC r289626: Update firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0. This also removes separate "_multi" images, since this funcationality is now in base, and there is simply no new images without it for years. Deleted: stable/10/sys/modules/ispfw/isp_2400_multi/ stable/10/sys/modules/ispfw/isp_2500_multi/ Modified: stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/ispfw/asm_2400.h stable/10/sys/dev/ispfw/asm_2500.h stable/10/sys/dev/ispfw/ispfw.c stable/10/sys/modules/ispfw/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:34:42 2015 (r290781) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:36:43 2015 (r290782) @@ -899,9 +899,6 @@ isp_pci_attach(device_t dev) if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->def_role & ISP_ROLE_TARGET)) { snprintf(fwname, sizeof (fwname), "isp_%04x_it", did); isp->isp_osinfo.fw = firmware_get(fwname); - } else if (IS_24XX(isp)) { - snprintf(fwname, sizeof (fwname), "isp_%04x_multi", did); - isp->isp_osinfo.fw = firmware_get(fwname); } if (isp->isp_osinfo.fw == NULL) { snprintf(fwname, sizeof (fwname), "isp_%04x", did); Modified: stable/10/sys/dev/ispfw/asm_2400.h ============================================================================== --- stable/10/sys/dev/ispfw/asm_2400.h Fri Nov 13 19:34:42 2015 (r290781) +++ stable/10/sys/dev/ispfw/asm_2400.h Fri Nov 13 19:36:43 2015 (r290782) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (C) 2005-2010 by Qlogic, Inc. + * Copyright (C) 2005-2014 by Qlogic, Inc. * All rights reserved. * * Redistribution and use in source and binary forms are permitted provided @@ -25,23 +25,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Firmware Version 5.05.00 (15:31 Dec 14, 2010) + * Firmware Version 7.03.00 (Apr 14, 2014) */ #ifdef ISP_2400 static const uint32_t isp_2400_risc_code[] = { - 0x0401f195, 0x00110000, 0x00100000, 0x0000afb1, - 0x00000005, 0x00000005, 0x00000000, 0x00008482, + 0x0401f195, 0x00112000, 0x00100000, 0x0000c798, + 0x00000007, 0x00000003, 0x00000000, 0x00009496, 0x00000003, 0x00000000, 0x20434f50, 0x59524947, 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020352e, 0x30352e30, + 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x42001800, 0x0010014c, 0x42002000, 0x0010bdc7, + 0x42001800, 0x0010014c, 0x42002000, 0x0010e36f, 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, 0x54042000, 0x80102000, 0x80040800, 0x80081040, 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, @@ -124,23 +124,23 @@ static const uint32_t isp_2400_risc_code 0x00006150, 0x00000010, 0x00006170, 0x00000010, 0x00006190, 0x00000010, 0x000061b0, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00100000, 0x00100000, 0x0000afb1, - 0xffffffff, 0x00110004, 0x00020000, 0x00000b53, - 0xffffffff, 0x00110b57, 0x0010d700, 0x00001ac0, - 0xffffffff, 0x00112617, 0x0000c000, 0x000007e8, - 0x00ffffff, 0x00112dff, 0x00008000, 0x000005e5, + 0x00000000, 0x00100000, 0x00100000, 0x0000c798, + 0xffffffff, 0x00112004, 0x00020000, 0x00000c50, + 0xffffffff, 0x00112c54, 0x0010fd00, 0x00001b58, + 0xffffffff, 0x001147ac, 0x0000c000, 0x000008b1, + 0x00ffffff, 0x0011505d, 0x00008000, 0x00000696, 0x00ffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, 0x40000000, 0x4203e000, 0x90000100, 0x40000000, 0x42000800, - 0x00020b54, 0x4202f000, 0x00000000, 0x42000000, + 0x00020c51, 0x4202f000, 0x00000000, 0x42000000, 0x00007023, 0x50000000, 0x8c000500, 0x04020003, 0x42000800, 0x00020000, 0x45780800, 0x80040800, 0x82040580, 0x00022000, 0x040207fc, 0x4178a000, - 0x4200a800, 0x0010afb1, 0x42000800, 0x0010d700, - 0x40540000, 0x8004b480, 0x0201f800, 0x0010aeeb, - 0x0401fac9, 0x0401fa00, 0x4803c856, 0x42000000, + 0x4200a800, 0x0010c798, 0x42000800, 0x0010fd00, + 0x40540000, 0x8004b480, 0x0201f800, 0x0010c5e6, + 0x0401fade, 0x0401fa0a, 0x4803c856, 0x42000000, 0x00001000, 0x50000000, 0x82000480, 0x24320002, - 0x0402000d, 0x0201f800, 0x0010af26, 0x04000008, + 0x0402000d, 0x0201f800, 0x0010c62d, 0x04000008, 0x42000800, 0x00007a17, 0x50040000, 0x8c00050e, 0x04020003, 0x8400054e, 0x44000800, 0x4a030000, 0x00000000, 0x4a03c020, 0x00000004, 0x4203e000, @@ -148,14743 +148,177 @@ static const uint32_t isp_2400_risc_code 0x00000003, 0x59e00023, 0x8c000500, 0x04020027, 0x42002800, 0x0010017d, 0x58140800, 0x4817c857, 0x4807c857, 0x800409c0, 0x0400000b, 0x58142002, - 0x4813c857, 0x58141003, 0x4c140000, 0x0401fa95, + 0x4813c857, 0x58141003, 0x4c140000, 0x0401faaa, 0x5c002800, 0x0402002a, 0x82142c00, 0x00000004, 0x0401f7f2, 0x42002800, 0x0010017d, 0x5814a000, 0x4817c857, 0x4853c857, 0x8050a1c0, 0x0400000f, 0x4c140000, 0x5814a801, 0x4857c857, 0x40500000, 0x80540480, 0x04000005, 0x5814b002, 0x485bc857, - 0x0201f800, 0x0010aee2, 0x5c002800, 0x82142c00, + 0x0201f800, 0x0010c5dd, 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7ee, 0x42002800, 0x0010017d, 0x58140801, 0x4817c857, 0x4807c857, 0x800409c0, 0x04000018, 0x58142002, 0x4813c857, 0x58141003, - 0x4c140000, 0x0401fa6f, 0x04020005, 0x5c002800, + 0x4c140000, 0x0401fa84, 0x04020005, 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7f2, 0x4803c856, 0x4a03c020, 0x00004010, 0x4a03c011, 0x40100011, 0x04006000, 0x4203e000, 0x40000000, 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, 0x0401f000, - 0x4803c856, 0x0201f800, 0x0010d704, 0x0401faf6, - 0x4a03c014, 0x001c001c, 0x42002000, 0x0010f1c0, - 0x0201f800, 0x0010aef3, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04000906, + 0x4803c856, 0x0201f800, 0x0010fd04, 0x0401fb0b, + 0x4a03c014, 0x001c001c, 0x42002000, 0x00111858, + 0x0201f800, 0x0010c5ee, 0x42000000, 0x00001000, + 0x50000000, 0x82000480, 0x24220001, 0x04000908, 0x42000000, 0x00001000, 0x50000000, 0x82000480, - 0x24320001, 0x04000900, 0x59c40000, 0x82000500, + 0x24320001, 0x04000902, 0x59c40000, 0x82000500, 0xffff0000, 0x80000120, 0x82000580, 0x00002422, - 0x04020005, 0x59a8006d, 0x84000540, 0x4803506d, + 0x04020005, 0x59a8007e, 0x84000540, 0x4803507e, 0x0401f00a, 0x59e00003, 0x82000500, 0x00030000, - 0x82000580, 0x00010000, 0x04020004, 0x59a8006d, - 0x84000542, 0x4803506d, 0x4c140000, 0x0201f800, - 0x0010a6a0, 0x5c002800, 0x42000800, 0x00001100, + 0x82000580, 0x00010000, 0x04020004, 0x59a8007e, + 0x84000542, 0x4803507e, 0x4c140000, 0x0201f800, + 0x0010bd98, 0x5c002800, 0x42000800, 0x00001100, 0x42001800, 0x00000100, 0x82141480, 0x0017ffff, 0x0402100d, 0x42000800, 0x00000900, 0x82141480, - 0x0013ffff, 0x04021008, 0x42000800, 0x00000480, - 0x42001800, 0x00000080, 0x82141480, 0x0011ffff, - 0x040018d5, 0x4807500d, 0x480f5251, 0x42001000, - 0x00000024, 0x0201f800, 0x00105fef, 0x82040c00, - 0x0010f694, 0x4807500b, 0x4a03c810, 0x00100000, - 0x4a03c811, 0x0010afb1, 0x4a03c812, 0x0010d700, - 0x4a03c813, 0x0010f1bf, 0x4a03c829, 0x00000004, + 0x0013ffff, 0x04021008, 0x42000800, 0x00000240, + 0x42001800, 0x00000040, 0x82141480, 0x0011ffff, + 0x040018d7, 0x48075013, 0x480f5257, 0x42001000, + 0x0000002c, 0x0201f800, 0x00106fe1, 0x82040c00, + 0x00111d44, 0x4807500b, 0x4a03c810, 0x00100000, + 0x4a03c811, 0x0010c798, 0x4a03c812, 0x0010fd00, + 0x4a03c813, 0x00111857, 0x4a03c829, 0x00000004, 0x59e40001, 0x82000540, 0x0003403f, 0x4803c801, - 0x42001000, 0x0000001c, 0x0401f9f0, 0x4202c000, - 0x0010f694, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, - 0x59aac80d, 0x49675050, 0x59a8000b, 0x4803500c, - 0x0201f800, 0x00107133, 0x0401fac4, 0x0401fb14, - 0x0201f800, 0x001017f9, 0x0201f800, 0x001010ea, - 0x0401fbdb, 0x0201f800, 0x00100ca5, 0x0201f800, - 0x0010602f, 0x0401f85c, 0x0201f800, 0x00101c0f, - 0x0201f800, 0x00104bce, 0x0201f800, 0x001044e5, - 0x0201f800, 0x00105acd, 0x0201f800, 0x001057ce, - 0x0201f800, 0x0010118f, 0x0201f800, 0x00100ff2, - 0x4203e000, 0xf0000001, 0x0201f800, 0x0010af45, - 0x4a03c018, 0x00000000, 0x4203e000, 0x20000511, - 0x4203e000, 0x50010000, 0x4a03c020, 0x00000000, - 0x04027010, 0x59e00020, 0x82000580, 0x00000002, - 0x0402000c, 0x4a03c020, 0x00004000, 0x4a03c011, - 0x40000010, 0x04006000, 0x4203e000, 0x40000000, - 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, - 0x4202d800, 0x00000000, 0x4203e000, 0xb0600000, - 0x59a80071, 0x4003f800, 0x0201f000, 0x00020004, - 0x4df00000, 0x4203e000, 0x50000000, 0x416c0000, - 0x82000c80, 0x00000008, 0x0402186b, 0x0c01f804, - 0x5c03e000, 0x0201f000, 0x00020008, 0x001002d0, - 0x0010f007, 0x0010ef4c, 0x001002cf, 0x0010ef18, - 0x001002cf, 0x001002cf, 0x001002e2, 0x0401f85e, - 0x42000800, 0x0010b8fa, 0x5804001e, 0x8c000500, - 0x0400000d, 0x84000500, 0x4800081e, 0x4202d800, - 0x00000004, 0x0401f97b, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00003e00, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x4a038805, 0x000000f0, - 0x1c01f000, 0x4a035048, 0x00000005, 0x4a035049, - 0x00000005, 0x4a03504a, 0x00000000, 0x4a03504b, - 0x00008482, 0x0201f800, 0x00104b98, 0x4a03541b, - 0x0000ffff, 0x4a03500f, 0x00ffffff, 0x0201f800, - 0x00108c7d, 0x4a03501f, 0x20200000, 0x4a035020, - 0x88000200, 0x4a035021, 0x00ff001f, 0x4a035022, - 0x000007d0, 0x4a035023, 0x80000000, 0x4a035024, - 0x00000200, 0x4a035025, 0x00ff0000, 0x4a035026, - 0x00010000, 0x4a03502d, 0x514c4f47, 0x4a03502e, - 0x49432020, 0x1c01f000, 0x4d440000, 0x417a8800, - 0x4c5c0000, 0x4178b800, 0x0201f800, 0x00020319, - 0x04020005, 0x0201f800, 0x00104181, 0x04020002, - 0x805cb800, 0x81468800, 0x83440580, 0x000007f0, - 0x040207f6, 0x405c0800, 0x5c00b800, 0x5c028800, - 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, - 0x4803c857, 0x0401f80c, 0x485fc857, 0x4203e000, - 0x50000000, 0x5c000000, 0x4d780000, 0x4200b800, - 0x00008002, 0x0401f009, 0x486bc857, 0x486fc857, - 0x4873c857, 0x485fc857, 0x4203e000, 0x50000000, - 0x4200b800, 0x00008002, 0x04006000, 0x4c000000, - 0x4c040000, 0x59bc00ea, 0x4803c857, 0x82000500, - 0x00000007, 0x82000580, 0x00000001, 0x04020005, - 0x42000800, 0x00000000, 0x0201f800, 0x001061cb, - 0x59b800ea, 0x4803c857, 0x4a0370e8, 0x00000004, - 0x5c000800, 0x4807c025, 0x80040920, 0x4807c026, - 0x5c000000, 0x4803c023, 0x80000120, 0x4803c024, - 0x5c000000, 0x4803c857, 0x4803c021, 0x80000120, - 0x4803c022, 0x41f80000, 0x4803c029, 0x80000120, - 0x4803c02a, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x4803c857, 0x0400104b, - 0x0201f800, 0x0010af26, 0x04000046, 0x42000800, - 0x0010c626, 0x46000800, 0xfaceface, 0x80040800, - 0x4c080000, 0x4c0c0000, 0x42001000, 0x00007a00, - 0x58080013, 0x44000800, 0x80040800, 0x58080019, - 0x44000800, 0x80040800, 0x5808001a, 0x44000800, - 0x80040800, 0x5808001b, 0x44000800, 0x80040800, - 0x5808001c, 0x44000800, 0x80040800, 0x5808001f, - 0x44000800, 0x80040800, 0x42001000, 0x00007a40, - 0x42001800, 0x0000000b, 0x50080000, 0x44000800, - 0x80081000, 0x80040800, 0x800c1840, 0x040207fb, - 0x42001800, 0x00000003, 0x42001000, 0x00007b00, - 0x480c1003, 0x58080005, 0x44000800, 0x80040800, - 0x800c1840, 0x040217fb, 0x42001000, 0x00007c00, - 0x58080002, 0x44000800, 0x80040800, 0x58080003, - 0x44000800, 0x80040800, 0x58080020, 0x44000800, - 0x80040800, 0x58080021, 0x44000800, 0x80040800, - 0x58080022, 0x44000800, 0x80040800, 0x58080023, - 0x44000800, 0x80040800, 0x5c001800, 0x5c001000, - 0x4a030000, 0x00000000, 0x485fc020, 0x905cb9c0, - 0x825cbd40, 0x00000012, 0x485fc011, 0x4203e000, - 0x40000000, 0x4202d800, 0x00000005, 0x4a03c017, - 0x00000000, 0x4203e000, 0x30000001, 0x0401f847, - 0x0401f7ff, 0x42000000, 0x00000004, 0x0401f80c, - 0x4a03c855, 0x0001eb5a, 0x59e40001, 0x82000540, - 0x00000700, 0x4803c801, 0x42000000, 0x0010bdb1, - 0x49780003, 0x49780004, 0x1c01f000, 0x42000800, - 0x0010bdb3, 0x44000800, 0x59e40801, 0x82041500, - 0xfff3c0ff, 0x480bc801, 0x8c040d24, 0x0400000c, - 0x4c000000, 0x59e41052, 0x59e40054, 0x800000d4, - 0x82000400, 0x0010c642, 0x80081480, 0x480bc853, - 0x4a03c800, 0x00000040, 0x5c000000, 0x4a03c850, - 0x0010c642, 0x800000d4, 0x82002400, 0x0010c641, - 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, - 0x0010c642, 0x82001400, 0x00001000, 0x45780000, - 0x80000000, 0x80081d80, 0x040207fd, 0x4807c801, - 0x1c01f000, 0x42002000, 0x0010bdb1, 0x59e41801, - 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, - 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, - 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, - 0x1c01f000, 0x1c01f000, 0x59a80059, 0x8c000530, - 0x040207fe, 0x4c080000, 0x42001000, 0x00000004, - 0x0401f862, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0201f800, 0x001059d2, 0x4c080000, 0x42001000, - 0x00000008, 0x0401f859, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0201f800, 0x001059d2, 0x4c080000, - 0x42001000, 0x00000010, 0x0401f850, 0x5c001000, - 0x4201d000, 0x00028b0a, 0x0201f800, 0x001059d2, - 0x0401f7e2, 0x8c00050c, 0x59a80859, 0x04020003, - 0x84040d30, 0x0401f006, 0x84040d70, 0x48075059, - 0x42001000, 0x00000000, 0x0401f040, 0x48075059, - 0x836c0500, 0x00000007, 0x0c01f001, 0x00100461, - 0x00100447, 0x00100447, 0x0010042f, 0x00100454, - 0x00100447, 0x00100447, 0x00100454, 0x59a8006d, - 0x8c000502, 0x04020013, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00010000, 0x0400000a, - 0x82040580, 0x00008000, 0x04000004, 0x42001000, - 0x42004000, 0x0401f006, 0x42001000, 0x22002000, - 0x0401f003, 0x42001000, 0x12001000, 0x0401f025, - 0x42001000, 0x00001004, 0x0401f022, 0x59a8006d, - 0x8c000502, 0x04020008, 0x59a80059, 0x8c000534, - 0x04020004, 0x42001000, 0x74057005, 0x0401f819, - 0x1c01f000, 0x42001000, 0x00002008, 0x0401f7fc, - 0x59a80059, 0x8c000534, 0x0402000a, 0x59a8006d, - 0x8c000502, 0x04000004, 0x42001000, 0x24052005, - 0x0401f00c, 0x42001000, 0x74057005, 0x0401f009, - 0x1c01f000, 0x1c01f000, 0x82081500, 0x0000001c, - 0x82081540, 0x001c0000, 0x480bc013, 0x1c01f000, - 0x59a80059, 0x8c000530, 0x04000002, 0x84081570, - 0x480b5059, 0x8c000530, 0x04020005, 0x82081500, - 0x00007000, 0x80081114, 0x0401fff0, 0x1c01f000, - 0x41780000, 0x50041800, 0x800c0400, 0x80040800, - 0x80102040, 0x040207fc, 0x80080500, 0x80000540, - 0x1c01f000, 0x4202f000, 0x00000000, 0x41780000, - 0x41780800, 0x41781000, 0x41781800, 0x41782000, - 0x41782800, 0x41783000, 0x41783800, 0x41784000, - 0x41784800, 0x41785000, 0x41785800, 0x41786000, - 0x41786800, 0x41787000, 0x41787800, 0x41788000, - 0x41788800, 0x41789000, 0x41789800, 0x4178a000, - 0x4178a800, 0x4178b000, 0x4178b800, 0x4178c000, - 0x4178c800, 0x4178d000, 0x4178d800, 0x4178e000, - 0x4178e800, 0x4178f000, 0x4178f800, 0x41790000, - 0x41790800, 0x41791000, 0x41791800, 0x41792000, - 0x41792800, 0x41793000, 0x41793800, 0x41794000, - 0x41794800, 0x41795000, 0x41795800, 0x41796000, - 0x41796800, 0x41797000, 0x41797800, 0x41798000, - 0x41798800, 0x42019000, 0x0010b989, 0x42019800, - 0x0010b960, 0x4179a000, 0x4179a800, 0x4179b000, - 0x4179b800, 0x4179c800, 0x4179c000, 0x4179d000, - 0x4179d800, 0x4179e000, 0x4179e800, 0x4179f000, - 0x4179f800, 0x417a0000, 0x417a0800, 0x417a1000, - 0x417a1800, 0x417a2000, 0x42022800, 0x00006100, - 0x417a3000, 0x417a3800, 0x417a4000, 0x417a4800, - 0x417a5000, 0x417a5800, 0x417a6000, 0x417a6800, - 0x417a7000, 0x417a7800, 0x417a8000, 0x417a8800, - 0x417a9000, 0x417a9800, 0x417ae800, 0x417af800, - 0x42030000, 0x00007c00, 0x42031000, 0x0010bc5a, - 0x42031800, 0x0000bf1d, 0x42032000, 0x0000bf32, - 0x42032800, 0x0010bc22, 0x42033000, 0x00020b5d, - 0x42034000, 0x0010b8fa, 0x42033800, 0x0010b919, - 0x42034800, 0x0010b998, 0x42035000, 0x0010b880, - 0x42035800, 0x0010b080, 0x42030800, 0x0010b95b, - 0x417b6000, 0x42036800, 0x00006f00, 0x4203c800, - 0x00003000, 0x42037000, 0x0000ff00, 0x42037800, - 0x0000bf00, 0x42038000, 0x00007700, 0x42038800, - 0x00004000, 0x42039000, 0x00006000, 0x42039800, - 0x0010c35e, 0x4203a000, 0x00007600, 0x4203a800, - 0x00007400, 0x4203b000, 0x00007200, 0x4203b800, - 0x00007100, 0x4203c000, 0x00007000, 0x4203d000, - 0x00000000, 0x4203e800, 0x0002018e, 0x417bd800, - 0x1c01f000, 0x42000800, 0x00100000, 0x50040000, - 0x4c000000, 0x42000000, 0x0000aaaa, 0x44000800, - 0x42001800, 0x00005555, 0x42002000, 0x00010000, - 0x82102400, 0x00010000, 0x40100000, 0x80042c00, - 0x440c2800, 0x42003000, 0x0000000a, 0x80183040, - 0x040207ff, 0x50140000, 0x800c0580, 0x04020004, - 0x50040000, 0x800c0580, 0x040207f2, 0x5c000000, - 0x44000800, 0x80142840, 0x4817c861, 0x4817500a, - 0x1c01f000, 0x40681800, 0x59a80819, 0x800409c0, - 0x04020008, 0x49781c0c, 0x4a001a0c, 0x00000002, - 0x4a001804, 0x00000007, 0x59a8000f, 0x48001805, - 0x0401fdce, 0x800409c0, 0x04020002, 0x80040800, - 0x48041806, 0x1c01f000, 0x59a8080c, 0x4006d000, - 0x4202b800, 0x00000001, 0x59a8180a, 0x480fc857, - 0x82041400, 0x00000015, 0x82082400, 0x00000015, - 0x40100000, 0x800c0480, 0x04001006, 0x44080800, - 0x40080800, 0x40101000, 0x815eb800, 0x0401f7f7, - 0x45780800, 0x495f501a, 0x1c01f000, 0x0401f803, - 0x412d8800, 0x1c01f000, 0x835c0480, 0x00000020, - 0x0400100a, 0x496bc857, 0x815eb840, 0x416a5800, - 0x592ed000, 0x497a5800, 0x497a5801, 0x497a5805, - 0x812e59c0, 0x1c01f000, 0x42000000, 0x0010bd0f, - 0x0201f800, 0x0010ae10, 0x417a5800, 0x0401f7f9, - 0x0401f803, 0x412d8800, 0x1c01f000, 0x815eb840, - 0x04001009, 0x416a5800, 0x492fc857, 0x592ed000, - 0x497a5800, 0x497a5801, 0x497a5805, 0x812e59c0, - 0x1c01f000, 0x42000000, 0x0010bd0f, 0x0201f800, - 0x0010ae10, 0x417ab800, 0x417a5800, 0x0401f7f8, - 0x492fc857, 0x496a5800, 0x412ed000, 0x815eb800, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x1c01f000, 0x492fc857, 0x812e59c0, 0x04000007, - 0x592c0001, 0x497a5801, 0x4c000000, 0x0401fff1, - 0x5c025800, 0x0401f7f9, 0x1c01f000, 0x4807c856, - 0x42007000, 0x00020b54, 0x4a007000, 0x00000000, - 0x59e00003, 0x82000540, 0x00008080, 0x4803c003, - 0x4a03b805, 0x90000001, 0x59dc0006, 0x4a03b805, - 0x70000000, 0x59dc0006, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x80000000, 0x4200b000, - 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, - 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x60000001, 0x59dc0006, 0x4a03b805, 0x70000001, - 0x59dc0006, 0x4a03b805, 0x30000002, 0x4200b000, - 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, - 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x60000001, 0x4803c856, 0x0401ff98, 0x04000d6a, - 0x42001000, 0x0010bc55, 0x452c1000, 0x4a025801, - 0x00000001, 0x4a025802, 0x00000100, 0x4a025808, - 0x00106826, 0x497a5809, 0x497a580a, 0x497a580b, - 0x0401ff8a, 0x04000d5c, 0x42001000, 0x0010bc56, - 0x452c1000, 0x4a025801, 0x00000000, 0x4a025802, - 0x00000100, 0x4a025808, 0x00100f2f, 0x497a5803, - 0x497a5806, 0x497a5807, 0x497a5809, 0x59a8006d, - 0x8c000500, 0x04000006, 0x4a03b805, 0xe0000001, - 0x59dc0006, 0x8c000522, 0x040007fc, 0x1c01f000, - 0x40681000, 0x0201f800, 0x00020016, 0x1c01f000, - 0x42001000, 0x00020026, 0x0201f800, 0x0010587d, - 0x0201f800, 0x00108d64, 0x0201f800, 0x0010a32a, - 0x04000014, 0x4a03b805, 0x30000002, 0x59dc0006, - 0x4807b800, 0x480bb801, 0x42007000, 0x00020b54, - 0x4a007002, 0x00000040, 0x480c7008, 0x58380007, - 0x82000400, 0x00000005, 0x48007003, 0x4a007000, - 0x00000003, 0x4803b803, 0x0201f000, 0x00020050, - 0x42000000, 0x0010bc77, 0x0201f800, 0x0010ae10, - 0x0201f800, 0x00108d7c, 0x42000800, 0x00000001, - 0x42001000, 0x00020026, 0x0201f800, 0x00105856, - 0x42007000, 0x00020b54, 0x0201f000, 0x00020030, - 0x58380802, 0x42001000, 0x0000ff00, 0x82040480, - 0x0000ff00, 0x04021003, 0x40041000, 0x80000580, - 0x48007002, 0x480bb802, 0x59dc0006, 0x4a03b805, - 0x10000000, 0x1c01f000, 0x4a03b805, 0x30000001, - 0x58386001, 0x58301008, 0x4807c857, 0x4803c857, - 0x4833c857, 0x4a006002, 0x00000200, 0x4a007000, - 0x00000000, 0x800811c0, 0x02000000, 0x0002002c, - 0x0201f000, 0x00020092, 0x59dc0006, 0x8c000520, - 0x0400000a, 0x02004800, 0x0002090c, 0x59dc0006, - 0x82000500, 0x00006000, 0x04000004, 0x82000580, - 0x00006000, 0x040207f8, 0x1c01f000, 0x41781800, - 0x58382005, 0x40300000, 0x80100580, 0x04000007, - 0x40101800, 0x58102000, 0x801021c0, 0x040207fa, - 0x4803c856, 0x0401f011, 0x4833c857, 0x58302000, - 0x49786000, 0x800c19c0, 0x04020008, 0x801021c0, - 0x04000003, 0x48107005, 0x0401f008, 0x49787005, - 0x49787004, 0x0401f005, 0x48101800, 0x801021c0, - 0x04020002, 0x480c7004, 0x1c01f000, 0x4803c856, - 0x4dc00000, 0x42007000, 0x0010bc58, 0x4a007400, - 0x00000000, 0x49787001, 0x42038000, 0x00007720, - 0x4a038006, 0x60000001, 0x4a038009, 0xf4f60000, - 0x42038000, 0x00007700, 0x4a038006, 0x60000001, - 0x4a038009, 0xf4f60000, 0x4a03c822, 0x00000010, - 0x4a0370e8, 0x00000000, 0x0401f809, 0x4a0370e9, - 0x00003a0f, 0x4a0370e8, 0x00000000, 0x4a0370e8, - 0x00000001, 0x5c038000, 0x1c01f000, 0x4c5c0000, - 0x4178b800, 0x0401f80a, 0x5c00b800, 0x1c01f000, - 0x4803c856, 0x4c5c0000, 0x825cbd40, 0x00000001, - 0x0401f803, 0x5c00b800, 0x1c01f000, 0x4803c856, - 0x4dc00000, 0x4c500000, 0x4c580000, 0x4c540000, - 0x4a0370e8, 0x00000000, 0x805cb9c0, 0x0400000b, - 0x4a038807, 0x00000004, 0x4a0370e5, 0x00080000, - 0x59b800ea, 0x8c000510, 0x04000004, 0x59b800e0, - 0x0401f879, 0x0401f7fb, 0x42038000, 0x00007720, - 0x0201f800, 0x00100c07, 0x59c00007, 0x4a038006, - 0x20000000, 0x59c00007, 0x4a038006, 0x8000000a, - 0x59c00007, 0x4a038006, 0x8000000b, 0x59c00007, - 0x4a038006, 0x40000001, 0x83c00580, 0x00007700, - 0x04000004, 0x42038000, 0x00007700, 0x0401f7ed, - 0x42038000, 0x00007720, 0x42000800, 0x00000800, - 0x59c00007, 0x8c00051e, 0x04000006, 0x4a038006, - 0x90000001, 0x80040840, 0x040207fa, 0x0401fc6e, - 0x83c00580, 0x00007700, 0x04000004, 0x42038000, - 0x00007700, 0x0401f7f1, 0x4178a000, 0x805cb9c0, - 0x0402001d, 0x4200b000, 0x00000020, 0x83b8ac00, - 0x00000020, 0x0201f800, 0x0010aeeb, 0x4a0370fb, - 0x00000001, 0x4a037020, 0x00100e3a, 0x59a8002c, - 0x82000500, 0x0000ffff, 0x48037021, 0x4a037035, - 0x0010c2a4, 0x4a037030, 0x0010b88f, 0x4a037031, - 0x0010b080, 0x4a037032, 0x0010b96b, 0x4a037036, - 0x0010b976, 0x59840002, 0x48037034, 0x4a037038, - 0x00100e31, 0x4a0370fb, 0x00000001, 0x4200b000, - 0x00000020, 0x83b8ac00, 0x00000000, 0x0201f800, - 0x0010aeeb, 0x4200b000, 0x00000040, 0x83b8ac00, - 0x00000040, 0x0201f800, 0x0010aeeb, 0x805cb9c0, - 0x04020004, 0x4a0370e4, 0xaaaaaaaa, 0x0401f003, - 0x4a0370e4, 0xa2aa2a82, 0x4a0370e5, 0xaaaaaaaa, - 0x4a0370e6, 0xaaaaaaaa, 0x4a0370fb, 0x00000000, - 0x4a0370e6, 0xaaaaaaaa, 0x42038000, 0x00007720, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x04020c25, 0x42038000, 0x00007700, 0x4a038006, - 0x90000000, 0x59c00007, 0x8c00051e, 0x04020c1e, - 0x5c00a800, 0x5c00b000, 0x5c00a000, 0x5c038000, - 0x1c01f000, 0x4d300000, 0x4d380000, 0x40026000, - 0x82000500, 0x7f000000, 0x82000580, 0x60000000, - 0x04020012, 0x83326500, 0x00ffffff, 0x0201f800, - 0x00109291, 0x0402000d, 0x59300203, 0x82000580, - 0x00000004, 0x04020009, 0x59300c07, 0x82040580, - 0x00000009, 0x04020005, 0x42027000, 0x00000047, - 0x0201f800, 0x00020a34, 0x5c027000, 0x5c026000, - 0x1c01f000, 0x4d300000, 0x4d2c0000, 0x4d340000, - 0x4d400000, 0x4cfc0000, 0x4d380000, 0x4d3c0000, - 0x4d440000, 0x4d4c0000, 0x4d480000, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x4d040000, 0x4cc80000, - 0x4ccc0000, 0x4cf40000, 0x4cf80000, 0x0201f800, - 0x00020095, 0x5c01f000, 0x5c01e800, 0x5c019800, - 0x5c019000, 0x5c020800, 0x5c00c800, 0x5c00c000, - 0x5c00b800, 0x5c029000, 0x5c029800, 0x5c028800, - 0x5c027800, 0x5c027000, 0x5c01f800, 0x5c028000, - 0x5c026800, 0x5c025800, 0x5c026000, 0x1c01f000, - 0x493bc857, 0x0201f000, 0x000200bc, 0x83300500, - 0x000000ff, 0x82000c80, 0x00000007, 0x02021800, - 0x0010032d, 0x0c01f025, 0x1c01f000, 0x82000d00, - 0xc0000038, 0x02020800, 0x00100322, 0x0201f800, - 0x0010032d, 0x00000000, 0x00000048, 0x00000054, - 0x00000053, 0x00100784, 0x001007a8, 0x001007a3, - 0x001007c7, 0x0010078f, 0x0010079b, 0x00100784, - 0x001007c2, 0x0010080e, 0x00100784, 0x00100811, - 0x00100784, 0x00100784, 0x00100814, 0x0010081a, - 0x00100837, 0x0010084c, 0x00100784, 0x00100855, - 0x00100861, 0x00100784, 0x00100784, 0x00100784, - 0x0201f800, 0x0010032d, 0x0010078d, 0x001008f8, - 0x001007d4, 0x001007fd, 0x0010078d, 0x0010078d, - 0x0010078d, 0x0201f800, 0x0010032d, 0x4803c856, - 0x59300004, 0x8c00053e, 0x04020005, 0x42027000, - 0x00000055, 0x0201f000, 0x00020a34, 0x0201f800, - 0x001064f2, 0x040007fa, 0x1c01f000, 0x4803c856, - 0x0401f8c7, 0x40002800, 0x41782000, 0x42027000, - 0x00000056, 0x0201f000, 0x00020a34, 0x4803c856, - 0x42027000, 0x00000057, 0x0201f000, 0x00020a34, - 0x4803c856, 0x59325809, 0x812e59c0, 0x04000016, - 0x59300008, 0x8c00051a, 0x0402000d, 0x592c0409, - 0x8c00051c, 0x04020003, 0x4a026012, 0xffffffff, - 0x59300004, 0x8c00053e, 0x04020008, 0x42027000, - 0x00000048, 0x0201f000, 0x00020a34, 0x4a025a07, - 0x00000007, 0x0401f7f5, 0x0201f800, 0x001064f2, - 0x040007f7, 0x1c01f000, 0x4803c856, 0x83300500, - 0x00ffffff, 0x0201f000, 0x00105e17, 0x1c01f000, - 0x4c040000, 0x59b808ea, 0x82040d00, 0x00000007, - 0x82040580, 0x00000003, 0x04000004, 0x42000000, - 0x60000000, 0x0401f8c6, 0x5c000800, 0x1c01f000, - 0x0401f914, 0x0400001b, 0x59325809, 0x812e59c0, - 0x04000018, 0x592c0205, 0x82000500, 0x000000ff, - 0x82000d80, 0x00000029, 0x04020012, 0x59300203, - 0x82000580, 0x00000003, 0x0400000b, 0x59300808, - 0x84040d26, 0x48066008, 0x0201f800, 0x00020111, - 0x4a03900d, 0x00000040, 0x4a0370e5, 0x00000008, - 0x1c01f000, 0x0201f800, 0x001064f2, 0x040007f4, - 0x42000000, 0x0010bd15, 0x0201f800, 0x0010ae10, - 0x5988014a, 0x80000000, 0x4803114a, 0x4a03900d, - 0x00000040, 0x42000000, 0xc0000000, 0x0201f000, - 0x00020105, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x4200c800, 0x0010c2ab, 0x4200b800, 0x00003000, - 0x4200c000, 0x00000105, 0x0201f800, 0x00105655, - 0x4a0370e4, 0x02000000, 0x5c00c800, 0x5c00c000, - 0x5c00b800, 0x1c01f000, 0x4933c857, 0x0201f000, - 0x00020a10, 0x4933c857, 0x0401fbfd, 0x1c01f000, - 0x41300800, 0x800409c0, 0x02020800, 0x0010032d, - 0x0201f800, 0x00100322, 0x42000000, 0x0010bd15, - 0x0201f800, 0x0010ae10, 0x4933c857, 0x813261c0, - 0x02000800, 0x0010032d, 0x0401f841, 0x40002800, - 0x0201f800, 0x0010ad79, 0x4c140000, 0x59a8006a, - 0x80000540, 0x04000004, 0x8c142d2a, 0x04000002, - 0x0401fbe3, 0x5c002800, 0x0401f8ae, 0x04000007, - 0x5932680a, 0x59340200, 0x8c00050e, 0x59300415, - 0x02020800, 0x00108c33, 0x1c01f000, 0x42000000, - 0x0010bd15, 0x0201f800, 0x0010ae10, 0x4933c857, - 0x813261c0, 0x02000800, 0x0010032d, 0x0401f89d, - 0x0400000b, 0x0201f800, 0x00108953, 0x04000008, - 0x59325809, 0x592c0209, 0x8400054e, 0x48025a09, - 0x417a7800, 0x0201f800, 0x0010853c, 0x1c01f000, - 0x485fc857, 0x5c000000, 0x4d780000, 0x4203e000, - 0x50000000, 0x4200b800, 0x00008005, 0x0201f000, - 0x00100332, 0x4933c857, 0x83300480, 0x00000020, - 0x02021800, 0x0010032d, 0x83300c00, 0x0010bd88, - 0x50040000, 0x80000000, 0x04001002, 0x44000800, - 0x1c01f000, 0x4933c857, 0x0401f7f4, 0x4807c856, - 0x59b800ea, 0x8c000510, 0x040007fd, 0x59b800e0, - 0x4803c857, 0x1c01f000, 0x4803c856, 0x42000000, - 0x10000000, 0x41300800, 0x0401f029, 0x8c000510, - 0x02000000, 0x0002010b, 0x4c040000, 0x0401f80b, - 0x5c000800, 0x82100480, 0x00000008, 0x02001000, - 0x0002010b, 0x4c040000, 0x0401feb7, 0x5c000800, - 0x0201f000, 0x0002010b, 0x59b800e2, 0x59b820e2, - 0x80100580, 0x040207fd, 0x80102114, 0x0401f001, - 0x40101800, 0x800c190a, 0x82100500, 0x0000001f, - 0x820c1d00, 0x0000001f, 0x800c2480, 0x82102500, - 0x0000001f, 0x1c01f000, 0x40680000, 0x406c0800, - 0x0401f807, 0x42018800, 0x00000001, 0x04020003, - 0x42018800, 0x00000000, 0x1c01f000, 0x82000500, - 0xf0000000, 0x82040d00, 0x0fffffff, 0x80040d40, - 0x4807c857, 0x42001000, 0x0010bc59, 0x50080000, - 0x80000540, 0x04020005, 0x4a0370e5, 0x00000003, - 0x4a0370e4, 0x00000300, 0x80000000, 0x44001000, - 0x42001000, 0x00000400, 0x59b800ea, 0x8c000510, - 0x0400000c, 0x0401ffd1, 0x82100480, 0x00000008, - 0x04001007, 0x4c040000, 0x4c080000, 0x0401fe7e, - 0x5c001000, 0x5c000800, 0x0401f020, 0x59b800ea, - 0x8c000516, 0x0402001d, 0x4a0370e4, 0x00300000, - 0x480770e1, 0x42001000, 0x0000ff00, 0x80081040, - 0x04000012, 0x59b808e4, 0x8c040d28, 0x040207fc, - 0x42001000, 0x0010bc59, 0x50080000, 0x80000040, - 0x04020005, 0x4a0370e5, 0x00000002, 0x4a0370e4, - 0x00000200, 0x02001800, 0x0010032d, 0x44001000, - 0x8c040d2c, 0x1c01f000, 0x41f80000, 0x50000000, - 0x0201f800, 0x0010032d, 0x80081040, 0x040207d3, - 0x41f80000, 0x50000000, 0x0201f800, 0x0010032d, - 0x4d380000, 0x59300c07, 0x82040580, 0x00000009, - 0x04020006, 0x42027000, 0x00000047, 0x0201f800, - 0x00020a34, 0x80000580, 0x5c027000, 0x1c01f000, - 0x4c500000, 0x4a03900d, 0x00000001, 0x59c8a020, - 0x4a03900d, 0x00000002, 0x59c80820, 0x8c50a52e, - 0x04000002, 0x900409c0, 0x82040d00, 0x0000ffff, - 0x0201f800, 0x00105617, 0x5c00a000, 0x1c01f000, - 0x42000000, 0x0010bd0c, 0x0201f800, 0x0010ae10, - 0x0401ffec, 0x0400004e, 0x4933c857, 0x59300407, - 0x82000580, 0x00000000, 0x04000049, 0x59c82021, - 0x4a03900d, 0x00000001, 0x59c82821, 0x82142d00, - 0x0000ffff, 0x59325809, 0x812e59c0, 0x04000040, - 0x5932680a, 0x0201f800, 0x001040c4, 0x02020800, - 0x00108c1b, 0x599c0019, 0x8c00050c, 0x04020018, - 0x0201f800, 0x001040c4, 0x04020015, 0x59300812, - 0x4807c857, 0x592c0409, 0x8c00051c, 0x0402000e, - 0x8400055c, 0x48025c09, 0x592c0a05, 0x82040d00, - 0x000000ff, 0x82040580, 0x00000048, 0x04000004, - 0x82040580, 0x00000018, 0x04020003, 0x59300812, - 0x48065803, 0x4a026012, 0x7fffffff, 0x48166014, - 0x0201f800, 0x001040c4, 0x04000004, 0x59300415, - 0x8c00051c, 0x04000004, 0x599c0019, 0x8c00050c, - 0x04000017, 0x0201f800, 0x00100e5a, 0x04020014, - 0x0401fa2f, 0x40280000, 0x4802600e, 0x04000005, - 0x4832600c, 0x50200000, 0x4802600b, 0x4822600d, - 0x59300415, 0x8c00051c, 0x04020004, 0x599c0019, - 0x8c00050c, 0x04020885, 0x4a03900d, 0x00000040, - 0x4a0370e5, 0x00000008, 0x1c01f000, 0x42000000, - 0x0010bd15, 0x0201f800, 0x0010ae10, 0x5988014c, - 0x80000000, 0x4803114c, 0x4a03900d, 0x00000040, - 0x42000000, 0xc0000000, 0x0201f000, 0x00020105, - 0x4cf80000, 0x58f40000, 0x8001f540, 0x0401f820, - 0x41781800, 0x0401f8f9, 0x04020014, 0x44140800, - 0x0401f82a, 0x04000011, 0x40043800, 0x42001800, - 0x00000001, 0x40142000, 0x0401f8f0, 0x0402000b, - 0x801c3800, 0x501c0000, 0x44000800, 0x0401f810, - 0x801c0580, 0x04000004, 0x44103800, 0x801c3840, - 0x44143800, 0x0401f819, 0x5c01f000, 0x1c01f000, - 0x80f9f1c0, 0x04020003, 0x58f41202, 0x0401f003, - 0x42001000, 0x00000007, 0x1c01f000, 0x80f9f1c0, - 0x04020006, 0x58f40401, 0x82000480, 0x00000002, - 0x80f40400, 0x0401f005, 0x58f80401, 0x82000480, - 0x00000002, 0x80f80400, 0x50002800, 0x80000000, - 0x50002000, 0x1c01f000, 0x80f9f1c0, 0x04020008, - 0x58f40401, 0x82000480, 0x00000002, 0x02001800, - 0x0010032d, 0x4801ec01, 0x0401f00b, 0x58f80401, - 0x82000480, 0x00000002, 0x02001800, 0x0010032d, - 0x4801f401, 0x82000580, 0x00000002, 0x04020002, - 0x0401f81b, 0x58f40202, 0x80000040, 0x4801ea02, - 0x02000800, 0x0010032d, 0x82000580, 0x00000001, - 0x1c01f000, 0x82f40580, 0xffffffff, 0x0400000f, - 0x58f40201, 0x82000580, 0x0000dcb3, 0x02020800, - 0x0010032d, 0x58f40000, 0x8001f540, 0x04000006, - 0x58f80201, 0x82000580, 0x0000ddb9, 0x02020800, - 0x0010032d, 0x0401f80a, 0x1c01f000, 0x4d2c0000, - 0x40fa5800, 0x0201f800, 0x00100580, 0x4979e800, - 0x4179f000, 0x5c025800, 0x1c01f000, 0x80f5e9c0, - 0x04000009, 0x80f9f1c0, 0x04020ff5, 0x4d2c0000, - 0x40f65800, 0x0201f800, 0x00100580, 0x4179e800, - 0x5c025800, 0x1c01f000, 0x4cf40000, 0x0201f800, - 0x001040c4, 0x04020036, 0x59300808, 0x82040500, - 0x00013100, 0x04020032, 0x8c040d22, 0x04000032, - 0x59300020, 0x8001ed40, 0x02000800, 0x0010032d, - 0x82000580, 0xffffffff, 0x04000029, 0x58f40201, - 0x82000580, 0x0000dcb3, 0x02020800, 0x0010032d, - 0x58f40a02, 0x82040500, 0x0000fffe, 0x04000003, - 0x0401ff74, 0x58f40a02, 0x82040480, 0x0000000f, - 0x04021059, 0x80040800, 0x4805ea02, 0x82040580, - 0x00000008, 0x0400005d, 0x82040480, 0x00000008, - 0x0400100a, 0x58f40000, 0x8001ed40, 0x02000800, - 0x0010032d, 0x58f40201, 0x82000580, 0x0000ddb9, - 0x02020800, 0x0010032d, 0x58f40401, 0x82000c00, - 0x00000002, 0x4805ec01, 0x80f40400, 0x59300813, - 0x44040000, 0x80000000, 0x45780000, 0x5c01e800, - 0x1c01f000, 0x42001000, 0x00000400, 0x59b800e4, - 0x8c000524, 0x04020023, 0x4a0370e4, 0x00030000, - 0x40000000, 0x59b800e4, 0x8c000524, 0x0402001b, - 0x59300808, 0x84040d62, 0x48066008, 0x4a0370e4, - 0x00020000, 0x4d2c0000, 0x0201f800, 0x0010055a, - 0x04000025, 0x492e6020, 0x4a025a01, 0x0000dcb3, - 0x59300009, 0x80001d40, 0x02000800, 0x0010032d, - 0x580c0810, 0x48065803, 0x59301812, 0x40040000, - 0x800c0580, 0x0402000d, 0x497a5a02, 0x4a025c01, - 0x00000004, 0x0401f011, 0x4a0370e4, 0x00020000, - 0x40000000, 0x40000000, 0x80081040, 0x02000800, - 0x0010032d, 0x0401f7d6, 0x4a025a02, 0x00000001, - 0x4a025c01, 0x00000006, 0x497a5804, 0x400c0000, - 0x80040480, 0x48025805, 0x412de800, 0x5c025800, - 0x0401f7a9, 0x5c025800, 0x4a026020, 0xffffffff, - 0x0401f7c3, 0x4d2c0000, 0x58f65800, 0x0201f800, - 0x00100580, 0x40f65800, 0x0201f800, 0x00100580, - 0x5c025800, 0x0401f7f5, 0x4d2c0000, 0x0201f800, - 0x0010055a, 0x040007f8, 0x4a025a01, 0x0000ddb9, - 0x4a025c01, 0x00000002, 0x492de800, 0x412de800, - 0x5c025800, 0x0401f7a5, 0x0401ff1e, 0x82f40400, - 0x00000004, 0x800c0400, 0x40000800, 0x50040000, - 0x80100580, 0x04000016, 0x82040c00, 0x00000002, - 0x80081040, 0x040207fa, 0x80f9f1c0, 0x04000011, - 0x58f41202, 0x82081480, 0x00000007, 0x82f80400, - 0x00000002, 0x800c0400, 0x40000800, 0x50040000, - 0x80100580, 0x04000006, 0x82040c00, 0x00000002, - 0x80081040, 0x040207fa, 0x0401f002, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fd, 0x4cf40000, - 0x4cf80000, 0x4001e800, 0x812e59c0, 0x04000024, - 0x592c0a07, 0x800409c0, 0x04020021, 0x82f40580, - 0xffffffff, 0x0400001b, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032d, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032d, 0x41783800, - 0x58f44003, 0x0401f839, 0x04020009, 0x0401ff2c, - 0x497a6020, 0x59300808, 0x84040d22, 0x48066008, - 0x5c01f000, 0x5c01e800, 0x1c01f000, 0x0401ff24, - 0x4a025a07, 0x00000011, 0x0401f7f6, 0x0401ff06, - 0x0401f7f4, 0x4cf40000, 0x4cf80000, 0x4001e800, - 0x82040580, 0x00000001, 0x04020020, 0x82f40580, - 0xffffffff, 0x0400001a, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032d, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032d, 0x41783800, - 0x58f44003, 0x0401f811, 0x04020008, 0x0401ff04, - 0x42000800, 0x00000001, 0x497a6020, 0x5c01f000, - 0x5c01e800, 0x1c01f000, 0x0401fefd, 0x42000800, - 0x00000011, 0x0401f7f9, 0x4c040000, 0x0401fede, - 0x5c000800, 0x0401f7f5, 0x4803c856, 0x401c2000, - 0x41781800, 0x4c200000, 0x0401ff88, 0x5c004000, - 0x0402002a, 0x40202000, 0x42001800, 0x00000001, - 0x0401ff82, 0x04020025, 0x0401fe9e, 0x40082800, - 0x82f43400, 0x00000004, 0x50182000, 0x40100000, - 0x801c0580, 0x04000005, 0x42001800, 0x00000001, - 0x0401ff76, 0x04020019, 0x82183400, 0x00000002, - 0x80142840, 0x040207f5, 0x80f9f1c0, 0x04000012, - 0x58f42a02, 0x82142c80, 0x00000007, 0x82f83400, - 0x00000002, 0x50182000, 0x40100000, 0x801c0580, - 0x04000005, 0x42001800, 0x00000001, 0x0401ff63, - 0x04020006, 0x82183400, 0x00000002, 0x80142840, - 0x040207f5, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x0201f800, 0x0010032d, 0x58380a05, - 0x82040d00, 0x000000ff, 0x82040580, 0x0000001b, - 0x04000004, 0x82040580, 0x0000002b, 0x040207f6, - 0x50200000, 0x80387c00, 0x583c2800, 0x583c2001, - 0x583c1002, 0x592c0a08, 0x58383010, 0x59303808, - 0x497a6013, 0x497a6014, 0x0201f000, 0x00020149, - 0x58380208, 0x8c000502, 0x040007e7, 0x50200000, - 0x80387c00, 0x583c2800, 0x583c2001, 0x58380405, - 0x80001540, 0x04020002, 0x58381408, 0x58c83401, - 0x58380c09, 0x59303808, 0x497a6013, 0x497a6014, - 0x0201f000, 0x00020149, 0x592c0409, 0x8c000502, - 0x040007d5, 0x592c040a, 0x80000540, 0x040007d2, - 0x82000c80, 0x00000002, 0x04001011, 0x58380001, - 0x80007540, 0x02000800, 0x0010032d, 0x58380205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x40040000, 0x800409c0, 0x04000005, - 0x82040c80, 0x00000005, 0x040217f1, 0x80204400, - 0x50200000, 0x80387c00, 0x583c2800, 0x583c2001, - 0x583c1002, 0x592c0a08, 0x592c4c09, 0x592c300e, - 0x59303808, 0x497a6013, 0x497a6014, 0x4816600f, - 0x48126010, 0x480a6011, 0x481a6012, 0x80040840, - 0x4806600e, 0x02000000, 0x00020151, 0x80204000, - 0x50201800, 0x800c19c0, 0x0402000c, 0x58380001, - 0x80007540, 0x02000800, 0x0010032d, 0x58380205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x50201800, 0x483a600c, 0x480e600b, - 0x4822600d, 0x0201f000, 0x00020151, 0x4803c856, - 0x592c0209, 0x8c00051e, 0x04020017, 0x50200000, - 0x80306c00, 0x40240000, 0x0c01f001, 0x00100b7f, - 0x00100b7f, 0x00100b88, 0x00100b7f, 0x00100b7f, - 0x00100b7f, 0x00100b7f, 0x00100b7f, 0x00100b88, - 0x00100b7f, 0x00100b88, 0x00100b7f, 0x00100b7f, - 0x00100b88, 0x00100b7f, 0x00100b7f, 0x0201f800, - 0x0010032d, 0x8400051e, 0x48025a09, 0x50200000, - 0x80306c00, 0x58343801, 0x481e6010, 0x0401f007, - 0x58341802, 0x58342800, 0x58343801, 0x480e6011, - 0x4816600f, 0x481e6010, 0x0401f28a, 0x4933c857, - 0x5931f809, 0x59301006, 0x800811c0, 0x0400000b, - 0x41780800, 0x42000000, 0x0000000a, 0x0201f800, - 0x0010600e, 0x80080102, 0x04020002, 0x84001542, - 0x80081040, 0x4809fc07, 0x4a026006, 0x00000002, - 0x592c040a, 0x82000500, 0x00000008, 0x0400000b, - 0x0401f831, 0x59300203, 0x82000580, 0x00000004, - 0x04020005, 0x42027000, 0x00000048, 0x0201f800, - 0x00020a34, 0x1c01f000, 0x4cfc0000, 0x58fc0205, - 0x82000500, 0x000000ff, 0x82000580, 0x00000048, - 0x04020009, 0x58fc0409, 0x8c000500, 0x04000006, - 0x58fc080c, 0x8c040d16, 0x04000017, 0x58fc0008, - 0x0401f00a, 0x58fc0409, 0x8c000512, 0x04020014, - 0x58fc0c0a, 0x8c040d16, 0x04020003, 0x5c01f800, - 0x1c01f000, 0x58fc000b, 0x59300812, 0x80040580, - 0x04020009, 0x59300008, 0x84000500, 0x48026008, - 0x42027000, 0x00000048, 0x5c01f800, 0x0201f000, - 0x00020a34, 0x5c01f800, 0x1c01f000, 0x58fdf80a, - 0x0401f7ec, 0x5c000000, 0x4c000000, 0x4803c857, - 0x4933c857, 0x59b808ea, 0x82040d00, 0x00000007, - 0x82040580, 0x00000000, 0x04000025, 0x82040580, - 0x00000003, 0x04000022, 0x59300407, 0x4c000000, - 0x4a026407, 0x00000000, 0x42003000, 0x00000041, - 0x4a0370e5, 0x00003000, 0x42000000, 0x50000000, - 0x41300800, 0x4c180000, 0x0401fca9, 0x5c003000, - 0x0400000e, 0x42000000, 0x0000001e, 0x80000040, - 0x040207ff, 0x80183040, 0x040207f4, 0x42000000, - 0x40000000, 0x41300800, 0x0401fc9d, 0x59880146, - 0x80000000, 0x48031146, 0x4a0370e5, 0x00002000, - 0x5c000000, 0x48026407, 0x1c01f000, 0x59300008, - 0x84000500, 0x48026008, 0x0401f7fc, 0x59c00007, - 0x4a038006, 0x30000000, 0x40000000, 0x59c00007, - 0x8c00050a, 0x040207fe, 0x1c01f000, 0x5c000000, - 0x4c000000, 0x4803c857, 0x42000800, 0x00000001, - 0x0201f800, 0x00101994, 0x4dc00000, 0x4a0370e8, - 0x00000000, 0x42038000, 0x00007720, 0x0401ffec, - 0x42038000, 0x00007700, 0x0401ffe9, 0x0201f800, - 0x00104755, 0x04020017, 0x4a038891, 0x0000ffff, - 0x497b8880, 0x4ce80000, 0x4201d000, 0x00000016, - 0x0201f800, 0x001059d2, 0x497b8892, 0x4201d000, - 0x00000016, 0x0201f800, 0x001059d2, 0x5c01d000, - 0x42000000, 0x0010bd60, 0x0201f800, 0x0010ae10, - 0x0401f812, 0x5c038000, 0x0201f000, 0x00104879, - 0x0401f830, 0x4c080000, 0x4c140000, 0x42000000, - 0x0010bd61, 0x0201f800, 0x0010ae10, 0x0401f807, - 0x5c002800, 0x5c001000, 0x48178892, 0x480b8880, - 0x5c038000, 0x1c01f000, 0x496fc857, 0x836c0580, - 0x00000003, 0x0402000b, 0x4c080000, 0x4c0c0000, - 0x42001000, 0x00008048, 0x42001800, 0x0000ffff, - 0x0201f800, 0x001031f5, 0x5c001800, 0x5c001000, - 0x42000800, 0x0000003c, 0x0201f800, 0x001010db, - 0x59a8006a, 0x80000540, 0x04000005, 0x59a8106b, - 0x800811c0, 0x02020800, 0x001018ff, 0x4a038891, - 0x0000ffff, 0x4a03900d, 0x00000040, 0x0201f800, - 0x00100684, 0x4a0370e8, 0x00000001, 0x1c01f000, - 0x5c000000, 0x4c000000, 0x4803c857, 0x59c41080, - 0x497b8880, 0x4ce80000, 0x4201d000, 0x00000016, - 0x4c080000, 0x0201f800, 0x001059d2, 0x5c001000, - 0x5c01d000, 0x59c42892, 0x497b8892, 0x0201f800, - 0x00104755, 0x04020002, 0x1c01f000, 0x42002000, - 0x00000260, 0x59c418a4, 0x820c1d00, 0x0000000f, - 0x820c0580, 0x00000000, 0x04000010, 0x59c41805, - 0x820c1d00, 0x00000001, 0x0402000e, 0x59c418a4, - 0x820c1d00, 0x0000000f, 0x820c0480, 0x00000007, - 0x04001004, 0x820c0480, 0x0000000c, 0x04001003, - 0x80102040, 0x040207ec, 0x497b8891, 0x1c01f000, - 0x4c100000, 0x42002000, 0x00000019, 0x4a038805, - 0x00000001, 0x0201f800, 0x00101731, 0x59c41805, - 0x820c1d00, 0x00000001, 0x04000005, 0x80102040, - 0x040207f7, 0x5c002000, 0x0401f7f0, 0x5c002000, - 0x0401f7ec, 0x4803c856, 0x1c01f000, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cdb, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cb7, 0x00100cb7, - 0x00100cdb, 0x00100cb7, 0x00100cb9, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cb7, 0x0201f800, - 0x0010032d, 0x82040580, 0x0000001b, 0x0400001a, - 0x82040580, 0x0000002b, 0x04000017, 0x82040580, - 0x0000003b, 0x02020800, 0x0010032d, 0x592c020b, - 0x8c000500, 0x04000073, 0x592c1a08, 0x82040500, - 0x0000000f, 0x82000400, 0x00100e3a, 0x50001000, - 0x50080000, 0x59302014, 0x4802600b, 0x492e600c, - 0x480a600d, 0x480e600e, 0x48126013, 0x5c025800, - 0x1c01f000, 0x592c0010, 0x48026012, 0x592c0011, - 0x48026014, 0x592c1a08, 0x0401f7ed, 0x82040500, - 0x0000000f, 0x82000400, 0x00100e3a, 0x50001000, - 0x50080000, 0x592c1a08, 0x4802600b, 0x492e600c, - 0x480a600d, 0x480e600e, 0x497a6013, 0x0401f7ec, - 0x8c040d00, 0x0402004f, 0x82040d00, 0x00000080, - 0x0400004c, 0x0201f000, 0x00020164, 0x59300014, - 0x59301013, 0x80080580, 0x0402000c, 0x42007800, - 0x80000005, 0x592c1209, 0x82080500, 0xffff7fff, - 0x48025a09, 0x8c08151e, 0x0402003b, 0x823c7d40, - 0x00000020, 0x0401f038, 0x480bc857, 0x42000000, - 0x0010bd0d, 0x0201f800, 0x0010ae10, 0x59302014, - 0x59300415, 0x4803c857, 0x8c000514, 0x04020011, - 0x599c1819, 0x8c0c1d12, 0x0400000b, 0x592c0810, - 0x59300016, 0x80040c80, 0x04000005, 0x04001004, - 0x80040000, 0x80140480, 0x0400100a, 0x0201f800, - 0x001071c7, 0x820c1d40, 0x00000001, 0x0401f020, - 0x84000514, 0x48026415, 0x48126016, 0x4813c857, - 0x0401f93e, 0x0402001a, 0x42007800, 0x80000005, - 0x5930500e, 0x592c0209, 0x4803c857, 0x8c00051e, - 0x04020005, 0x823c7d40, 0x00000020, 0x5930400d, - 0x0401f004, 0x8400051e, 0x48025a09, 0x0401f8ed, - 0x50201800, 0x480e600b, 0x4832600c, 0x4822600d, - 0x482a600e, 0x480fc857, 0x4833c857, 0x4823c857, - 0x482bc857, 0x80000580, 0x483e6004, 0x1c01f000, - 0x0201f800, 0x0010032d, 0x4933c857, 0x4d2c0000, - 0x59900004, 0x81300580, 0x02020800, 0x0010032d, - 0x0201f800, 0x00108953, 0x02000800, 0x0010032d, - 0x59325809, 0x4d3c0000, 0x4d400000, 0x59300004, - 0x4803c857, 0x4c000000, 0x0201f800, 0x00106346, - 0x0201f800, 0x001060e2, 0x5c000000, 0x8c000516, - 0x04000011, 0x592c0010, 0x4803c857, 0x48025808, - 0x41780800, 0x42028000, 0x00000002, 0x0201f800, - 0x00104543, 0x4a025c07, 0x0000ffff, 0x492fc857, - 0x0201f800, 0x000203ab, 0x0201f800, 0x00107144, - 0x0401f015, 0x4a026203, 0x00000002, 0x592c0209, - 0x8400054e, 0x48025a09, 0x59300407, 0x82000580, - 0x00000006, 0x04020009, 0x811800ca, 0x81c80c00, - 0x58040939, 0x592c000e, 0x80040480, 0x592c0810, - 0x80040480, 0x4802580c, 0x417a7800, 0x0201f800, - 0x0010853c, 0x5c028000, 0x5c027800, 0x5c025800, - 0x1c01f000, 0x4933c857, 0x4d2c0000, 0x59900004, - 0x81300580, 0x02020800, 0x0010032d, 0x0201f800, - 0x00108953, 0x02000800, 0x0010032d, 0x59325809, - 0x592c0209, 0x84000540, 0x48025a09, 0x0401f7be, - 0x491bc857, 0x4dd00000, 0x4c580000, 0x41780800, - 0x8007a0ca, 0x83d3a400, 0x00007600, 0x4200b000, - 0x000007d0, 0x599c0019, 0x8c000506, 0x04020003, - 0x4200b000, 0x000003e8, 0x4a03a005, 0x80000002, - 0x0402400d, 0x4c040000, 0x02004800, 0x0002090c, - 0x5c000800, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x04001003, 0x8058b040, - 0x04000016, 0x59d01006, 0x82080500, 0x00006000, - 0x82000580, 0x00006000, 0x04000007, 0x8c08151e, - 0x040007ec, 0x59d01006, 0x82080500, 0x00006000, - 0x040207e8, 0x83d3a400, 0x00000020, 0x80040800, - 0x82040480, 0x00000005, 0x040017d9, 0x5c00b000, - 0x5c03a000, 0x1c01f000, 0x41180000, 0x80040580, - 0x04000008, 0x42003000, 0x0010b995, 0x58180401, - 0x8c000504, 0x040007f0, 0x850e1d6e, 0x0401f7ee, - 0x4a03a005, 0x30000000, 0x59d00006, 0x4a03a005, - 0x30000000, 0x59d00006, 0x497ba003, 0x497ba007, - 0x4a03a005, 0xf0000001, 0x42001800, 0x00008000, - 0x59d00006, 0x8c00050a, 0x04000005, 0x800c1840, - 0x040207fc, 0x0201f800, 0x0010032d, 0x4a03a005, - 0xf0000000, 0x59d00006, 0x850e1d2e, 0x800410c8, - 0x82081400, 0x0000bf32, 0x58081804, 0x800c19c0, - 0x040007d1, 0x580c0004, 0x84000576, 0x48001804, - 0x4933c857, 0x0401f7cc, 0x4803c856, 0x4dd00000, - 0x41780800, 0x8007a0ca, 0x83d3a400, 0x00007600, - 0x4a03a005, 0x80000001, 0x59d00006, 0x83d3a400, - 0x00000020, 0x80040800, 0x82040480, 0x00000005, - 0x040017f8, 0x5c03a000, 0x1c01f000, 0x59d00006, - 0x8c00053e, 0x0400001e, 0x59902804, 0x4817c857, - 0x801429c0, 0x04000013, 0x5990000a, 0x5990080b, - 0x5990100c, 0x5990180d, 0x4800280b, 0x4804280c, - 0x4808280d, 0x480c280e, 0x59d00000, 0x59d00801, - 0x59d01002, 0x59d01803, 0x59d02004, 0x4800280f, - 0x48042810, 0x48082811, 0x480c2812, 0x48102813, - 0x59900006, 0x82000500, 0xffff0000, 0x48032006, - 0x4a03a005, 0x30000000, 0x59d00006, 0x1c01f000, - 0x4803c856, 0x80204000, 0x50200000, 0x80000540, - 0x04000003, 0x80285040, 0x1c01f000, 0x58300001, - 0x80000540, 0x0400000e, 0x4802600c, 0x40006000, - 0x58300205, 0x82000500, 0x0000000f, 0x82000400, - 0x00100e3a, 0x50004000, 0x802041c0, 0x02000800, - 0x0010032d, 0x80285040, 0x1c01f000, 0x40005000, - 0x1c01f000, 0x00000006, 0x00000009, 0x0000000c, - 0x0000000f, 0x00000012, 0x00000000, 0x00000000, - 0x0000000c, 0x00000000, 0x00000000, 0x00000000, - 0x00100e35, 0x00100e34, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00100e35, 0x00100e34, - 0x00100e31, 0x00100e35, 0x00100e34, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00100e35, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00100e35, 0x00100e35, - 0x00100e35, 0x00000000, 0x00100e35, 0x00000000, - 0x00000000, 0x00000000, 0x4813c857, 0x492fc857, - 0x4933c857, 0x48126013, 0x592c5208, 0x802851c0, - 0x0400004a, 0x412c6000, 0x0401f84b, 0x04000009, - 0x82240580, 0x00000002, 0x04020003, 0x5830000e, - 0x80102480, 0x50200000, 0x80004540, 0x0400003f, - 0x50200000, 0x80000540, 0x0400000b, 0x80301400, - 0x58080002, 0x80102480, 0x0400101e, 0x801021c0, - 0x04000009, 0x80285040, 0x04000034, 0x80204000, - 0x0401f7f4, 0x58300001, 0x80006540, 0x0400002f, - 0x0401f7e6, 0x80285040, 0x0400002c, 0x80204000, - 0x50200000, 0x80000540, 0x0402000a, 0x58300001, - 0x80006540, 0x04000025, 0x58300205, 0x82004d00, - 0x0000000f, 0x82244400, 0x00100e3a, 0x50204000, - 0x592c0209, 0x8400051e, 0x48025a09, 0x0401f013, - 0x80102080, 0x80102000, 0x48126011, 0x4813c857, - 0x58080802, 0x40100000, 0x80042480, 0x02001800, - 0x0010032d, 0x58080000, 0x58081801, 0x80102400, - 0x4812600f, 0x480e6010, 0x4813c857, 0x592c0209, - 0x8400055e, 0x48025a09, 0x4833c857, 0x4823c857, - 0x482bc857, 0x4832600c, 0x4822600d, 0x482a600e, - 0x80000580, 0x0401f003, 0x82000540, 0x00000001, - 0x1c01f000, 0x58300205, 0x82004d00, 0x0000000f, - 0x82244400, 0x00100e3a, 0x82000500, 0x000000ff, - 0x82000580, 0x00000029, 0x0402001b, 0x50204000, - 0x592c040a, 0x80000540, 0x02000800, 0x0010032d, - 0x82000c80, 0x00000002, 0x04001011, 0x58300001, - 0x80006540, 0x02000800, 0x0010032d, 0x58300205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x40040000, 0x800409c0, 0x04000006, - 0x82040c80, 0x00000005, 0x040217f1, 0x80204400, - 0x80000580, 0x1c01f000, 0x4c5c0000, 0x59e4b800, - 0x485fc857, 0x825c0500, 0x0000001f, 0x04000004, - 0x59e40862, 0x0201f800, 0x0010032d, 0x825c0500, - 0x000000e0, 0x02000800, 0x0010032d, 0x8c5cbd0e, - 0x04020807, 0x8c5cbd0c, 0x04020809, 0x8c5cbd0a, - 0x04020873, 0x5c00b800, 0x1c01f000, 0x4803c856, - 0x4a03c800, 0x00000080, 0x1c01f000, 0x4d2c0000, - 0x42007800, 0x0010bdb1, 0x583c0003, 0x583c0804, - 0x80040540, 0x0400003a, 0x42000800, 0x0010bc56, - 0x50065800, 0x592c0002, 0x82000580, 0x00000000, - 0x04000033, 0x59e40050, 0x59e40852, 0x80040480, - 0x82000500, 0xfffffc00, 0x04020005, 0x59e40050, - 0x59e40851, 0x80040800, 0x80040480, 0x82000c80, - 0x00000400, 0x59e40050, 0x80041400, 0x480bc857, - 0x50080000, 0x58080801, 0x80040540, 0x04000020, - 0x480bc857, 0x480a5803, 0x583c1009, 0x583c000a, - 0x80080580, 0x04020005, 0x583c0000, 0x84000550, - 0x48007800, 0x41781000, 0x82080400, 0x00001000, - 0x4803c857, 0x48007809, 0x583c0003, 0x80081400, - 0x480bc857, 0x583c0804, 0x4a025801, 0x00000000, - 0x4a025808, 0x00100f2f, 0x480a5806, 0x48065807, - 0x59e40053, 0x800000c4, 0x48025805, 0x412c1000, - 0x492fc857, 0x0201f800, 0x00020016, 0x5c025800, - 0x4a03c800, 0x00000040, 0x1c01f000, 0x42007800, - 0x0010bc56, 0x503c7800, 0x4a007802, 0x00000100, - 0x42007800, 0x0010bdb1, 0x583c0000, 0x84000552, - 0x48007800, 0x583c100c, 0x480bc857, 0x80081000, - 0x4808780c, 0x583c180b, 0x800c19c0, 0x04000017, - 0x82080500, 0x00000003, 0x04020014, 0x583c0007, - 0x4803c857, 0x583c2008, 0x4813c857, 0x80102000, - 0x80100580, 0x04020002, 0x41782000, 0x48107808, - 0x400c0000, 0x80080580, 0x04020008, 0x4978780c, - 0x42001800, 0x00000001, 0x42001000, 0x00008028, - 0x0201f800, 0x001031f5, 0x1c01f000, 0x4a03c800, - 0x00000020, 0x0201f800, 0x0010ae08, 0x59e40000, - 0x1c01f000, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x0400100d, 0x0201f800, - 0x0010af26, 0x04000008, 0x42000000, 0x00007a42, - 0x50007000, 0x8c387520, 0x04020003, 0x84387560, - 0x44380000, 0x4a030000, 0x00000000, 0x1c01f000, - 0x4d2c0000, 0x4a007000, 0x00000000, 0x82040d00, - 0x43000f80, 0x02020800, 0x0010032d, 0x58380008, - 0x4803c00f, 0x4a0370e4, 0x00003000, 0x0201f800, - 0x00108d7c, 0x583a5807, 0x592c0000, 0x48007007, - 0x800001c0, 0x04020002, 0x49787006, 0x0201f800, - 0x00100580, 0x5c025800, 0x42007000, 0x00020b54, - 0x0201f000, 0x0002002c, 0x4803c856, 0x4c3c0000, - 0x4d2c0000, 0x4d300000, 0x58300009, 0x80025d40, - 0x02000800, 0x0010032d, 0x592e6009, 0x4c300000, - 0x0201f800, 0x00108d9b, 0x5c006000, 0x02000800, - 0x0010032d, 0x58300002, 0x82000580, 0x00000100, - 0x0402000f, 0x5930780c, 0x583c0001, 0x80007d40, - 0x0400000e, 0x4802600c, 0x82000400, 0x00000002, - 0x48006003, 0x583c0000, 0x48006005, 0x40301000, - 0x0201f800, 0x00020016, 0x0401f00c, 0x4a025a07, - 0x00000002, 0x492fc857, 0x4c300000, 0x0201f800, - 0x000203ab, 0x5c025800, 0x0201f800, 0x00100580, - 0x0201f800, 0x00020a10, 0x5c026000, 0x5c025800, - 0x5c007800, 0x1c01f000, 0x4803c856, 0x4d2c0000, - 0x4d300000, 0x42007000, 0x00020b54, 0x58380800, - 0x82040580, 0x00000002, 0x04020011, 0x58386001, - 0x58300009, 0x812c0580, 0x0402000d, 0x59e00004, - 0x8c00050e, 0x040007fe, 0x59dc0006, 0x4803c857, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 13 19:39:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF07A2E62E; Fri, 13 Nov 2015 19:39:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7E2D195A; Fri, 13 Nov 2015 19:39:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJdaTk092708; Fri, 13 Nov 2015 19:39:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJdaob092707; Fri, 13 Nov 2015 19:39:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131939.tADJdaob092707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290783 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:39:38 -0000 Author: mav Date: Fri Nov 13 19:39:36 2015 New Revision: 290783 URL: https://svnweb.freebsd.org/changeset/base/290783 Log: MFC r289643: Document isp_*_multi firmware kernel modules removal. Modified: stable/10/UPDATING Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Nov 13 19:36:43 2015 (r290782) +++ stable/10/UPDATING Fri Nov 13 19:39:36 2015 (r290783) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20151113: + Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. + Kernel modules isp_2400_multi and isp_2500_multi were removed and + should be replaced with isp_2400 and isp_2500 modules respectively. + 20151026: NTP has been upgraded to 4.2.8p4. From owner-svn-src-all@freebsd.org Fri Nov 13 19:41:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B05BA2E779; Fri, 13 Nov 2015 19:41:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8C1D1BCE; Fri, 13 Nov 2015 19:41:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJf4oC094756; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJf4QK094754; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131941.tADJf4QK094754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290784 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:41:06 -0000 Author: mav Date: Fri Nov 13 19:41:04 2015 New Revision: 290784 URL: https://svnweb.freebsd.org/changeset/base/290784 Log: MFC r289681: Some more defines and polishing for INIT_FIRMWARE. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:41:04 2015 (r290784) @@ -2075,10 +2075,11 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions2 |= ICB2400_OPT2_FCTAPE; } - if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) { - FCPARAM(isp, chan)->fctape_enabled = 1; - } else { - FCPARAM(isp, chan)->fctape_enabled = 0; + for (chan = 0; chan < isp->isp_nchan; chan++) { + if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) + FCPARAM(isp, chan)->fctape_enabled = 1; + else + FCPARAM(isp, chan)->fctape_enabled = 0; } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { @@ -2209,31 +2210,39 @@ isp_fibre_init_2400(ispsoftc_t *isp) size_t amt = 0; uint8_t *off; - vpinfo.vp_count = isp->isp_nchan - 1; vpinfo.vp_global_options = 0; + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) { + vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; + vpinfo.vp_count = isp->isp_nchan; + chan = 0; + } else { + vpinfo.vp_count = isp->isp_nchan - 1; + chan = 1; + } off = fcp->isp_scratch; off += ICB2400_VPINFO_OFF; vdst = (isp_icb_2400_vpinfo_t *) off; isp_put_icb_2400_vpinfo(isp, &vpinfo, vdst); amt = ICB2400_VPINFO_OFF + sizeof (isp_icb_2400_vpinfo_t); - for (chan = 1; chan < isp->isp_nchan; chan++) { + for (; chan < isp->isp_nchan; chan++) { fcparam *fcp2; ISP_MEMZERO(&pi, sizeof (pi)); fcp2 = FCPARAM(isp, chan); if (fcp2->role != ISP_ROLE_NONE) { pi.vp_port_options = ICB2400_VPOPT_ENABLED; - if (fcp2->role & ISP_ROLE_INITIATOR) { + if (fcp2->role & ISP_ROLE_INITIATOR) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((fcp2->role & ISP_ROLE_TARGET) == 0) { + if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; - } - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); } + MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; - off += ICB2400_VPINFO_PORT_OFF(chan); + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) + off += ICB2400_VPINFO_PORT_OFF(chan); + else + off += ICB2400_VPINFO_PORT_OFF(chan - 1); pdst = (vp_port_info_t *) off; isp_put_vp_port_info(isp, &pi, pdst); amt += ICB2400_VPOPT_WRITE_SIZE; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:41:04 2015 (r290784) @@ -989,6 +989,13 @@ typedef struct { #define ICB2400_OPT1_FAIRNESS 0x00000002 #define ICB2400_OPT1_HARD_ADDRESS 0x00000001 +#define ICB2400_OPT2_ENA_ATIOMQ 0x08000000 +#define ICB2400_OPT2_ENA_IHA 0x04000000 +#define ICB2400_OPT2_QOS 0x02000000 +#define ICB2400_OPT2_IOCBS 0x01000000 +#define ICB2400_OPT2_ENA_IHR 0x00400000 +#define ICB2400_OPT2_ENA_VMS 0x00200000 +#define ICB2400_OPT2_ENA_TA 0x00100000 #define ICB2400_OPT2_TPRLIC 0x00004000 #define ICB2400_OPT2_FCTAPE 0x00001000 #define ICB2400_OPT2_FCSP 0x00000800 @@ -1003,14 +1010,20 @@ typedef struct { #define ICB2400_OPT2_ZIO 0x00000005 #define ICB2400_OPT2_ZIO1 0x00000006 -#define ICB2400_OPT3_75_OHM 0x00010000 +#define ICB2400_OPT3_NO_CTXDIS 0x40000000 +#define ICB2400_OPT3_ENA_ETH_RESP 0x08000000 +#define ICB2400_OPT3_ENA_ETH_ATIO 0x04000000 +#define ICB2400_OPT3_ENA_MFCF 0x00020000 +#define ICB2400_OPT3_SKIP_FOURGB 0x00010000 #define ICB2400_OPT3_RATE_MASK 0x0000E000 #define ICB2400_OPT3_RATE_ONEGB 0x00000000 #define ICB2400_OPT3_RATE_TWOGB 0x00002000 -#define ICB2400_OPT3_RATE_AUTO 0x00004000 +#define ICB2400_OPT3_RATE_AUTO 0x00004000 #define ICB2400_OPT3_RATE_FOURGB 0x00006000 #define ICB2400_OPT3_RATE_EIGHTGB 0x00008000 +#define ICB2400_OPT3_RATE_SIXTEENGB 0x0000A000 #define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 +#define ICB2400_OPT3_NO_N2N_LOGI 0x00000100 #define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 #define ICB2400_OPT3_ENA_OOF 0x00000040 /* note that a response size flag of zero is reserved! */ @@ -1124,12 +1137,13 @@ typedef struct { uint16_t vp_port_portid_hi; /* not present when trailing icb */ } vp_port_info_t; -#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* disable target mode */ -#define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* enable initiator mode */ -#define ICB2400_VPOPT_ENABLED 0x00000008 -#define ICB2400_VPOPT_NOPLAY 0x00000004 -#define ICB2400_VPOPT_PREVLOOP 0x00000002 -#define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 +#define ICB2400_VPOPT_ENA_SNSLOGIN 0x00000040 /* Enable SNS Login and SCR for Virtual Ports */ +#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* Target Mode Disabled */ +#define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* Initiator Mode Enabled */ +#define ICB2400_VPOPT_ENABLED 0x00000008 /* VP Enabled */ +#define ICB2400_VPOPT_NOPLAY 0x00000004 /* ID Not Acquired */ +#define ICB2400_VPOPT_PREVLOOP 0x00000002 /* Previously Assigned ID */ +#define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 /* Hard Assigned ID */ #define ICB2400_VPOPT_WRITE_SIZE 20 @@ -1145,12 +1159,14 @@ typedef struct { #define ICB2400_VPINFO_OFF 0x80 /* offset from start of ICB */ #define ICB2400_VPINFO_PORT_OFF(chan) \ - ICB2400_VPINFO_OFF + \ - sizeof (isp_icb_2400_vpinfo_t) + ((chan - 1) * ICB2400_VPOPT_WRITE_SIZE) + (ICB2400_VPINFO_OFF + \ + sizeof (isp_icb_2400_vpinfo_t) + (chan * ICB2400_VPOPT_WRITE_SIZE)) #define ICB2400_VPGOPT_FCA 0x01 /* Assume Clean Address bit in FLOGI ACC set (works only in static configurations) */ #define ICB2400_VPGOPT_MID_DISABLE 0x02 /* when set, connection mode2 will work with NPIV-capable switched */ #define ICB2400_VPGOPT_VP0_DECOUPLE 0x04 /* Allow VP0 decoupling if firmware supports it */ +#define ICB2400_VPGOPT_SUSP_FDISK 0x10 /* Suspend FDISC for Enabled VPs */ +#define ICB2400_VPGOPT_GEN_RIDA 0x20 /* Generate RIDA if FLOGI Fails */ typedef struct { isphdr_t vp_ctrl_hdr; @@ -1197,8 +1213,10 @@ typedef struct { #define VP_IDX_ERR 0x04 #define VP_STS_BSY 0x05 -#define VP_MODIFY_VP 0x00 +#define VP_MODIFY 0x00 #define VP_MODIFY_ENA 0x01 +#define VP_MODIFY_OPT 0x02 +#define VP_RESUME 0x03 /* * Port Data Base Element From owner-svn-src-all@freebsd.org Fri Nov 13 19:42:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EEBA2E7DF; Fri, 13 Nov 2015 19:42:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D12DC1DE1; Fri, 13 Nov 2015 19:42:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJguN2095483; Fri, 13 Nov 2015 19:42:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJgtqe095477; Fri, 13 Nov 2015 19:42:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131942.tADJgtqe095477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290785 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:42:57 -0000 Author: mav Date: Fri Nov 13 19:42:55 2015 New Revision: 290785 URL: https://svnweb.freebsd.org/changeset/base/290785 Log: MFC r289812, r289852: Some polishing and unification in ISR code. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c stable/10/sys/dev/isp/ispreg.h stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:42:55 2015 (r290785) @@ -5037,7 +5037,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct #endif void -isp_intr(ispsoftc_t *isp, uint32_t isr, uint16_t sema, uint16_t mbox) +isp_intr(ispsoftc_t *isp, uint16_t isr, uint16_t sema, uint16_t info) { XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; uint32_t iptr, optr, junk; @@ -5051,11 +5051,11 @@ again: */ if (sema) { fmbox: - if (mbox & MBOX_COMMAND_COMPLETE) { + if (info & MBOX_COMMAND_COMPLETE) { isp->isp_intmboxc++; if (isp->isp_mboxbsy) { int obits = isp->isp_obits; - isp->isp_mboxtmp[0] = mbox; + isp->isp_mboxtmp[0] = info; for (i = 1; i < ISP_NMBOX(isp); i++) { if ((obits & (1 << i)) == 0) { continue; @@ -5069,15 +5069,15 @@ again: } MBOX_NOTIFY_COMPLETE(isp); } else { - isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", mbox); + isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); } } else { - i = IS_FC(isp)? isp_parse_async_fc(isp, mbox) : isp_parse_async(isp, mbox); + i = IS_FC(isp)? isp_parse_async_fc(isp, info) : isp_parse_async(isp, info); if (i < 0) { return; } } - if ((IS_FC(isp) && mbox != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { + if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; } } @@ -5092,7 +5092,8 @@ again: if (isp->isp_mboxbsy && isp->isp_lastmbxcmd == MBOX_ABOUT_FIRMWARE) { goto fmbox; } - isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x) when not ready", isr, sema); + isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x INFO=%x) " + "when not ready", isr, sema, info); /* * Thank you very much! *Burrrp*! */ @@ -5110,8 +5111,8 @@ again: * Check for ATIO Queue entries. */ if (IS_24XX(isp) && - ((isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RSPQ_UPDATE || - (isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RQST_UPDATE)) { + (isr == ISPR2HST_ATIO_UPDATE || isr == ISPR2HST_ATIO_RSPQ_UPDATE || + isr == ISPR2HST_ATIO_UPDATE2)) { iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); optr = isp->isp_atioodx; @@ -5145,25 +5146,6 @@ again: #endif /* - * Get the current Response Queue Out Pointer. - * - * If we're a 2300 or 2400, we can ask what hardware what it thinks. - */ -#if 0 - if (IS_23XX(isp) || IS_24XX(isp)) { - optr = ISP_READ(isp, isp->isp_respoutrp); - /* - * Debug: to be taken out eventually - */ - if (isp->isp_resodx != optr) { - isp_prt(isp, ISP_LOGINFO, "isp_intr: hard optr=%x, soft optr %x", optr, isp->isp_resodx); - isp->isp_resodx = optr; - } - } else -#endif - optr = isp->isp_resodx; - - /* * You *must* read the Response Queue In Pointer * prior to clearing the RISC interrupt. * @@ -5184,6 +5166,7 @@ again: iptr = ISP_READ(isp, isp->isp_respinrp); } + optr = isp->isp_resodx; if (optr == iptr && sema == 0) { /* * There are a lot of these- reasons unknown- mostly on @@ -5207,8 +5190,8 @@ again: ; } else { sema = ISP_READ(isp, BIU_SEMA); - mbox = ISP_READ(isp, OUTMAILBOX0); - if ((sema & 0x3) && (mbox & 0x8000)) { + info = ISP_READ(isp, OUTMAILBOX0); + if ((sema & 0x3) && (info & 0x8000)) { goto again; } } Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:42:55 2015 (r290785) @@ -4520,12 +4520,10 @@ static void isp_poll(struct cam_sim *sim) { ispsoftc_t *isp = cam_sim_softc(sim); - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { - isp_intr(isp, isr, sema, mbox); - } + if (ISP_READ_ISR(isp, &isr, &sema, &info)) + isp_intr(isp, isr, sema, info); } @@ -4544,11 +4542,9 @@ isp_watchdog(void *arg) * Hand crank the interrupt code just to be sure the command isn't stuck somewhere. */ if (handle != ISP_HANDLE_FREE) { - uint32_t isr; - uint16_t sema, mbox; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox) != 0) { - isp_intr(isp, isr, sema, mbox); - } + uint16_t isr, sema, info; + if (ISP_READ_ISR(isp, &isr, &sema, &info) != 0) + isp_intr(isp, isr, sema, info); ohandle = handle; handle = isp_find_handle(isp, xs); } @@ -6277,13 +6273,12 @@ isp_mbox_wait_complete(ispsoftc_t *isp, } else { for (olim = 0; olim < max; olim++) { for (ilim = 0; ilim < usecs; ilim += 100) { - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; if (isp->isp_osinfo.mboxcmd_done) { break; } - if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { - isp_intr(isp, isr, sema, mbox); + if (ISP_READ_ISR(isp, &isr, &sema, &info)) { + isp_intr(isp, isr, sema, info); if (isp->isp_osinfo.mboxcmd_done) { break; } @@ -6351,16 +6346,14 @@ void isp_platform_intr(void *arg) { ispsoftc_t *isp = arg; - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; ISP_LOCK(isp); isp->isp_intcnt++; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox) == 0) { + if (ISP_READ_ISR(isp, &isr, &sema, &info)) + isp_intr(isp, isr, sema, info); + else isp->isp_intbogus++; - } else { - isp_intr(isp, isr, sema, mbox); - } ISP_UNLOCK(isp); } Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:42:55 2015 (r290785) @@ -59,9 +59,9 @@ static uint32_t isp_pci_rd_reg_1080(isps static void isp_pci_wr_reg_1080(ispsoftc_t *, int, uint32_t); static uint32_t isp_pci_rd_reg_2400(ispsoftc_t *, int); static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t); -static int isp_pci_rd_isr(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2300(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2400(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_mbxdma(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -1112,7 +1112,7 @@ isp_pci_rd_debounced(ispsoftc_t *isp, in } static int -isp_pci_rd_isr(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbp) +isp_pci_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint16_t isr, sema; @@ -1136,21 +1136,20 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint32_t *isrp = isr; if ((*semap = sema) != 0) { if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, OUTMAILBOX0, mbp)) { + if (isp_pci_rd_debounced(isp, OUTMAILBOX0, info)) { return (0); } } else { - *mbp = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); } } return (1); } static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2300(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { - uint32_t hccr; - uint32_t r2hisr; + uint32_t hccr, r2hisr; if (!(BXR2(isp, IspVirt2Off(isp, BIU_ISR) & BIU2100_ISR_RISC_INT))) { *isrp = 0; @@ -1162,36 +1161,29 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin *isrp = 0; return (0); } - switch (r2hisr & BIU_R2HST_ISTAT_MASK) { + switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: case ISPR2HST_ASYNC_EVENT: - *isrp = r2hisr & 0xffff; - *mbox0p = (r2hisr >> 16); *semap = 1; - return (1); + break; case ISPR2HST_RIO_16: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_RIO16_1; + *info = ASYNC_RIO16_1; *semap = 1; return (1); case ISPR2HST_FPOST: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_CMD_CMPLT; + *info = ASYNC_CMD_CMPLT; *semap = 1; return (1); case ISPR2HST_FPOST_CTIO: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_CTIO_DONE; + *info = ASYNC_CTIO_DONE; *semap = 1; return (1); case ISPR2HST_RSPQ_UPDATE: - *isrp = r2hisr & 0xffff; - *mbox0p = 0; *semap = 0; - return (1); + break; default: hccr = ISP_READ(isp, HCCR); if (hccr & HCCR_PAUSE) { @@ -1203,41 +1195,43 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin } return (0); } + *info = (r2hisr >> 16); + return (1); } static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2400(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint32_t r2hisr; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU2400_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU2400_R2HST_INTR) == 0) { + if ((r2hisr & BIU_R2HST_INTR) == 0) { *isrp = 0; return (0); } - switch (r2hisr & BIU2400_R2HST_ISTAT_MASK) { - case ISP2400R2HST_ROM_MBX_OK: - case ISP2400R2HST_ROM_MBX_FAIL: - case ISP2400R2HST_MBX_OK: - case ISP2400R2HST_MBX_FAIL: - case ISP2400R2HST_ASYNC_EVENT: - *isrp = r2hisr & 0xffff; - *mbox0p = (r2hisr >> 16); + switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + case ISPR2HST_ROM_MBX_OK: + case ISPR2HST_ROM_MBX_FAIL: + case ISPR2HST_MBX_OK: + case ISPR2HST_MBX_FAIL: + case ISPR2HST_ASYNC_EVENT: *semap = 1; - return (1); - case ISP2400R2HST_RSPQ_UPDATE: - case ISP2400R2HST_ATIO_RSPQ_UPDATE: - case ISP2400R2HST_ATIO_RQST_UPDATE: - *isrp = r2hisr & 0xffff; - *mbox0p = 0; + break; + case ISPR2HST_RSPQ_UPDATE: + case ISPR2HST_RSPQ_UPDATE2: + case ISPR2HST_ATIO_UPDATE: + case ISPR2HST_ATIO_RSPQ_UPDATE: + case ISPR2HST_ATIO_UPDATE2: *semap = 0; - return (1); + break; default: ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); return (0); } + *info = (r2hisr >> 16); + return (1); } static uint32_t Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:42:55 2015 (r290785) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); -static int isp_sbus_rd_isr(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); +static int isp_sbus_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_sbus_mbxdma(ispsoftc_t *); static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -388,7 +388,7 @@ isp_sbus_detach(device_t dev) bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) static int -isp_sbus_rd_isr(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbp) +isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint16_t isr, sema; @@ -401,9 +401,8 @@ isp_sbus_rd_isr(ispsoftc_t *isp, uint32_ return (0); } *isrp = isr; - if ((*semap = sema) != 0) { - *mbp = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); - } + if ((*semap = sema) != 0) + *info = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); return (1); } Modified: stable/10/sys/dev/isp/ispreg.h ============================================================================== --- stable/10/sys/dev/isp/ispreg.h Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/ispreg.h Fri Nov 13 19:42:55 2015 (r290785) @@ -125,17 +125,20 @@ #define BIU_R2HST_INTR (1 << 15) /* RISC to Host Interrupt */ #define BIU_R2HST_PAUSED (1 << 8) /* RISC paused */ -#define BIU_R2HST_ISTAT_MASK 0x3f /* intr information && status */ +#define BIU_R2HST_ISTAT_MASK 0xff /* intr information && status */ #define ISPR2HST_ROM_MBX_OK 0x1 /* ROM mailbox cmd done ok */ #define ISPR2HST_ROM_MBX_FAIL 0x2 /* ROM mailbox cmd done fail */ #define ISPR2HST_MBX_OK 0x10 /* mailbox cmd done ok */ #define ISPR2HST_MBX_FAIL 0x11 /* mailbox cmd done fail */ #define ISPR2HST_ASYNC_EVENT 0x12 /* Async Event */ #define ISPR2HST_RSPQ_UPDATE 0x13 /* Response Queue Update */ -#define ISPR2HST_RQST_UPDATE 0x14 /* Resquest Queue Update */ +#define ISPR2HST_RSPQ_UPDATE2 0x14 /* Response Queue Update */ #define ISPR2HST_RIO_16 0x15 /* RIO 1-16 */ #define ISPR2HST_FPOST 0x16 /* Low 16 bits fast post */ #define ISPR2HST_FPOST_CTIO 0x17 /* Low 16 bits fast post ctio */ +#define ISPR2HST_ATIO_UPDATE 0x1C /* ATIO Queue Update */ +#define ISPR2HST_ATIO_RSPQ_UPDATE 0x1D /* ATIO & Request Update */ +#define ISPR2HST_ATIO_UPDATE2 0x1E /* ATIO Queue Update */ /* fifo command stuff- mostly for SPI */ #define DFIFO_COMMAND (BIU_BLOCK+0x60) /* RW : Command FIFO Port */ @@ -246,11 +249,6 @@ #define BIU2100_ISR_RXDMA_INT_PENDING 0x0002 /* Global interrupt pending */ #define BIU2100_ISR_TXDMA_INT_PENDING 0x0001 /* Global interrupt pending */ -#define INT_PENDING(isp, isr) \ - IS_FC(isp)? \ - (IS_24XX(isp)? (isr & BIU2400_ISR_RISC_INT) : (isr & BIU2100_ISR_RISC_INT)) :\ - (isr & BIU_ISR_RISC_INT) - #define INT_PENDING_MASK(isp) \ (IS_FC(isp)? (IS_24XX(isp)? BIU2400_ISR_RISC_INT : BIU2100_ISR_RISC_INT) : \ (BIU_ISR_RISC_INT)) @@ -398,19 +396,6 @@ /* BIU2400_ISR definitions */ #define BIU2400_ISR_RISC_INT 0x8 -#define BIU2400_R2HST_INTR BIU_R2HST_INTR -#define BIU2400_R2HST_PAUSED BIU_R2HST_PAUSED -#define BIU2400_R2HST_ISTAT_MASK 0x1f -/* interrupt status meanings */ -#define ISP2400R2HST_ROM_MBX_OK 0x1 /* ROM mailbox cmd done ok */ -#define ISP2400R2HST_ROM_MBX_FAIL 0x2 /* ROM mailbox cmd done fail */ -#define ISP2400R2HST_MBX_OK 0x10 /* mailbox cmd done ok */ -#define ISP2400R2HST_MBX_FAIL 0x11 /* mailbox cmd done fail */ -#define ISP2400R2HST_ASYNC_EVENT 0x12 /* Async Event */ -#define ISP2400R2HST_RSPQ_UPDATE 0x13 /* Response Queue Update */ -#define ISP2400R2HST_ATIO_RSPQ_UPDATE 0x1C /* ATIO Response Queue Update */ -#define ISP2400R2HST_ATIO_RQST_UPDATE 0x1D /* ATIO Request Queue Update */ - /* BIU2400_HCCR definitions */ #define HCCR_2400_CMD_NOP 0x00000000 Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:42:55 2015 (r290785) @@ -58,7 +58,7 @@ */ typedef struct ispsoftc ispsoftc_t; struct ispmdvec { - int (*dv_rd_isr) (ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); + int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); uint32_t (*dv_rd_reg) (ispsoftc_t *, int); void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); int (*dv_mbxdma) (ispsoftc_t *); @@ -86,8 +86,8 @@ struct ispmdvec { * Macros to access ISP registers through bus specific layers- * mostly wrappers to vector through the mdvec structure. */ -#define ISP_READ_ISR(isp, isrp, semap, mbox0p) \ - (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, mbox0p) +#define ISP_READ_ISR(isp, isrp, semap, info) \ + (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, info) #define ISP_READ(isp, reg) \ (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg)) @@ -829,7 +829,7 @@ int isp_reinit(ispsoftc_t *, int); * semaphore register and first mailbox register (if appropriate). This also * means that most spurious/bogus interrupts not for us can be filtered first. */ -void isp_intr(ispsoftc_t *, uint32_t, uint16_t, uint16_t); +void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); /* From owner-svn-src-all@freebsd.org Fri Nov 13 19:44:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93545A2E835; Fri, 13 Nov 2015 19:44:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 678311F2B; Fri, 13 Nov 2015 19:44:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJhxeg095574; Fri, 13 Nov 2015 19:43:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJhx87095571; Fri, 13 Nov 2015 19:43:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131943.tADJhx87095571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290786 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:44:00 -0000 Author: mav Date: Fri Nov 13 19:43:58 2015 New Revision: 290786 URL: https://svnweb.freebsd.org/changeset/base/290786 Log: MFC r289817: Disable full bus scan by CAM for FC adapters. FC port database code already notifies CAM about all devices. Additional full scan is just a waste of time, that by definition won't find anything that is not present in port database. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:43:58 2015 (r290786) @@ -54,7 +54,6 @@ int isp_fabric_hysteresis = 5; int isp_loop_down_limit = 60; /* default loop down limit */ int isp_quickboot_time = 7; /* don't wait more than N secs for loop up */ int isp_gone_device_time = 30; /* grace time before reporting device lost */ -int isp_autoconfig = 1; /* automatically attach/detach devices */ static const char prom3[] = "Chan %d [%u] PortID 0x%06x Departed because of %s"; static void isp_freeze_loopdown(ispsoftc_t *, int, char *); @@ -418,6 +417,9 @@ isp_freeze_loopdown(ispsoftc_t *isp, int if (fc->simqfrozen == 0) { isp_prt(isp, ISP_LOGDEBUG0, "%s: freeze simq (loopdown) chan %d", msg, chan); fc->simqfrozen = SIMQFRZ_LOOPDOWN; +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#endif xpt_freeze_simq(fc->sim, 1); } else { isp_prt(isp, ISP_LOGDEBUG0, "%s: mark frozen (loopdown) chan %d", msg, chan); @@ -436,6 +438,9 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, i if (wasfrozen && fc->simqfrozen == 0) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d releasing simq", __func__, chan); xpt_release_simq(fc->sim, 1); +#if __FreeBSD_version >= 1000039 + xpt_release_boot(); +#endif } } } @@ -4602,10 +4607,6 @@ isp_make_here(ispsoftc_t *isp, fcportdb_ union ccb *ccb; struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (isp_autoconfig == 0) { - return; - } - /* * Allocate a CCB, create a wildcard path for this target and schedule a rescan. */ @@ -4629,9 +4630,6 @@ isp_make_gone(ispsoftc_t *isp, fcportdb_ struct cam_path *tp; struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (isp_autoconfig == 0) { - return; - } if (xpt_create_path(&tp, NULL, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) == CAM_REQ_CMP) { xpt_async(AC_LOST_DEVICE, tp, NULL); xpt_free_path(tp); @@ -5516,6 +5514,9 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#if __FreeBSD_version >= 1000039 + cpi->hba_misc |= PIM_NOSCAN; +#endif /* * Because our loop ID can shift from time to time, Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:43:58 2015 (r290786) @@ -734,7 +734,6 @@ extern int isp_fabric_hysteresis; extern int isp_loop_down_limit; extern int isp_gone_device_time; extern int isp_quickboot_time; -extern int isp_autoconfig; /* * Platform private flags Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:43:58 2015 (r290786) @@ -489,9 +489,6 @@ isp_get_generic_options(device_t dev, is if (tval > 0 && tval < 127) { isp_nvports = tval; } - tval = 1; - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "autoconfig", &tval); - isp_autoconfig = tval; tval = 7; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "quickboot_time", &tval); isp_quickboot_time = tval; From owner-svn-src-all@freebsd.org Fri Nov 13 19:45:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB17A2E8B2; Fri, 13 Nov 2015 19:45:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4D0F1129; Fri, 13 Nov 2015 19:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJjGYw095694; Fri, 13 Nov 2015 19:45:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJjF4R095689; Fri, 13 Nov 2015 19:45:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131945.tADJjF4R095689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290787 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:45:17 -0000 Author: mav Date: Fri Nov 13 19:45:15 2015 New Revision: 290787 URL: https://svnweb.freebsd.org/changeset/base/290787 Log: MFC r289838: Improve INOTs handling for 24xx and above chips. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:45:15 2015 (r290787) @@ -2480,12 +2480,13 @@ isp_handle_platform_atio2(ispsoftc_t *is else { if ((isp_find_pdb_by_handle(isp, 0, nphdl, &lp) == 0 || lp->state == FC_PORTDB_STATE_ZOMBIE)) { - uint64_t iid = + uint64_t wwpn = (((uint64_t) aep->at_wwpn[0]) << 48) | (((uint64_t) aep->at_wwpn[1]) << 32) | (((uint64_t) aep->at_wwpn[2]) << 16) | (((uint64_t) aep->at_wwpn[3]) << 0); - isp_add_wwn_entry(isp, 0, iid, nphdl, PORT_ANY, 0); + isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, + nphdl, PORT_ANY, 0); isp_find_pdb_by_handle(isp, 0, nphdl, &lp); } atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); @@ -3195,8 +3196,9 @@ isp_handle_platform_notify_24xx(ispsoftc uint16_t prli_options = 0; uint32_t portid; fcportdb_t *lp; - uint8_t *ptr = NULL; - uint64_t wwn; + char *msg = NULL; + uint8_t *ptr = (uint8_t *)inot; + uint64_t wwpn = INI_NONE, wwnn = INI_NONE; nphdl = inot->in_nphdl; if (nphdl != NIL_HANDLE) { @@ -3208,7 +3210,7 @@ isp_handle_platform_notify_24xx(ispsoftc switch (inot->in_status) { case IN24XX_ELS_RCVD: { - char buf[16], *msg; + char buf[16]; int chan = ISP_GET_VPIDX(isp, inot->in_vpidx); /* @@ -3219,49 +3221,27 @@ isp_handle_platform_notify_24xx(ispsoftc switch (inot->in_status_subcode) { case LOGO: msg = "LOGO"; - if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { - ptr = (uint8_t *)inot; /* point to unswizzled entry! */ - wwn = (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF]) << 56) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+1]) << 48) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+2]) << 40) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+3]) << 32) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+4]) << 24) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+5]) << 16) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+6]) << 8) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+7])); - } else { - wwn = INI_ANY; - } - isp_del_wwn_entry(isp, chan, wwn, nphdl, portid); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); break; case PRLO: msg = "PRLO"; break; case PLOGI: + msg = "PLOGI"; + wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; case PRLI: - /* - * Treat PRLI the same as PLOGI and make a database entry for it. - */ - if (inot->in_status_subcode == PLOGI) { - msg = "PLOGI"; - } else { - prli_options = inot->in_prli_options; - msg = "PRLI"; - } - if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { - ptr = (uint8_t *)inot; /* point to unswizzled entry! */ - wwn = (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF]) << 56) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+1]) << 48) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+2]) << 40) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+3]) << 32) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+4]) << 24) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+5]) << 16) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+6]) << 8) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+7])); - } else { - wwn = INI_NONE; - } - isp_add_wwn_entry(isp, chan, wwn, nphdl, portid, prli_options); + msg = "PRLI"; + prli_options = inot->in_prli_options; + if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) + wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); break; case PDISC: msg = "PDISC"; @@ -3285,21 +3265,19 @@ isp_handle_platform_notify_24xx(ispsoftc } case IN24XX_PORT_LOGOUT: - ptr = "PORT LOGOUT"; + msg = "PORT LOGOUT"; if (isp_find_pdb_by_handle(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), nphdl, &lp)) { isp_del_wwn_entry(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), lp->port_wwn, nphdl, lp->portid); } /* FALLTHROUGH */ case IN24XX_PORT_CHANGED: - if (ptr == NULL) { - ptr = "PORT CHANGED"; - } + if (msg == NULL) + msg = "PORT CHANGED"; /* FALLTHROUGH */ - case IN24XX_LIP_RESET: - if (ptr == NULL) { - ptr = "LIP RESET"; - } - isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), ptr, inot->in_status_subcode, nphdl); + case IN24XX_LIP_RESET: + if (msg == NULL) + msg = "LIP RESET"; + isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), msg, inot->in_status_subcode, nphdl); /* * All subcodes here are irrelevant. What is relevant @@ -3315,21 +3293,18 @@ isp_handle_platform_notify_24xx(ispsoftc isp_handle_srr_notify(isp, inot); break; #else - if (ptr == NULL) { - ptr = "SRR RCVD"; - } + if (msg == NULL) + msg = "SRR RCVD"; /* FALLTHROUGH */ #endif case IN24XX_LINK_RESET: - if (ptr == NULL) { - ptr = "LINK RESET"; - } + if (msg == NULL) + msg = "LINK RESET"; case IN24XX_LINK_FAILED: - if (ptr == NULL) { - ptr = "LINK FAILED"; - } + if (msg == NULL) + msg = "LINK FAILED"; default: - isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), ptr); + isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), msg); isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); break; } @@ -5704,20 +5679,17 @@ isp_async(ispsoftc_t *isp, ispasync_t cm break; } case ISPASYNC_LIP: - if (msg == NULL) { + if (msg == NULL) msg = "LIP Received"; - } /* FALLTHROUGH */ case ISPASYNC_LOOP_RESET: - if (msg == NULL) { + if (msg == NULL) msg = "LOOP Reset"; - } /* FALLTHROUGH */ case ISPASYNC_LOOP_DOWN: { - if (msg == NULL) { + if (msg == NULL) msg = "LOOP Down"; - } va_start(ap, cmd); bus = va_arg(ap, int); va_end(ap); Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:45:15 2015 (r290787) @@ -2421,7 +2421,8 @@ isp_find_chan_by_did(ispsoftc_t *isp, ui * Add an initiator device to the port database */ void -isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint32_t s_id, uint16_t prli_params) +isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t wwpn, uint64_t wwnn, + uint16_t nphdl, uint32_t s_id, uint16_t prli_params) { char buf[64]; fcparam *fcp; @@ -2432,7 +2433,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c if (nphdl >= MAX_NPORT_HANDLE) { isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d WWPN 0x%016llx " "PortID 0x%06x handle 0x%x -- bad handle", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); return; } @@ -2441,7 +2442,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c * with new parameters. Some cases of update can be suspicious, * so log them verbosely and dump the whole port database. */ - if ((VALID_INI(ini) && isp_find_pdb_by_wwn(isp, chan, ini, &lp)) || + if ((VALID_INI(wwpn) && isp_find_pdb_by_wwn(isp, chan, wwpn, &lp)) || (s_id != PORT_NONE && isp_find_pdb_by_sid(isp, chan, s_id, &lp))) { change = 0; lp->new_portid = lp->portid; @@ -2465,24 +2466,42 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c lp->new_portid = s_id; change++; } - if (VALID_INI(ini) && lp->port_wwn != ini) { + if (VALID_INI(wwpn) && lp->port_wwn != wwpn) { if (!VALID_INI(lp->port_wwn)) { isp_prt(isp, ISP_LOGTINFO, "Chan %d PortID 0x%06x handle 0x%x " - "gets WWN 0x%016llxx", + "gets WWPN 0x%016llxx", chan, lp->portid, nphdl, - (unsigned long long) ini); - } else if (lp->port_wwn != ini) { + (unsigned long long) wwpn); + } else if (lp->port_wwn != wwpn) { isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d PortID 0x%06x handle 0x%x " - "changes WWN 0x%016llx to 0x%016llx", + "changes WWPN 0x%016llx to 0x%016llx", chan, lp->portid, nphdl, (unsigned long long) lp->port_wwn, - (unsigned long long) ini); + (unsigned long long) wwpn); if (isp->isp_dblev & (ISP_LOGTINFO|ISP_LOGWARN)) isp_dump_portdb(isp, chan); } - lp->port_wwn = ini; + lp->port_wwn = wwpn; + change++; + } + if (VALID_INI(wwnn) && lp->node_wwn != wwnn) { + if (!VALID_INI(lp->node_wwn)) { + isp_prt(isp, ISP_LOGTINFO, + "Chan %d PortID 0x%06x handle 0x%x " + "gets WWNN 0x%016llxx", + chan, lp->portid, nphdl, + (unsigned long long) wwnn); + } else if (lp->port_wwn != wwnn) { + isp_prt(isp, ISP_LOGTINFO, + "Chan %d PortID 0x%06x handle 0x%x " + "changes WWNN 0x%016llx to 0x%016llx", + chan, lp->portid, nphdl, + (unsigned long long) lp->node_wwn, + (unsigned long long) wwnn); + } + lp->node_wwn = wwnn; change++; } if (prli_params != 0 && lp->prli_word3 != prli_params) { @@ -2531,7 +2550,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x handle 0x%x " "-- no room in port database", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); if (isp->isp_dblev & (ISP_LOGTINFO|ISP_LOGWARN)) isp_dump_portdb(isp, chan); return; @@ -2542,14 +2561,15 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c ISP_MEMZERO(lp, sizeof (fcportdb_t)); lp->handle = nphdl; lp->portid = s_id; - lp->port_wwn = ini; + lp->port_wwn = wwpn; + lp->node_wwn = wwnn; lp->prli_word3 = (prli_params != 0) ? prli_params : PRLI_WD3_INITIATOR_FUNCTION; lp->state = FC_PORTDB_STATE_VALID; isp_gen_role_str(buf, sizeof (buf), lp->prli_word3); isp_prt(isp, ISP_LOGTINFO, "Chan %d WWPN 0x%016llx " "PortID 0x%06x handle 0x%x vtgt %d %s added", chan, - (unsigned long long) ini, s_id, nphdl, i, buf); + (unsigned long long) wwpn, s_id, nphdl, i, buf); /* Notify above levels about new port arrival. */ isp_async(isp, ISPASYNC_DEV_ARRIVED, chan, lp); @@ -2559,21 +2579,21 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c * Remove a target device to the port database */ void -isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint32_t s_id) +isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t wwpn, uint16_t nphdl, uint32_t s_id) { fcparam *fcp; fcportdb_t *lp; if (nphdl >= MAX_NPORT_HANDLE) { isp_prt(isp, ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x bad handle 0x%x", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); return; } fcp = FCPARAM(isp, chan); if (isp_find_pdb_by_handle(isp, chan, nphdl, &lp) == 0) { isp_prt(isp, ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x handle 0x%x cannot be found to be deleted", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); isp_dump_portdb(isp, chan); return; } @@ -3468,7 +3488,7 @@ isp_put_notify_24xx(ispsoftc_t *isp, in_ ISP_IOXPUT_16(isp, src->in_srr_rxid, &dst->in_srr_rxid); ISP_IOXPUT_16(isp, src->in_status, &dst->in_status); ISP_IOXPUT_8(isp, src->in_status_subcode, &dst->in_status_subcode); - ISP_IOXPUT_16(isp, src->in_reserved2, &dst->in_reserved2); + ISP_IOXPUT_8(isp, src->in_fwhandle, &dst->in_fwhandle); ISP_IOXPUT_32(isp, src->in_rxid, &dst->in_rxid); ISP_IOXPUT_16(isp, src->in_srr_reloff_hi, &dst->in_srr_reloff_hi); ISP_IOXPUT_16(isp, src->in_srr_reloff_lo, &dst->in_srr_reloff_lo); @@ -3531,7 +3551,7 @@ isp_get_notify_24xx(ispsoftc_t *isp, in_ ISP_IOXGET_16(isp, &src->in_srr_rxid, dst->in_srr_rxid); ISP_IOXGET_16(isp, &src->in_status, dst->in_status); ISP_IOXGET_8(isp, &src->in_status_subcode, dst->in_status_subcode); - ISP_IOXGET_16(isp, &src->in_reserved2, dst->in_reserved2); + ISP_IOXGET_8(isp, &src->in_fwhandle, dst->in_fwhandle); ISP_IOXGET_32(isp, &src->in_rxid, dst->in_rxid); ISP_IOXGET_16(isp, &src->in_srr_reloff_hi, dst->in_srr_reloff_hi); ISP_IOXGET_16(isp, &src->in_srr_reloff_lo, dst->in_srr_reloff_lo); @@ -3650,7 +3670,7 @@ isp_put_notify_24xx_ack(ispsoftc_t *isp, ISP_IOXPUT_16(isp, src->na_srr_rxid, &dst->na_srr_rxid); ISP_IOXPUT_16(isp, src->na_status, &dst->na_status); ISP_IOXPUT_8(isp, src->na_status_subcode, &dst->na_status_subcode); - ISP_IOXPUT_16(isp, src->na_reserved2, &dst->na_reserved2); + ISP_IOXPUT_8(isp, src->na_fwhandle, &dst->na_fwhandle); ISP_IOXPUT_32(isp, src->na_rxid, &dst->na_rxid); ISP_IOXPUT_16(isp, src->na_srr_reloff_hi, &dst->na_srr_reloff_hi); ISP_IOXPUT_16(isp, src->na_srr_reloff_lo, &dst->na_srr_reloff_lo); @@ -3721,7 +3741,7 @@ isp_get_notify_ack_24xx(ispsoftc_t *isp, ISP_IOXGET_16(isp, &src->na_srr_rxid, dst->na_srr_rxid); ISP_IOXGET_16(isp, &src->na_status, dst->na_status); ISP_IOXGET_8(isp, &src->na_status_subcode, dst->na_status_subcode); - ISP_IOXGET_16(isp, &src->na_reserved2, dst->na_reserved2); + ISP_IOXGET_8(isp, &src->na_fwhandle, dst->na_fwhandle); ISP_IOXGET_32(isp, &src->na_rxid, dst->na_rxid); ISP_IOXGET_16(isp, &src->na_srr_reloff_hi, dst->na_srr_reloff_hi); ISP_IOXGET_16(isp, &src->na_srr_reloff_lo, dst->na_srr_reloff_lo); Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_library.h Fri Nov 13 19:45:15 2015 (r290787) @@ -171,7 +171,7 @@ int isp_find_pdb_by_wwn(ispsoftc_t *, in int isp_find_pdb_by_handle(ispsoftc_t *, int, uint32_t, fcportdb_t **); int isp_find_pdb_by_sid(ispsoftc_t *, int, uint32_t, fcportdb_t **); void isp_find_chan_by_did(ispsoftc_t *, uint32_t, uint16_t *); -void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t, uint16_t); +void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint64_t, uint16_t, uint32_t, uint16_t); void isp_del_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t); void isp_del_all_wwn_entries(ispsoftc_t *, int); void isp_del_wwn_entries(ispsoftc_t *, isp_notify_t *); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:45:15 2015 (r290787) @@ -1085,6 +1085,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar na->na_flags = in->in_flags; na->na_status = in->in_status; na->na_status_subcode = in->in_status_subcode; + na->na_fwhandle = in->in_fwhandle; na->na_rxid = in->in_rxid; na->na_oxid = in->in_oxid; na->na_vpidx = in->in_vpidx; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:45:15 2015 (r290787) @@ -1812,7 +1812,7 @@ typedef struct { uint16_t in_srr_rxid; uint16_t in_status; uint8_t in_status_subcode; - uint8_t in_reserved2; + uint8_t in_fwhandle; uint32_t in_rxid; uint16_t in_srr_reloff_lo; uint16_t in_srr_reloff_hi; @@ -1845,6 +1845,8 @@ typedef struct { #define IN24XX_FLAG_PUREX_IOCB 0x1 #define IN24XX_FLAG_GLOBAL_LOGOUT 0x2 #define IN24XX_FLAG_NPHDL_VALID 0x4 +#define IN24XX_FLAG_N2N_PRLI 0x8 +#define IN24XX_FLAG_PN_NN_VALID 0x10 #define IN24XX_LIP_RESET 0x0E #define IN24XX_LINK_RESET 0x0F @@ -1862,6 +1864,8 @@ typedef struct { * the WWNN/WWPN if the ELS is PLOGI, PDISC or ADISC. The WWN is in * Big Endian format. */ +#define IN24XX_PRLI_WWNN_OFF 0x18 +#define IN24XX_PRLI_WWPN_OFF 0x28 #define IN24XX_PLOGI_WWNN_OFF 0x20 #define IN24XX_PLOGI_WWPN_OFF 0x28 @@ -1965,7 +1969,7 @@ typedef struct { uint16_t na_srr_rxid; uint16_t na_status; uint8_t na_status_subcode; - uint8_t na_reserved2; + uint8_t na_fwhandle; uint32_t na_rxid; uint16_t na_srr_reloff_lo; uint16_t na_srr_reloff_hi; From owner-svn-src-all@freebsd.org Fri Nov 13 19:46:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEB20A2E95E; Fri, 13 Nov 2015 19:46:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6F912E1; Fri, 13 Nov 2015 19:46:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJkPDK095786; Fri, 13 Nov 2015 19:46:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJkP50095784; Fri, 13 Nov 2015 19:46:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131946.tADJkP50095784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290788 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:46:26 -0000 Author: mav Date: Fri Nov 13 19:46:25 2015 New Revision: 290788 URL: https://svnweb.freebsd.org/changeset/base/290788 Log: MFC r289855: Minor additions to Status Type 0 IOCB. Modified: stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:45:15 2015 (r290787) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:46:25 2015 (r290788) @@ -1158,7 +1158,7 @@ isp_get_24xx_response(ispsoftc_t *isp, i ISP_IOXGET_32(isp, &src->req_resid, dst->req_resid); ISP_IOXGET_16(isp, &src->req_reserved0, dst->req_reserved0); ISP_IOXGET_16(isp, &src->req_state_flags, dst->req_state_flags); - ISP_IOXGET_16(isp, &src->req_reserved1, dst->req_reserved1); + ISP_IOXGET_16(isp, &src->req_retry_delay, dst->req_retry_delay); ISP_IOXGET_16(isp, &src->req_scsi_status, dst->req_scsi_status); ISP_IOXGET_32(isp, &src->req_fcp_residual, dst->req_fcp_residual); ISP_IOXGET_32(isp, &src->req_sense_len, dst->req_sense_len); Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:45:15 2015 (r290787) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:46:25 2015 (r290788) @@ -632,7 +632,7 @@ typedef struct { uint32_t req_resid; uint16_t req_reserved0; uint16_t req_state_flags; - uint16_t req_reserved1; + uint16_t req_retry_delay; /* aka Status Qualifier */ uint16_t req_scsi_status; uint32_t req_fcp_residual; uint32_t req_sense_len; @@ -644,11 +644,12 @@ typedef struct { * For Qlogic 2X00, the high order byte of SCSI status has * additional meaning. */ -#define RQCS_RU 0x800 /* Residual Under */ -#define RQCS_RO 0x400 /* Residual Over */ +#define RQCS_CR 0x1000 /* Confirmation Request */ +#define RQCS_RU 0x0800 /* Residual Under */ +#define RQCS_RO 0x0400 /* Residual Over */ #define RQCS_RESID (RQCS_RU|RQCS_RO) -#define RQCS_SV 0x200 /* Sense Length Valid */ -#define RQCS_RV 0x100 /* FCP Response Length Valid */ +#define RQCS_SV 0x0200 /* Sense Length Valid */ +#define RQCS_RV 0x0100 /* FCP Response Length Valid */ /* * CT Passthru IOCB From owner-svn-src-all@freebsd.org Fri Nov 13 19:47:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 111ACA2E9AE; Fri, 13 Nov 2015 19:47:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B539F147F; Fri, 13 Nov 2015 19:47:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJlJ0K095869; Fri, 13 Nov 2015 19:47:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJlJev095868; Fri, 13 Nov 2015 19:47:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131947.tADJlJev095868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290789 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:47:21 -0000 Author: mav Date: Fri Nov 13 19:47:19 2015 New Revision: 290789 URL: https://svnweb.freebsd.org/changeset/base/290789 Log: MFC r289875: Decode few more response info codes. Though CAM still does not send any requests that would require those. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:46:25 2015 (r290788) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:47:19 2015 (r290789) @@ -5443,24 +5443,32 @@ again: if (resp && rlen >= 4 && resp[FCP_RSPNS_CODE_OFFSET] != 0) { const char *ptr; char lb[64]; - const char *rnames[6] = { - "Task Management Function Done", - "Data Length Differs From Burst Length", - "Invalid FCP Cmnd", - "FCP DATA RO mismatch with FCP DATA_XFR_RDY RO", - "Task Management Function Rejected", - "Task Management Function Failed", + const char *rnames[10] = { + "Task Management function complete", + "FCP_DATA length different than FCP_BURST_LEN", + "FCP_CMND fields invalid", + "FCP_DATA parameter mismatch with FCP_DATA_RO", + "Task Management function rejected", + "Task Management function failed", + NULL, + NULL, + "Task Management function succeeded", + "Task Management function incorrect logical unit number", }; - if (resp[FCP_RSPNS_CODE_OFFSET] > 5) { - ISP_SNPRINTF(lb, sizeof lb, "Unknown FCP Response Code 0x%x", resp[FCP_RSPNS_CODE_OFFSET]); + uint8_t code = resp[FCP_RSPNS_CODE_OFFSET]; + if (code >= 10 || rnames[code] == NULL) { + ISP_SNPRINTF(lb, sizeof(lb), + "Unknown FCP Response Code 0x%x", + code); ptr = lb; } else { - ptr = rnames[resp[FCP_RSPNS_CODE_OFFSET]]; + ptr = rnames[code]; } - isp_xs_prt(isp, xs, ISP_LOGWARN, "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", rlen, ptr, XS_CDBP(xs)[0] & 0xff); - if (resp[FCP_RSPNS_CODE_OFFSET] != 0) { + isp_xs_prt(isp, xs, ISP_LOGWARN, + "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", + rlen, ptr, XS_CDBP(xs)[0] & 0xff); + if (code != 0 && code != 8) XS_SETERR(xs, HBA_BOTCH); - } } if (IS_24XX(isp)) { isp_parse_status_24xx(isp, (isp24xx_statusreq_t *)sp, xs, &resid); From owner-svn-src-all@freebsd.org Fri Nov 13 19:48:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 129DEA2EA2B; Fri, 13 Nov 2015 19:48:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C671B1630; Fri, 13 Nov 2015 19:48:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJmfe0095967; Fri, 13 Nov 2015 19:48:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJmfx5095965; Fri, 13 Nov 2015 19:48:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131948.tADJmfx5095965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290790 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:48:43 -0000 Author: mav Date: Fri Nov 13 19:48:41 2015 New Revision: 290790 URL: https://svnweb.freebsd.org/changeset/base/290790 Log: MFC r289877: Remove ISP_INTERNAL_TARGET code. We have CTL now, which is real and much more functional then this joke. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:47:19 2015 (r290789) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:48:41 2015 (r290790) @@ -68,10 +68,6 @@ static timeout_t isp_ldt; static task_fn_t isp_ldt_task; static void isp_kthread(void *); static void isp_action(struct cam_sim *, union ccb *); -#ifdef ISP_INTERNAL_TARGET -static void isp_target_thread_pi(void *); -static void isp_target_thread_fc(void *); -#endif static int isp_timer_count; static void isp_timer(void *); @@ -159,14 +155,6 @@ isp_attach_chan(ispsoftc_t *isp, struct struct isp_spi *spi = ISP_SPI_PC(isp, chan); spi->sim = sim; spi->path = path; -#ifdef ISP_INTERNAL_TARGET - ISP_SET_PC(isp, chan, proc_active, 1); - if (THREAD_CREATE(isp_target_thread_pi, spi, &spi->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - ISP_SET_PC(isp, chan, proc_active, 0); - isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); - } - ISP_SPI_PC(isp, chan)->num_threads += 1; -#endif } else { fcparam *fcp = FCPARAM(isp, chan); struct isp_fc *fc = ISP_FC_PC(isp, chan); @@ -205,14 +193,6 @@ isp_attach_chan(ispsoftc_t *isp, struct return (ENOMEM); } fc->num_threads += 1; -#ifdef ISP_INTERNAL_TARGET - ISP_SET_PC(isp, chan, proc_active, 1); - if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - ISP_SET_PC(isp, chan, proc_active, 0); - isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); - } - fc->num_threads += 1; -#endif if (chan > 0) { snprintf(name, sizeof(name), "chan%d", chan); tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), @@ -258,18 +238,6 @@ isp_attach_chan(ispsoftc_t *isp, struct } static void -isp_detach_internal_target(ispsoftc_t *isp, int chan) -{ -#ifdef ISP_INTERNAL_TARGET - void *wchan; - - ISP_GET_PC(isp, chan, target_proc, wchan); - ISP_SET_PC(isp, chan, proc_active, 0); - wakeup(wchan); -#endif -} - -static void isp_detach_chan(ispsoftc_t *isp, int chan) { struct cam_sim *sim; @@ -293,7 +261,6 @@ isp_detach_chan(ispsoftc_t *isp, int cha /* Wait for the channel's spawned threads to exit. */ wakeup(isp->isp_osinfo.pc.ptr); - isp_detach_internal_target(isp, chan); while (*num_threads != 0) mtx_sleep(isp, &isp->isp_osinfo.lock, PRIBIO, "isp_reap", 100); } @@ -3598,859 +3565,6 @@ isp_target_mark_aborted_early(ispsoftc_t } } } - - -#ifdef ISP_INTERNAL_TARGET -//#define ISP_SEPARATE_STATUS 1 -#define ISP_MULTI_CCBS 1 -#if defined(ISP_MULTI_CCBS) && !defined(ISP_SEPARATE_STATUS) -#define ISP_SEPARATE_STATUS 1 -#endif - -typedef struct periph_private_data_t { - union ccb *ccb; /* original ATIO or Immediate Notify */ - unsigned long offset; /* current offset */ - int sequence; /* current CTIO sequence */ - int ctio_cnt; /* current # of ctio's outstanding */ - int - status_sent : 1, - on_queue : 1; /* on restart queue */ -} ppd_t; -/* - * Each ATIO we allocate will have periph private data associated with it - * that maintains per-command state. This private to each ATIO. - */ -#define ATIO_PPD(ccb) ((ppd_t *)(((struct ccb_hdr *)ccb)->ppriv_ptr0)) -/* - * Each CTIO we send downstream will get a pointer to the ATIO itself - * so that on completion we can retrieve that pointer. - */ -#define ccb_atio ppriv_ptr1 -#define ccb_inot ppriv_ptr1 - -/* - * Each CTIO we send downstream will contain a sequence number - */ -#define CTIO_SEQ(ccb) ccb->ccb_h.ppriv_field0 - -#define MAX_ISP_TARG_TRANSFER (2 << 20) -#define NISP_TARG_CMDS 64 -#define NISP_TARG_NOTIFIES 64 -#define DISK_SHIFT 9 -#define JUNK_SIZE 256 -#define MULTI_CCB_DATA_LIM 8192 -//#define MULTI_CCB_DATA_CNT 64 -#define MULTI_CCB_DATA_CNT 8 - -extern u_int vm_kmem_size; -static int ca; -static uint32_t disk_size; -static uint8_t *disk_data = NULL; -static uint8_t *junk_data; -static MALLOC_DEFINE(M_ISPTARG, "ISPTARG", "ISP TARGET data"); -struct isptarg_softc { - /* CCBs (CTIOs, ATIOs, INOTs) pending on the controller */ - struct isp_ccbq work_queue; - struct isp_ccbq rework_queue; - struct isp_ccbq running_queue; - struct isp_ccbq inot_queue; - struct cam_periph *periph; - struct cam_path *path; - ispsoftc_t *isp; -}; -static periph_ctor_t isptargctor; -static periph_dtor_t isptargdtor; -static periph_start_t isptargstart; -static periph_init_t isptarginit; -static void isptarg_done(struct cam_periph *, union ccb *); -static void isptargasync(void *, u_int32_t, struct cam_path *, void *); - - -static int isptarg_rwparm(uint8_t *, uint8_t *, uint64_t, uint32_t, uint8_t **, uint32_t *, int *); - -static struct periph_driver isptargdriver = -{ - isptarginit, "isptarg", TAILQ_HEAD_INITIALIZER(isptargdriver.units), 0 -}; - -static void -isptarginit(void) -{ -} - -static void -isptargnotify(ispsoftc_t *isp, union ccb *iccb, struct ccb_immediate_notify *inot) -{ - struct ccb_notify_acknowledge *ack = &iccb->cna2; - - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, inot->ccb_h.path, "%s: [0x%x] immediate notify for 0x%x from 0x%x status 0x%x arg 0x%x\n", __func__, - inot->tag_id, inot->initiator_id, inot->seq_id, inot->ccb_h.status, inot->arg); - ack->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; - ack->ccb_h.flags = 0; - ack->ccb_h.retry_count = 0; - ack->ccb_h.cbfcnp = isptarg_done; - ack->ccb_h.timeout = 0; - ack->ccb_h.ccb_inot = inot; - ack->tag_id = inot->tag_id; - ack->seq_id = inot->seq_id; - ack->initiator_id = inot->initiator_id; - xpt_action(iccb); -} - -static void -isptargstart(struct cam_periph *periph, union ccb *iccb) -{ - const uint8_t niliqd[SHORT_INQUIRY_LENGTH] = { - 0x7f, 0x0, 0x5, 0x2, 32, 0, 0, 0x32, - 'F', 'R', 'E', 'E', 'B', 'S', 'D', ' ', - 'S', 'C', 'S', 'I', ' ', 'N', 'U', 'L', - 'L', ' ', 'D', 'E', 'V', 'I', 'C', 'E', - '0', '0', '0', '1' - }; - const uint8_t iqd[SHORT_INQUIRY_LENGTH] = { - 0, 0x0, 0x5, 0x2, 32, 0, 0, 0x32, - 'F', 'R', 'E', 'E', 'B', 'S', 'D', ' ', - 'S', 'C', 'S', 'I', ' ', 'M', 'E', 'M', - 'O', 'R', 'Y', ' ', 'D', 'I', 'S', 'K', - '0', '0', '0', '1' - }; - int r, i, more = 0, last, is_data_cmd = 0, is_write; - char *queue; - struct isptarg_softc *softc = periph->softc; - struct ccb_scsiio *csio; - lun_id_t return_lun; - struct ccb_accept_tio *atio; - uint8_t *cdb, *ptr, status; - uint8_t *data_ptr; - uint32_t data_len, flags; - struct ccb_hdr *ccbh; - - mtx_assert(periph->sim->mtx, MA_OWNED); - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, iccb->ccb_h.path, "%s: function code 0x%x INOTQ=%c WORKQ=%c REWORKQ=%c\n", __func__, iccb->ccb_h.func_code, - TAILQ_FIRST(&softc->inot_queue)? 'y' : 'n', TAILQ_FIRST(&softc->work_queue)? 'y' : 'n', TAILQ_FIRST(&softc->rework_queue)? 'y' : 'n'); - /* - * Check for immediate notifies first - */ - ccbh = TAILQ_FIRST(&softc->inot_queue); - if (ccbh) { - TAILQ_REMOVE(&softc->inot_queue, ccbh, periph_links.tqe); - if (TAILQ_FIRST(&softc->inot_queue) || TAILQ_FIRST(&softc->work_queue) || TAILQ_FIRST(&softc->rework_queue)) { - xpt_schedule(periph, 1); - } - isptargnotify(softc->isp, iccb, (struct ccb_immediate_notify *)ccbh); - return; - } - - /* - * Check the rework (continuation) work queue first. - */ - ccbh = TAILQ_FIRST(&softc->rework_queue); - if (ccbh) { - atio = (struct ccb_accept_tio *)ccbh; - TAILQ_REMOVE(&softc->rework_queue, ccbh, periph_links.tqe); - more = TAILQ_FIRST(&softc->work_queue) || TAILQ_FIRST(&softc->rework_queue); - queue = "rework"; - } else { - ccbh = TAILQ_FIRST(&softc->work_queue); - if (ccbh == NULL) { - xpt_release_ccb(iccb); - return; - } - atio = (struct ccb_accept_tio *)ccbh; - TAILQ_REMOVE(&softc->work_queue, ccbh, periph_links.tqe); - more = TAILQ_FIRST(&softc->work_queue) != NULL; - queue = "work"; - } - ATIO_PPD(atio)->on_queue = 0; - - if (atio->tag_id == 0xffffffff || atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { - panic("BAD ATIO"); - } - - data_len = is_write = 0; - data_ptr = NULL; - csio = &iccb->csio; - status = SCSI_STATUS_OK; - flags = CAM_SEND_STATUS; - memset(&atio->sense_data, 0, sizeof (atio->sense_data)); - cdb = atio->cdb_io.cdb_bytes; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, ccbh->path, "%s: [0x%x] processing ATIO from %s queue initiator 0x%x CDB=0x%x data_offset=%u\n", __func__, atio->tag_id, - queue, atio->init_id, cdb[0], ATIO_PPD(atio)->offset); - - return_lun = XS_LUN(atio); - if (return_lun != 0) { - xpt_print(atio->ccb_h.path, "[0x%x] Non-Zero Lun %d: cdb0=0x%x\n", atio->tag_id, return_lun, cdb[0]); - if (cdb[0] != INQUIRY && cdb[0] != REPORT_LUNS && cdb[0] != REQUEST_SENSE) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x25; /* LOGICAL UNIT NOT SUPPORTED */ - atio->sense_len = SSD_MIN_SIZE; - } - return_lun = CAM_LUN_WILDCARD; - } - - switch (cdb[0]) { - case REQUEST_SENSE: - flags |= CAM_DIR_IN; - data_len = sizeof (atio->sense_data); - junk_data[0] = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR|SSD_KEY_NO_SENSE; - memset(junk_data+1, 0, data_len-1); - if (data_len > cdb[4]) { - data_len = cdb[4]; - } - if (data_len) { - data_ptr = junk_data; - } - break; - case WRITE_6: - case WRITE_10: - case WRITE_12: - case WRITE_16: - is_write = 1; - /* FALLTHROUGH */ - case READ_6: - case READ_10: - case READ_12: - case READ_16: - is_data_cmd = 1; - r = isptarg_rwparm(cdb, disk_data, disk_size, ATIO_PPD(atio)->offset, &data_ptr, &data_len, &last); - if (r != 0) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - if (r == -1) { - SDFIXED(atio->sense_data)->add_sense_code = 0x21; /* LOGICAL BLOCK ADDRESS OUT OF RANGE */ - } else { - SDFIXED(atio->sense_data)->add_sense_code = 0x20; /* INVALID COMMAND OPERATION CODE */ - } - atio->sense_len = SSD_MIN_SIZE; - } else { -#ifdef ISP_SEPARATE_STATUS - if (last && data_len) { - last = 0; - } -#endif - if (last == 0) { - flags &= ~CAM_SEND_STATUS; - } - if (data_len) { - ATIO_PPD(atio)->offset += data_len; - if (is_write) - flags |= CAM_DIR_OUT; - else - flags |= CAM_DIR_IN; - } else { - flags |= CAM_DIR_NONE; - } - } - break; - case INQUIRY: - flags |= CAM_DIR_IN; - if (cdb[1] || cdb[2] || cdb[3]) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_UNIT_ATTENTION; - SDFIXED(atio->sense_data)->add_sense_code = 0x24; /* INVALID FIELD IN CDB */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - data_len = sizeof (iqd); - if (data_len > cdb[4]) { - data_len = cdb[4]; - } - if (data_len) { - if (XS_LUN(iccb) != 0) { - memcpy(junk_data, niliqd, sizeof (iqd)); - } else { - memcpy(junk_data, iqd, sizeof (iqd)); - } - data_ptr = junk_data; - } - break; - case TEST_UNIT_READY: - flags |= CAM_DIR_NONE; - if (ca) { - ca = 0; - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_UNIT_ATTENTION; - SDFIXED(atio->sense_data)->add_sense_code = 0x29; /* POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */ - atio->sense_len = SSD_MIN_SIZE; - } - break; - case SYNCHRONIZE_CACHE: - case START_STOP: - case RESERVE: - case RELEASE: - case VERIFY_10: - flags |= CAM_DIR_NONE; - break; - - case READ_CAPACITY: - flags |= CAM_DIR_IN; - if (cdb[2] || cdb[3] || cdb[4] || cdb[5]) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x24; /* INVALID FIELD IN CDB */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - if (cdb[8] & 0x1) { /* PMI */ - junk_data[0] = 0xff; - junk_data[1] = 0xff; - junk_data[2] = 0xff; - junk_data[3] = 0xff; - } else { - uint64_t last_blk = (disk_size >> DISK_SHIFT) - 1; - if (last_blk < 0xffffffffULL) { - junk_data[0] = (last_blk >> 24) & 0xff; - junk_data[1] = (last_blk >> 16) & 0xff; - junk_data[2] = (last_blk >> 8) & 0xff; - junk_data[3] = (last_blk) & 0xff; - } else { - junk_data[0] = 0xff; - junk_data[1] = 0xff; - junk_data[2] = 0xff; - junk_data[3] = 0xff; - } - } - junk_data[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; - junk_data[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; - junk_data[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; - junk_data[7] = ((1 << DISK_SHIFT)) & 0xff; - data_ptr = junk_data; - data_len = 8; - break; - case REPORT_LUNS: - flags |= CAM_DIR_IN; - memset(junk_data, 0, JUNK_SIZE); - junk_data[0] = (1 << 3) >> 24; - junk_data[1] = (1 << 3) >> 16; - junk_data[2] = (1 << 3) >> 8; - junk_data[3] = (1 << 3); - ptr = NULL; - for (i = 0; i < 1; i++) { - ptr = &junk_data[8 + (i << 3)]; - if (i >= 256) { - ptr[0] = 0x40 | ((i >> 8) & 0x3f); - } - ptr[1] = i; - } - data_ptr = junk_data; - data_len = (ptr + 8) - junk_data; - break; - - default: - flags |= CAM_DIR_NONE; - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x20; /* INVALID COMMAND OPERATION CODE */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - - /* - * If we are done with the transaction, tell the - * controller to send status and perform a CMD_CMPLT. - * If we have associated sense data, see if we can - * send that too. - */ - if (status == SCSI_STATUS_CHECK_COND) { - flags |= CAM_SEND_SENSE; - csio->sense_len = atio->sense_len; - csio->sense_data = atio->sense_data; - flags &= ~CAM_DIR_MASK; - data_len = 0; - data_ptr = NULL; - } - cam_fill_ctio(csio, 0, isptarg_done, flags, MSG_SIMPLE_Q_TAG, atio->tag_id, atio->init_id, status, data_ptr, data_len, 30 * hz); - iccb->ccb_h.target_id = atio->ccb_h.target_id; - iccb->ccb_h.target_lun = return_lun; - iccb->ccb_h.ccb_atio = atio; - CTIO_SEQ(iccb) = ATIO_PPD(atio)->sequence++; - ATIO_PPD(atio)->ctio_cnt++; - if (flags & CAM_SEND_STATUS) { - KASSERT((ATIO_PPD(atio)->status_sent == 0), ("we have already sent status for 0x%x in %s", atio->tag_id, __func__)); - ATIO_PPD(atio)->status_sent = 1; - } - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, atio->ccb_h.path, "%s: sending downstream for 0x%x sequence %u len %u flags %x\n", __func__, atio->tag_id, CTIO_SEQ(iccb), data_len, flags); - xpt_action(iccb); - - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, 0, 0, 0, 0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } -#ifdef ISP_MULTI_CCBS - if (is_data_cmd && ATIO_PPD(atio)->status_sent == 0 && ATIO_PPD(atio)->ctio_cnt < MULTI_CCB_DATA_CNT && ATIO_PPD(atio)->on_queue == 0) { - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, atio->ccb_h.path, "%s: more still to do for 0x%x\n", __func__, atio->tag_id); - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - more = 1; - } -#endif - if (more) { - xpt_schedule(periph, 1); - } -} - -static cam_status -isptargctor(struct cam_periph *periph, void *arg) -{ - struct isptarg_softc *softc; - - softc = (struct isptarg_softc *)arg; - periph->softc = softc; - softc->periph = periph; - softc->path = periph->path; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, periph->path, "%s called\n", __func__); - return (CAM_REQ_CMP); -} - -static void -isptargdtor(struct cam_periph *periph) -{ - struct isptarg_softc *softc; - softc = (struct isptarg_softc *)periph->softc; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, periph->path, "%s called\n", __func__); - softc->periph = NULL; - softc->path = NULL; - periph->softc = NULL; -} - -static void -isptarg_done(struct cam_periph *periph, union ccb *ccb) -{ - struct isptarg_softc *softc; - ispsoftc_t *isp; - uint32_t newoff; - struct ccb_accept_tio *atio; - struct ccb_immediate_notify *inot; - cam_status status; - - softc = (struct isptarg_softc *)periph->softc; - isp = softc->isp; - status = ccb->ccb_h.status & CAM_STATUS_MASK; - - switch (ccb->ccb_h.func_code) { - case XPT_ACCEPT_TARGET_IO: - atio = (struct ccb_accept_tio *) ccb; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] ATIO seen in %s\n", atio->tag_id, __func__); - memset(ATIO_PPD(atio), 0, sizeof (ppd_t)); - TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - xpt_schedule(periph, 1); - break; - case XPT_IMMEDIATE_NOTIFY: - inot = (struct ccb_immediate_notify *) ccb; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] INOT for 0x%x seen in %s\n", inot->tag_id, inot->seq_id, __func__); - TAILQ_INSERT_TAIL(&softc->inot_queue, &ccb->ccb_h, periph_links.tqe); - xpt_schedule(periph, 1); - break; - case XPT_CONT_TARGET_IO: - atio = ccb->ccb_h.ccb_atio; - KASSERT((ATIO_PPD(atio)->ctio_cnt != 0), ("ctio zero when finishing a CTIO")); - ATIO_PPD(atio)->ctio_cnt--; - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - switch (ccb->ccb_h.status & CAM_STATUS_MASK) { - case CAM_MESSAGE_RECV: - newoff = (ccb->csio.msg_ptr[3] << 24) | (ccb->csio.msg_ptr[4] << 16) | (ccb->csio.msg_ptr[5] << 8) | (ccb->csio.msg_ptr[6]); - ISP_PATH_PRT(isp, ISP_LOGWARN, ccb->ccb_h.path, "[0x%x] got message to return to reset offset to 0x%x at sequence %u\n", atio->tag_id, newoff, CTIO_SEQ(ccb)); - ATIO_PPD(atio)->offset = newoff; - ATIO_PPD(atio)->status_sent = 0; - if (ATIO_PPD(atio)->on_queue == 0) { - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - } - xpt_schedule(periph, 1); - break; - default: - cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL); - xpt_action((union ccb *)atio); - break; - } - } else if ((ccb->ccb_h.flags & CAM_SEND_STATUS) == 0) { - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] MID CTIO sequence %u seen in %s\n", atio->tag_id, CTIO_SEQ(ccb), __func__); - if (ATIO_PPD(atio)->status_sent == 0 && ATIO_PPD(atio)->on_queue == 0) { - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - } - xpt_schedule(periph, 1); - } else { - KASSERT((ATIO_PPD(atio)->ctio_cnt == 0), ("ctio count still %d when we think we've sent the STATUS ctio", ATIO_PPD(atio)->ctio_cnt)); - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] FINAL CTIO sequence %u seen in %s\n", atio->tag_id, CTIO_SEQ(ccb), __func__); - xpt_action((union ccb *)atio); - } - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); - ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - xpt_release_ccb(ccb); - break; - case XPT_NOTIFY_ACKNOWLEDGE: - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); - ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - inot = ccb->ccb_h.ccb_inot; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG1, inot->ccb_h.path, "[0x%x] recycle notify for tag 0x%x\n", inot->tag_id, inot->seq_id); - xpt_release_ccb(ccb); - xpt_action((union ccb *)inot); - break; - default: - xpt_print(ccb->ccb_h.path, "unexpected code 0x%x\n", ccb->ccb_h.func_code); - break; - } -} - -static void -isptargasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) -{ - struct ac_contract *acp = arg; - struct ac_device_changed *fc = (struct ac_device_changed *) acp->contract_data; - - if (code != AC_CONTRACT) { - return; - } - xpt_print(path, "0x%016llx Port ID 0x%06x %s\n", (unsigned long long) fc->wwpn, fc->port, fc->arrived? "arrived" : "departed"); -} - -static void -isp_target_thread(ispsoftc_t *isp, int chan) -{ - union ccb *ccb = NULL; - int i; - void *wchan; - cam_status status; - struct isptarg_softc *softc = NULL; - struct cam_periph *periph = NULL, *wperiph = NULL; - struct cam_path *path, *wpath; - struct cam_sim *sim; - - if (disk_data == NULL) { - disk_size = roundup2(vm_kmem_size >> 1, (1ULL << 20)); - if (disk_size < (50 << 20)) { - disk_size = 50 << 20; - } - disk_data = malloc(disk_size, M_ISPTARG, M_WAITOK | M_ZERO); - if (disk_data == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate disk data", __func__); - goto out; - } - isp_prt(isp, ISP_LOGINFO, "allocated a %ju MiB disk", (uintmax_t) (disk_size >> 20)); - } - junk_data = malloc(JUNK_SIZE, M_ISPTARG, M_WAITOK | M_ZERO); - if (junk_data == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate junk", __func__); - goto out; - } - - - softc = malloc(sizeof (*softc), M_ISPTARG, M_WAITOK | M_ZERO); - if (softc == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate softc", __func__); - goto out; - } - TAILQ_INIT(&softc->work_queue); - TAILQ_INIT(&softc->rework_queue); - TAILQ_INIT(&softc->running_queue); - TAILQ_INIT(&softc->inot_queue); - softc->isp = isp; - - periphdriver_register(&isptargdriver); - ISP_GET_PC(isp, chan, sim, sim); - ISP_GET_PC(isp, chan, path, path); - status = xpt_create_path(&wpath, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); - if (status != CAM_REQ_CMP) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate wildcard path", __func__); - return; - } - status = xpt_create_path(&path, NULL, cam_sim_path(sim), 0, 0); - if (status != CAM_REQ_CMP) { - xpt_free_path(wpath); - isp_prt(isp, ISP_LOGERR, "%s: could not allocate path", __func__); - return; - } - - ISP_LOCK(isp); - status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, wpath, NULL, 0, softc); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: cam_periph_alloc for wildcard failed", __func__); - goto out; - } - wperiph = cam_periph_find(wpath, "isptarg"); - if (wperiph == NULL) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: wildcard periph already allocated but doesn't exist", __func__); - goto out; - } - - status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, path, NULL, 0, softc); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: cam_periph_alloc failed", __func__); - goto out; - } - - periph = cam_periph_find(path, "isptarg"); - if (periph == NULL) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: periph already allocated but doesn't exist", __func__); - goto out; - } - - status = xpt_register_async(AC_CONTRACT, isptargasync, isp, wpath); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: xpt_register_async failed", __func__); - goto out; - } - - ISP_UNLOCK(isp); - - ccb = xpt_alloc_ccb(); - - /* - * Make sure role is none. - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_SET_SIM_KNOB; - ccb->knob.xport_specific.fc.role = KNOB_ROLE_NONE; - ccb->knob.xport_specific.fc.valid = KNOB_VALID_ROLE; - - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - - /* - * Now enable luns - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_EN_LUN; - ccb->cel.enable = 1; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - if (ccb->ccb_h.status != CAM_REQ_CMP) { - xpt_free_ccb(ccb); - xpt_print(periph->path, "failed to enable lun (0x%x)\n", ccb->ccb_h.status); - goto out; - } - - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 10); - ccb->ccb_h.func_code = XPT_EN_LUN; - ccb->cel.enable = 1; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - if (ccb->ccb_h.status != CAM_REQ_CMP) { - xpt_free_ccb(ccb); - xpt_print(wperiph->path, "failed to enable lun (0x%x)\n", ccb->ccb_h.status); - goto out; - } - xpt_free_ccb(ccb); - - /* - * Add resources - */ - ISP_GET_PC(isp, chan, target_proc, wchan); - for (i = 0; i < 4; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 1); - ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; - ccb->ccb_h.cbfcnp = isptarg_done; - ccb->ccb_h.ppriv_ptr0 = malloc(sizeof (ppd_t), M_ISPTARG, M_WAITOK | M_ZERO); - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < NISP_TARG_CMDS; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, periph->path, 1); - ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; - ccb->ccb_h.cbfcnp = isptarg_done; - ccb->ccb_h.ppriv_ptr0 = malloc(sizeof (ppd_t), M_ISPTARG, M_WAITOK | M_ZERO); - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < 4; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 1); - ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; - ccb->ccb_h.cbfcnp = isptarg_done; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < NISP_TARG_NOTIFIES; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, periph->path, 1); - ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; - ccb->ccb_h.cbfcnp = isptarg_done; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - - /* - * Now turn it all back on - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_SET_SIM_KNOB; - ccb->knob.xport_specific.fc.valid = KNOB_VALID_ROLE; - ccb->knob.xport_specific.fc.role = KNOB_ROLE_TARGET; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - - /* - * Okay, while things are still active, sleep... - */ - ISP_LOCK(isp); - for (;;) { - ISP_GET_PC(isp, chan, proc_active, i); - if (i == 0) { - break; - } - msleep(wchan, &isp->isp_lock, PUSER, "tsnooze", 0); - } - ISP_UNLOCK(isp); - -out: - if (wperiph) { - cam_periph_invalidate(wperiph); - } - if (periph) { - cam_periph_invalidate(periph); - } - if (junk_data) { - free(junk_data, M_ISPTARG); - } - if (disk_data) { - free(disk_data, M_ISPTARG); - } - if (softc) { - free(softc, M_ISPTARG); - } - xpt_free_path(path); - xpt_free_path(wpath); -} - -static void -isp_target_thread_pi(void *arg) -{ - struct isp_spi *pi = arg; - ispsoftc_t *isp = cam_sim_softc(pi->sim); - int chan = cam_sim_bus(pi->sim); - - isp_target_thread(isp, chan); - ISP_SPI_PC(isp, chan)->num_threads -= 1; - kthread_exit(); -} - -static void -isp_target_thread_fc(void *arg) -{ - struct isp_fc *fc = arg; - ispsoftc_t *isp = cam_sim_softc(pi->sim); - int chan = cam_sim_bus(pi->sim); - - isp_target_thread(isp, chan); - ISP_FC_PC(isp, chan)->num_threads -= 1; - kthread_exit(); -} - -static int -isptarg_rwparm(uint8_t *cdb, uint8_t *dp, uint64_t dl, uint32_t offset, uint8_t **kp, uint32_t *tl, int *lp) -{ - uint32_t cnt, curcnt; - uint64_t lba; - - switch (cdb[0]) { - case WRITE_16: - case READ_16: - cnt = (((uint32_t)cdb[10]) << 24) | - (((uint32_t)cdb[11]) << 16) | - (((uint32_t)cdb[12]) << 8) | - ((uint32_t)cdb[13]); - - lba = (((uint64_t)cdb[2]) << 56) | - (((uint64_t)cdb[3]) << 48) | - (((uint64_t)cdb[4]) << 40) | - (((uint64_t)cdb[5]) << 32) | - (((uint64_t)cdb[6]) << 24) | - (((uint64_t)cdb[7]) << 16) | - (((uint64_t)cdb[8]) << 8) | - ((uint64_t)cdb[9]); - break; - case WRITE_12: - case READ_12: - cnt = (((uint32_t)cdb[6]) << 16) | - (((uint32_t)cdb[7]) << 8) | - ((u_int32_t)cdb[8]); - - lba = (((uint32_t)cdb[2]) << 24) | - (((uint32_t)cdb[3]) << 16) | - (((uint32_t)cdb[4]) << 8) | - ((uint32_t)cdb[5]); - break; - case WRITE_10: - case READ_10: - cnt = (((uint32_t)cdb[7]) << 8) | - ((u_int32_t)cdb[8]); - - lba = (((uint32_t)cdb[2]) << 24) | - (((uint32_t)cdb[3]) << 16) | - (((uint32_t)cdb[4]) << 8) | - ((uint32_t)cdb[5]); - break; - case WRITE_6: - case READ_6: - cnt = cdb[4]; - if (cnt == 0) { - cnt = 256; - } - lba = (((uint32_t)cdb[1] & 0x1f) << 16) | - (((uint32_t)cdb[2]) << 8) | - ((uint32_t)cdb[3]); - break; - default: - return (-1); - } - - cnt <<= DISK_SHIFT; - lba <<= DISK_SHIFT; - - if (offset == cnt) { - *lp = 1; - return (0); - } - - if (lba + cnt > dl) { - return (-2); - } - - curcnt = MAX_ISP_TARG_TRANSFER; - if (offset + curcnt >= cnt) { - curcnt = cnt - offset; - *lp = 1; - } else { - *lp = 0; - } -#ifdef ISP_MULTI_CCBS - if (curcnt > MULTI_CCB_DATA_LIM) - curcnt = MULTI_CCB_DATA_LIM; -#endif - *tl = curcnt; - *kp = &dp[lba + offset]; - return (0); -} - -#endif #endif static void Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:47:19 2015 (r290789) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:48:41 2015 (r290790) @@ -242,9 +242,6 @@ struct isp_fc { struct isp_nexus *nexus_free_list; uint32_t #ifdef ISP_TARGET_MODE -#ifdef ISP_INTERNAL_TARGET - proc_active : 1, -#endif tm_luns_enabled : 1, tm_enable_defer : 1, tm_enabled : 1, @@ -263,9 +260,6 @@ struct isp_fc { struct task gtask; #ifdef ISP_TARGET_MODE struct tslist lun_hash[LUN_HASH_SIZE]; -#ifdef ISP_INTERNAL_TARGET - struct proc * target_proc; -#endif #if defined(DEBUG) unsigned int inject_lost_data_frame; #endif @@ -278,9 +272,6 @@ struct isp_spi { struct cam_path *path; uint32_t #ifdef ISP_TARGET_MODE -#ifdef ISP_INTERNAL_TARGET - proc_active : 1, -#endif tm_luns_enabled : 1, tm_enable_defer : 1, tm_enabled : 1, @@ -290,9 +281,6 @@ struct isp_spi { iid : 4; #ifdef ISP_TARGET_MODE struct tslist lun_hash[LUN_HASH_SIZE]; -#ifdef ISP_INTERNAL_TARGET - struct proc * target_proc; -#endif #endif int num_threads; }; From owner-svn-src-all@freebsd.org Fri Nov 13 19:50:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5351A2EA89; Fri, 13 Nov 2015 19:50:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE5B218A6; Fri, 13 Nov 2015 19:50:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJo8mt096084; Fri, 13 Nov 2015 19:50:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJo8YC096080; Fri, 13 Nov 2015 19:50:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131950.tADJo8YC096080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290791 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:50:10 -0000 Author: mav Date: Fri Nov 13 19:50:08 2015 New Revision: 290791 URL: https://svnweb.freebsd.org/changeset/base/290791 Log: MFC r289882: Add PIM_EXTLUNS support to isp(4) driver. Now 24xx and above chips support full 8-byte LUN address space. Older FC chips may support up to 16K LUNs when firmware allows. Tested in both initiator and target modes for 23xx, 24xx and 25xx. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:50:08 2015 (r290791) @@ -1319,7 +1319,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } else { if (ISP_CAP_SCCFW(isp)) { - isp->isp_maxluns = 16384; + isp->isp_maxluns = 0; /* No limit -- 2/8 bytes */ } else { isp->isp_maxluns = 16; } @@ -4380,7 +4380,9 @@ isp_start(XS_T *xs) fcparam *fcp = FCPARAM(isp, XS_CHANNEL(xs)); if ((fcp->role & ISP_ROLE_INITIATOR) == 0) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx I am not an initiator", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4400,18 +4402,24 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } if (lp->state == FC_PORTDB_STATE_ZOMBIE) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d target zombie", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx target zombie", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); return (CMD_RQLATER); } if (lp->state != FC_PORTDB_STATE_VALID) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d bad db port state 0x%x", XS_CHANNEL(xs), target, XS_LUN(xs), lp->state); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx bad db port state 0x%x", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs), lp->state); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } } else { sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs)); if ((sdp->role & ISP_ROLE_INITIATOR) == 0) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx I am not an initiator", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4561,14 +4569,20 @@ isp_start(XS_T *xs) t7->req_tidlo = lp->portid; t7->req_tidhi = lp->portid >> 16; t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs)); - if (XS_LUN(xs) > 256) { +#if __FreeBSD_version >= 1000700 + be64enc(t7->req_lun, CAM_EXTLUN_BYTE_SWIZZLE(XS_LUN(xs))); +#else + if (XS_LUN(xs) >= 256) { t7->req_lun[0] = XS_LUN(xs) >> 8; t7->req_lun[0] |= 0x40; } t7->req_lun[1] = XS_LUN(xs); +#endif if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t7->req_crn, xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx cannot generate next CRN", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4585,7 +4599,9 @@ isp_start(XS_T *xs) } if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t2->req_crn, xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx cannot generate next CRN", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4594,11 +4610,19 @@ isp_start(XS_T *xs) ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = lp->handle; t2e->req_scclun = XS_LUN(xs); +#if __FreeBSD_version < 1000700 + if (XS_LUN(xs) >= 256) + t2e->req_scclun |= 0x4000; +#endif cdbp = t2e->req_cdb; } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = lp->handle; t2->req_scclun = XS_LUN(xs); +#if __FreeBSD_version < 1000700 + if (XS_LUN(xs) >= 256) + t2->req_scclun |= 0x4000; +#endif cdbp = t2->req_cdb; } else { t2->req_target = lp->handle; @@ -5386,12 +5410,14 @@ again: continue; } if (req_status_flags & RQSTF_BUS_RESET) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d bus was reset", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx bus was reset", + XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BUSRESET); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); } if (buddaboom) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d buddaboom", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx buddaboom", + XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); } @@ -5535,7 +5561,11 @@ again: *XS_STSP(xs) = SCSI_QFULL; XS_SETERR(xs, HBA_NOERROR); } else if (XS_NOERR(xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d badness at %s:%u", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), __func__, __LINE__); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx badness at %s:%u", + XS_CHANNEL(xs), XS_TGT(xs), + (uintmax_t)XS_LUN(xs), + __func__, __LINE__); XS_SETERR(xs, HBA_BOTCH); } XS_SET_RESID(xs, XS_XFRLEN(xs)); @@ -5947,7 +5977,11 @@ isp_parse_async_fc(ispsoftc_t *isp, uint continue; } j++; - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d bus reset set at %s:%u", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), __func__, __LINE__); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx bus reset set at %s:%u", + XS_CHANNEL(xs), XS_TGT(xs), + (uintmax_t)XS_LUN(xs), + __func__, __LINE__); XS_SETERR(xs, HBA_BUSRESET); } if (j) { @@ -6426,7 +6460,9 @@ isp_parse_status(ispsoftc_t *isp, ispsta break; case RQCS_XACT_ERR2: - isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction to target routine %d", XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, + "HBA attempted queued transaction to target routine %jx", + (uintmax_t)XS_LUN(xs)); break; case RQCS_XACT_ERR3: Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:50:08 2015 (r290791) @@ -1153,7 +1153,7 @@ create_lun_state(ispsoftc_t *isp, int bu lun = xpt_path_lun_id(path); if (lun != CAM_LUN_WILDCARD) { - if (lun >= ISP_MAX_LUNS(isp)) { + if (ISP_MAX_LUNS(isp) > 0 && lun >= ISP_MAX_LUNS(isp)) { return (CAM_LUN_INVALID); } } @@ -1238,7 +1238,8 @@ isp_enable_lun(ispsoftc_t *isp, union cc bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "enabling lun %u\n", lun); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, + "enabling lun %jx\n", (uintmax_t)lun); if (target == CAM_TARGET_WILDCARD && lun != CAM_LUN_WILDCARD) { ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); @@ -1251,7 +1252,8 @@ isp_enable_lun(ispsoftc_t *isp, union cc return; } if (isp->isp_dblev & ISP_LOGTDEBUG0) { - xpt_print(ccb->ccb_h.path, "enabling lun 0x%x on channel %d\n", lun, bus); + xpt_print(ccb->ccb_h.path, + "enabling lun 0x%jx on channel %d\n", (uintmax_t)lun, bus); } /* @@ -1450,7 +1452,8 @@ isp_disable_lun(ispsoftc_t *isp, union c bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "disabling lun %u\n", lun); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, + "disabling lun %jx\n", (uintmax_t)lun); if (target == CAM_TARGET_WILDCARD && lun != CAM_LUN_WILDCARD) { ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); @@ -2181,6 +2184,10 @@ isp_target_putback_atio(union ccb *ccb) at->at_header.rqs_entry_count = 1; if (ISP_CAP_SCCFW(isp)) { at->at_scclun = (uint16_t) ccb->ccb_h.target_lun; +#if __FreeBSD_version < 1000700 + if (at->at_scclun >= 256) + at->at_scclun |= 0x4000; +#endif } else { at->at_lun = (uint8_t) ccb->ccb_h.target_lun; } @@ -2366,6 +2373,9 @@ isp_handle_platform_atio2(ispsoftc_t *is if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = aep->at_lun; } @@ -2512,7 +2522,8 @@ static void isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t *aep) { int cdbxlen; - uint16_t lun, chan, nphdl = NIL_HANDLE; + lun_id_t lun; + uint16_t chan, nphdl = NIL_HANDLE; uint32_t did, sid; fcportdb_t *lp; tstate_t *tptr; @@ -2523,7 +2534,12 @@ isp_handle_platform_atio7(ispsoftc_t *is did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; - lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | aep->at_cmnd.fcp_cmnd_lun[1]; +#if __FreeBSD_version >= 1000700 + lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); +#else + lun = (aep->at_cmnd.fcp_cmnd_lun[0] & 0x3f << 8) | + aep->at_cmnd.fcp_cmnd_lun[1]; +#endif /* * Find the N-port handle, and Virtual Port Index for this command. @@ -2589,7 +2605,9 @@ isp_handle_platform_atio7(ispsoftc_t *is if (tptr == NULL) { tptr = get_lun_statep(isp, chan, CAM_LUN_WILDCARD); if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [0x%x] no state pointer for lun %d or wildcard", __func__, aep->at_rxid, lun); + isp_prt(isp, ISP_LOGWARN, + "%s: [0x%x] no state pointer for lun %jx or wildcard", + __func__, aep->at_rxid, (uintmax_t)lun); if (lun == 0) { isp_endcmd(isp, aep, nphdl, SCSI_STATUS_BUSY, 0); } else { @@ -2711,7 +2729,8 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->cdb0 = atiop->cdb_io.cdb_bytes[0]; atp->tattr = aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK; atp->state = ATPD_STATE_CAM; - isp_prt(isp, ISP_LOGTDEBUG0, "ATIO7[0x%x] CDB=0x%x lun %d datalen %u", aep->at_rxid, atp->cdb0, lun, atp->orig_datalen); + isp_prt(isp, ISP_LOGTDEBUG0, "ATIO7[0x%x] CDB=0x%x lun %jx datalen %u", + aep->at_rxid, atp->cdb0, (uintmax_t)lun, atp->orig_datalen); xpt_done((union ccb *)atiop); rls_lun_statep(isp, tptr); return; @@ -2999,7 +3018,7 @@ isp_handle_platform_ctio(ispsoftc_t *isp resid = ct->ct_resid; moved_data = data_requested - resid; } - isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO[%x] seq %u nc %d tag %x S_ID 0x%x lun %d sts %x flg %x resid %d %s", __func__, ct->ct_fwhandle, ATPD_GET_SEQNO(ct), + isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO[%x] seq %u nc %d tag %x S_ID 0x%x lun %x sts %x flg %x resid %d %s", __func__, ct->ct_fwhandle, ATPD_GET_SEQNO(ct), notify_cam, ct->ct_tag_val, ct->ct_iid, ct->ct_lun, ct->ct_status, ct->ct_flags, resid, sentstatus? "FIN" : "MID"); } if (ok) { @@ -3090,6 +3109,9 @@ isp_handle_platform_notify_fc(ispsoftc_t if (ISP_CAP_SCCFW(isp)) { lun = inp->in_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = inp->in_lun; } @@ -3849,8 +3871,9 @@ isp_ldt_task(void *arg, int pending) if (dbidx != XS_TGT(xs)) { continue; } - isp_prt(isp, ISP_LOGWARN, "command handle 0x%x for %d.%d.%d orphaned by loop down timeout", - isp->isp_xflist[i].handle, chan, XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOGWARN, "command handle 0x%x for %d.%d.%jx orphaned by loop down timeout", + isp->isp_xflist[i].handle, chan, XS_TGT(xs), + (uintmax_t)XS_LUN(xs)); } isp_prt(isp, ISP_LOGCONFIG, prom3, chan, dbidx, lp->portid, "Loop Down Timeout"); @@ -4034,10 +4057,11 @@ isp_action(struct cam_sim *sim, union cc } ccb->csio.req_map = NULL; #ifdef DIAGNOSTIC - if (ccb->ccb_h.target_id > (ISP_MAX_TARGETS(isp) - 1)) { + if (ccb->ccb_h.target_id >= ISP_MAX_TARGETS(isp)) { xpt_print(ccb->ccb_h.path, "invalid target\n"); ccb->ccb_h.status = CAM_PATH_INVALID; - } else if (ccb->ccb_h.target_lun > (ISP_MAX_LUNS(isp) - 1)) { + } else if (ISP_MAX_LUNS(isp) > 0 && + ccb->ccb_h.target_lun >= ISP_MAX_LUNS(isp)) { xpt_print(ccb->ccb_h.path, "invalid lun\n"); ccb->ccb_h.status = CAM_PATH_INVALID; } @@ -4080,15 +4104,23 @@ isp_action(struct cam_sim *sim, union cc lim = ISP_FC_PC(isp, bus)->loop_down_limit; if (FCPARAM(isp, bus)->loop_seen_once == 0 || ISP_FC_PC(isp, bus)->loop_down_time >= lim) { if (FCPARAM(isp, bus)->loop_seen_once == 0) { - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d loop not seen yet @ %lu", XS_TGT(ccb), XS_LUN(ccb), (unsigned long) time_uptime); + isp_prt(isp, ISP_LOGDEBUG0, + "%d.%jx loop not seen yet @ %lu", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb), + (unsigned long) time_uptime); } else { - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d downtime (%d) > lim (%d)", XS_TGT(ccb), XS_LUN(ccb), ISP_FC_PC(isp, bus)->loop_down_time, lim); + isp_prt(isp, ISP_LOGDEBUG0, + "%d.%jx downtime (%d) > lim (%d)", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb), + ISP_FC_PC(isp, bus)->loop_down_time, + lim); } ccb->ccb_h.status = CAM_SEL_TIMEOUT; isp_done((struct ccb_scsiio *) ccb); break; } - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d retry later", XS_TGT(ccb), XS_LUN(ccb)); + isp_prt(isp, ISP_LOGDEBUG0, "%d.%jx retry later", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); cam_freeze_devq(ccb->ccb_h.path); cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0); ccb->ccb_h.status = CAM_REQUEUE_REQ; @@ -4591,7 +4623,8 @@ isp_action(struct cam_sim *sim, union cc #endif cpi->hba_eng_cnt = 0; cpi->max_target = ISP_MAX_TARGETS(isp) - 1; - cpi->max_lun = ISP_MAX_LUNS(isp) - 1; + cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ? + 255 : ISP_MAX_LUNS(isp) - 1; cpi->bus_id = cam_sim_bus(sim); if (isp->isp_osinfo.sixtyfourbit) cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE; @@ -4603,6 +4636,9 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#if __FreeBSD_version >= 1000700 + cpi->hba_misc |= PIM_EXTLUNS; +#endif #if __FreeBSD_version >= 1000039 cpi->hba_misc |= PIM_NOSCAN; #endif @@ -4682,7 +4718,10 @@ isp_done(XS_T *sccb) status = sccb->ccb_h.status & CAM_STATUS_MASK; if (status != CAM_REQ_CMP) { if (status != CAM_SEL_TIMEOUT) - isp_prt(isp, ISP_LOGDEBUG0, "target %d lun %d CAM status 0x%x SCSI status 0x%x", XS_TGT(sccb), XS_LUN(sccb), sccb->ccb_h.status, sccb->scsi_status); + isp_prt(isp, ISP_LOGDEBUG0, + "target %d lun %jx CAM status 0x%x SCSI status 0x%x", + XS_TGT(sccb), (uintmax_t)XS_LUN(sccb), + sccb->ccb_h.status, sccb->scsi_status); else if ((IS_FC(isp)) && (XS_TGT(sccb) < MAX_FC_TARG)) { fcparam *fcp; @@ -5485,7 +5524,8 @@ isp_fcp_reset_crn(struct isp_fc *fc, uin int isp_fcp_next_crn(ispsoftc_t *isp, uint8_t *crnp, XS_T *cmd) { - uint32_t chan, tgt, lun; + lun_id_t lun; + uint32_t chan, tgt; struct isp_fc *fc; struct isp_nexus *nxp; int idx; Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:50:08 2015 (r290791) @@ -207,12 +207,10 @@ struct isp_pcmd { * Per nexus info. */ struct isp_nexus { - struct isp_nexus * next; - uint32_t - crnseed : 8; /* next command reference number */ - uint32_t - tgt : 16, /* TGT for target */ - lun : 16; /* LUN for target */ + uint64_t lun; /* LUN for target */ + uint32_t tgt; /* TGT for target */ + uint8_t crnseed; /* next command reference number */ + struct isp_nexus *next; }; #define NEXUS_HASH_WIDTH 32 #define INITIAL_NEXUS_COUNT MAX_FC_TARG Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:50:08 2015 (r290791) @@ -953,6 +953,9 @@ isp_got_msg_fc(ispsoftc_t *isp, in_fcent /* nt_tgt set in outer layers */ if (ISP_CAP_SCCFW(isp)) { notify.nt_lun = inp->in_scclun; +#if __FreeBSD_version < 1000700 + notify.nt_lun &= 0x3fff; +#endif } else { notify.nt_lun = inp->in_lun; } @@ -1330,6 +1333,9 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = aep->at_lun; } @@ -1357,7 +1363,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en /* * ATIO rejected by the firmware due to disabled lun. */ - isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for disabled lun %d", lun); + isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for disabled lun %x", lun); break; case AT_NOCAP: /* @@ -1365,7 +1371,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en * We sent an ATIO that overflowed the firmware's * command resource count. */ - isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for lun %d- command count overflow", lun); + isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for lun %x- command count overflow", lun); break; case AT_BDR_MSG: @@ -1402,7 +1408,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en default: - isp_prt(isp, ISP_LOGERR, "Unknown ATIO2 status 0x%x from loopid %d for lun %d", aep->at_status, iid, lun); + isp_prt(isp, ISP_LOGERR, "Unknown ATIO2 status 0x%x from loopid %d for lun %x", aep->at_status, iid, lun); (void) isp_target_put_atio(isp, aep); break; } From owner-svn-src-all@freebsd.org Fri Nov 13 19:50:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F084FA2EADF; Fri, 13 Nov 2015 19:50:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E3B21A2D; Fri, 13 Nov 2015 19:50:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJotXr096657; Fri, 13 Nov 2015 19:50:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJotU8096655; Fri, 13 Nov 2015 19:50:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131950.tADJotU8096655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290792 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:50:57 -0000 Author: mav Date: Fri Nov 13 19:50:55 2015 New Revision: 290792 URL: https://svnweb.freebsd.org/changeset/base/290792 Log: MFC r289886: Add new field to Abort IOCB. Modified: stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:50:08 2015 (r290791) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:50:55 2015 (r290792) @@ -1071,6 +1071,7 @@ isp_put_24xx_abrt(ispsoftc_t *isp, isp24 ISP_IOXPUT_16(isp, src->abrt_nphdl, &dst->abrt_nphdl); ISP_IOXPUT_16(isp, src->abrt_options, &dst->abrt_options); ISP_IOXPUT_32(isp, src->abrt_cmd_handle, &dst->abrt_cmd_handle); + ISP_IOXPUT_16(isp, src->abrt_queue_number, &dst->abrt_queue_number); for (i = 0; i < ASIZE(src->abrt_reserved); i++) { ISP_IOXPUT_8(isp, src->abrt_reserved[i], &dst->abrt_reserved[i]); } @@ -1179,6 +1180,7 @@ isp_get_24xx_abrt(ispsoftc_t *isp, isp24 ISP_IOXGET_16(isp, &src->abrt_nphdl, dst->abrt_nphdl); ISP_IOXGET_16(isp, &src->abrt_options, dst->abrt_options); ISP_IOXGET_32(isp, &src->abrt_cmd_handle, dst->abrt_cmd_handle); + ISP_IOXGET_16(isp, &src->abrt_queue_number, dst->abrt_queue_number); for (i = 0; i < ASIZE(src->abrt_reserved); i++) { ISP_IOXGET_8(isp, &src->abrt_reserved[i], dst->abrt_reserved[i]); } Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:50:08 2015 (r290791) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:50:55 2015 (r290792) @@ -574,7 +574,8 @@ typedef struct { uint16_t abrt_nphdl; uint16_t abrt_options; uint32_t abrt_cmd_handle; - uint8_t abrt_reserved[32]; + uint16_t abrt_queue_number; + uint8_t abrt_reserved[30]; uint16_t abrt_tidlo; uint8_t abrt_tidhi; uint8_t abrt_vpidx; From owner-svn-src-all@freebsd.org Fri Nov 13 19:51:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D3CDA2EB4B; Fri, 13 Nov 2015 19:51:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 676211CE2; Fri, 13 Nov 2015 19:51:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJptJS098678; Fri, 13 Nov 2015 19:51:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJptEa098676; Fri, 13 Nov 2015 19:51:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131951.tADJptEa098676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290793 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:51:56 -0000 Author: mav Date: Fri Nov 13 19:51:55 2015 New Revision: 290793 URL: https://svnweb.freebsd.org/changeset/base/290793 Log: MFC r289890: Skip reserved IP Broadcast handle from using. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:50:55 2015 (r290792) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:51:55 2015 (r290793) @@ -3164,7 +3164,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) continue; } if (ISP_CAP_2KLOGIN(isp)) { - if (handle >= NPH_RESERVED && handle <= NPH_FL_ID) { + if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { continue; } } @@ -4301,8 +4301,8 @@ isp_nxt_handle(ispsoftc_t *isp, int chan if (handle >= FL_ID && handle <= SNS_ID) { handle = SNS_ID+1; } - if (handle >= NPH_RESERVED && handle <= NPH_FL_ID) { - handle = NPH_FL_ID+1; + if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { + handle = NPH_IP_BCST + 1; } if (ISP_CAP_2KLOGIN(isp)) { if (handle == NPH_MAX_2K) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:50:55 2015 (r290792) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:51:55 2015 (r290793) @@ -253,7 +253,7 @@ typedef struct { #define NPH_SNS_ID 0x7FC /* SNS Server Special ID */ #define NPH_FABRIC_CTLR 0x7FD /* Fabric Controller (0xFFFFFD) */ #define NPH_FL_ID 0x7FE /* F Port Special ID (0xFFFFFE) */ -#define NPH_IP_BCST 0x7ff /* IP Broadcast Special ID (0xFFFFFF) */ +#define NPH_IP_BCST 0x7FF /* IP Broadcast Special ID (0xFFFFFF) */ #define NPH_MAX_2K 0x800 /* From owner-svn-src-all@freebsd.org Fri Nov 13 19:53:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A2CA2EC75; Fri, 13 Nov 2015 19:53:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87DEF1E95; Fri, 13 Nov 2015 19:53:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJrVbl098790; Fri, 13 Nov 2015 19:53:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJrVpY098786; Fri, 13 Nov 2015 19:53:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131953.tADJrVpY098786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290794 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:53:32 -0000 Author: mav Date: Fri Nov 13 19:53:31 2015 New Revision: 290794 URL: https://svnweb.freebsd.org/changeset/base/290794 Log: MFC r289930: Formalize/unify chip (re-)inits. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:53:31 2015 (r290794) @@ -1368,6 +1368,8 @@ isp_scsi_init(ispsoftc_t *isp) sdparam *sdp_chan0, *sdp_chan1; mbreg_t mbs; + isp->isp_state = ISP_INITSTATE; + sdp_chan0 = SDPARAM(isp, 0); sdp_chan1 = sdp_chan0; if (IS_DUALBUS(isp)) { @@ -1543,7 +1545,7 @@ isp_scsi_init(ispsoftc_t *isp) } } - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -1673,11 +1675,10 @@ isp_fibre_init(ispsoftc_t *isp) * We only support one channel on non-24XX cards */ fcp = FCPARAM(isp, 0); - if (fcp->role == ISP_ROLE_NONE) { - isp->isp_state = ISP_INITSTATE; + if (fcp->role == ISP_ROLE_NONE) return; - } + isp->isp_state = ISP_INITSTATE; ISP_MEMZERO(icbp, sizeof (*icbp)); icbp->icb_version = ICB_VERSION1; icbp->icb_fwoptions = fcp->isp_fwoptions; @@ -1978,7 +1979,7 @@ isp_fibre_init(ispsoftc_t *isp) /* * Whatever happens, we're now committed to being here. */ - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -2001,10 +2002,11 @@ isp_fibre_init_2400(ispsoftc_t *isp) } if (chan == isp->isp_nchan) { isp_prt(isp, ISP_LOG_WARN1, "all %d channels with role 'none'", chan); - isp->isp_state = ISP_INITSTATE; return; } + isp->isp_state = ISP_INITSTATE; + /* * Start with channel 0. */ @@ -2285,7 +2287,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) /* * Whatever happens, we're now committed to being here. */ - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -4349,16 +4351,6 @@ isp_start(XS_T *xs) isp = XS_ISP(xs); /* - * Now make sure we're running. - */ - - if (isp->isp_state != ISP_RUNSTATE) { - isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); - XS_SETERR(xs, HBA_BOTCH); - return (CMD_COMPLETE); - } - - /* * Check command CDB length, etc.. We really are limited to 16 bytes * for Fibre Channel, but can do up to 44 bytes in parallel SCSI, * but probably only if we're running fairly new firmware (we'll @@ -4387,6 +4379,12 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } + if (isp->isp_state != ISP_RUNSTATE) { + isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + /* * Try again later. */ @@ -4423,6 +4421,13 @@ isp_start(XS_T *xs) XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } + + if (isp->isp_state != ISP_RUNSTATE) { + isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + if (sdp->update) { isp_spi_update(isp, XS_CHANNEL(xs)); } @@ -7915,7 +7920,8 @@ isp_reinit(ispsoftc_t *isp, int do_load_ { int i, res = 0; - isp_reset(isp, do_load_defaults); + if (isp->isp_state != ISP_RESETSTATE) + isp_reset(isp, do_load_defaults); if (isp->isp_state != ISP_RESETSTATE) { res = EIO; isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__); @@ -7924,15 +7930,10 @@ isp_reinit(ispsoftc_t *isp, int do_load_ } isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } - - if (isp->isp_state != ISP_RUNSTATE) { + if (isp->isp_state > ISP_RESETSTATE && + isp->isp_state != ISP_RUNSTATE) { res = EIO; -#ifndef ISP_TARGET_MODE - isp_prt(isp, ISP_LOGWARN, "%s: not at runstate", __func__); -#endif + isp_prt(isp, ISP_LOGERR, "%s: cannot init card", __func__); ISP_DISABLE_INTS(isp); if (IS_FC(isp)) { /* Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:53:31 2015 (r290794) @@ -4029,19 +4029,6 @@ isp_action(struct cam_sim *sim, union cc isp_prt(isp, ISP_LOGDEBUG2, "isp_action code %x", ccb->ccb_h.func_code); ISP_PCMD(ccb) = NULL; - if (isp->isp_state != ISP_RUNSTATE && ccb->ccb_h.func_code == XPT_SCSI_IO) { - isp_init(isp); - if (isp->isp_state != ISP_INITSTATE) { - /* - * Lie. Say it was a selection timeout. - */ - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - isp_done((struct ccb_scsiio *) ccb); - return; - } - isp->isp_state = ISP_RUNSTATE; - } - switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: /* Execute the requested I/O operation */ bus = XS_CHANNEL(ccb); Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:53:31 2015 (r290794) @@ -991,15 +991,10 @@ isp_pci_attach(device_t dev) * Make sure we're in reset state. */ ISP_LOCK(isp); - isp_reset(isp, 1); - if (isp->isp_state != ISP_RESETSTATE) { + if (isp_reinit(isp, 1) != 0) { ISP_UNLOCK(isp); goto bad; } - isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:53:31 2015 (r290794) @@ -313,16 +313,11 @@ isp_sbus_attach(device_t dev) * Make sure we're in reset state. */ ISP_LOCK(isp); - isp_reset(isp, 1); - if (isp->isp_state != ISP_RESETSTATE) { + if (isp_reinit(isp, 1) != 0) { isp_uninit(isp); ISP_UNLOCK(isp); goto bad; } - isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); From owner-svn-src-all@freebsd.org Fri Nov 13 19:54:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A142A2ECE1; Fri, 13 Nov 2015 19:54:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8E01023; Fri, 13 Nov 2015 19:54:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJswTa098889; Fri, 13 Nov 2015 19:54:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJsw6u098887; Fri, 13 Nov 2015 19:54:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131954.tADJsw6u098887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290795 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:54:59 -0000 Author: mav Date: Fri Nov 13 19:54:58 2015 New Revision: 290795 URL: https://svnweb.freebsd.org/changeset/base/290795 Log: MFC r289933, r289939: Improve Port Database Changed handling and reporting. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:53:31 2015 (r290794) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:54:58 2015 (r290795) @@ -6074,21 +6074,21 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_PDB_CHANGED: { - int nphdl, nlstate, reason; - /* - * We *should* get a channel out of the 24XX, but we don't seem - * to get more than a PDB CHANGED on channel 0, so turn it into - * a broadcast event. - */ + int echan, nphdl, nlstate, reason; + if (IS_24XX(isp)) { nphdl = ISP_READ(isp, OUTMAILBOX1); nlstate = ISP_READ(isp, OUTMAILBOX2); reason = ISP_READ(isp, OUTMAILBOX3) >> 8; + GET_24XX_BUS(isp, chan, "ASYNC_CHANGE_NOTIFY"); + echan = (nphdl == NIL_HANDLE) ? + isp->isp_nchan - 1 : chan; } else { nphdl = NIL_HANDLE; nlstate = reason = 0; + chan = echan = 0; } - for (chan = 0; chan < isp->isp_nchan; chan++) { + for (; chan <= echan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) { Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:53:31 2015 (r290794) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:54:58 2015 (r290795) @@ -382,14 +382,16 @@ isp_freeze_loopdown(ispsoftc_t *isp, int if (IS_FC(isp)) { struct isp_fc *fc = ISP_FC_PC(isp, chan); if (fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, "%s: freeze simq (loopdown) chan %d", msg, chan); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d %s -- freeze simq (loopdown)", chan, msg); fc->simqfrozen = SIMQFRZ_LOOPDOWN; #if __FreeBSD_version >= 1000039 xpt_hold_boot(); #endif xpt_freeze_simq(fc->sim, 1); } else { - isp_prt(isp, ISP_LOGDEBUG0, "%s: mark frozen (loopdown) chan %d", msg, chan); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d %s -- mark frozen (loopdown)", chan, msg); fc->simqfrozen |= SIMQFRZ_LOOPDOWN; } } @@ -4988,11 +4990,11 @@ changed: fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { - msg = "Chan %d Port Database Changed"; + msg = "Port Database Changed"; } else if (evt == ISPASYNC_CHANGE_SNS) { - msg = "Chan %d Name Server Database Changed"; + msg = "Name Server Database Changed"; } else { - msg = "Chan %d Other Change Notify"; + msg = "Other Change Notify"; } /* @@ -5002,7 +5004,7 @@ changed: isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime); callout_stop(&fc->ldt); } - isp_prt(isp, ISP_LOGINFO, msg, bus); + isp_prt(isp, ISP_LOGINFO, "Chan %d %s", bus, msg); if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } From owner-svn-src-all@freebsd.org Fri Nov 13 19:56:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BD6A2ED4C; Fri, 13 Nov 2015 19:56:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAE311DB; Fri, 13 Nov 2015 19:56:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJtxik098996; Fri, 13 Nov 2015 19:55:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJtxot098994; Fri, 13 Nov 2015 19:55:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131955.tADJtxot098994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290796 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:56:00 -0000 Author: mav Date: Fri Nov 13 19:55:59 2015 New Revision: 290796 URL: https://svnweb.freebsd.org/changeset/base/290796 Log: MFC r289937: Try to keep Loop IDs persistent across chip reinits. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:54:58 2015 (r290795) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:55:59 2015 (r290796) @@ -1669,7 +1669,6 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; - int ownloopid; /* * We only support one channel on non-24XX cards @@ -1743,19 +1742,12 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - icbp->icb_hardaddr = fcp->isp_loopid; - ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; - if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = 0; - ownloopid = 0; - } - - /* - * Our life seems so much better with 2200s and later with - * the latest f/w if we set Hard Address. - */ - if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + else + icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; } /* @@ -1989,7 +1981,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; - int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2024,16 +2015,20 @@ isp_fibre_init_2400(ispsoftc_t *isp) ISP_MEMZERO(icbp, sizeof (*icbp)); icbp->icb_fwoptions1 = fcp->isp_fwoptions; - if (fcp->role & ISP_ROLE_TARGET) { - icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; - } else { - icbp->icb_fwoptions1 &= ~ICB2400_OPT1_TGT_ENABLE; - } - - if (fcp->role & ISP_ROLE_INITIATOR) { + icbp->icb_fwoptions2 = fcp->isp_xfwoptions; + icbp->icb_fwoptions3 = fcp->isp_zfwoptions; + if (isp->isp_nchan > 1 && (isp->isp_fwattr & ISP2400_FW_ATTR_VP0)) { icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; + icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; } else { - icbp->icb_fwoptions1 |= ICB2400_OPT1_INI_DISABLE; + if (fcp->role & ISP_ROLE_TARGET) + icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; + else + icbp->icb_fwoptions1 &= ~ICB2400_OPT1_TGT_ENABLE; + if (fcp->role & ISP_ROLE_INITIATOR) + icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; + else + icbp->icb_fwoptions1 |= ICB2400_OPT1_INI_DISABLE; } icbp->icb_version = ICB_VERSION1; @@ -2058,18 +2053,14 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - - ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; - icbp->icb_hardaddr = fcp->isp_loopid; - if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = 0; - ownloopid = 0; + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + else + icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; } - if (ownloopid) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - - icbp->icb_fwoptions2 = fcp->isp_xfwoptions; if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2113,7 +2104,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } - icbp->icb_fwoptions3 = fcp->isp_zfwoptions; if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } @@ -2129,9 +2119,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) } else { icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO; } - if (ownloopid == 0) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; - } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2238,6 +2225,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; } + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + else + pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; + } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:54:58 2015 (r290795) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:55:59 2015 (r290796) @@ -928,7 +928,7 @@ typedef struct { #define ICBOPT_BOTH_WWNS 0x4000 #define ICBOPT_FULL_LOGIN 0x2000 #define ICBOPT_STOP_ON_QFULL 0x1000 /* 2200/2100 only */ -#define ICBOPT_PREVLOOP 0x0800 +#define ICBOPT_PREV_ADDRESS 0x0800 #define ICBOPT_SRCHDOWN 0x0400 #define ICBOPT_NOLIP 0x0200 #define ICBOPT_PDBCHANGE_AE 0x0100 @@ -982,7 +982,7 @@ typedef struct { /* 2400 F/W options */ #define ICB2400_OPT1_BOTH_WWNS 0x00004000 #define ICB2400_OPT1_FULL_LOGIN 0x00002000 -#define ICB2400_OPT1_PREVLOOP 0x00000800 +#define ICB2400_OPT1_PREV_ADDRESS 0x00000800 #define ICB2400_OPT1_SRCHDOWN 0x00000400 #define ICB2400_OPT1_NOLIP 0x00000200 #define ICB2400_OPT1_INI_DISABLE 0x00000020 @@ -1144,7 +1144,7 @@ typedef struct { #define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* Initiator Mode Enabled */ #define ICB2400_VPOPT_ENABLED 0x00000008 /* VP Enabled */ #define ICB2400_VPOPT_NOPLAY 0x00000004 /* ID Not Acquired */ -#define ICB2400_VPOPT_PREVLOOP 0x00000002 /* Previously Assigned ID */ +#define ICB2400_VPOPT_PREV_ADDRESS 0x00000002 /* Previously Assigned ID */ #define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 /* Hard Assigned ID */ #define ICB2400_VPOPT_WRITE_SIZE 20 From owner-svn-src-all@freebsd.org Fri Nov 13 19:57:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0132AA2EDAD; Fri, 13 Nov 2015 19:57:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB231324; Fri, 13 Nov 2015 19:57:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJvCFp099092; Fri, 13 Nov 2015 19:57:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJvCfU099091; Fri, 13 Nov 2015 19:57:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131957.tADJvCfU099091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290797 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:57:14 -0000 Author: mav Date: Fri Nov 13 19:57:12 2015 New Revision: 290797 URL: https://svnweb.freebsd.org/changeset/base/290797 Log: MFC r289942: Deliver INOTs only to enabled virtual ports. Modified: stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:55:59 2015 (r290796) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:57:12 2015 (r290797) @@ -1889,6 +1889,8 @@ isp_handle_24xx_inotify(ispsoftc_t *isp, } isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); for (chan = lochan; chan < hichan; chan++) { + if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) + continue; switch (inot_24xx->in_status) { case IN24XX_LIP_RESET: case IN24XX_LINK_RESET: From owner-svn-src-all@freebsd.org Fri Nov 13 19:58:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B61A2EDFE; Fri, 13 Nov 2015 19:58:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6E114CC; Fri, 13 Nov 2015 19:58:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJvxXr099170; Fri, 13 Nov 2015 19:57:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJvxZQ099167; Fri, 13 Nov 2015 19:57:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131957.tADJvxZQ099167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290798 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:58:00 -0000 Author: mav Date: Fri Nov 13 19:57:59 2015 New Revision: 290798 URL: https://svnweb.freebsd.org/changeset/base/290798 Log: MFC r290018: Reimplement enable and implement disable of virtual ports. Now on 24xx and above chips it is really possible to simulate several virtual FC ports with single physical one. For example, it allows to configure several targets in ctl.conf, assign each of them to separate virtual port, and let user to control access to them with switch zoning. I still doubt that all problems are solved there, but at now it passes at least basic tests. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:57:59 2015 (r290798) @@ -1275,7 +1275,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d */ if (IS_FC(isp) && isp->isp_nchan > 1) { if (!ISP_CAP_MULTI_ID(isp)) { - isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); + isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, " + "only can enable 1 of %d channels", isp->isp_nchan); + isp->isp_nchan = 1; + } else if (!ISP_CAP_VP0(isp)) { + isp_prt(isp, ISP_LOGWARN, "We can not use MULTIID " + "feature properly without VP0_Decoupling"); isp->isp_nchan = 1; } } @@ -2017,7 +2022,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions1 = fcp->isp_fwoptions; icbp->icb_fwoptions2 = fcp->isp_xfwoptions; icbp->icb_fwoptions3 = fcp->isp_zfwoptions; - if (isp->isp_nchan > 1 && (isp->isp_fwattr & ISP2400_FW_ATTR_VP0)) { + if (isp->isp_nchan > 1 && ISP_CAP_VP0(isp)) { icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; } else { @@ -2200,7 +2205,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) uint8_t *off; vpinfo.vp_global_options = 0; - if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) { + if (ISP_CAP_VP0(isp)) { vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; vpinfo.vp_count = isp->isp_nchan; chan = 0; @@ -2235,7 +2240,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; - if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) + if (ISP_CAP_VP0(isp)) off += ICB2400_VPINFO_PORT_OFF(chan); else off += ICB2400_VPINFO_PORT_OFF(chan - 1); Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:57:59 2015 (r290798) @@ -581,6 +581,136 @@ isp_fc_toponame(fcparam *fcp) } } +static int +isp_fc_enable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_modify_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* + * Build a VP MODIFY command in memory + */ + vp = (vp_modify_t *) qe; + vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; + vp->vp_mod_hdr.rqs_entry_count = 1; + vp->vp_mod_cnt = 1; + vp->vp_mod_idx0 = chan; + vp->vp_mod_cmd = VP_MODIFY_ENA; + vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED; + if (fcp->role & ISP_ROLE_INITIATOR) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; + } + if ((fcp->role & ISP_ROLE_TARGET) == 0) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; + } + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + vp->vp_mod_ports[0].loopid = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_HARD_ADDRESS; + else + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_PREV_ADDRESS; + } + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); + isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); + + /* + * Build a EXEC IOCB A64 command that points to the VP MODIFY command + */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_mod_status != VP_STS_OK) { + isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); + return (EIO); + } + return (0); +} + +static int +isp_fc_disable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_ctrl_info_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* + * Build a VP CTRL command in memory + */ + vp = (vp_ctrl_info_t *) qe; + vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; + vp->vp_ctrl_hdr.rqs_entry_count = 1; + if (ISP_CAP_VP0(isp)) { + vp->vp_ctrl_status = 1; + } else { + vp->vp_ctrl_status = 0; + chan--; /* VP0 can not be controlled in this case. */ + } + vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; + vp->vp_ctrl_vp_count = 1; + vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); + isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); + + /* + * Build a EXEC IOCB A64 command that points to the VP CTRL command + */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_ctrl_status != 0) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d failed with status %d %d", + __func__, chan, vp->vp_ctrl_status, vp->vp_ctrl_index_fail); + return (EIO); + } + return (0); +} + /* * Change Roles */ @@ -588,74 +718,28 @@ int isp_fc_change_role(ispsoftc_t *isp, int chan, int new_role) { fcparam *fcp = FCPARAM(isp, chan); + int i, was, res = 0; if (chan >= isp->isp_nchan) { isp_prt(isp, ISP_LOGWARN, "%s: bad channel %d", __func__, chan); return (ENXIO); } - if (chan == 0) { + if (fcp->role == new_role) + return (0); + for (was = 0, i = 0; i < isp->isp_nchan; i++) { + if (FCPARAM(isp, i)->role != ISP_ROLE_NONE) + was++; + } + if (was == 0 || (was == 1 && fcp->role != ISP_ROLE_NONE)) { fcp->role = new_role; return (isp_reinit(isp, 0)); - } else if (ISP_CAP_MULTI_ID(isp)) { - mbreg_t mbs; - vp_modify_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; - - /* - * Build a VP MODIFY command in memory - */ - vp = (vp_modify_t *) qe; - vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; - vp->vp_mod_hdr.rqs_entry_count = 1; - vp->vp_mod_cnt = 1; - vp->vp_mod_idx0 = chan; - vp->vp_mod_cmd = VP_MODIFY_ENA; - vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED; - if (new_role & ISP_ROLE_INITIATOR) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((new_role & ISP_ROLE_TARGET) == 0) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; - } - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); - isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); - - /* - * Build a EXEC IOCB A64 command that points to the VP MODIFY command - */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); - return (EIO); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); - - FC_SCRATCH_RELEASE(isp, chan); - - if (vp->vp_mod_status != VP_STS_OK) { - isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); - return (EIO); - } - fcp->role = new_role; - return (0); - } else { - return (EINVAL); } + if (fcp->role != ISP_ROLE_NONE) + res = isp_fc_disable_vp(isp, chan); + fcp->role = new_role; + if (fcp->role != ISP_ROLE_NONE) + res = isp_fc_enable_vp(isp, chan); + return (res); } void @@ -1400,8 +1484,9 @@ isp_put_vp_ctrl_info(ispsoftc_t *isp, vp ISP_IOXPUT_16(isp, src->vp_ctrl_idmap[i], &dst->vp_ctrl_idmap[i]); } for (i = 0; i < ASIZE(src->vp_ctrl_reserved); i++) { - ISP_IOXPUT_8(isp, src->vp_ctrl_reserved[i], &dst->vp_ctrl_reserved[i]); + ISP_IOXPUT_16(isp, src->vp_ctrl_reserved[i], &dst->vp_ctrl_reserved[i]); } + ISP_IOXPUT_16(isp, src->vp_ctrl_fcf_index, &dst->vp_ctrl_fcf_index); } void @@ -1418,8 +1503,9 @@ isp_get_vp_ctrl_info(ispsoftc_t *isp, vp ISP_IOXGET_16(isp, &src->vp_ctrl_idmap[i], dst->vp_ctrl_idmap[i]); } for (i = 0; i < ASIZE(src->vp_ctrl_reserved); i++) { - ISP_IOXGET_8(isp, &src->vp_ctrl_reserved[i], dst->vp_ctrl_reserved[i]); + ISP_IOXGET_16(isp, &src->vp_ctrl_reserved[i], dst->vp_ctrl_reserved[i]); } + ISP_IOXGET_16(isp, &src->vp_ctrl_fcf_index, dst->vp_ctrl_fcf_index); } void Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:59 2015 (r290798) @@ -855,6 +855,8 @@ typedef struct { (IS_24XX(isp)? (isp->isp_fwattr & ISP2400_FW_ATTR_MULTIID) : 0) #define ISP_GET_VPIDX(isp, tag) \ (ISP_CAP_MULTI_ID(isp) ? tag : 0) +#define ISP_CAP_VP0(isp) \ + (IS_24XX(isp)? (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) : 0) /* * This is true manifestly or is dependent on a f/w attribute @@ -1177,14 +1179,16 @@ typedef struct { uint16_t vp_ctrl_status; uint16_t vp_ctrl_command; uint16_t vp_ctrl_vp_count; - uint16_t vp_ctrl_idmap[8]; - uint8_t vp_ctrl_reserved[32]; + uint16_t vp_ctrl_idmap[16]; + uint16_t vp_ctrl_reserved[7]; + uint16_t vp_ctrl_fcf_index; } vp_ctrl_info_t; -#define VP_CTRL_CMD_ENABLE_VP 0 -#define VP_CTRL_CMD_DISABLE_VP 8 -#define VP_CTRL_CMD_DISABLE_VP_REINIT_LINK 9 -#define VP_CTRL_CMD_DISABLE_VP_LOGO 0xA +#define VP_CTRL_CMD_ENABLE_VP 0x00 +#define VP_CTRL_CMD_DISABLE_VP 0x08 +#define VP_CTRL_CMD_DISABLE_VP_REINIT_LINK 0x09 +#define VP_CTRL_CMD_DISABLE_VP_LOGO 0x0A +#define VP_CTRL_CMD_DISABLE_VP_LOGO_ALL 0x0B /* * We can use this structure for modifying either one or two VP ports after initialization From owner-svn-src-all@freebsd.org Fri Nov 13 19:58:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B689A2EE82; Fri, 13 Nov 2015 19:58:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5D771796; Fri, 13 Nov 2015 19:58:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJwgfh099252; Fri, 13 Nov 2015 19:58:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJwg1S099251; Fri, 13 Nov 2015 19:58:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131958.tADJwg1S099251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290799 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:58:44 -0000 Author: mav Date: Fri Nov 13 19:58:42 2015 New Revision: 290799 URL: https://svnweb.freebsd.org/changeset/base/290799 Log: MFC r290042: Fix error code that looks like wrong. Modified: stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:59 2015 (r290798) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:58:42 2015 (r290799) @@ -1411,7 +1411,7 @@ typedef struct { #define PLOGX_IOCBERR_FAILED 0x04 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_NOFABRIC 0x05 #define PLOGX_IOCBERR_NOTREADY 0x07 -#define PLOGX_IOCBERR_NOLOGIN 0x08 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_NOLOGIN 0x09 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_NOPCB 0x0a #define PLOGX_IOCBERR_REJECT 0x18 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_EINVAL 0x19 /* further info in IOPARM 1 */ From owner-svn-src-all@freebsd.org Fri Nov 13 19:59:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43512A2EED7; Fri, 13 Nov 2015 19:59:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014491902; Fri, 13 Nov 2015 19:59:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJxNk2099331; Fri, 13 Nov 2015 19:59:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJxMLJ099329; Fri, 13 Nov 2015 19:59:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131959.tADJxMLJ099329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290800 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:59:24 -0000 Author: mav Date: Fri Nov 13 19:59:22 2015 New Revision: 290800 URL: https://svnweb.freebsd.org/changeset/base/290800 Log: MFC r290054: Reimplement next port handle generation. For some reason port handles should be allocated from HBA-global space, while old code was not very specific, mixing per-HBA and per-VP logic. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:58:42 2015 (r290799) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:59:22 2015 (r290800) @@ -130,7 +130,7 @@ static int isp_scan_fabric(ispsoftc_t *, static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t *); static int isp_register_fc4_type(ispsoftc_t *, int); static int isp_register_fc4_type_24xx(ispsoftc_t *, int); -static uint16_t isp_nxt_handle(ispsoftc_t *, int, uint16_t); +static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static void isp_fw_state(ispsoftc_t *, int); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *); @@ -2901,7 +2901,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_fabric_params = 0; } if (chan) { - fcp->isp_sns_hdl = NPH_SNS_HDLBASE + chan; + fcp->isp_sns_hdl = NPH_RESERVED - chan; r = isp_plogx(isp, chan, fcp->isp_sns_hdl, SNS_PORT_ID, PLOGX_FLG_CMD_PLOGI | PLOGX_FLG_COND_PLOGI | PLOGX_FLG_SKIP_PRLI, 0); if (r) { isp_prt(isp, ISP_LOGWARN, "%s: Chan %d cannot log into SNS", __func__, chan); @@ -3522,7 +3522,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha { fcparam *fcp = FCPARAM(isp, chan); uint32_t portid; - uint16_t handle, oldhandle, loopid; + uint16_t handle, loopid; isp_pdb_t pdb; int portidx, portlim, r; sns_gid_ft_rsp_t *rs0, *rs1; @@ -3625,11 +3625,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha fcp->portdb[FL_ID].state = FC_PORTDB_STATE_PENDING_VALID; /* - * Prime the handle we will start using. - */ - oldhandle = FCPARAM(isp, 0)->isp_lasthdl; - - /* * Go through the list and remove duplicate port ids. */ @@ -3822,7 +3817,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha */ if ((fcp->role & ISP_ROLE_INITIATOR) == 0 || isp_login_device(isp, chan, portid, &pdb, - &oldhandle)) { + &FCPARAM(isp, 0)->isp_lasthdl)) { lp->new_portid = portid; lp->state = FC_PORTDB_STATE_DEAD; if (fcp->isp_loopstate != @@ -3839,7 +3834,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha ISP_MARK_PORTDB(isp, chan, 1); return (-1); } - FCPARAM(isp, 0)->isp_lasthdl = oldhandle; MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(wwpn, pdb.portname); if (wwpn != lp->port_wwn || @@ -3940,7 +3934,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha * isp_login_device will check for handle and * portid consistency after login. */ - if (isp_login_device(isp, chan, portid, &pdb, &oldhandle)) { + if (isp_login_device(isp, chan, portid, &pdb, + &FCPARAM(isp, 0)->isp_lasthdl)) { if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { FC_SCRATCH_RELEASE(isp, chan); ISP_MARK_PORTDB(isp, chan, 1); @@ -3953,7 +3948,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha ISP_MARK_PORTDB(isp, chan, 1); return (-1); } - FCPARAM(isp, 0)->isp_lasthdl = oldhandle; handle = pdb.handle; MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename); @@ -4046,7 +4040,7 @@ isp_login_device(ispsoftc_t *isp, int ch lim = NPH_MAX; } - handle = isp_nxt_handle(isp, chan, *ohp); + handle = isp_next_handle(isp, ohp); for (i = 0; i < lim; i++) { /* * See if we're still logged into something with @@ -4070,7 +4064,6 @@ isp_login_device(ispsoftc_t *isp, int ch return (-1); } if (r == 0) { - *ohp = handle; break; } else if ((r & 0xffff) == MBOX_PORT_ID_USED) { /* @@ -4088,22 +4081,14 @@ isp_login_device(ispsoftc_t *isp, int ch if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) { return (-1); } - if (r == 0) { - *ohp = handle; - } else { + if (r != 0) i = lim; - } break; } else if ((r & 0xffff) == MBOX_LOOP_ID_USED) { - /* - * Try the next loop id. - */ - *ohp = handle; - handle = isp_nxt_handle(isp, chan, handle); + /* Try the next loop id. */ + handle = isp_next_handle(isp, ohp); } else { - /* - * Give up. - */ + /* Give up. */ i = lim; break; } @@ -4288,45 +4273,46 @@ isp_register_fc4_type_24xx(ispsoftc_t *i } static uint16_t -isp_nxt_handle(ispsoftc_t *isp, int chan, uint16_t handle) +isp_next_handle(ispsoftc_t *isp, uint16_t *ohp) { - int i; + fcparam *fcp; + int i, chan, wrap; + uint16_t handle, minh, maxh; + + handle = *ohp; + if (ISP_CAP_2KLOGIN(isp)) { + minh = 0; + maxh = NPH_RESERVED - isp->isp_nchan; /* Reserve for SNS */ + } else { + minh = SNS_ID + 1; + maxh = NPH_MAX - 1; + } + wrap = 0; + +next: if (handle == NIL_HANDLE) { - if (FCPARAM(isp, chan)->isp_topo == TOPO_F_PORT) { - handle = 0; - } else { - handle = SNS_ID+1; - } + handle = minh; } else { - handle += 1; - if (handle >= FL_ID && handle <= SNS_ID) { - handle = SNS_ID+1; - } - if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { - handle = NPH_IP_BCST + 1; - } - if (ISP_CAP_2KLOGIN(isp)) { - if (handle == NPH_MAX_2K) { - handle = 0; - } - } else { - if (handle == NPH_MAX) { - handle = 0; + handle++; + if (handle > maxh) { + if (++wrap >= 2) { + isp_prt(isp, ISP_LOGERR, "Out of port handles!"); + return (NIL_HANDLE); } + handle = minh; } } - if (handle == FCPARAM(isp, chan)->isp_loopid) { - return (isp_nxt_handle(isp, chan, handle)); - } - for (i = 0; i < MAX_FC_TARG; i++) { - if (FCPARAM(isp, chan)->portdb[i].state == - FC_PORTDB_STATE_NIL) { + for (chan = 0; chan < isp->isp_nchan; chan++) { + fcp = FCPARAM(isp, chan); + if (fcp->role == ISP_ROLE_NONE) continue; - } - if (FCPARAM(isp, chan)->portdb[i].handle == handle) { - return (isp_nxt_handle(isp, chan, handle)); + for (i = 0; i < MAX_FC_TARG; i++) { + if (fcp->portdb[i].state != FC_PORTDB_STATE_NIL && + fcp->portdb[i].handle == handle) + goto next; } } + *ohp = handle; return (handle); } @@ -5015,7 +5001,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct return (isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0)); } do { - p->handle = isp_nxt_handle(isp, p->channel, p->handle); + isp_next_handle(isp, &p->handle); r = isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0); if ((r & 0xffff) == MBOX_PORT_ID_USED) { p->handle = r >> 16; Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:58:42 2015 (r290799) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:59:22 2015 (r290800) @@ -244,9 +244,6 @@ typedef struct { #define SNS_ID 0x80 /* SNS Server Special ID */ #define NPH_MAX 0xfe -/* Use this handle for the base for multi-id firmware SNS logins */ -#define NPH_SNS_HDLBASE 0x400 - /* These are for 2K Login Firmware cards */ #define NPH_RESERVED 0x7F0 /* begin of reserved N-port handles */ #define NPH_MGT_ID 0x7FA /* Management Server Special ID */ From owner-svn-src-all@freebsd.org Fri Nov 13 20:25:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C610A2E360; Fri, 13 Nov 2015 20:25:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DB351283; Fri, 13 Nov 2015 20:25:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADKPVf7007856; Fri, 13 Nov 2015 20:25:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADKPVZw007855; Fri, 13 Nov 2015 20:25:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511132025.tADKPVZw007855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 Nov 2015 20:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290801 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 20:25:32 -0000 Author: bdrewery Date: Fri Nov 13 20:25:30 2015 New Revision: 290801 URL: https://svnweb.freebsd.org/changeset/base/290801 Log: Revert r290740. Discussing with sjg@, we agree the better fix is to be done in meta.stage.mk. This also broke staging of SYMLINKS for non-shared libraries, such as for lib/libcompiler_rt, which results in all Makefile.depend removing it. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Nov 13 19:59:22 2015 (r290800) +++ head/share/mk/bsd.sys.mk Fri Nov 13 20:25:30 2015 (r290801) @@ -276,8 +276,7 @@ STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif -# Don't handle SYMLINKS for libraries since stage_libs is already doing so. -.if !empty(SYMLINKS) && empty(_LIBS) +.if !empty(SYMLINKS) STAGE_TARGETS+= stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} From owner-svn-src-all@freebsd.org Fri Nov 13 20:39:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A8BA2E587; Fri, 13 Nov 2015 20:39:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED6119A3; Fri, 13 Nov 2015 20:39:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 26B9711E7; Fri, 13 Nov 2015 20:39:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CD52716B5A; Fri, 13 Nov 2015 20:39:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id LtaxggaXJOqR; Fri, 13 Nov 2015 20:39:44 +0000 (UTC) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CEA4B16B55 To: "Alexander V. Chernikov" , Randall Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56464A90.2040405@FreeBSD.org> Date: Fri, 13 Nov 2015 12:39:44 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1660421447413365@web19h.yandex.ru> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CW9sTjHg6mdRojhStSbqKAP5Ogfq95RTg" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 20:39:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CW9sTjHg6mdRojhStSbqKAP5Ogfq95RTg Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 11/13/2015 3:16 AM, Alexander V. Chernikov wrote: > 10.11.2015, 17:49, "Randall Stewart" : >> Author: rrs >> Date: Tue Nov 10 14:49:32 2015 >> New Revision: 290664 >> URL: https://svnweb.freebsd.org/changeset/base/290664 >> >> Log: >> Add new async_drain to the callout system. This is so-far not used b= ut >> should be used by TCP for sure in its cleanup of the IN-PCB (will be= coming shortly). >=20 > Randall, this commit introduced change in callout_stop() which was not = mentioned in commit message. > This change has broken lltable arp/nd handling: deleting interface addr= ess causes immediate panic. > I also see other other code/subsystems relying on callout_stop() return= value (netgraph, pfsync, iscsi). > I was not able to find any discussion/analysis/testing for these in D40= 76 so this change does not look like being properly tested prior commitin= g.. >=20 >=20 Fixing this is pretty easy. Keeping _callout_stop_safe() as a function wrapper around a new _callstop_stop_safe_drain() that takes the new argument. Then change callout_stop define to use _callstop_stop_safe_drain(). New code will avoid the wrapper function as it is recompiled. --=20 Regards, Bryan Drewery --CW9sTjHg6mdRojhStSbqKAP5Ogfq95RTg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRkqQAAoJEDXXcbtuRpfP2MgH/Rsb4k6DoC+2RpUWM18GiuB5 YXoWqzhOguIJ3pYfujBT1rddw2s7J31ZB+Q3RhMJUoBadqEilFUGK1Pr73U3TZeP nmXLwi+X3ETal25nb0MmPVlm2NLuW1NdBNxrmxb5dJxIdUEeEWTLApV+yjE1NdaX i9BQEnYGbxk6yzVxHeRj79fNchTkpBX1woHlI4yXTRLn9OOrvIAh8No5OlDK1mCp oGGn3cAbTZjhr+RFUPTas4swfEh4I33HCOvQMbmdJixvHC1l3E1pQWMxFYN0fWdr KhuBfomzcF2mP3lRNEweE47tg6+iIGUKwgeGhYiJf7arImA5tT9BC8sbgzj4gHE= =0Pmp -----END PGP SIGNATURE----- --CW9sTjHg6mdRojhStSbqKAP5Ogfq95RTg-- From owner-svn-src-all@freebsd.org Fri Nov 13 20:49:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF628A2E6D4; Fri, 13 Nov 2015 20:49:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 899461D9E; Fri, 13 Nov 2015 20:49:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 805FA13ED; Fri, 13 Nov 2015 20:49:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 33CE816B88; Fri, 13 Nov 2015 20:49:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id n3OaTvynq9F7; Fri, 13 Nov 2015 20:48:58 +0000 (UTC) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3144216B7F To: "Alexander V. Chernikov" , Randall Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56464CBA.7060206@FreeBSD.org> Date: Fri, 13 Nov 2015 12:48:58 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56464A90.2040405@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O57Uc3KRGFjE9H7grtNpeAIcE7THREfU6" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 20:49:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --O57Uc3KRGFjE9H7grtNpeAIcE7THREfU6 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 11/13/2015 12:39 PM, Bryan Drewery wrote: > On 11/13/2015 3:16 AM, Alexander V. Chernikov wrote: >> 10.11.2015, 17:49, "Randall Stewart" : >>> Author: rrs >>> Date: Tue Nov 10 14:49:32 2015 >>> New Revision: 290664 >>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>> >>> Log: >>> Add new async_drain to the callout system. This is so-far not used = but >>> should be used by TCP for sure in its cleanup of the IN-PCB (will b= e coming shortly). >> >> Randall, this commit introduced change in callout_stop() which was not= mentioned in commit message. >> This change has broken lltable arp/nd handling: deleting interface add= ress causes immediate panic. >> I also see other other code/subsystems relying on callout_stop() retur= n value (netgraph, pfsync, iscsi). >> I was not able to find any discussion/analysis/testing for these in D4= 076 so this change does not look like being properly tested prior commiti= ng.. >> >> >=20 > Fixing this is pretty easy. Keeping _callout_stop_safe() as a function > wrapper around a new _callstop_stop_safe_drain() that takes the new > argument. Then change callout_stop define to use > _callstop_stop_safe_drain(). New code will avoid the wrapper function a= s > it is recompiled. >=20 I was more speaking about hps@ point that the drain ptr is random for old modules. This should fix that: https://people.freebsd.org/~bdrewery/patches/callout-abi-compat.diff I don't have any opinion or idea on the return value though. Perhaps a revert is best for now until it can be discussed properly. --=20 Regards, Bryan Drewery --O57Uc3KRGFjE9H7grtNpeAIcE7THREfU6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRky6AAoJEDXXcbtuRpfPjTMIALeH8hd6JTFTGFQVt9q+ylgD k13e9qi+SNUeCZMs+6+5u4KgwpN7qzndd1fZQg9ovmxmmQq4DAzLBDLDutaHLVl0 kcyo4OUlpCVjH/RohAQEe6b9A7rkxjduJDLlgwZvx5o2ww0rMPb+znjHnY52WN3D kxo4wEb+QKvwzbXPCaZCNyYZ9IF9Ik710yeFiqxZvOyVGoN2zlr2mlkgmtc3C+oM ulMpI2lcywZEJsddhA24f8Aks8Cuy+IMscxi8F//soIL62lrOEM5KT909NA6JXNf W3SFjhnXeQi/wqhjwBqE49h23SR0bubjAWtW9vOGyNCFPRs4WKu1va6jrCmk+cU= =bw+E -----END PGP SIGNATURE----- --O57Uc3KRGFjE9H7grtNpeAIcE7THREfU6-- From owner-svn-src-all@freebsd.org Fri Nov 13 20:59:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8917A2E8B0 for ; Fri, 13 Nov 2015 20:59:07 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6298E1215 for ; Fri, 13 Nov 2015 20:59:07 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by padhx2 with SMTP id hx2so110657034pad.1 for ; Fri, 13 Nov 2015 12:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=vYlLOUw7K0zEBQ10q4TOdipphUfLwRdJSh59DaS4bvg=; b=K2XDTUeA+Po2o5Zv+bXdDFrbjJlpWnIe4lHQjZAZ3WsoCEqHQj7+wnYnODe+rq+0FC hAChif1t5wi6VzVv82WpuaLgdqWmf0CGXmT8g0yqp+A5RVUtSBdc8mIKvUtiCAww2Fbe VL2usbgqoLrnm999KQ1UQsDMUdN8qNLqagtV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=vYlLOUw7K0zEBQ10q4TOdipphUfLwRdJSh59DaS4bvg=; b=I9i3JNqQmJxKABDlUK4q0D8jc5cXis0kxhzx6ao/VpRExg+kD66LWV62pn0NSazcLQ 0pv54pXy9gU92Q/AR9A4QrIMeMD7geDRqXOP/CazygGKr+rheHS5Y+EH/UsI3aKKZC+v zYdAFU57mLdK8+nwjAo7XQqpKZ4CyCRH4IdA79NS3970typDtcsfuUweR7atAIYtnCsr ZENWWXrYaKWX6pZfRD53dBV5biGNAS/nApV83e1VRy74WnYCww/oKF5Eq8JlljAAjU9c /Xb0+FO8xeA5TcryphblF9b41Xg38JOa/9Bhc6z2c6bvrsM+jPqtSmkSSVe8UecD6eeQ lXQw== X-Gm-Message-State: ALoCoQlFt1Y2tMvhAfrHBUdeWqltpfJhj8gZGoDl91wT9jSSFNJ9lRwQLxT8Hd+bRIW+xLlRv/9a X-Received: by 10.66.119.174 with SMTP id kv14mr35239492pab.143.1447448346712; Fri, 13 Nov 2015 12:59:06 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id qk7sm22059504pbb.80.2015.11.13.12.59.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Nov 2015 12:59:05 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <1660421447413365@web19h.yandex.ru> Date: Fri, 13 Nov 2015 15:59:07 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 20:59:07 -0000 Strange I went looking through all calls to callout stop with cscope and saw no one paying attention to the return value=85 (which I thought was not = good). And yes I am running this in a lot of systems. R On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: > 10.11.2015, 17:49, "Randall Stewart" : >> Author: rrs >> Date: Tue Nov 10 14:49:32 2015 >> New Revision: 290664 >> URL: https://svnweb.freebsd.org/changeset/base/290664 >>=20 >> Log: >> Add new async_drain to the callout system. This is so-far not used = but >> should be used by TCP for sure in its cleanup of the IN-PCB (will = be coming shortly). >=20 > Randall, this commit introduced change in callout_stop() which was not = mentioned in commit message. > This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. > I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). > I was not able to find any discussion/analysis/testing for these in = D4076 so this change does not look like being properly tested prior = commiting.. >=20 >=20 >>=20 >> Sponsored by: Netflix Inc. >> Differential Revision: https://reviews.freebsd.org/D4076 >>=20 >> Modified: >> head/share/man/man9/timeout.9 >> head/sys/kern/kern_timeout.c >> head/sys/sys/callout.h >>=20 >> Modified: head/share/man/man9/timeout.9 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 (r290664) >> @@ -35,6 +35,7 @@ >> .Sh NAME >> .Nm callout_active , >> .Nm callout_deactivate , >> +.Nm callout_async_drain , >> .Nm callout_drain , >> .Nm callout_handle_init , >> .Nm callout_init , >> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >> .Ft void >> .Fn callout_deactivate "struct callout *c" >> .Ft int >> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >> +.Ft int >> .Fn callout_drain "struct callout *c" >> .Ft void >> .Fn callout_handle_init "struct callout_handle *handle" >> @@ -236,17 +239,42 @@ The function >> cancels a callout >> .Fa c >> if it is currently pending. >> -If the callout is pending, then >> +If the callout is pending and successfuly stopped, then >> .Fn callout_stop >> -returns a non-zero value. >> -If the callout is not set, >> -has already been serviced, >> -or is currently being serviced, >> +returns a value of one. >> +If the callout is not set, or >> +has already been serviced, then >> +negative one is returned. >> +If the callout is currently being serviced and cannot be stopped, >> 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_async_drain >> +is identical to >> +.Fn callout_stop >> +with one difference. >> +When >> +.Fn callout_async_drain >> +returns zero it will arrange for the function >> +.Fa drain >> +to be called using the same argument given to the >> +.Fn callout_reset >> +function. >> +.Fn callout_async_drain >> +If the callout has an associated lock, >> +then that lock must be held when this function is called. >> +Note that when stopping multiple callouts that use the same lock it = is possible >> +to get multiple return's of zero and multiple calls to the >> +.Fa drain >> +function, depending upon which CPU's the callouts are running. The >> +.Fa drain >> +function itself is called from the context of the completing callout >> +i.e. softclock or hardclock, just like a callout itself. >> +p >> +.Pp >> +The function >> .Fn callout_drain >> is identical to >> .Fn callout_stop >>=20 >> Modified: head/sys/kern/kern_timeout.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) >> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >> */ >> struct cc_exec { >> struct callout *cc_curr; >> + void (*cc_drain)(void *); >> #ifdef SMP >> void (*ce_migration_func)(void *); >> void *ce_migration_arg; >> @@ -170,6 +171,7 @@ struct callout_cpu { >> #define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) >>=20 >> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >> #define cc_exec_next(cc) cc->cc_next >> #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel >> #define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting >> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>=20 >> cc_exec_curr(cc, direct) =3D c; >> cc_exec_cancel(cc, direct) =3D false; >> + cc_exec_drain(cc, direct) =3D NULL; >> CC_UNLOCK(cc); >> if (c_lock !=3D NULL) { >> class->lc_lock(c_lock, lock_status); >> @@ -744,6 +747,15 @@ skip: >> CC_LOCK(cc); >> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >> cc_exec_curr(cc, direct) =3D NULL; >> + if (cc_exec_drain(cc, direct)) { >> + void (*drain)(void *); >> + >> + drain =3D cc_exec_drain(cc, direct); >> + cc_exec_drain(cc, direct) =3D NULL; >> + CC_UNLOCK(cc); >> + drain(c_arg); >> + CC_LOCK(cc); >> + } >> if (cc_exec_waiting(cc, direct)) { >> /* >> * There is someone waiting for the >> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >> } >>=20 >> int >> -_callout_stop_safe(struct callout *c, int safe) >> +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void = *)) >> { >> struct callout_cpu *cc, *old_cc; >> struct lock_class *class; >> @@ -1225,19 +1237,22 @@ again: >> * stop it by other means however. >> */ >> if (!(c->c_iflags & CALLOUT_PENDING)) { >> - c->c_flags &=3D ~CALLOUT_ACTIVE; >> - >> /* >> * If it wasn't on the queue and it isn't the = current >> * callout, then we can't stop it, so just bail. >> + * It probably has already been run (if locking >> + * is properly done). You could get here if the caller >> + * calls stop twice in a row for example. The second >> + * call would fall here without CALLOUT_ACTIVE set. >> */ >> + c->c_flags &=3D ~CALLOUT_ACTIVE; >> if (cc_exec_curr(cc, direct) !=3D c) { >> CTR3(KTR_CALLOUT, "failed to stop %p func %p = arg %p", >> c, c->c_func, c->c_arg); >> CC_UNLOCK(cc); >> if (sq_locked) >> sleepq_release(&cc_exec_waiting(cc, = direct)); >> - return (0); >> + return (-1); >> } >>=20 >> if (safe) { >> @@ -1298,14 +1313,16 @@ again: >> CC_LOCK(cc); >> } >> } else if (use_lock && >> - !cc_exec_cancel(cc, direct)) { >> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>=20 >> /* >> * The current callout is waiting for its >> * lock which we hold. Cancel the callout >> * and return. After our caller drops the >> * lock, the callout will be skipped in >> - * softclock(). >> + * softclock(). This *only* works with a >> + * callout_stop() *not* callout_drain() or >> + * callout_async_drain(). >> */ >> cc_exec_cancel(cc, direct) =3D true; >> CTR3(KTR_CALLOUT, "cancelled %p func %p arg = %p", >> @@ -1351,11 +1368,17 @@ again: >> #endif >> CTR3(KTR_CALLOUT, "postponing stop %p func = %p arg %p", >> c, c->c_func, c->c_arg); >> + if (drain) { >> + cc_exec_drain(cc, direct) =3D drain; >> + } >> CC_UNLOCK(cc); >> return (0); >> } >> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >> c, c->c_func, c->c_arg); >> + if (drain) { >> + cc_exec_drain(cc, direct) =3D drain; >> + } >> CC_UNLOCK(cc); >> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >> return (0); >>=20 >> Modified: head/sys/sys/callout.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >> @@ -81,7 +81,7 @@ struct callout_handle { >> */ >> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >> #define callout_deactivate(c) ((c)->c_flags &=3D ~CALLOUT_ACTIVE) >> -#define callout_drain(c) _callout_stop_safe(c, 1) >> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >> void callout_init(struct callout *, int); >> void _callout_init_lock(struct callout *, struct lock_object *, = int); >> #define callout_init_mtx(c, mtx, flags) \ >> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >> int callout_schedule_on(struct callout *, int, int); >> #define callout_schedule_curcpu(c, on_tick) \ >> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >> -#define callout_stop(c) _callout_stop_safe(c, 0) >> -int _callout_stop_safe(struct callout *, int); >> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >> void callout_process(sbintime_t now); >> - >> +#define callout_async_drain(c, d) \ >> + _callout_stop_safe(c, 0, d) >> #endif >>=20 >> #endif /* _SYS_CALLOUT_H_ */ -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:00:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E62C1A2E928 for ; Fri, 13 Nov 2015 21:00:00 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5AF51383 for ; Fri, 13 Nov 2015 21:00:00 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so110498987pac.3 for ; Fri, 13 Nov 2015 13:00:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=y4LrjwcSkzTb11U8RU8q7DqUy6HXdqZ7H5cIfJRp2fs=; b=iUWXgCV4ULvwFPZE5xLcnmKwvMP0j5LJC3IEEFmQ8hRhSEO8gC8FJ+xoAtPy7/5OxO fI8mOb3D4x2eprHW5mTNVMWE37M7Vb1c1EPkrlIF7iWaTP/sm/K7VKmn7V3T9Ph1Y2+g Vz1B+6EA1pA9/Au5U9TkfVb4W6EeYCMBl3nI0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=y4LrjwcSkzTb11U8RU8q7DqUy6HXdqZ7H5cIfJRp2fs=; b=Lob+VExGXD9W0yhxawMhuJEhta8ZEaek0wHOXt8p6OzL9EGIZKnVM09dl/UwzRZpyM VfgWrGpooomwTkcG1hjRAqFb2LGe/nAiKnc1WJPMpBM5zUwV2n3Zkh0NvCmZZiFjW3i5 JGo+uNcd36fjWKfkQgEvZujcsJZ77+O9V7COv3kwAkEoQ1PS2ATDN0ImhyNkrtB8Q6R0 4lzwoGMBwQnOuTRVhnKAJqA9KCaEn+KeYgB8UqhreBPO1tuFBRNbmdyF3304GirRbmzc H6XK+DW6yzMCbdi8kHZUoK9V/emNEe5wm1PC1gwURf1nyE+qWpn5KYT+mtJ5VUgM9ZkS kF2A== X-Gm-Message-State: ALoCoQlbhadiTKHCOtcktb/jfaP9dn7N08bB6envbgrv382dQZqIPWwogbVxzTLPxZ5Qmc/wgSuv X-Received: by 10.66.90.227 with SMTP id bz3mr35086620pab.36.1447448400262; Fri, 13 Nov 2015 13:00:00 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id qk7sm22059504pbb.80.2015.11.13.12.59.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Nov 2015 12:59:59 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <56464CBA.7060206@FreeBSD.org> Date: Fri, 13 Nov 2015 16:00:04 -0500 Cc: "Alexander V. Chernikov" , Randall Ray Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:00:01 -0000 Bryan: This looks like a decent thing to do.. Still wondering why changing the callout.h header file would not have = caused things to recompile to pick up the new argument.. We can do it this way though it looks fine. You want to commit it or I? R On Nov 13, 2015, at 3:48 PM, Bryan Drewery wrote: > On 11/13/2015 12:39 PM, Bryan Drewery wrote: >> On 11/13/2015 3:16 AM, Alexander V. Chernikov wrote: >>> 10.11.2015, 17:49, "Randall Stewart" : >>>> Author: rrs >>>> Date: Tue Nov 10 14:49:32 2015 >>>> New Revision: 290664 >>>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>>>=20 >>>> Log: >>>> Add new async_drain to the callout system. This is so-far not used = but >>>> should be used by TCP for sure in its cleanup of the IN-PCB (will = be coming shortly). >>>=20 >>> Randall, this commit introduced change in callout_stop() which was = not mentioned in commit message. >>> This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. >>> I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). >>> I was not able to find any discussion/analysis/testing for these in = D4076 so this change does not look like being properly tested prior = commiting.. >>>=20 >>>=20 >>=20 >> Fixing this is pretty easy. Keeping _callout_stop_safe() as a = function >> wrapper around a new _callstop_stop_safe_drain() that takes the new >> argument. Then change callout_stop define to use >> _callstop_stop_safe_drain(). New code will avoid the wrapper function = as >> it is recompiled. >>=20 >=20 > I was more speaking about hps@ point that the drain ptr is random for > old modules. >=20 > This should fix that: >=20 > https://people.freebsd.org/~bdrewery/patches/callout-abi-compat.diff >=20 > I don't have any opinion or idea on the return value though. Perhaps a > revert is best for now until it can be discussed properly. >=20 > --=20 > Regards, > Bryan Drewery -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:03:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05B01A2EA71; Fri, 13 Nov 2015 21:03:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DD78C189E; Fri, 13 Nov 2015 21:03:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id D47FA18B9; Fri, 13 Nov 2015 21:03:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9CB2F16BE7; Fri, 13 Nov 2015 21:03:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Gicq5AGir1tL; Fri, 13 Nov 2015 21:02:59 +0000 (UTC) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B860F16BDE To: Randall Stewart References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> Cc: "Alexander V. Chernikov" , Randall Ray Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56465003.8070709@FreeBSD.org> Date: Fri, 13 Nov 2015 13:02:59 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G04tTwWnx6wA5vvXQ7sS2M6ihqaW0IFjv" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:03:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G04tTwWnx6wA5vvXQ7sS2M6ihqaW0IFjv Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 11/13/2015 1:00 PM, Randall Stewart wrote: > Bryan: >=20 > This looks like a decent thing to do.. >=20 > Still wondering why changing the callout.h header file would not have c= aused > things to recompile to pick up the new argument.. >=20 > We can do it this way though it looks fine. >=20 > You want to commit it or I? Well your change is totally safe for compiling. It's just not KBI backwards compat for older modules. This is not typically a problem but I think in this case it is worth doing to avoid random data coming into the 'drain' argument if loading an older module. I'll do a test build and commit it. Perhaps this is what was leading to Alexander's panics. I haven't analyzed the return value issue at all. --=20 Regards, Bryan Drewery --G04tTwWnx6wA5vvXQ7sS2M6ihqaW0IFjv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRlADAAoJEDXXcbtuRpfPnb4IANfTG0cl9GOtj5vhJEmsfyKs y9aqkIaAEvw/ApUp9X79crEjDguThTws+jultOyLel/O+moJ5edcV8Puqsbw5V+U +L9RCslkU4wxnChBJ09069iI2hcrAlxBvryQP8iQXDjus4t5DVYwawP2vPKNkidA fg8j5kgGLmR/6vtVWGv27gVsvqUEdIRvDIW6aGQq2wCzj99KKZE1KUa0IQYJztb5 J4E8FTAhl9VbbsPbUNiNt1p3qsuiFQQ/YpXuGtn4gjcCrU7IoxiStabymUtCI4Ad LMb/24/TWG+USGcqII5k2eh6J8zUWtKPmerL9mM1eIzNLVsPTZyPHJFjtlbDXvw= =et0M -----END PGP SIGNATURE----- --G04tTwWnx6wA5vvXQ7sS2M6ihqaW0IFjv-- From owner-svn-src-all@freebsd.org Fri Nov 13 21:14:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820D1A2EBDB; Fri, 13 Nov 2015 21:14:07 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward11j.cmail.yandex.net (forward11j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::b1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 130931CAE; Fri, 13 Nov 2015 21:14:06 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web25j.yandex.ru (web25j.yandex.ru [5.45.198.66]) by forward11j.cmail.yandex.net (Yandex) with ESMTP id 60D6320742; Sat, 14 Nov 2015 00:13:54 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web25j.yandex.ru (Yandex) with ESMTP id 046A21321346; Sat, 14 Nov 2015 00:13:52 +0300 (MSK) Received: by web25j.yandex.ru with HTTP; Sat, 14 Nov 2015 00:13:52 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Randall Stewart Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" In-Reply-To: References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys Message-Id: <278491447449232@web25j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Nov 2015 00:13:52 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:14:07 -0000 From owner-svn-src-all@freebsd.org Fri Nov 13 21:19:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6323BA2EC41 for ; Fri, 13 Nov 2015 21:19:44 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::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 1DA0F1E40 for ; Fri, 13 Nov 2015 21:19:44 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by padhx2 with SMTP id hx2so111112328pad.1 for ; Fri, 13 Nov 2015 13:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=RWbzZJATu0UpD0TMVJY7++4OCcsncdKDE579td/1lXg=; b=GgzlLkPPMC1N0zXi0ni2hf/ha3GAA+60L2fvb0imMAgwU26BBMhtM25Zu5Gl76SQ4d tIomFrKBaM5DyHQfcM6DxTzfl2vJab5BlksIF6iZtJkHnyBUfNBXi6I50+19WQYbi/kQ sDl7z2lW4LbZieG6xPEVZye/mOVgbThDVMzys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=RWbzZJATu0UpD0TMVJY7++4OCcsncdKDE579td/1lXg=; b=YaWbztFkWleAZYokrFwL6M407ndZjc3L12RxP1BeY97qjEksNXyHnMJZk7U+tQVHwi r4/psM4VuDddafbuvyGtPXCOIt4vaBDS+GzYjnZPA8GFAIqZLLP5fXYzbr0aPCMa1DkX V7WXC9jS5h7rB4+GkWRPkL3/vq/W2SiH12mBk9Xpj25uIeKo0LItuJlK5EBkZbVwcmoD 9m6MxeSlhxkbov/Lp+HUnl2tKfZCWCOwIBIEaKCt09OIq3KQd19l1BUNHsN6s6VZwxgU JVuzxwRrgG4NVn1IJCb2gb7nCCjbmjN3JUih49VaxJbFCaDqEOicQr366lwyQPB0rcQS IWMg== X-Gm-Message-State: ALoCoQnuJUF0atnbw0gtm+lbc+/+DcaptkPBRQbfb9jjzrVqkvSQ5Dg0XWzynnaCStJHlAsuD6B/ X-Received: by 10.68.235.40 with SMTP id uj8mr34975551pbc.95.1447449583611; Fri, 13 Nov 2015 13:19:43 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id ur1sm6420325pbc.44.2015.11.13.13.19.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 13:19:42 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <1660421447413365@web19h.yandex.ru> Date: Fri, 13 Nov 2015 16:19:42 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:19:44 -0000 So looking deeper something like the following (with Bryan=92s patch) is = in order. Though there is one place in the task code that looks funny since it was pending =3D !!callout_stop() I changed it to pending =3D !! (callout_stop > 0) But I wonder about the double !! that seems rather convoluted.. Unless someone objects I will commit this shortly R On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: > 10.11.2015, 17:49, "Randall Stewart" : >> Author: rrs >> Date: Tue Nov 10 14:49:32 2015 >> New Revision: 290664 >> URL: https://svnweb.freebsd.org/changeset/base/290664 >>=20 >> Log: >> Add new async_drain to the callout system. This is so-far not used = but >> should be used by TCP for sure in its cleanup of the IN-PCB (will = be coming shortly). >=20 > Randall, this commit introduced change in callout_stop() which was not = mentioned in commit message. > This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. > I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). > I was not able to find any discussion/analysis/testing for these in = D4076 so this change does not look like being properly tested prior = commiting.. >=20 >=20 >>=20 >> Sponsored by: Netflix Inc. >> Differential Revision: https://reviews.freebsd.org/D4076 >>=20 >> Modified: >> head/share/man/man9/timeout.9 >> head/sys/kern/kern_timeout.c >> head/sys/sys/callout.h >>=20 >> Modified: head/share/man/man9/timeout.9 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 (r290664) >> @@ -35,6 +35,7 @@ >> .Sh NAME >> .Nm callout_active , >> .Nm callout_deactivate , >> +.Nm callout_async_drain , >> .Nm callout_drain , >> .Nm callout_handle_init , >> .Nm callout_init , >> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >> .Ft void >> .Fn callout_deactivate "struct callout *c" >> .Ft int >> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >> +.Ft int >> .Fn callout_drain "struct callout *c" >> .Ft void >> .Fn callout_handle_init "struct callout_handle *handle" >> @@ -236,17 +239,42 @@ The function >> cancels a callout >> .Fa c >> if it is currently pending. >> -If the callout is pending, then >> +If the callout is pending and successfuly stopped, then >> .Fn callout_stop >> -returns a non-zero value. >> -If the callout is not set, >> -has already been serviced, >> -or is currently being serviced, >> +returns a value of one. >> +If the callout is not set, or >> +has already been serviced, then >> +negative one is returned. >> +If the callout is currently being serviced and cannot be stopped, >> 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_async_drain >> +is identical to >> +.Fn callout_stop >> +with one difference. >> +When >> +.Fn callout_async_drain >> +returns zero it will arrange for the function >> +.Fa drain >> +to be called using the same argument given to the >> +.Fn callout_reset >> +function. >> +.Fn callout_async_drain >> +If the callout has an associated lock, >> +then that lock must be held when this function is called. >> +Note that when stopping multiple callouts that use the same lock it = is possible >> +to get multiple return's of zero and multiple calls to the >> +.Fa drain >> +function, depending upon which CPU's the callouts are running. The >> +.Fa drain >> +function itself is called from the context of the completing callout >> +i.e. softclock or hardclock, just like a callout itself. >> +p >> +.Pp >> +The function >> .Fn callout_drain >> is identical to >> .Fn callout_stop >>=20 >> Modified: head/sys/kern/kern_timeout.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) >> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >> */ >> struct cc_exec { >> struct callout *cc_curr; >> + void (*cc_drain)(void *); >> #ifdef SMP >> void (*ce_migration_func)(void *); >> void *ce_migration_arg; >> @@ -170,6 +171,7 @@ struct callout_cpu { >> #define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) >>=20 >> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >> #define cc_exec_next(cc) cc->cc_next >> #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel >> #define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting >> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>=20 >> cc_exec_curr(cc, direct) =3D c; >> cc_exec_cancel(cc, direct) =3D false; >> + cc_exec_drain(cc, direct) =3D NULL; >> CC_UNLOCK(cc); >> if (c_lock !=3D NULL) { >> class->lc_lock(c_lock, lock_status); >> @@ -744,6 +747,15 @@ skip: >> CC_LOCK(cc); >> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >> cc_exec_curr(cc, direct) =3D NULL; >> + if (cc_exec_drain(cc, direct)) { >> + void (*drain)(void *); >> + >> + drain =3D cc_exec_drain(cc, direct); >> + cc_exec_drain(cc, direct) =3D NULL; >> + CC_UNLOCK(cc); >> + drain(c_arg); >> + CC_LOCK(cc); >> + } >> if (cc_exec_waiting(cc, direct)) { >> /* >> * There is someone waiting for the >> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >> } >>=20 >> int >> -_callout_stop_safe(struct callout *c, int safe) >> +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void = *)) >> { >> struct callout_cpu *cc, *old_cc; >> struct lock_class *class; >> @@ -1225,19 +1237,22 @@ again: >> * stop it by other means however. >> */ >> if (!(c->c_iflags & CALLOUT_PENDING)) { >> - c->c_flags &=3D ~CALLOUT_ACTIVE; >> - >> /* >> * If it wasn't on the queue and it isn't the = current >> * callout, then we can't stop it, so just bail. >> + * It probably has already been run (if locking >> + * is properly done). You could get here if the caller >> + * calls stop twice in a row for example. The second >> + * call would fall here without CALLOUT_ACTIVE set. >> */ >> + c->c_flags &=3D ~CALLOUT_ACTIVE; >> if (cc_exec_curr(cc, direct) !=3D c) { >> CTR3(KTR_CALLOUT, "failed to stop %p func %p = arg %p", >> c, c->c_func, c->c_arg); >> CC_UNLOCK(cc); >> if (sq_locked) >> sleepq_release(&cc_exec_waiting(cc, = direct)); >> - return (0); >> + return (-1); >> } >>=20 >> if (safe) { >> @@ -1298,14 +1313,16 @@ again: >> CC_LOCK(cc); >> } >> } else if (use_lock && >> - !cc_exec_cancel(cc, direct)) { >> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>=20 >> /* >> * The current callout is waiting for its >> * lock which we hold. Cancel the callout >> * and return. After our caller drops the >> * lock, the callout will be skipped in >> - * softclock(). >> + * softclock(). This *only* works with a >> + * callout_stop() *not* callout_drain() or >> + * callout_async_drain(). >> */ >> cc_exec_cancel(cc, direct) =3D true; >> CTR3(KTR_CALLOUT, "cancelled %p func %p arg = %p", >> @@ -1351,11 +1368,17 @@ again: >> #endif >> CTR3(KTR_CALLOUT, "postponing stop %p func = %p arg %p", >> c, c->c_func, c->c_arg); >> + if (drain) { >> + cc_exec_drain(cc, direct) =3D drain; >> + } >> CC_UNLOCK(cc); >> return (0); >> } >> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >> c, c->c_func, c->c_arg); >> + if (drain) { >> + cc_exec_drain(cc, direct) =3D drain; >> + } >> CC_UNLOCK(cc); >> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >> return (0); >>=20 >> Modified: head/sys/sys/callout.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >> @@ -81,7 +81,7 @@ struct callout_handle { >> */ >> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >> #define callout_deactivate(c) ((c)->c_flags &=3D ~CALLOUT_ACTIVE) >> -#define callout_drain(c) _callout_stop_safe(c, 1) >> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >> void callout_init(struct callout *, int); >> void _callout_init_lock(struct callout *, struct lock_object *, = int); >> #define callout_init_mtx(c, mtx, flags) \ >> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >> int callout_schedule_on(struct callout *, int, int); >> #define callout_schedule_curcpu(c, on_tick) \ >> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >> -#define callout_stop(c) _callout_stop_safe(c, 0) >> -int _callout_stop_safe(struct callout *, int); >> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >> void callout_process(sbintime_t now); >> - >> +#define callout_async_drain(c, d) \ >> + _callout_stop_safe(c, 0, d) >> #endif >>=20 >> #endif /* _SYS_CALLOUT_H_ */ -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:20:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFA66A2ECFA for ; Fri, 13 Nov 2015 21:20:43 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::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 75DE31FFD for ; Fri, 13 Nov 2015 21:20:43 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by padhx2 with SMTP id hx2so111132832pad.1 for ; Fri, 13 Nov 2015 13:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=PK7y+xNEps/hIQJxKOL34psrsRCnvZhFVjjNaWHN+h4=; b=DUtbDh93lG4Pt4THxU7M9Qjp9YPOBrZXeXgCocNkE/0ThpIHQRTTlWaaXr+CFvF9nm Rx2epqwzXHxd5FLItX0WILXgHy+p6vW9L7z4mum1Mc64hWYC1gHQj2/csR/9P0zSkUar rMjPwEpc5UUX/EXNGC9Is8+GYZpQoDerO9HB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=PK7y+xNEps/hIQJxKOL34psrsRCnvZhFVjjNaWHN+h4=; b=HspPJ6QU+BLyefX6oXj+ULxL8/ikz7Cc8oC+XwAyuUCB3+KmMuwyVlE7zBbC+ZLeGz GPY8dCVMUYj+Qvlxz3zahYo6o/C6dgansyFWjzR8oTt9PLm7Hlh1FvyPcQkrewWXqbpa k1WG4DzH4CvjhUZ+CfaWrBEisBHcV97SOfC16hv7goB7BZciybmYTBm+47xpAVjt+ke/ 9pR+dHA9zTRYLkgInNYBigprdleFBf8N4X5Nbqf+1MLHYXpBzsDf+dANuoGCE8IS3RRW iQLNCG/mVm7HcCuElLf8LbTwwWzJR/3DerA5dZ57oodgTkX6xOrdzrYJfbCGMm1nseHk Uy5g== X-Gm-Message-State: ALoCoQmHojUT50IfSFI62mhZDQal6m0lgXoeT5k6ZYcBnZESj7WBeuTCV0bniVcge0WjvNCjY7zj X-Received: by 10.66.234.8 with SMTP id ua8mr6294212pac.45.1447449642823; Fri, 13 Nov 2015 13:20:42 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id ur1sm6420325pbc.44.2015.11.13.13.20.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 13:20:42 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <56465003.8070709@FreeBSD.org> Date: Fri, 13 Nov 2015 16:20:45 -0500 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: <4A4A2115-6392-487A-BEBE-499A68689D4A@netflix.com> References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> <56465003.8070709@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:20:43 -0000 No alexander=92s panic=92s are because the LLREF is done if (callout_stop()) But now if it was not running -1 is returned.. Try the patch I just sent.. R On Nov 13, 2015, at 4:02 PM, Bryan Drewery wrote: > On 11/13/2015 1:00 PM, Randall Stewart wrote: >> Bryan: >>=20 >> This looks like a decent thing to do.. >>=20 >> Still wondering why changing the callout.h header file would not have = caused >> things to recompile to pick up the new argument.. >>=20 >> We can do it this way though it looks fine. >>=20 >> You want to commit it or I? >=20 > Well your change is totally safe for compiling. It's just not KBI > backwards compat for older modules. This is not typically a problem = but > I think in this case it is worth doing to avoid random data coming = into > the 'drain' argument if loading an older module. >=20 > I'll do a test build and commit it. Perhaps this is what was leading = to > Alexander's panics. >=20 > I haven't analyzed the return value issue at all. >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:24:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9089A2EEC2 for ; Fri, 13 Nov 2015 21:24:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::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 8F5481434 for ; Fri, 13 Nov 2015 21:24:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by padhx2 with SMTP id hx2so111213698pad.1 for ; Fri, 13 Nov 2015 13:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=vH4UMNY+JKG3cK7sc2fVn7iJ7MaWz2apBIJJRtQ3QZ4=; b=MGcWp2toIDh1kbvAbo1oZrUOeMew/yqVAgjUEaamEKxZNd9JVJDQlhmJ5DPFYyOXeb oiaFdrqoMX8bXJN3sTGOiyAR2hkoB4iljHllxAxjcd2SSvLbkv3K4qDh1nPuz6tjIo99 e/c5tiwsUod2RsYoDlQtV3u/dRYdD1ZGiBMSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=vH4UMNY+JKG3cK7sc2fVn7iJ7MaWz2apBIJJRtQ3QZ4=; b=cjpbQlEfjLhBG8UuvwuQiR45k9hk3xU2hIaIgGXzG5dw6ICOyosB8GuPX5YhI3Wvtv Dj/Ju0ndigGBODPrGaDdRS47Ig2btX+80zBvY1/YM7RZiBeqYRI6yh2J3DGjP9zrNRZ7 waVPAA2SB8W7vpvbBdVL9hkh57x8VU/OVbDf2qpXiPG2lpCwUYSMxURcJ+IOlAHMvxfk Dmt9DIfE2J2N0NBLK8N+V35bq9FBUkq3wqt8q42e4ooZ8ON3KwxH/NptaMaS+fwWEbq8 kQhnbv37BjOcQE0zMUyRqp/xMuvoLp29q9aIgEx1szT9VlJgEIhdTVKhOyPKnHMfHYB9 5hzQ== X-Gm-Message-State: ALoCoQmbPPvs4cF6pN0UyQXf+eKqMTZ4AjTdMCHNGzGygrRis6VR026My8MYJ9rHqcFrwD5bYNqJ X-Received: by 10.66.194.16 with SMTP id hs16mr11013581pac.93.1447449887076; Fri, 13 Nov 2015 13:24:47 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id ux3sm22217266pac.18.2015.11.13.13.24.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Nov 2015 13:24:45 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <4A4A2115-6392-487A-BEBE-499A68689D4A@netflix.com> Date: Fri, 13 Nov 2015 16:24:47 -0500 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> <56465003.8070709@FreeBSD.org> <4A4A2115-6392-487A-BEBE-499A68689D4A@netflix.com> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:24:47 -0000 Looking at the patch, we need a define of your _callout_stop_safe and we need to switch callout_stop()=92s define to use the new _callout_stop_safe() R On Nov 13, 2015, at 4:20 PM, Randall Stewart wrote: > No alexander=92s panic=92s are because the > LLREF > is done if (callout_stop()) >=20 > But now if it was not running -1 is returned.. >=20 > Try the patch I just sent.. >=20 > R > On Nov 13, 2015, at 4:02 PM, Bryan Drewery = wrote: >=20 >> On 11/13/2015 1:00 PM, Randall Stewart wrote: >>> Bryan: >>>=20 >>> This looks like a decent thing to do.. >>>=20 >>> Still wondering why changing the callout.h header file would not = have caused >>> things to recompile to pick up the new argument.. >>>=20 >>> We can do it this way though it looks fine. >>>=20 >>> You want to commit it or I? >>=20 >> Well your change is totally safe for compiling. It's just not KBI >> backwards compat for older modules. This is not typically a problem = but >> I think in this case it is worth doing to avoid random data coming = into >> the 'drain' argument if loading an older module. >>=20 >> I'll do a test build and commit it. Perhaps this is what was leading = to >> Alexander's panics. >>=20 >> I haven't analyzed the return value issue at all. >>=20 >>=20 >> --=20 >> Regards, >> Bryan Drewery >>=20 >=20 > -------- > Randall Stewart > rrs@netflix.com > 803-317-4952 >=20 >=20 >=20 >=20 >=20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:32:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D55EA2E088; Fri, 13 Nov 2015 21:32:07 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward1o.mail.yandex.net (forward1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::29]) by mx1.freebsd.org (Postfix) with ESMTP id B8BF41A16; Fri, 13 Nov 2015 21:32:06 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web13o.yandex.ru (web13o.yandex.ru [IPv6:2a02:6b8:0:1a2d::5:113]) by forward1o.mail.yandex.net (Yandex) with ESMTP id AADA11301A11; Sat, 14 Nov 2015 00:32:03 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web13o.yandex.ru (Yandex) with ESMTP id 67E0B48825F7; Sat, 14 Nov 2015 00:32:02 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1447450323; bh=aa4v9ufR6mfDT1GUSTFoCblZwkMIzKudfTstzJStyf0=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=NEbd7Zw+8MU8l+Hq6r+zHSEl0uMTyn+wxGj64vsXSaVSIKyoo/gPSV3SGm7n/Stfm hl7lwga+xDCNHRKl5zYPQk0OXCTkn3PeHuYGYfGeugwa8CmsL3A9DZtc5gAbQRcJ7i 6qAhaLUGclUUfGa45EA9STjGYIrF9u++u7oY48qY= Received: by web13o.yandex.ru with HTTP; Sat, 14 Nov 2015 00:32:01 +0300 From: Alexander V. Chernikov To: Randall Stewart Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" In-Reply-To: <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys Message-Id: <81431447450321@web13o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Nov 2015 00:32:01 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:32:07 -0000 From owner-svn-src-all@freebsd.org Fri Nov 13 21:34:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26AD1A2E0EC for ; Fri, 13 Nov 2015 21:34:13 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E04481BEA for ; Fri, 13 Nov 2015 21:34:12 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pabfh17 with SMTP id fh17so111635453pab.0 for ; Fri, 13 Nov 2015 13:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Ug+Hy2LCj98I1L3IU/0K7i81PwQGJl+D/HimwT2GDYs=; b=pxQPtxOhW/qaL/lQqB6ny3owJvcM9S5B534Rr3CzRhndQpywKkwHRW3LcmcBNn/Y/K V/S1anJLEUB6bmuhpFTum5AylO/mKNugjYo+FgMbA1fgEprBD6ca7pEB6fVOArFSkCuG lR8X/zHfGeTsXDfJNHVC51BV1VQ/1h5QNczq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Ug+Hy2LCj98I1L3IU/0K7i81PwQGJl+D/HimwT2GDYs=; b=KpSpHys+0733MoTtBAmEZWoelsnYBl7BKv1h1fRhmvMMrN8FAerOPxjb81TIpSZpJR H5b1fr0ENss+LbB1NgQPVVBgLlnCggpyr2IjKsaAgBhHMe86h08h9obfQN6oN/r1kh2Q b1+EEeHBLUjOXgGyP2h+Lmib7oAVmRdyCV7A3RR5CdPG/ykEJ2T8d2iEsjI5C08WGwJA oGfFA2yaWtsa48giH0o7hzp2RiDgVUVNS32rTpJfzFWIpb/pQpseO4F8rBoH5kXCCZhO Lu6nrLrenSd2k/DNNH0euVzKn8kV5vvz/C+XsgglSAYKqYcO9B8Rf1KDo0PIhBLNYR5O 181A== X-Gm-Message-State: ALoCoQlwwyleZ/0REVx9HVgwmtS84/DzjQe6/9BLj8PCdLmHZpSrA9jaCbB9VmQ6FrF9GmndiUky X-Received: by 10.66.150.165 with SMTP id uj5mr34795447pab.23.1447450452391; Fri, 13 Nov 2015 13:34:12 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id qk7sm22139948pbb.80.2015.11.13.13.34.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Nov 2015 13:34:11 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <278491447449232@web25j.yandex.ru> Date: Fri, 13 Nov 2015 16:34:13 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" Message-Id: <343356B9-A02C-4DC6-A890-A2727436041C@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <278491447449232@web25j.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:34:13 -0000 My patch address the following: On Nov 13, 2015, at 4:13 PM, Alexander V. Chernikov = wrote: > =20 > =20 > 13.11.2015, 23:59, "Randall Stewart" : >> Strange >> =20 >> I went looking through all calls to callout stop with cscope and saw >> no one paying attention to the return value=85 (which I thought was = not good). > =20 > 23:49 [0] m@fhead5 grep -R callout_stop sys | egrep '(=3D|\)' > sys/netgraph/ng_base.c: rval =3D callout_stop(c); This one does not need changing. > sys/netpfil/pf/if_pfsync.c: if (callout_stop(&pd->pd_tmo)) { > sys/netpfil/pf/if_pfsync.c: if (callout_stop(&pd->pd_tmo)) The above two I changed to > 0 > sys/dev/isci/isci_timer.c: /* callout_stop() will *not* keep the = time None of the ones in isci_timer.c check the return code or do anything = different. >=20 > sys/netinet6/nd6.c: canceled =3D callout_stop(&ln->lle_timer); > sys/netinet6/in6.c: if (callout_stop(&lle->lle_timer)) > sys/net/if_llatbl.c: if (callout_stop(&lle->lle_timer)) The above needed the same > sys/kern/subr_taskqueue.c: pending =3D = !!callout_stop(&timeout_task->c); same as above.. only I think the !! is strange :-) > sys/kern/kern_exit.c: callout_stop(&p->p_itcallout) =3D=3D 0) { Hmm I may have missed that one let me check Ok looking at that one it does not need to be changed.. in fact it is = more correct. Since the 0 return on a already expired callout is now -1 which this if = code is looking for. > sys/kern/subr_sleepqueue.c: else if = (callout_stop(&td->td_slpcallout) =3D=3D 0) { This one again was causing extra work when the callout was already = stopped and it returned 0.. it would do a synchronize on the other CPU.. but if -1 = comes back it says the callout is already stopped.. so no synchronization is needed.. > sys/netinet/in.c: if (callout_stop(&lle->lle_timer)) > sys/netinet/tcp_timer.c: if (callout_stop(t_callout) && These two I made > 0 though the TCP one needs to change to use the new async_drain > =20 > (not counting callout_drain() here) drain is different since it is done safe it should wait for the completion of the timeout. I don=92t know if you could ever get a 0 return from it.. R > =20 >> =20 >> And yes I am running this in a lot of systems. > Try this: > 0:11 [0] fhead0# ifconfig vtnet0 alias 10.10.10.10/32 > 0:11 [0] fhead0# ifconfig vtnet0 -alias 10.10.10.10 > callout_stop() for lle 10.10.10.10 on vtnet0, lle_refcnt=3D1 > panic: bogus refcnt 0 on lle 0xfffff8001996c400 >> =20 >> R >> =20 >> =20 >> On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: >> =20 >>>=20 >>> 10.11.2015, 17:49, "Randall Stewart" : >>>>=20 >>>> Author: rrs >>>> Date: Tue Nov 10 14:49:32 2015 >>>> New Revision: 290664 >>>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>>>=20 >>>> Log: >>>> Add new async_drain to the callout system. This is so-far not = used but >>>> should be used by TCP for sure in its cleanup of the IN-PCB (will = be coming shortly). >>>=20 >>> Randall, this commit introduced change in callout_stop() which was = not mentioned in commit message. >>> This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. >>> I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). >>> I was not able to find any discussion/analysis/testing for these in = D4076 so this change does not look like being properly tested prior = commiting.. >>>=20 >>>=20 >>> =20 >>>>=20 >>>> Sponsored by: Netflix Inc. >>>> Differential Revision: https://reviews.freebsd.org/D4076 >>>>=20 >>>> Modified: >>>> head/share/man/man9/timeout.9 >>>> head/sys/kern/kern_timeout.c >>>> head/sys/sys/callout.h >>>>=20 >>>> Modified: head/share/man/man9/timeout.9 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 = (r290663) >>>> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 = (r290664) >>>> @@ -35,6 +35,7 @@ >>>> .Sh NAME >>>> .Nm callout_active , >>>> .Nm callout_deactivate , >>>> +.Nm callout_async_drain , >>>> .Nm callout_drain , >>>> .Nm callout_handle_init , >>>> .Nm callout_init , >>>> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >>>> .Ft void >>>> .Fn callout_deactivate "struct callout *c" >>>> .Ft int >>>> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >>>> +.Ft int >>>> .Fn callout_drain "struct callout *c" >>>> .Ft void >>>> .Fn callout_handle_init "struct callout_handle *handle" >>>> @@ -236,17 +239,42 @@ The function >>>> cancels a callout >>>> .Fa c >>>> if it is currently pending. >>>> -If the callout is pending, then >>>> +If the callout is pending and successfuly stopped, then >>>> .Fn callout_stop >>>> -returns a non-zero value. >>>> -If the callout is not set, >>>> -has already been serviced, >>>> -or is currently being serviced, >>>> +returns a value of one. >>>> +If the callout is not set, or >>>> +has already been serviced, then >>>> +negative one is returned. >>>> +If the callout is currently being serviced and cannot be stopped, >>>> 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_async_drain >>>> +is identical to >>>> +.Fn callout_stop >>>> +with one difference. >>>> +When >>>> +.Fn callout_async_drain >>>> +returns zero it will arrange for the function >>>> +.Fa drain >>>> +to be called using the same argument given to the >>>> +.Fn callout_reset >>>> +function. >>>> +.Fn callout_async_drain >>>> +If the callout has an associated lock, >>>> +then that lock must be held when this function is called. >>>> +Note that when stopping multiple callouts that use the same lock = it is possible >>>> +to get multiple return's of zero and multiple calls to the >>>> +.Fa drain >>>> +function, depending upon which CPU's the callouts are running. The >>>> +.Fa drain >>>> +function itself is called from the context of the completing = callout >>>> +i.e. softclock or hardclock, just like a callout itself. >>>> +p >>>> +.Pp >>>> +The function >>>> .Fn callout_drain >>>> is identical to >>>> .Fn callout_stop >>>>=20 >>>> Modified: head/sys/kern/kern_timeout.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) >>>> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) >>>> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >>>> */ >>>> struct cc_exec { >>>> struct callout *cc_curr; >>>> + void (*cc_drain)(void *); >>>> #ifdef SMP >>>> void (*ce_migration_func)(void *); >>>> void *ce_migration_arg; >>>> @@ -170,6 +171,7 @@ struct callout_cpu { >>>> #define callout_migrating(c) ((c)->c_iflags & = CALLOUT_DFRMIGRATION) >>>>=20 >>>> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >>>> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >>>> #define cc_exec_next(cc) cc->cc_next >>>> #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel >>>> #define cc_exec_waiting(cc, dir) = cc->cc_exec_entity[dir].cc_waiting >>>> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>>>=20 >>>> cc_exec_curr(cc, direct) =3D c; >>>> cc_exec_cancel(cc, direct) =3D false; >>>> + cc_exec_drain(cc, direct) =3D NULL; >>>> CC_UNLOCK(cc); >>>> if (c_lock !=3D NULL) { >>>> class->lc_lock(c_lock, lock_status); >>>> @@ -744,6 +747,15 @@ skip: >>>> CC_LOCK(cc); >>>> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >>>> cc_exec_curr(cc, direct) =3D NULL; >>>> + if (cc_exec_drain(cc, direct)) { >>>> + void (*drain)(void *); >>>> + >>>> + drain =3D cc_exec_drain(cc, direct); >>>> + cc_exec_drain(cc, direct) =3D NULL; >>>> + CC_UNLOCK(cc); >>>> + drain(c_arg); >>>> + CC_LOCK(cc); >>>> + } >>>> if (cc_exec_waiting(cc, direct)) { >>>> /* >>>> * There is someone waiting for the >>>> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >>>> } >>>>=20 >>>> int >>>> -_callout_stop_safe(struct callout *c, int safe) >>>> +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void = *)) >>>> { >>>> struct callout_cpu *cc, *old_cc; >>>> struct lock_class *class; >>>> @@ -1225,19 +1237,22 @@ again: >>>> * stop it by other means however. >>>> */ >>>> if (!(c->c_iflags & CALLOUT_PENDING)) { >>>> - c->c_flags &=3D ~CALLOUT_ACTIVE; >>>> - >>>> /* >>>> * If it wasn't on the queue and it isn't the = current >>>> * callout, then we can't stop it, so just bail. >>>> + * It probably has already been run (if locking >>>> + * is properly done). You could get here if the caller >>>> + * calls stop twice in a row for example. The second >>>> + * call would fall here without CALLOUT_ACTIVE set. >>>> */ >>>> + c->c_flags &=3D ~CALLOUT_ACTIVE; >>>> if (cc_exec_curr(cc, direct) !=3D c) { >>>> CTR3(KTR_CALLOUT, "failed to stop %p func = %p arg %p", >>>> c, c->c_func, c->c_arg); >>>> CC_UNLOCK(cc); >>>> if (sq_locked) >>>> = sleepq_release(&cc_exec_waiting(cc, direct)); >>>> - return (0); >>>> + return (-1); >>>> } >>>>=20 >>>> if (safe) { >>>> @@ -1298,14 +1313,16 @@ again: >>>> CC_LOCK(cc); >>>> } >>>> } else if (use_lock && >>>> - !cc_exec_cancel(cc, direct)) { >>>> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>>>=20 >>>> /* >>>> * The current callout is waiting for its >>>> * lock which we hold. Cancel the callout >>>> * and return. After our caller drops the >>>> * lock, the callout will be skipped in >>>> - * softclock(). >>>> + * softclock(). This *only* works with a >>>> + * callout_stop() *not* callout_drain() or >>>> + * callout_async_drain(). >>>> */ >>>> cc_exec_cancel(cc, direct) =3D true; >>>> CTR3(KTR_CALLOUT, "cancelled %p func %p = arg %p", >>>> @@ -1351,11 +1368,17 @@ again: >>>> #endif >>>> CTR3(KTR_CALLOUT, "postponing stop %p func = %p arg %p", >>>> c, c->c_func, c->c_arg); >>>> + if (drain) { >>>> + cc_exec_drain(cc, direct) =3D drain; >>>> + } >>>> CC_UNLOCK(cc); >>>> return (0); >>>> } >>>> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >>>> c, c->c_func, c->c_arg); >>>> + if (drain) { >>>> + cc_exec_drain(cc, direct) =3D drain; >>>> + } >>>> CC_UNLOCK(cc); >>>> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >>>> return (0); >>>>=20 >>>> Modified: head/sys/sys/callout.h >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >>>> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >>>> @@ -81,7 +81,7 @@ struct callout_handle { >>>> */ >>>> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >>>> #define callout_deactivate(c) ((c)->c_flags &=3D ~CALLOUT_ACTIVE) >>>> -#define callout_drain(c) _callout_stop_safe(c, 1) >>>> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >>>> void callout_init(struct callout *, int); >>>> void _callout_init_lock(struct callout *, struct lock_object *, = int); >>>> #define callout_init_mtx(c, mtx, flags) \ >>>> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >>>> int callout_schedule_on(struct callout *, int, int); >>>> #define callout_schedule_curcpu(c, on_tick) \ >>>> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >>>> -#define callout_stop(c) _callout_stop_safe(c, 0) >>>> -int _callout_stop_safe(struct callout *, int); >>>> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >>>> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >>>> void callout_process(sbintime_t now); >>>> - >>>> +#define callout_async_drain(c, d) \ >>>> + _callout_stop_safe(c, 0, d) >>>> #endif >>>>=20 >>>> #endif /* _SYS_CALLOUT_H_ */ >> =20 >> -------- >> Randall Stewart >> rrs@netflix.com >> 803-317-4952 >> =20 >>=20 >> =20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:41:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5EA1A2E344 for ; Fri, 13 Nov 2015 21:41:45 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66FBF1FE5 for ; Fri, 13 Nov 2015 21:41:45 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so111390444pac.3 for ; Fri, 13 Nov 2015 13:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=roJ1BN+wHDfh6Py6iw7n2iv+RgwJSC4N2VSX7jDG6KM=; b=TQa4TG2dLgUuVcrApc3ew5uqZIaqErhs26fOP2X6zfLnd21ZajUdiizHiIrCMBMWIy yMf3BKmXJhwpXsquTHmuGi9e77S3iSqWVCvBssm18jSOtCWgGaWsw+kbYFUd/V6PLJKP 7LOxFCo9wdP9rn90+hUPqOE6sG6bPfc0vK9YE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=roJ1BN+wHDfh6Py6iw7n2iv+RgwJSC4N2VSX7jDG6KM=; b=Hr4AHlK1D08XDvnXbbQRFZsZ+iwEZQJplRGF3znZfnfTQZeJfAB4pum6z1AvVF0UvF bgrMsjGplDagc5W1SDBBWs9XRXkuHsN8fDm08qvSzk2zfhuRL4aN+h5bJm3WE+BkUzxl uAMa7Mg1XqdyZT1XKxaQRKDPQU+f5p1QiUY6hPNHMJsOHU7xqS8dfwX8SQ181/ZME3dO ioLDtm8HEEK7Q49Yw/yO3sML6PHuuNHr5YDAxbVKUpLV/47CeoHeeqd2NMBB+DqboQJc isNtojh5KHgMssaL+SWXl0d7DO3m6TXwWWhoDKcnztirzSf5vXy91dziyHUZXAhfncM/ jyeA== X-Gm-Message-State: ALoCoQleohKVXHzX0uQ2Qvjmr4Qr1amrmHwkvjjYhmfaxDNiFY9sb8r0T/WyLzMv5pqth5+yyIUh X-Received: by 10.66.236.201 with SMTP id uw9mr34958040pac.76.1447450904987; Fri, 13 Nov 2015 13:41:44 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id ns1sm22173985pbc.67.2015.11.13.13.41.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 13:41:43 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <81431447450321@web13o.yandex.ru> Date: Fri, 13 Nov 2015 16:41:44 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" Message-Id: <19FCC2F9-0986-4106-9559-75E65184704C@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> <81431447450321@web13o.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:41:45 -0000 Hmm callout_reset() returns either 0 or 1=20 It returns no other values and did not change.. maybe ti should say = positive or one in the manual=85 I can add that to the fix patch. R On Nov 13, 2015, at 4:32 PM, Alexander V. Chernikov = wrote: > One small note on lltable: change in nd6_llinfo_settimer_locked() = assumes that callout_reset() returns >0 for stopped callout. The man = page still says "non-zero value" for that case. > (And that was the reason of writing comment to D4076 on inconsistent = callout_reset() return value). > =20 >=20 >=20 > 14.11.2015, 00:19, "Randall Stewart" : >> So looking deeper something like the following (with Bryan=92s patch) = is in order. >>=20 >> Though there is one place in the task code that looks funny since it = was >>=20 >> pending =3D !!callout_stop() >>=20 >> I changed it to >>=20 >> pending =3D !! (callout_stop > 0) >>=20 >> But I wonder about the double !! that seems rather convoluted.. >>=20 >> Unless someone objects I will commit this shortly >> R >>=20 >>=20 >>=20 >> , >> On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: >>=20 >>> 10.11.2015, 17:49, "Randall Stewart" : >>>> Author: rrs >>>> Date: Tue Nov 10 14:49:32 2015 >>>> New Revision: 290664 >>>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>>>=20 >>>> Log: >>>> Add new async_drain to the callout system. This is so-far not = used but >>>> should be used by TCP for sure in its cleanup of the IN-PCB (will = be coming shortly). >>>=20 >>> Randall, this commit introduced change in callout_stop() which was = not mentioned in commit message. >>> This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. >>> I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). >>> I was not able to find any discussion/analysis/testing for these in = D4076 so this change does not look like being properly tested prior = commiting.. >>>=20 >>>=20 >>>>=20 >>>> Sponsored by: Netflix Inc. >>>> Differential Revision: https://reviews.freebsd.org/D4076 >>>>=20 >>>> Modified: >>>> head/share/man/man9/timeout.9 >>>> head/sys/kern/kern_timeout.c >>>> head/sys/sys/callout.h >>>>=20 >>>> Modified: head/share/man/man9/timeout.9 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 = (r290663) >>>> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 = (r290664) >>>> @@ -35,6 +35,7 @@ >>>> .Sh NAME >>>> .Nm callout_active , >>>> .Nm callout_deactivate , >>>> +.Nm callout_async_drain , >>>> .Nm callout_drain , >>>> .Nm callout_handle_init , >>>> .Nm callout_init , >>>> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >>>> .Ft void >>>> .Fn callout_deactivate "struct callout *c" >>>> .Ft int >>>> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >>>> +.Ft int >>>> .Fn callout_drain "struct callout *c" >>>> .Ft void >>>> .Fn callout_handle_init "struct callout_handle *handle" >>>> @@ -236,17 +239,42 @@ The function >>>> cancels a callout >>>> .Fa c >>>> if it is currently pending. >>>> -If the callout is pending, then >>>> +If the callout is pending and successfuly stopped, then >>>> .Fn callout_stop >>>> -returns a non-zero value. >>>> -If the callout is not set, >>>> -has already been serviced, >>>> -or is currently being serviced, >>>> +returns a value of one. >>>> +If the callout is not set, or >>>> +has already been serviced, then >>>> +negative one is returned. >>>> +If the callout is currently being serviced and cannot be stopped, >>>> 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_async_drain >>>> +is identical to >>>> +.Fn callout_stop >>>> +with one difference. >>>> +When >>>> +.Fn callout_async_drain >>>> +returns zero it will arrange for the function >>>> +.Fa drain >>>> +to be called using the same argument given to the >>>> +.Fn callout_reset >>>> +function. >>>> +.Fn callout_async_drain >>>> +If the callout has an associated lock, >>>> +then that lock must be held when this function is called. >>>> +Note that when stopping multiple callouts that use the same lock = it is possible >>>> +to get multiple return's of zero and multiple calls to the >>>> +.Fa drain >>>> +function, depending upon which CPU's the callouts are running. The >>>> +.Fa drain >>>> +function itself is called from the context of the completing = callout >>>> +i.e. softclock or hardclock, just like a callout itself. >>>> +p >>>> +.Pp >>>> +The function >>>> .Fn callout_drain >>>> is identical to >>>> .Fn callout_stop >>>>=20 >>>> Modified: head/sys/kern/kern_timeout.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 (r290663) >>>> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 (r290664) >>>> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >>>> */ >>>> struct cc_exec { >>>> struct callout *cc_curr; >>>> + void (*cc_drain)(void *); >>>> #ifdef SMP >>>> void (*ce_migration_func)(void *); >>>> void *ce_migration_arg; >>>> @@ -170,6 +171,7 @@ struct callout_cpu { >>>> #define callout_migrating(c) ((c)->c_iflags & = CALLOUT_DFRMIGRATION) >>>>=20 >>>> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >>>> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >>>> #define cc_exec_next(cc) cc->cc_next >>>> #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel >>>> #define cc_exec_waiting(cc, dir) = cc->cc_exec_entity[dir].cc_waiting >>>> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>>>=20 >>>> cc_exec_curr(cc, direct) =3D c; >>>> cc_exec_cancel(cc, direct) =3D false; >>>> + cc_exec_drain(cc, direct) =3D NULL; >>>> CC_UNLOCK(cc); >>>> if (c_lock !=3D NULL) { >>>> class->lc_lock(c_lock, lock_status); >>>> @@ -744,6 +747,15 @@ skip: >>>> CC_LOCK(cc); >>>> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >>>> cc_exec_curr(cc, direct) =3D NULL; >>>> + if (cc_exec_drain(cc, direct)) { >>>> + void (*drain)(void *); >>>> + >>>> + drain =3D cc_exec_drain(cc, direct); >>>> + cc_exec_drain(cc, direct) =3D NULL; >>>> + CC_UNLOCK(cc); >>>> + drain(c_arg); >>>> + CC_LOCK(cc); >>>> + } >>>> if (cc_exec_waiting(cc, direct)) { >>>> /* >>>> * There is someone waiting for the >>>> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >>>> } >>>>=20 >>>> int >>>> -_callout_stop_safe(struct callout *c, int safe) >>>> +_callout_stop_safe(struct callout *c, int safe, void (*drain)(void = *)) >>>> { >>>> struct callout_cpu *cc, *old_cc; >>>> struct lock_class *class; >>>> @@ -1225,19 +1237,22 @@ again: >>>> * stop it by other means however. >>>> */ >>>> if (!(c->c_iflags & CALLOUT_PENDING)) { >>>> - c->c_flags &=3D ~CALLOUT_ACTIVE; >>>> - >>>> /* >>>> * If it wasn't on the queue and it isn't the = current >>>> * callout, then we can't stop it, so just bail. >>>> + * It probably has already been run (if locking >>>> + * is properly done). You could get here if the caller >>>> + * calls stop twice in a row for example. The second >>>> + * call would fall here without CALLOUT_ACTIVE set. >>>> */ >>>> + c->c_flags &=3D ~CALLOUT_ACTIVE; >>>> if (cc_exec_curr(cc, direct) !=3D c) { >>>> CTR3(KTR_CALLOUT, "failed to stop %p func = %p arg %p", >>>> c, c->c_func, c->c_arg); >>>> CC_UNLOCK(cc); >>>> if (sq_locked) >>>> = sleepq_release(&cc_exec_waiting(cc, direct)); >>>> - return (0); >>>> + return (-1); >>>> } >>>>=20 >>>> if (safe) { >>>> @@ -1298,14 +1313,16 @@ again: >>>> CC_LOCK(cc); >>>> } >>>> } else if (use_lock && >>>> - !cc_exec_cancel(cc, direct)) { >>>> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>>>=20 >>>> /* >>>> * The current callout is waiting for its >>>> * lock which we hold. Cancel the callout >>>> * and return. After our caller drops the >>>> * lock, the callout will be skipped in >>>> - * softclock(). >>>> + * softclock(). This *only* works with a >>>> + * callout_stop() *not* callout_drain() or >>>> + * callout_async_drain(). >>>> */ >>>> cc_exec_cancel(cc, direct) =3D true; >>>> CTR3(KTR_CALLOUT, "cancelled %p func %p = arg %p", >>>> @@ -1351,11 +1368,17 @@ again: >>>> #endif >>>> CTR3(KTR_CALLOUT, "postponing stop %p func = %p arg %p", >>>> c, c->c_func, c->c_arg); >>>> + if (drain) { >>>> + cc_exec_drain(cc, direct) =3D drain; >>>> + } >>>> CC_UNLOCK(cc); >>>> return (0); >>>> } >>>> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >>>> c, c->c_func, c->c_arg); >>>> + if (drain) { >>>> + cc_exec_drain(cc, direct) =3D drain; >>>> + } >>>> CC_UNLOCK(cc); >>>> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >>>> return (0); >>>>=20 >>>> Modified: head/sys/sys/callout.h >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >>>> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >>>> @@ -81,7 +81,7 @@ struct callout_handle { >>>> */ >>>> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >>>> #define callout_deactivate(c) ((c)->c_flags &=3D ~CALLOUT_ACTIVE) >>>> -#define callout_drain(c) _callout_stop_safe(c, 1) >>>> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >>>> void callout_init(struct callout *, int); >>>> void _callout_init_lock(struct callout *, struct lock_object *, = int); >>>> #define callout_init_mtx(c, mtx, flags) \ >>>> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >>>> int callout_schedule_on(struct callout *, int, int); >>>> #define callout_schedule_curcpu(c, on_tick) \ >>>> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >>>> -#define callout_stop(c) _callout_stop_safe(c, 0) >>>> -int _callout_stop_safe(struct callout *, int); >>>> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >>>> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >>>> void callout_process(sbintime_t now); >>>> - >>>> +#define callout_async_drain(c, d) \ >>>> + _callout_stop_safe(c, 0, d) >>>> #endif >>>>=20 >>>> #endif /* _SYS_CALLOUT_H_ */ >>=20 >> -------- >> Randall Stewart >> rrs@netflix.com >> 803-317-4952 >>=20 >>=20 >>=20 >>=20 >>=20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:42:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C5FA2E385; Fri, 13 Nov 2015 21:42:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 AEB7811C8; Fri, 13 Nov 2015 21:42:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tADLg4EV073147 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Nov 2015 00:42:04 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tADLg4gc073146; Sat, 14 Nov 2015 00:42:04 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Nov 2015 00:42:04 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290403 - head/sys/netinet Message-ID: <20151113214204.GA73031@FreeBSD.org> References: <201511051723.tA5HN24j065530@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511051723.tA5HN24j065530@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:42:15 -0000 Steven, On Thu, Nov 05, 2015 at 05:23:02PM +0000, Steven Hartland wrote: S> Author: smh S> Date: Thu Nov 5 17:23:02 2015 S> New Revision: 290403 S> URL: https://svnweb.freebsd.org/changeset/base/290403 S> S> Log: S> Add MTU support to carp interfaces S> S> MFC after: 2 weeks S> Sponsored by: Multiplay What is "carp interfaces"? I believe you are committing a patch to FreeBSD 9 into FreeBSD 11, w/o doing any testing and w/o doing even light review of surrounding code, which differes a lot from FreeBSD 9. Please back this out or correct me being wrong. S> Modified: S> head/sys/netinet/ip_carp.c S> S> Modified: head/sys/netinet/ip_carp.c S> ============================================================================== S> --- head/sys/netinet/ip_carp.c Thu Nov 5 17:19:08 2015 (r290402) S> +++ head/sys/netinet/ip_carp.c Thu Nov 5 17:23:02 2015 (r290403) S> @@ -1769,6 +1769,13 @@ carp_ioctl(struct ifreq *ifr, u_long cmd S> } S> break; S> } S> + case SIOCSIFMTU: S> + if (ifr->ifr_mtu > ETHERMTU_JUMBO) { S> + error = EINVAL; S> + } else { S> + ifp->if_mtu = ifr->ifr_mtu; S> + } S> + break; S> default: S> error = EINVAL; S> } S> _______________________________________________ S> svn-src-all@freebsd.org mailing list S> https://lists.freebsd.org/mailman/listinfo/svn-src-all S> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Nov 13 21:43:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E39A2E3E9; Fri, 13 Nov 2015 21:43:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 710A31485; Fri, 13 Nov 2015 21:43:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 644DA1833; Fri, 13 Nov 2015 21:43:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1C2AB16D48; Fri, 13 Nov 2015 21:43:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3nokw7EVyLEV; Fri, 13 Nov 2015 21:43:45 +0000 (UTC) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 892A616D41 To: Randall Stewart References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> <56465003.8070709@FreeBSD.org> <4A4A2115-6392-487A-BEBE-499A68689D4A@netflix.com> Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56465991.5090906@FreeBSD.org> Date: Fri, 13 Nov 2015 13:43:45 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uRGlu0WMxOdm89LDmBTvN3SS6NevFDrkc" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:43:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uRGlu0WMxOdm89LDmBTvN3SS6NevFDrkc Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable On 11/13/2015 1:24 PM, Randall Stewart wrote: > Looking at the patch, we need a define of your >=20 > _callout_stop_safe >=20 > and we need to switch >=20 > callout_stop()=92s define to use the new _callout_stop_safe() For both cases, there would be no reason to have new code call my wrapper. The defines in my patch are fine for new code. The "new" _callout_stop_safe function is just for existing modules. I think the historical consensus is to not commit my patch though as people should recompile their modules when the kernel is updated, before rebooting into the new kernel even. >=20 > R > On Nov 13, 2015, at 4:20 PM, Randall Stewart > wrote: >=20 >> No alexander=92s panic=92s are because the >> LLREF >> is done if (callout_stop()) >> >> But now if it was not running -1 is returned.. >> >> Try the patch I just sent.. >> >> R >> On Nov 13, 2015, at 4:02 PM, Bryan Drewery > > wrote: >> >>> On 11/13/2015 1:00 PM, Randall Stewart wrote: >>>> Bryan: >>>> >>>> This looks like a decent thing to do.. >>>> >>>> Still wondering why changing the callout.h header file would not >>>> have caused >>>> things to recompile to pick up the new argument.. >>>> >>>> We can do it this way though it looks fine. >>>> >>>> You want to commit it or I? >>> >>> Well your change is totally safe for compiling. It's just not KBI >>> backwards compat for older modules. This is not typically a problem b= ut >>> I think in this case it is worth doing to avoid random data coming in= to >>> the 'drain' argument if loading an older module. >>> >>> I'll do a test build and commit it. Perhaps this is what was leading = to >>> Alexander's panics. >>> >>> I haven't analyzed the return value issue at all. >>> >>> --=20 Regards, Bryan Drewery --uRGlu0WMxOdm89LDmBTvN3SS6NevFDrkc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWRlmRAAoJEDXXcbtuRpfPX6EH/RW325PZr6YxDWWyxgac5lj5 AE6VtdT8Df6wiF8lC+Jv5VwgzT7xG+SC21K/wXjsxIkivtyug3PEbUyASz6CmUTv /onaL9cwFL9+ozIoJTGXSKgT7PQRQbbalQmYgXe5DY+DuZU9j1ij/WbFcgSZ9w8f ySjH41nqTgN0JicD7PyaM8Dj+tmWKa/+ZFYr5WMyqIvJ/7LNltmftbstAuL8OiGo +s2bD24QB2SgMiD7+t70mbHcv76eyeku+ZV+H9Oo1HraCqcw76uKjrrSt6fwMfnL Nyiaohho69XVLhWEFIgmbtFEvpcVtu4t4ttM9OyITkOr0JjT6cXajFzwxcU6Fjg= =pVGx -----END PGP SIGNATURE----- --uRGlu0WMxOdm89LDmBTvN3SS6NevFDrkc-- From owner-svn-src-all@freebsd.org Fri Nov 13 21:47:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698E3A2E450 for ; Fri, 13 Nov 2015 21:47:55 +0000 (UTC) (envelope-from rrs@netflix.com) 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 2E098175E for ; Fri, 13 Nov 2015 21:47:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pabfh17 with SMTP id fh17so111922296pab.0 for ; Fri, 13 Nov 2015 13:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Xrh6ujRVWsjbxqUpvnicdqW/M26eudKwY050lTEK5sI=; b=ZDPEE4kLy+S8HYaKlN8Y7EdDBRgrYEIYnPeEoLBlwIZAxG3+v+Vf5IgKeAevthI3zD Q3oEcKced1kaOUsbqocsgt6AnsufVBvTgII0plPmNg7DRZn8CS6Ly0siQ69TBv6x8Qpp 508A8MdykiXHSd69u+ZEV7u08U0RB7CGe1riI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Xrh6ujRVWsjbxqUpvnicdqW/M26eudKwY050lTEK5sI=; b=Con5GlWGrKCPRaWAO9ZVO9QRMMCgE7P0hR/u4u3Pl+fBsydod2mh02e5KHvYzf3j4A /OtVSlt+F3Pdj9LtaPFccD1JPHytQgbYR3yOK1bVcyTXmkQL8EcaUPGta/3clgP6y3XE Wckxnde2jWbLR89m03E8vUN5VPCFKqR8+mipVJWJ/WwZZlXrhX/mHuFAoPd8VYxVfS6L xhnRzZiEgzZT6yduQZ1AK2EHB108h2bSp0vn7dmg8yABklpXH6Rgr0ScRq9zfP3F+wp2 WntHPurPRv4bCL17YOBHeCStOspgoeUURbBlOb84yuadTPttH+sMa3wcZj2xFej6y0TN 1iBw== X-Gm-Message-State: ALoCoQnUc5r9Re/h4a1u2WAUM3MinCqB7ADK5cTYcNQcq9yUKgff5Ri2VOGzlmX2L6lXlIc5OdcV X-Received: by 10.67.30.168 with SMTP id kf8mr35875370pad.106.1447451274729; Fri, 13 Nov 2015 13:47:54 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id cn4sm22167889pbc.94.2015.11.13.13.47.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 13:47:53 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <56465991.5090906@FreeBSD.org> Date: Fri, 13 Nov 2015 16:47:53 -0500 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , imp@freebsd.org Message-Id: References: <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <56464A90.2040405@FreeBSD.org> <56464CBA.7060206@FreeBSD.org> <56465003.8070709@FreeBSD.org> <4A4A2115-6392-487A-BEBE-499A68689D4A@netflix.com> <56465991.5090906@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:47:55 -0000 On Nov 13, 2015, at 4:43 PM, Bryan Drewery wrote: > On 11/13/2015 1:24 PM, Randall Stewart wrote: >> Looking at the patch, we need a define of your >>=20 >> _callout_stop_safe >>=20 >> and we need to switch >>=20 >> callout_stop()=92s define to use the new _callout_stop_safe() >=20 > For both cases, there would be no reason to have new code call my > wrapper. The defines in my patch are fine for new code. The "new" > _callout_stop_safe function is just for existing modules. >=20 > I think the historical consensus is to not commit my patch though as > people should recompile their modules when the kernel is updated, = before > rebooting into the new kernel even. I did (as Han=92s suggested) bump the FreeBSD version number.. So maybe thats good enough. R >=20 >=20 >>=20 >> R >> On Nov 13, 2015, at 4:20 PM, Randall Stewart > > wrote: >>=20 >>> No alexander=92s panic=92s are because the >>> LLREF >>> is done if (callout_stop()) >>>=20 >>> But now if it was not running -1 is returned.. >>>=20 >>> Try the patch I just sent.. >>>=20 >>> R >>> On Nov 13, 2015, at 4:02 PM, Bryan Drewery >> > wrote: >>>=20 >>>> On 11/13/2015 1:00 PM, Randall Stewart wrote: >>>>> Bryan: >>>>>=20 >>>>> This looks like a decent thing to do.. >>>>>=20 >>>>> Still wondering why changing the callout.h header file would not >>>>> have caused >>>>> things to recompile to pick up the new argument.. >>>>>=20 >>>>> We can do it this way though it looks fine. >>>>>=20 >>>>> You want to commit it or I? >>>>=20 >>>> Well your change is totally safe for compiling. It's just not KBI >>>> backwards compat for older modules. This is not typically a problem = but >>>> I think in this case it is worth doing to avoid random data coming = into >>>> the 'drain' argument if loading an older module. >>>>=20 >>>> I'll do a test build and commit it. Perhaps this is what was = leading to >>>> Alexander's panics. >>>>=20 >>>> I haven't analyzed the return value issue at all. >>>>=20 >>>>=20 >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 21:49:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FD5A2E4A7; Fri, 13 Nov 2015 21:49:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E162C18F9; Fri, 13 Nov 2015 21:49:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADLnmHt032996; Fri, 13 Nov 2015 21:49:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADLnm5N032995; Fri, 13 Nov 2015 21:49:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201511132149.tADLnm5N032995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Nov 2015 21:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290802 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:49:50 -0000 Author: glebius Date: Fri Nov 13 21:49:48 2015 New Revision: 290802 URL: https://svnweb.freebsd.org/changeset/base/290802 Log: Review on pf is recommended. Add kp@ to the list. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Fri Nov 13 20:25:30 2015 (r290801) +++ head/MAINTAINERS Fri Nov 13 21:49:48 2015 (r290802) @@ -59,6 +59,7 @@ contrib/llvm dim Pre-commit review pref contrib/llvm/tools/lldb emaste Pre-commit review preferred. atf freebsd-testing,jmmv,ngie Pre-commit review requested. contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. +contrib/pf kp,glebius Pre-commit review recommended. contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. tests freebsd-testing,ngie Pre-commit review requested. @@ -111,7 +112,6 @@ ntp roberto Pre-commit review r inetd dwmalone Recommends pre-commit review. contrib/smbfs bp Open for in-tree committs. In case of functional changes pre-commit review requested. -contrib/pf glebius Pre-commit review recommended. file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. From owner-svn-src-all@freebsd.org Fri Nov 13 21:51:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80533A2E5FE; Fri, 13 Nov 2015 21:51:52 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward15o.cmail.yandex.net (forward15o.cmail.yandex.net [37.9.109.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19AB81C24; Fri, 13 Nov 2015 21:51:51 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web13o.yandex.ru (web13o.yandex.ru [IPv6:2a02:6b8:0:1a2d::5:113]) by forward15o.cmail.yandex.net (Yandex) with ESMTP id 2B085216A6; Sat, 14 Nov 2015 00:51:42 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web13o.yandex.ru (Yandex) with ESMTP id 0CE68488262E; Sat, 14 Nov 2015 00:51:40 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1447451501; bh=7N34Dpj6i7504/ggncGlW1vt8Q0vxlNau+LJZ++ea1Q=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=V461deJLTTmoIdqHDJaJYZH5jMy4jrrZUHP6lukmemdF4y8TZZ/q1HbIS0sJGZN3+ xPyB3Hb3meabE3wgmEs9v97RoymlDBvkT1Q3qdz/3ocjxwRhl/Vjb5WZ/Dym+h91yE R7icoQFtANVdeBhMjgzLBFYwu4yazKM5If2sDWhM= Received: by web13o.yandex.ru with HTTP; Sat, 14 Nov 2015 00:51:40 +0300 From: Alexander V. Chernikov To: Randall Stewart Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" In-Reply-To: <19FCC2F9-0986-4106-9559-75E65184704C@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> <81431447450321@web13o.yandex.ru> <19FCC2F9-0986-4106-9559-75E65184704C@netflix.com> Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys Message-Id: <94281447451500@web13o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Nov 2015 00:51:40 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:51:52 -0000 From owner-svn-src-all@freebsd.org Fri Nov 13 22:27:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BBA0A2EC49; Fri, 13 Nov 2015 22:27:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C81261CFD; Fri, 13 Nov 2015 22:27:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADMROqx046453; Fri, 13 Nov 2015 22:27:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMROxU046452; Fri, 13 Nov 2015 22:27:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511132227.tADMROxU046452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 Nov 2015 22:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290803 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:27:26 -0000 Author: bdrewery Date: Fri Nov 13 22:27:24 2015 New Revision: 290803 URL: https://svnweb.freebsd.org/changeset/base/290803 Log: META MODE: Don't double stage SYMLINKS for shared libraries. This also fixes truncating the path that the links were installed to, which was most likely going to be the same directory the library was in anyhow. Let bsd.sys.mk handle SYMLINKS via stage_symlinks. stage_libs continues to handle the SHLIB_LINK though since it is not a SYMLINKS. This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created by both stage_libs and stage_symlinks resulting in 'ln: File exists'. Sponsored by: EMC / Isilon Storage Division Discussed with: sjg Modified: head/share/mk/meta.stage.mk Modified: head/share/mk/meta.stage.mk ============================================================================== --- head/share/mk/meta.stage.mk Fri Nov 13 21:49:48 2015 (r290802) +++ head/share/mk/meta.stage.mk Fri Nov 13 22:27:24 2015 (r290803) @@ -156,7 +156,7 @@ stage_libs: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \ ${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@} .elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME) - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} .endif .endif @touch $@ From owner-svn-src-all@freebsd.org Fri Nov 13 22:33:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44729A2EEF2; Fri, 13 Nov 2015 22:33:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8141157; Fri, 13 Nov 2015 22:33:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADMXpT4049376; Fri, 13 Nov 2015 22:33:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMXp4M049375; Fri, 13 Nov 2015 22:33:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511132233.tADMXp4M049375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 22:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290804 - in stable: 10/usr.sbin/pciconf 9/usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:33:53 -0000 Author: jhb Date: Fri Nov 13 22:33:51 2015 New Revision: 290804 URL: https://svnweb.freebsd.org/changeset/base/290804 Log: MFC 290412: Note if relaxed ordering or no snoop is enabled for each PCI-express device. Modified: stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/10/usr.sbin/pciconf/cap.c ============================================================================== --- stable/10/usr.sbin/pciconf/cap.c Fri Nov 13 22:27:24 2015 (r290803) +++ stable/10/usr.sbin/pciconf/cap.c Fri Nov 13 22:33:51 2015 (r290804) @@ -459,6 +459,10 @@ cap_express(int fd, struct pci_conf *p, MAX_PAYLOAD(cap & PCIEM_CAP_MAX_PAYLOAD)); if ((cap & PCIEM_CAP_FLR) != 0) printf(" FLR"); + if (ctl & PCIEM_CTL_RELAXED_ORD_ENABLE) + printf(" RO"); + if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) + printf(" NS"); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, From owner-svn-src-all@freebsd.org Fri Nov 13 22:33:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B75CA2EEF3; Fri, 13 Nov 2015 22:33:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A011158; Fri, 13 Nov 2015 22:33:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADMXqL6049382; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMXqSL049381; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511132233.tADMXqSL049381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 22:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290804 - in stable: 10/usr.sbin/pciconf 9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:33:53 -0000 Author: jhb Date: Fri Nov 13 22:33:51 2015 New Revision: 290804 URL: https://svnweb.freebsd.org/changeset/base/290804 Log: MFC 290412: Note if relaxed ordering or no snoop is enabled for each PCI-express device. Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:27:24 2015 (r290803) +++ stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:33:51 2015 (r290804) @@ -458,6 +458,10 @@ cap_express(int fd, struct pci_conf *p, MAX_PAYLOAD(cap & PCIEM_CAP_MAX_PAYLOAD)); if ((cap & PCIEM_CAP_FLR) != 0) printf(" FLR"); + if (ctl & PCIEM_CTL_RELAXED_ORD_ENABLE) + printf(" RO"); + if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) + printf(" NS"); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, From owner-svn-src-all@freebsd.org Fri Nov 13 22:36:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 593A6A2EFEE; Fri, 13 Nov 2015 22:36:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 DC6E7149E; Fri, 13 Nov 2015 22:36:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tADMaRoa073703 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Nov 2015 01:36:27 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tADMaRlM073702; Sat, 14 Nov 2015 01:36:27 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Nov 2015 01:36:27 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290450 - in head: sbin/ifconfig share/man/man4 sys/net Message-ID: <20151113223627.GC73031@FreeBSD.org> References: <201511061533.tA6FXSmq054394@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511061533.tA6FXSmq054394@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:36:31 -0000 On Fri, Nov 06, 2015 at 03:33:28PM +0000, Steven Hartland wrote: S> Author: smh S> Date: Fri Nov 6 15:33:27 2015 S> New Revision: 290450 S> URL: https://svnweb.freebsd.org/changeset/base/290450 S> S> Log: S> Add sysctl to control LACP strict compliance default S> S> Add net.link.lagg.lacp.default_strict_mode which defines S> the default value for LACP strict compliance for created S> lagg devices. S> S> Also: S> * Add lacp_strict option to ifconfig(8). S> * Fix lagg(4) creation examples. S> * Minor style(9) fix. AFAIU, you are adding the sysctl to close a very short period of time between cloning a lagg(4) and configuring it. This is not a pretty solution to the problem. But the network stack has an API for supplying extra parameters at the cloning time. The lagg_clone_create() accepts the params, that can be supplied by ifconfig. If you put there the same arguments you supply with SIOCGLAGGOPTS, you can create and configure a lagg in one syscall. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Nov 13 22:44:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B73A2E220; Fri, 13 Nov 2015 22:44:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 B7C621A93; Fri, 13 Nov 2015 22:44:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tADMiVkg073759 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Nov 2015 01:44:31 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tADMiVGN073758; Sat, 14 Nov 2015 01:44:31 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Nov 2015 01:44:31 +0300 From: Gleb Smirnoff To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290481 - head/sys/kern Message-ID: <20151113224431.GD73031@FreeBSD.org> References: <201511070404.tA7440RE080849@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511070404.tA7440RE080849@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:44:36 -0000 On Sat, Nov 07, 2015 at 04:04:00AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Sat Nov 7 04:04:00 2015 A> New Revision: 290481 A> URL: https://svnweb.freebsd.org/changeset/base/290481 A> A> Log: A> Add a sched_yield() to work around low memory conditions in the current code. A> A> Things seem to get stuck in low memory conditions where no bufs are available, A> the reclamation path is called to wakeup the daemon, but no sleeping is done. A> Because of this, we are stuck in a tight loop in the current process and A> never run said reclamation path. A> A> This was introduced in r289279 . This is only a temporary workaround A> to restore system usefulness until the more permanent solutions can be A> found. A> A> Tested: A> A> * Carambola2, 64MB (and 32MB by manual config.) A> A> Modified: A> head/sys/kern/vfs_bio.c A> A> Modified: head/sys/kern/vfs_bio.c A> ============================================================================== A> --- head/sys/kern/vfs_bio.c Sat Nov 7 02:18:19 2015 (r290480) A> +++ head/sys/kern/vfs_bio.c Sat Nov 7 04:04:00 2015 (r290481) A> @@ -3622,6 +3622,23 @@ loop: A> if (bp == NULL) { A> if (slpflag || slptimeo) A> return NULL; A> + /* A> + * XXX This is here until the sleep path is diagnosed A> + * enough to work under very low memory conditions. A> + * A> + * There's an issue on low memory, 4BSD+non-preempt A> + * systems (eg MIPS routers with 32MB RAM) where buffer A> + * exhaustion occurs without sleeping for buffer A> + * reclaimation. This just sticks in a loop and A> + * constantly attempts to allocate a buffer, which A> + * hits exhaustion and tries to wakeup bufdaemon. A> + * This never happens because we never yield. A> + * A> + * The real solution is to identify and fix these cases A> + * so we aren't effectively busy-waiting in a loop A> + * until the reclaimation path has cycles to run. A> + */ A> + kern_yield(PRI_USER); A> goto loop; A> } It'll be nice if such crutches have a test case in src/tests, and a reference to it in the comment above. So that in future, someone considering that the crutch is no longer needed, can quickly check that assumption. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Nov 13 22:45:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EC3A2E274 for ; Fri, 13 Nov 2015 22:45:01 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC4F1C09 for ; Fri, 13 Nov 2015 22:45:01 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so112679515pac.3 for ; Fri, 13 Nov 2015 14:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=hRBB8GXiDTu4By9Bnhhcpd2VtzUTmJRskEYxkKwShFY=; b=T8af0Ms1ATsFZxBlafUhqbFZ5/RYkqzBJbuGqWg5oqyy3LDCl2L9sOWB6zjsJN6V65 PGcU8riQ6LpbioMcIwaYON/PNEqZXGu6O+2WXowCC5ER4HehCqDboV58e3DqP90YD4gk 6Txjb7OIx7zbmBCIDB7gjitjx4hvmVKcJz+pw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=hRBB8GXiDTu4By9Bnhhcpd2VtzUTmJRskEYxkKwShFY=; b=LudUB37WFZlYOrkQ3qfclxp96XLl+iyysh8gBg55zMxxGh+aAoR8+mgWZKPz4eUHCg UfpcD107nFqycgmBHwWzz5UZstr58Bm7eWwbqs8xgtV7ZPUgW8QasGlTLvokO6TAat5b F3HUed7eU7cHQbMNIc/sGnhmVEgJr5hkldKUYh160/XVpOrfWrdLQjwrVNC+KcY98Mid K2dJ40PAMv3FUVAuKIHcTIarjC5T1wTCddSpe36Ou2zv3KOuPFaaA9c2ow6UqIYF3Fct Rhug21kUMMc1Mu0vJwaPKasqqoD8iPel82mQff75bgtaAl5aYHKaDrNKzpqW3OxHd0p9 oh4A== X-Gm-Message-State: ALoCoQkHN0EilLwj2bODUu9luevwbfMkCZ6aR641m/h3ibjn/SI+3xmUbuZAhoO2IIwXBoT4K5vQ X-Received: by 10.66.155.226 with SMTP id vz2mr8180435pab.18.1447454701005; Fri, 13 Nov 2015 14:45:01 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id ea1sm22311044pbb.76.2015.11.13.14.44.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 14:44:59 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <94281447451500@web13o.yandex.ru> Date: Fri, 13 Nov 2015 17:44:59 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" Message-Id: <320E56BB-64E8-41BF-BFF3-003F6610BC11@netflix.com> References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> <81431447450321@web13o.yandex.ru> <19FCC2F9-0986-4106-9559-75E65184704C@netflix.com> <94281447451500@web13o.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:45:01 -0000 let me fix that R On Nov 13, 2015, at 4:51 PM, Alexander V. Chernikov = wrote: > 14.11.2015, 00:41, "Randall Stewart" : >> Hmm >> =20 >> callout_reset() returns either 0 or 1=20 >> =20 >> It returns no other values and did not change.. maybe ti should say = positive or one in the manual=85 >> =20 >> I can add that to the fix patch. > It would be great :) > Also (just nitpicking) "return values" section of callout(9) still = states that callout_stop() returns non-zero value if the callout is = pending. >> =20 >> =20 >> R >> On Nov 13, 2015, at 4:32 PM, Alexander V. Chernikov = wrote: >> =20 >>>=20 >>> One small note on lltable: change in nd6_llinfo_settimer_locked() = assumes that callout_reset() returns >0 for stopped callout. The man = page still says "non-zero value" for that case. >>> (And that was the reason of writing comment to D4076 on inconsistent = callout_reset() return value). >>> =20 >>> =20 >>> =20 >>> 14.11.2015, 00:19, "Randall Stewart" : >>>> So looking deeper something like the following (with Bryan=92s = patch) is in order. >>>> =20 >>>> Though there is one place in the task code that looks funny since = it was >>>> =20 >>>> pending =3D !!callout_stop() >>>> =20 >>>> I changed it to >>>> =20 >>>> pending =3D !! (callout_stop > 0) >>>> =20 >>>> But I wonder about the double !! that seems rather convoluted.. >>>> =20 >>>> Unless someone objects I will commit this shortly >>>> R >>>> =20 >>>> =20 >>>> =20 >>>> =20 >>>> , >>>> =20 >>>> On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: >>>> =20 >>>>>=20 >>>>> 10.11.2015, 17:49, "Randall Stewart" : >>>>>>=20 >>>>>> Author: rrs >>>>>> Date: Tue Nov 10 14:49:32 2015 >>>>>> New Revision: 290664 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>>>>>=20 >>>>>> Log: >>>>>> Add new async_drain to the callout system. This is so-far not = used but >>>>>> should be used by TCP for sure in its cleanup of the IN-PCB = (will be coming shortly). >>>>>=20 >>>>> Randall, this commit introduced change in callout_stop() which was = not mentioned in commit message. >>>>> This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. >>>>> I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). >>>>> I was not able to find any discussion/analysis/testing for these = in D4076 so this change does not look like being properly tested prior = commiting.. >>>>>=20 >>>>>=20 >>>>> =20 >>>>>>=20 >>>>>> Sponsored by: Netflix Inc. >>>>>> Differential Revision: https://reviews.freebsd.org/D4076 >>>>>>=20 >>>>>> Modified: >>>>>> head/share/man/man9/timeout.9 >>>>>> head/sys/kern/kern_timeout.c >>>>>> head/sys/sys/callout.h >>>>>>=20 >>>>>> Modified: head/share/man/man9/timeout.9 >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 = (r290663) >>>>>> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 = (r290664) >>>>>> @@ -35,6 +35,7 @@ >>>>>> .Sh NAME >>>>>> .Nm callout_active , >>>>>> .Nm callout_deactivate , >>>>>> +.Nm callout_async_drain , >>>>>> .Nm callout_drain , >>>>>> .Nm callout_handle_init , >>>>>> .Nm callout_init , >>>>>> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >>>>>> .Ft void >>>>>> .Fn callout_deactivate "struct callout *c" >>>>>> .Ft int >>>>>> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >>>>>> +.Ft int >>>>>> .Fn callout_drain "struct callout *c" >>>>>> .Ft void >>>>>> .Fn callout_handle_init "struct callout_handle *handle" >>>>>> @@ -236,17 +239,42 @@ The function >>>>>> cancels a callout >>>>>> .Fa c >>>>>> if it is currently pending. >>>>>> -If the callout is pending, then >>>>>> +If the callout is pending and successfuly stopped, then >>>>>> .Fn callout_stop >>>>>> -returns a non-zero value. >>>>>> -If the callout is not set, >>>>>> -has already been serviced, >>>>>> -or is currently being serviced, >>>>>> +returns a value of one. >>>>>> +If the callout is not set, or >>>>>> +has already been serviced, then >>>>>> +negative one is returned. >>>>>> +If the callout is currently being serviced and cannot be = stopped, >>>>>> 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_async_drain >>>>>> +is identical to >>>>>> +.Fn callout_stop >>>>>> +with one difference. >>>>>> +When >>>>>> +.Fn callout_async_drain >>>>>> +returns zero it will arrange for the function >>>>>> +.Fa drain >>>>>> +to be called using the same argument given to the >>>>>> +.Fn callout_reset >>>>>> +function. >>>>>> +.Fn callout_async_drain >>>>>> +If the callout has an associated lock, >>>>>> +then that lock must be held when this function is called. >>>>>> +Note that when stopping multiple callouts that use the same lock = it is possible >>>>>> +to get multiple return's of zero and multiple calls to the >>>>>> +.Fa drain >>>>>> +function, depending upon which CPU's the callouts are running. = The >>>>>> +.Fa drain >>>>>> +function itself is called from the context of the completing = callout >>>>>> +i.e. softclock or hardclock, just like a callout itself. >>>>>> +p >>>>>> +.Pp >>>>>> +The function >>>>>> .Fn callout_drain >>>>>> is identical to >>>>>> .Fn callout_stop >>>>>>=20 >>>>>> Modified: head/sys/kern/kern_timeout.c >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>>> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 = (r290663) >>>>>> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 = (r290664) >>>>>> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >>>>>> */ >>>>>> struct cc_exec { >>>>>> struct callout *cc_curr; >>>>>> + void (*cc_drain)(void *); >>>>>> #ifdef SMP >>>>>> void (*ce_migration_func)(void *); >>>>>> void *ce_migration_arg; >>>>>> @@ -170,6 +171,7 @@ struct callout_cpu { >>>>>> #define callout_migrating(c) ((c)->c_iflags & = CALLOUT_DFRMIGRATION) >>>>>>=20 >>>>>> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >>>>>> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >>>>>> #define cc_exec_next(cc) cc->cc_next >>>>>> #define cc_exec_cancel(cc, dir) = cc->cc_exec_entity[dir].cc_cancel >>>>>> #define cc_exec_waiting(cc, dir) = cc->cc_exec_entity[dir].cc_waiting >>>>>> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>>>>>=20 >>>>>> cc_exec_curr(cc, direct) =3D c; >>>>>> cc_exec_cancel(cc, direct) =3D false; >>>>>> + cc_exec_drain(cc, direct) =3D NULL; >>>>>> CC_UNLOCK(cc); >>>>>> if (c_lock !=3D NULL) { >>>>>> class->lc_lock(c_lock, lock_status); >>>>>> @@ -744,6 +747,15 @@ skip: >>>>>> CC_LOCK(cc); >>>>>> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >>>>>> cc_exec_curr(cc, direct) =3D NULL; >>>>>> + if (cc_exec_drain(cc, direct)) { >>>>>> + void (*drain)(void *); >>>>>> + >>>>>> + drain =3D cc_exec_drain(cc, direct); >>>>>> + cc_exec_drain(cc, direct) =3D NULL; >>>>>> + CC_UNLOCK(cc); >>>>>> + drain(c_arg); >>>>>> + CC_LOCK(cc); >>>>>> + } >>>>>> if (cc_exec_waiting(cc, direct)) { >>>>>> /* >>>>>> * There is someone waiting for the >>>>>> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >>>>>> } >>>>>>=20 >>>>>> int >>>>>> -_callout_stop_safe(struct callout *c, int safe) >>>>>> +_callout_stop_safe(struct callout *c, int safe, void = (*drain)(void *)) >>>>>> { >>>>>> struct callout_cpu *cc, *old_cc; >>>>>> struct lock_class *class; >>>>>> @@ -1225,19 +1237,22 @@ again: >>>>>> * stop it by other means however. >>>>>> */ >>>>>> if (!(c->c_iflags & CALLOUT_PENDING)) { >>>>>> - c->c_flags &=3D ~CALLOUT_ACTIVE; >>>>>> - >>>>>> /* >>>>>> * If it wasn't on the queue and it isn't the = current >>>>>> * callout, then we can't stop it, so just bail. >>>>>> + * It probably has already been run (if locking >>>>>> + * is properly done). You could get here if the caller >>>>>> + * calls stop twice in a row for example. The second >>>>>> + * call would fall here without CALLOUT_ACTIVE set. >>>>>> */ >>>>>> + c->c_flags &=3D ~CALLOUT_ACTIVE; >>>>>> if (cc_exec_curr(cc, direct) !=3D c) { >>>>>> CTR3(KTR_CALLOUT, "failed to stop %p = func %p arg %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> CC_UNLOCK(cc); >>>>>> if (sq_locked) >>>>>> = sleepq_release(&cc_exec_waiting(cc, direct)); >>>>>> - return (0); >>>>>> + return (-1); >>>>>> } >>>>>>=20 >>>>>> if (safe) { >>>>>> @@ -1298,14 +1313,16 @@ again: >>>>>> CC_LOCK(cc); >>>>>> } >>>>>> } else if (use_lock && >>>>>> - !cc_exec_cancel(cc, direct)) { >>>>>> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>>>>>=20 >>>>>> /* >>>>>> * The current callout is waiting for = its >>>>>> * lock which we hold. Cancel the = callout >>>>>> * and return. After our caller drops = the >>>>>> * lock, the callout will be skipped in >>>>>> - * softclock(). >>>>>> + * softclock(). This *only* works with a >>>>>> + * callout_stop() *not* callout_drain() or >>>>>> + * callout_async_drain(). >>>>>> */ >>>>>> cc_exec_cancel(cc, direct) =3D true; >>>>>> CTR3(KTR_CALLOUT, "cancelled %p func %p = arg %p", >>>>>> @@ -1351,11 +1368,17 @@ again: >>>>>> #endif >>>>>> CTR3(KTR_CALLOUT, "postponing stop %p = func %p arg %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> + if (drain) { >>>>>> + cc_exec_drain(cc, direct) =3D drain; >>>>>> + } >>>>>> CC_UNLOCK(cc); >>>>>> return (0); >>>>>> } >>>>>> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> + if (drain) { >>>>>> + cc_exec_drain(cc, direct) =3D drain; >>>>>> + } >>>>>> CC_UNLOCK(cc); >>>>>> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >>>>>> return (0); >>>>>>=20 >>>>>> Modified: head/sys/sys/callout.h >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>>> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >>>>>> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >>>>>> @@ -81,7 +81,7 @@ struct callout_handle { >>>>>> */ >>>>>> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >>>>>> #define callout_deactivate(c) ((c)->c_flags &=3D = ~CALLOUT_ACTIVE) >>>>>> -#define callout_drain(c) _callout_stop_safe(c, 1) >>>>>> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >>>>>> void callout_init(struct callout *, int); >>>>>> void _callout_init_lock(struct callout *, struct lock_object *, = int); >>>>>> #define callout_init_mtx(c, mtx, flags) \ >>>>>> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >>>>>> int callout_schedule_on(struct callout *, int, int); >>>>>> #define callout_schedule_curcpu(c, on_tick) \ >>>>>> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >>>>>> -#define callout_stop(c) _callout_stop_safe(c, 0) >>>>>> -int _callout_stop_safe(struct callout *, int); >>>>>> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >>>>>> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >>>>>> void callout_process(sbintime_t now); >>>>>> - >>>>>> +#define callout_async_drain(c, d) \ >>>>>> + _callout_stop_safe(c, 0, d) >>>>>> #endif >>>>>>=20 >>>>>> #endif /* _SYS_CALLOUT_H_ */ >>>> =20 >>>> -------- >>>> Randall Stewart >>>> rrs@netflix.com >>>> 803-317-4952 >>>> =20 >>>>=20 >>>> =20 >> =20 >> -------- >> Randall Stewart >> rrs@netflix.com >> 803-317-4952 >> =20 >>=20 >> =20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 22:51:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF740A2E309; Fri, 13 Nov 2015 22:51:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C797C1F85; Fri, 13 Nov 2015 22:51:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADMpamW053832; Fri, 13 Nov 2015 22:51:36 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMpa8o053824; Fri, 13 Nov 2015 22:51:36 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201511132251.tADMpa8o053824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 13 Nov 2015 22:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290805 - in head: share/man/man9 sys/kern sys/net sys/netinet sys/netinet6 sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:51:38 -0000 Author: rrs Date: Fri Nov 13 22:51:35 2015 New Revision: 290805 URL: https://svnweb.freebsd.org/changeset/base/290805 Log: This fixes several places where callout_stops return is examined. The new return codes of -1 were mistakenly being considered "true". Callout_stop now returns -1 to indicate the callout had either already completed or was not running and 0 to indicate it could not be stopped. Also update the manual page to make it more consistent no non-zero in the callout_stop or callout_reset descriptions. MFC after: 1 Month with associated callout change. Modified: head/share/man/man9/timeout.9 head/sys/kern/subr_taskqueue.c head/sys/net/if_llatbl.c head/sys/netinet/in.c head/sys/netinet/tcp_timer.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netpfil/pf/if_pfsync.c Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Fri Nov 13 22:33:51 2015 (r290804) +++ head/share/man/man9/timeout.9 Fri Nov 13 22:51:35 2015 (r290805) @@ -302,7 +302,7 @@ 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 +These functions return a value of one 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. @@ -804,16 +804,16 @@ The .Fn callout_reset and .Fn callout_schedule -function families return non-zero if the callout was pending before the new +function families return a value of one 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 +functions return a value of one if the callout was still pending when it was +called, a zero if the callout could not be stopped and a negative one is it +was either not running or haas already completed. The .Fn timeout function returns a .Ft struct callout_handle Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/kern/subr_taskqueue.c Fri Nov 13 22:51:35 2015 (r290805) @@ -496,7 +496,7 @@ taskqueue_cancel_timeout(struct taskqueu int error; TQ_LOCK(queue); - pending = !!callout_stop(&timeout_task->c); + pending = !!(callout_stop(&timeout_task->c) > 0); error = taskqueue_cancel_locked(queue, &timeout_task->t, &pending1); if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) { timeout_task->f &= ~DT_CALLOUT_ARMED; Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/net/if_llatbl.c Fri Nov 13 22:51:35 2015 (r290805) @@ -394,7 +394,7 @@ lltable_free(struct lltable *llt) IF_AFDATA_WUNLOCK(llt->llt_ifp); LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) { - if (callout_stop(&lle->lle_timer)) + if (callout_stop(&lle->lle_timer) > 0) LLE_REMREF(lle); llentry_free(lle); } Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/netinet/in.c Fri Nov 13 22:51:35 2015 (r290805) @@ -1093,7 +1093,7 @@ in_lltable_free_entry(struct lltable *ll } /* cancel timer */ - if (callout_stop(&lle->lle_timer)) + if (callout_stop(&lle->lle_timer) > 0) LLE_REMREF(lle); /* Drop hold queue */ Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/netinet/tcp_timer.c Fri Nov 13 22:51:35 2015 (r290805) @@ -862,7 +862,7 @@ tcp_timer_activate(struct tcpcb *tp, uin } if (delta == 0) { if ((tp->t_timers->tt_flags & timer_type) && - callout_stop(t_callout) && + (callout_stop(t_callout) > 0) && (tp->t_timers->tt_flags & f_reset)) { tp->t_timers->tt_flags &= ~(timer_type | f_reset); } @@ -949,7 +949,7 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ } if (tp->t_timers->tt_flags & timer_type) { - if (callout_stop(t_callout) && + if ((callout_stop(t_callout) > 0) && (tp->t_timers->tt_flags & f_reset)) { tp->t_timers->tt_flags &= ~(timer_type | f_reset); } else { Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/netinet6/in6.c Fri Nov 13 22:51:35 2015 (r290805) @@ -2133,7 +2133,7 @@ in6_lltable_free_entry(struct lltable *l lltable_unlink_entry(llt, lle); } - if (callout_stop(&lle->lle_timer)) + if (callout_stop(&lle->lle_timer) > 0) LLE_REMREF(lle); llentry_free(lle); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/netinet6/nd6.c Fri Nov 13 22:51:35 2015 (r290805) @@ -508,7 +508,7 @@ nd6_llinfo_settimer_locked(struct llentr nd6_llinfo_timer, ln); } } - if (canceled) + if (canceled > 0) LLE_REMREF(ln); } Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 13 22:33:51 2015 (r290804) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 13 22:51:35 2015 (r290805) @@ -352,7 +352,7 @@ pfsync_clone_destroy(struct ifnet *ifp) TAILQ_REMOVE(&sc->sc_deferrals, pd, pd_entry); sc->sc_deferred--; - if (callout_stop(&pd->pd_tmo)) { + if (callout_stop(&pd->pd_tmo) > 0) { pf_release_state(pd->pd_st); m_freem(pd->pd_m); free(pd, M_PFSYNC); @@ -1775,7 +1775,7 @@ pfsync_undefer_state(struct pf_state *st TAILQ_FOREACH(pd, &sc->sc_deferrals, pd_entry) { if (pd->pd_st == st) { - if (callout_stop(&pd->pd_tmo)) + if (callout_stop(&pd->pd_tmo) > 0) pfsync_undefer(pd, drop); return; } From owner-svn-src-all@freebsd.org Fri Nov 13 22:52:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88682A2E42D for ; Fri, 13 Nov 2015 22:52:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::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 4CD4B11BF for ; Fri, 13 Nov 2015 22:52:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so112835913pac.3 for ; Fri, 13 Nov 2015 14:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=LYRmR72wUfG6GCy7m/S2yVRb9hdnmn2X4IPbeVeVStk=; b=cB58JqhQpJ2ftoEsP56W9WIvw4HtfLbo3pBlly0mgUy4MkyeNNAKjsOhiB1euETHzh faw8xS8PyrMmmSfxVzYCLPOSbuA83xtB3fkFk8JcEB3pLOpmKHkX0u9qOy3h/EWGiVcJ 2wiNkU7QOX4MlffhmRXmGtYVz5u7Fci2MjmU4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=LYRmR72wUfG6GCy7m/S2yVRb9hdnmn2X4IPbeVeVStk=; b=KtEtXDcBepPwDdlKeuY07CQYPitqVxe0ffb8qXox8ZXY/NpnRstY5DO1knlmK34w8k 7N5JNfXvmFbT5ybFYMPaXJAKh0RbkmbWWYjcTJPqgeWJncbDH/yv2j6534bghMriJCkM 0KgtUbqg7jMHSRZoxPifUVpLlkZVrRhdxO8yALZrs127Eox20Zo4KwTb9sROYtJRHGHg L/nhAEeriRL6eOlM7DMo8BJCxyBGQ+Yc1yoCauVOExbyPPLc4XjXoN/I/VI7DVCPjyyN bKPkKB9ZfupeaWKoHlycNznR9ZLYpotr117F0cDFyRnlppjwnO0k4zBYT0NVn3mN8jPl KBJw== X-Gm-Message-State: ALoCoQkqiUO15HvikERueAi7PxwfwCPOrQLM4o3fxfoGu8TuwIObpyj1Burbgf/LunQ6a+KKScDu X-Received: by 10.66.164.233 with SMTP id yt9mr36211227pab.32.1447455174813; Fri, 13 Nov 2015 14:52:54 -0800 (PST) Received: from ip-192-168-70-10.us-west-2.compute.internal ([69.53.245.107]) by smtp.gmail.com with ESMTPSA id yh3sm22323225pbb.82.2015.11.13.14.52.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 14:52:53 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r290664 - in head: share/man/man9 sys/kern sys/sys From: Randall Stewart In-Reply-To: <94281447451500@web13o.yandex.ru> Date: Fri, 13 Nov 2015 17:52:55 -0500 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd , "imp@freebsd.org" Message-Id: References: null <201511101449.tAAEnXIi065747@repo.freebsd.org> <1660421447413365@web19h.yandex.ru> <758BC83D-E327-4B08-9103-C31EC4DDB193@netflix.com> <81431447450321@web13o.yandex.ru> <19FCC2F9-0986-4106-9559-75E65184704C@netflix.com> <94281447451500@web13o.yandex.ru> To: "Alexander V. Chernikov" X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:52:55 -0000 Done in 290805 R On Nov 13, 2015, at 4:51 PM, Alexander V. Chernikov = wrote: > 14.11.2015, 00:41, "Randall Stewart" : >> Hmm >> =20 >> callout_reset() returns either 0 or 1=20 >> =20 >> It returns no other values and did not change.. maybe ti should say = positive or one in the manual=85 >> =20 >> I can add that to the fix patch. > It would be great :) > Also (just nitpicking) "return values" section of callout(9) still = states that callout_stop() returns non-zero value if the callout is = pending. >> =20 >> =20 >> R >> On Nov 13, 2015, at 4:32 PM, Alexander V. Chernikov = wrote: >> =20 >>>=20 >>> One small note on lltable: change in nd6_llinfo_settimer_locked() = assumes that callout_reset() returns >0 for stopped callout. The man = page still says "non-zero value" for that case. >>> (And that was the reason of writing comment to D4076 on inconsistent = callout_reset() return value). >>> =20 >>> =20 >>> =20 >>> 14.11.2015, 00:19, "Randall Stewart" : >>>> So looking deeper something like the following (with Bryan=92s = patch) is in order. >>>> =20 >>>> Though there is one place in the task code that looks funny since = it was >>>> =20 >>>> pending =3D !!callout_stop() >>>> =20 >>>> I changed it to >>>> =20 >>>> pending =3D !! (callout_stop > 0) >>>> =20 >>>> But I wonder about the double !! that seems rather convoluted.. >>>> =20 >>>> Unless someone objects I will commit this shortly >>>> R >>>> =20 >>>> =20 >>>> =20 >>>> =20 >>>> , >>>> =20 >>>> On Nov 13, 2015, at 6:16 AM, Alexander V. Chernikov = wrote: >>>> =20 >>>>>=20 >>>>> 10.11.2015, 17:49, "Randall Stewart" : >>>>>>=20 >>>>>> Author: rrs >>>>>> Date: Tue Nov 10 14:49:32 2015 >>>>>> New Revision: 290664 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/290664 >>>>>>=20 >>>>>> Log: >>>>>> Add new async_drain to the callout system. This is so-far not = used but >>>>>> should be used by TCP for sure in its cleanup of the IN-PCB = (will be coming shortly). >>>>>=20 >>>>> Randall, this commit introduced change in callout_stop() which was = not mentioned in commit message. >>>>> This change has broken lltable arp/nd handling: deleting interface = address causes immediate panic. >>>>> I also see other other code/subsystems relying on callout_stop() = return value (netgraph, pfsync, iscsi). >>>>> I was not able to find any discussion/analysis/testing for these = in D4076 so this change does not look like being properly tested prior = commiting.. >>>>>=20 >>>>>=20 >>>>> =20 >>>>>>=20 >>>>>> Sponsored by: Netflix Inc. >>>>>> Differential Revision: https://reviews.freebsd.org/D4076 >>>>>>=20 >>>>>> Modified: >>>>>> head/share/man/man9/timeout.9 >>>>>> head/sys/kern/kern_timeout.c >>>>>> head/sys/sys/callout.h >>>>>>=20 >>>>>> Modified: head/share/man/man9/timeout.9 >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man9/timeout.9 Tue Nov 10 14:14:41 2015 = (r290663) >>>>>> +++ head/share/man/man9/timeout.9 Tue Nov 10 14:49:32 2015 = (r290664) >>>>>> @@ -35,6 +35,7 @@ >>>>>> .Sh NAME >>>>>> .Nm callout_active , >>>>>> .Nm callout_deactivate , >>>>>> +.Nm callout_async_drain , >>>>>> .Nm callout_drain , >>>>>> .Nm callout_handle_init , >>>>>> .Nm callout_init , >>>>>> @@ -69,6 +70,8 @@ typedef void timeout_t (void *); >>>>>> .Ft void >>>>>> .Fn callout_deactivate "struct callout *c" >>>>>> .Ft int >>>>>> +.Fn callout_async_drain "struct callout *c" "timeout_t *drain" >>>>>> +.Ft int >>>>>> .Fn callout_drain "struct callout *c" >>>>>> .Ft void >>>>>> .Fn callout_handle_init "struct callout_handle *handle" >>>>>> @@ -236,17 +239,42 @@ The function >>>>>> cancels a callout >>>>>> .Fa c >>>>>> if it is currently pending. >>>>>> -If the callout is pending, then >>>>>> +If the callout is pending and successfuly stopped, then >>>>>> .Fn callout_stop >>>>>> -returns a non-zero value. >>>>>> -If the callout is not set, >>>>>> -has already been serviced, >>>>>> -or is currently being serviced, >>>>>> +returns a value of one. >>>>>> +If the callout is not set, or >>>>>> +has already been serviced, then >>>>>> +negative one is returned. >>>>>> +If the callout is currently being serviced and cannot be = stopped, >>>>>> 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_async_drain >>>>>> +is identical to >>>>>> +.Fn callout_stop >>>>>> +with one difference. >>>>>> +When >>>>>> +.Fn callout_async_drain >>>>>> +returns zero it will arrange for the function >>>>>> +.Fa drain >>>>>> +to be called using the same argument given to the >>>>>> +.Fn callout_reset >>>>>> +function. >>>>>> +.Fn callout_async_drain >>>>>> +If the callout has an associated lock, >>>>>> +then that lock must be held when this function is called. >>>>>> +Note that when stopping multiple callouts that use the same lock = it is possible >>>>>> +to get multiple return's of zero and multiple calls to the >>>>>> +.Fa drain >>>>>> +function, depending upon which CPU's the callouts are running. = The >>>>>> +.Fa drain >>>>>> +function itself is called from the context of the completing = callout >>>>>> +i.e. softclock or hardclock, just like a callout itself. >>>>>> +p >>>>>> +.Pp >>>>>> +The function >>>>>> .Fn callout_drain >>>>>> is identical to >>>>>> .Fn callout_stop >>>>>>=20 >>>>>> Modified: head/sys/kern/kern_timeout.c >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>>> --- head/sys/kern/kern_timeout.c Tue Nov 10 14:14:41 2015 = (r290663) >>>>>> +++ head/sys/kern/kern_timeout.c Tue Nov 10 14:49:32 2015 = (r290664) >>>>>> @@ -136,6 +136,7 @@ u_int callwheelsize, callwheelmask; >>>>>> */ >>>>>> struct cc_exec { >>>>>> struct callout *cc_curr; >>>>>> + void (*cc_drain)(void *); >>>>>> #ifdef SMP >>>>>> void (*ce_migration_func)(void *); >>>>>> void *ce_migration_arg; >>>>>> @@ -170,6 +171,7 @@ struct callout_cpu { >>>>>> #define callout_migrating(c) ((c)->c_iflags & = CALLOUT_DFRMIGRATION) >>>>>>=20 >>>>>> #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr >>>>>> +#define cc_exec_drain(cc, dir) cc->cc_exec_entity[dir].cc_drain >>>>>> #define cc_exec_next(cc) cc->cc_next >>>>>> #define cc_exec_cancel(cc, dir) = cc->cc_exec_entity[dir].cc_cancel >>>>>> #define cc_exec_waiting(cc, dir) = cc->cc_exec_entity[dir].cc_waiting >>>>>> @@ -679,6 +681,7 @@ softclock_call_cc(struct callout *c, str >>>>>>=20 >>>>>> cc_exec_curr(cc, direct) =3D c; >>>>>> cc_exec_cancel(cc, direct) =3D false; >>>>>> + cc_exec_drain(cc, direct) =3D NULL; >>>>>> CC_UNLOCK(cc); >>>>>> if (c_lock !=3D NULL) { >>>>>> class->lc_lock(c_lock, lock_status); >>>>>> @@ -744,6 +747,15 @@ skip: >>>>>> CC_LOCK(cc); >>>>>> KASSERT(cc_exec_curr(cc, direct) =3D=3D c, ("mishandled = cc_curr")); >>>>>> cc_exec_curr(cc, direct) =3D NULL; >>>>>> + if (cc_exec_drain(cc, direct)) { >>>>>> + void (*drain)(void *); >>>>>> + >>>>>> + drain =3D cc_exec_drain(cc, direct); >>>>>> + cc_exec_drain(cc, direct) =3D NULL; >>>>>> + CC_UNLOCK(cc); >>>>>> + drain(c_arg); >>>>>> + CC_LOCK(cc); >>>>>> + } >>>>>> if (cc_exec_waiting(cc, direct)) { >>>>>> /* >>>>>> * There is someone waiting for the >>>>>> @@ -1145,7 +1157,7 @@ callout_schedule(struct callout *c, int >>>>>> } >>>>>>=20 >>>>>> int >>>>>> -_callout_stop_safe(struct callout *c, int safe) >>>>>> +_callout_stop_safe(struct callout *c, int safe, void = (*drain)(void *)) >>>>>> { >>>>>> struct callout_cpu *cc, *old_cc; >>>>>> struct lock_class *class; >>>>>> @@ -1225,19 +1237,22 @@ again: >>>>>> * stop it by other means however. >>>>>> */ >>>>>> if (!(c->c_iflags & CALLOUT_PENDING)) { >>>>>> - c->c_flags &=3D ~CALLOUT_ACTIVE; >>>>>> - >>>>>> /* >>>>>> * If it wasn't on the queue and it isn't the = current >>>>>> * callout, then we can't stop it, so just bail. >>>>>> + * It probably has already been run (if locking >>>>>> + * is properly done). You could get here if the caller >>>>>> + * calls stop twice in a row for example. The second >>>>>> + * call would fall here without CALLOUT_ACTIVE set. >>>>>> */ >>>>>> + c->c_flags &=3D ~CALLOUT_ACTIVE; >>>>>> if (cc_exec_curr(cc, direct) !=3D c) { >>>>>> CTR3(KTR_CALLOUT, "failed to stop %p = func %p arg %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> CC_UNLOCK(cc); >>>>>> if (sq_locked) >>>>>> = sleepq_release(&cc_exec_waiting(cc, direct)); >>>>>> - return (0); >>>>>> + return (-1); >>>>>> } >>>>>>=20 >>>>>> if (safe) { >>>>>> @@ -1298,14 +1313,16 @@ again: >>>>>> CC_LOCK(cc); >>>>>> } >>>>>> } else if (use_lock && >>>>>> - !cc_exec_cancel(cc, direct)) { >>>>>> + !cc_exec_cancel(cc, direct) && (drain =3D=3D NULL)) { >>>>>>=20 >>>>>> /* >>>>>> * The current callout is waiting for = its >>>>>> * lock which we hold. Cancel the = callout >>>>>> * and return. After our caller drops = the >>>>>> * lock, the callout will be skipped in >>>>>> - * softclock(). >>>>>> + * softclock(). This *only* works with a >>>>>> + * callout_stop() *not* callout_drain() or >>>>>> + * callout_async_drain(). >>>>>> */ >>>>>> cc_exec_cancel(cc, direct) =3D true; >>>>>> CTR3(KTR_CALLOUT, "cancelled %p func %p = arg %p", >>>>>> @@ -1351,11 +1368,17 @@ again: >>>>>> #endif >>>>>> CTR3(KTR_CALLOUT, "postponing stop %p = func %p arg %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> + if (drain) { >>>>>> + cc_exec_drain(cc, direct) =3D drain; >>>>>> + } >>>>>> CC_UNLOCK(cc); >>>>>> return (0); >>>>>> } >>>>>> CTR3(KTR_CALLOUT, "failed to stop %p func %p arg = %p", >>>>>> c, c->c_func, c->c_arg); >>>>>> + if (drain) { >>>>>> + cc_exec_drain(cc, direct) =3D drain; >>>>>> + } >>>>>> CC_UNLOCK(cc); >>>>>> KASSERT(!sq_locked, ("sleepqueue chain still = locked")); >>>>>> return (0); >>>>>>=20 >>>>>> Modified: head/sys/sys/callout.h >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>>> --- head/sys/sys/callout.h Tue Nov 10 14:14:41 2015 (r290663) >>>>>> +++ head/sys/sys/callout.h Tue Nov 10 14:49:32 2015 (r290664) >>>>>> @@ -81,7 +81,7 @@ struct callout_handle { >>>>>> */ >>>>>> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >>>>>> #define callout_deactivate(c) ((c)->c_flags &=3D = ~CALLOUT_ACTIVE) >>>>>> -#define callout_drain(c) _callout_stop_safe(c, 1) >>>>>> +#define callout_drain(c) _callout_stop_safe(c, 1, NULL) >>>>>> void callout_init(struct callout *, int); >>>>>> void _callout_init_lock(struct callout *, struct lock_object *, = int); >>>>>> #define callout_init_mtx(c, mtx, flags) \ >>>>>> @@ -119,10 +119,11 @@ int callout_schedule(struct callout *, i >>>>>> int callout_schedule_on(struct callout *, int, int); >>>>>> #define callout_schedule_curcpu(c, on_tick) \ >>>>>> callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) >>>>>> -#define callout_stop(c) _callout_stop_safe(c, 0) >>>>>> -int _callout_stop_safe(struct callout *, int); >>>>>> +#define callout_stop(c) _callout_stop_safe(c, 0, NULL) >>>>>> +int _callout_stop_safe(struct callout *, int, void (*)(void *)); >>>>>> void callout_process(sbintime_t now); >>>>>> - >>>>>> +#define callout_async_drain(c, d) \ >>>>>> + _callout_stop_safe(c, 0, d) >>>>>> #endif >>>>>>=20 >>>>>> #endif /* _SYS_CALLOUT_H_ */ >>>> =20 >>>> -------- >>>> Randall Stewart >>>> rrs@netflix.com >>>> 803-317-4952 >>>> =20 >>>>=20 >>>> =20 >> =20 >> -------- >> Randall Stewart >> rrs@netflix.com >> 803-317-4952 >> =20 >>=20 >> =20 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Fri Nov 13 22:54:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBF37A2E48C; Fri, 13 Nov 2015 22:54:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 5D1861345; Fri, 13 Nov 2015 22:54:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tADMs0so073835 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Nov 2015 01:54:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tADMs0xf073834; Sat, 14 Nov 2015 01:54:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Nov 2015 01:54:00 +0300 From: Gleb Smirnoff To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290603 - in head/sys: net netgraph netinet Message-ID: <20151113225400.GE73031@FreeBSD.org> References: <201511091011.tA9ABFWb029549@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511091011.tA9ABFWb029549@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:54:04 -0000 Alexander, On Mon, Nov 09, 2015 at 10:11:15AM +0000, Alexander V. Chernikov wrote: A> Author: melifaro A> Date: Mon Nov 9 10:11:14 2015 A> New Revision: 290603 A> URL: https://svnweb.freebsd.org/changeset/base/290603 A> A> Log: A> Use lladdr_event to propagate gratiotus arp. A> A> Differential Revision: https://reviews.freebsd.org/D4019 Looking into a diff a lame question emerges: why can't the call to EVENTHANDLER_INVOKE() moved right into the end of the if_setlladdr()? A> Modified: A> head/sys/net/if.c A> head/sys/net/if_vlan.c A> head/sys/netgraph/ng_eiface.c A> head/sys/netgraph/ng_ether.c A> head/sys/netinet/if_ether.c A> A> Modified: head/sys/net/if.c A> ============================================================================== A> --- head/sys/net/if.c Mon Nov 9 09:39:59 2015 (r290602) A> +++ head/sys/net/if.c Mon Nov 9 10:11:14 2015 (r290603) A> @@ -2512,7 +2512,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, A> return (error); A> error = if_setlladdr(ifp, A> ifr->ifr_addr.sa_data, ifr->ifr_addr.sa_len); A> - EVENTHANDLER_INVOKE(iflladdr_event, ifp); A> + if (error == 0) A> + EVENTHANDLER_INVOKE(iflladdr_event, ifp); A> break; A> A> case SIOCAIFGROUP: A> @@ -3375,16 +3376,6 @@ if_setlladdr(struct ifnet *ifp, const u_ A> ifr.ifr_flagshigh = ifp->if_flags >> 16; A> (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); A> } A> -#ifdef INET A> - /* A> - * Also send gratuitous ARPs to notify other nodes about A> - * the address change. A> - */ A> - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { A> - if (ifa->ifa_addr->sa_family == AF_INET) A> - arp_ifinit(ifp, ifa); A> - } A> -#endif A> } A> return (0); A> } A> A> Modified: head/sys/net/if_vlan.c A> ============================================================================== A> --- head/sys/net/if_vlan.c Mon Nov 9 09:39:59 2015 (r290602) A> +++ head/sys/net/if_vlan.c Mon Nov 9 10:11:14 2015 (r290603) A> @@ -523,7 +523,7 @@ vlan_iflladdr(void *arg __unused, struct A> #ifndef VLAN_ARRAY A> struct ifvlan *next; A> #endif A> - int i; A> + int error, i; A> A> /* A> * Check if it's a trunk interface first of all A> @@ -544,8 +544,11 @@ vlan_iflladdr(void *arg __unused, struct A> LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { A> #endif /* VLAN_ARRAY */ A> VLAN_UNLOCK(); A> - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), A> + error = if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), A> ifp->if_addrlen); A> + if (error == 0) A> + EVENTHANDLER_INVOKE(iflladdr_event, A> + ifv->ifv_ifp); A> VLAN_LOCK(); A> } A> VLAN_UNLOCK(); A> A> Modified: head/sys/netgraph/ng_eiface.c A> ============================================================================== A> --- head/sys/netgraph/ng_eiface.c Mon Nov 9 09:39:59 2015 (r290602) A> +++ head/sys/netgraph/ng_eiface.c Mon Nov 9 10:11:14 2015 (r290603) A> @@ -489,7 +489,8 @@ ng_eiface_rcvmsg(node_p node, item_p ite A> } A> error = if_setlladdr(priv->ifp, A> (u_char *)msg->data, ETHER_ADDR_LEN); A> - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); A> + if (error == 0) A> + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); A> break; A> } A> A> A> Modified: head/sys/netgraph/ng_ether.c A> ============================================================================== A> --- head/sys/netgraph/ng_ether.c Mon Nov 9 09:39:59 2015 (r290602) A> +++ head/sys/netgraph/ng_ether.c Mon Nov 9 10:11:14 2015 (r290603) A> @@ -534,7 +534,8 @@ ng_ether_rcvmsg(node_p node, item_p item A> } A> error = if_setlladdr(priv->ifp, A> (u_char *)msg->data, ETHER_ADDR_LEN); A> - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); A> + if (error == 0) A> + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); A> break; A> } A> case NGM_ETHER_GET_PROMISC: A> A> Modified: head/sys/netinet/if_ether.c A> ============================================================================== A> --- head/sys/netinet/if_ether.c Mon Nov 9 09:39:59 2015 (r290602) A> +++ head/sys/netinet/if_ether.c Mon Nov 9 10:11:14 2015 (r290603) A> @@ -142,7 +142,9 @@ static void in_arpinput(struct mbuf *); A> static void arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, A> struct ifnet *ifp, int bridged, struct llentry *la); A> static void arp_mark_lle_reachable(struct llentry *la); A> +static void arp_iflladdr(void *arg __unused, struct ifnet *ifp); A> A> +static eventhandler_tag iflladdr_tag; A> A> static const struct netisr_handler arp_nh = { A> .nh_name = "arp", A> @@ -1150,10 +1152,39 @@ arp_ifinit2(struct ifnet *ifp, struct if A> ifa->ifa_rtrequest = NULL; A> } A> A> +/* A> + * Sends gratuitous ARPs for each ifaddr to notify other A> + * nodes about the address change. A> + */ A> +static __noinline void A> +arp_handle_ifllchange(struct ifnet *ifp) A> +{ A> + struct ifaddr *ifa; A> + A> + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { A> + if (ifa->ifa_addr->sa_family == AF_INET) A> + arp_ifinit(ifp, ifa); A> + } A> +} A> + A> +/* A> + * A handler for interface link layer address change event. A> + */ A> +static __noinline void A> +arp_iflladdr(void *arg __unused, struct ifnet *ifp) A> +{ A> + A> + if ((ifp->if_flags & IFF_UP) != 0) A> + arp_handle_ifllchange(ifp); A> +} A> + A> static void A> arp_init(void) A> { A> A> netisr_register(&arp_nh); A> + if (IS_DEFAULT_VNET(curvnet)) A> + iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, A> + arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); A> } A> SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); A> -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Nov 13 23:10:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF5E5A2E72E; Fri, 13 Nov 2015 23:10:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A63981A15; Fri, 13 Nov 2015 23:10:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 61EE21FE022; Sat, 14 Nov 2015 00:10:50 +0100 (CET) Subject: Re: svn commit: r290805 - in head: share/man/man9 sys/kern sys/net sys/netinet sys/netinet6 sys/netpfil/pf To: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511132251.tADMpa8o053824@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <56466E60.7000304@selasky.org> Date: Sat, 14 Nov 2015 00:12:32 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511132251.tADMpa8o053824@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:10:54 -0000 On 11/13/15 23:51, Randall Stewart wrote: > Modified: head/sys/kern/subr_taskqueue.c > ============================================================================== > --- head/sys/kern/subr_taskqueue.c Fri Nov 13 22:33:51 2015 (r290804) > +++ head/sys/kern/subr_taskqueue.c Fri Nov 13 22:51:35 2015 (r290805) > @@ -496,7 +496,7 @@ taskqueue_cancel_timeout(struct taskqueu > int error; > > TQ_LOCK(queue); > - pending = !!callout_stop(&timeout_task->c); > + pending = !!(callout_stop(&timeout_task->c) > 0); > error = taskqueue_cancel_locked(queue, &timeout_task->t, &pending1); The "!!" can go away after the "> 0" which is already boolean. --HPS From owner-svn-src-all@freebsd.org Fri Nov 13 23:11:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC58FA2E74B; Fri, 13 Nov 2015 23:11:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 654A71C09; Fri, 13 Nov 2015 23:11:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tADNB2Hl073927 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Nov 2015 02:11:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tADNB2x3073926; Sat, 14 Nov 2015 02:11:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Nov 2015 02:11:02 +0300 From: Gleb Smirnoff To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290805 - in head: share/man/man9 sys/kern sys/net sys/netinet sys/netinet6 sys/netpfil/pf Message-ID: <20151113231102.GG73031@FreeBSD.org> References: <201511132251.tADMpa8o053824@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201511132251.tADMpa8o053824@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:11:06 -0000 Randall, On Fri, Nov 13, 2015 at 10:51:36PM +0000, Randall Stewart wrote: R> Author: rrs R> Date: Fri Nov 13 22:51:35 2015 R> New Revision: 290805 R> URL: https://svnweb.freebsd.org/changeset/base/290805 R> R> Log: R> This fixes several places where callout_stops return is examined. The R> new return codes of -1 were mistakenly being considered "true". Callout_stop R> now returns -1 to indicate the callout had either already completed or R> was not running and 0 to indicate it could not be stopped. Also update R> the manual page to make it more consistent no non-zero in the callout_stop R> or callout_reset descriptions. What about making callout_stop() return value a enum? enum { NOTRUN = 1, COMPLETED, RUNNING, PENDING, }; Will make code more comprehendable, than now: pending = !!(callout_stop(&timeout_task->c) > 0); will be pending = callout_stop(&timeout_task->c) >= RUNNING; -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Nov 13 23:14:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B7CA2E96E; Fri, 13 Nov 2015 23:14:40 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A12B41064; Fri, 13 Nov 2015 23:14:40 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADNEd0b062365; Fri, 13 Nov 2015 23:14:39 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADNEdHa062364; Fri, 13 Nov 2015 23:14:39 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511132314.tADNEdHa062364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 13 Nov 2015 23:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290806 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:14:40 -0000 Author: smh Date: Fri Nov 13 23:14:39 2015 New Revision: 290806 URL: https://svnweb.freebsd.org/changeset/base/290806 Log: Revert r290403 CARP rework invalidated this change. Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Nov 13 22:51:35 2015 (r290805) +++ head/sys/netinet/ip_carp.c Fri Nov 13 23:14:39 2015 (r290806) @@ -1773,13 +1773,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd } break; } - case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU_JUMBO) { - error = EINVAL; - } else { - ifp->if_mtu = ifr->ifr_mtu; - } - break; default: error = EINVAL; } From owner-svn-src-all@freebsd.org Fri Nov 13 23:19:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8233DA2EA9D for ; Fri, 13 Nov 2015 23:19:32 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 116121367 for ; Fri, 13 Nov 2015 23:19:32 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmww144 with SMTP id w144so50583577wmw.0 for ; Fri, 13 Nov 2015 15:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay_co_uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=JJhZlcFH7zjO0ABOmbQ/eZeYMl127kgEki5LZm3bKmk=; b=GoVNyruMNMz4M2V3q4cnbg2F/mjecPd+WJcLOeDtJKV1/3SUqDFe7Adc9QzIzWq/rB UXwlqgV8yVSEXWBTIgax3Y3dTSMgldj5RnJ6MjoOc43IWgwd2W/rjjmc0ei4+GwM01yn YUenV8qdAG+oppOEQm0fE/za1DjbR8p1G1rnornnfH2Y0SqY3CCIDQpDHqiXuYVAHllj J9dzCxWr/nT1r8HUGt5Pe0GxWzRVLRyMndk3C+3EJq7JlTwIwMakyvGuiDyjCS76+jCY BwhOQPLXZz8yBAnW0QcSfSOFtfidcamFK/Ku/V6RMnsWy6jU02uyAMuNOjowsKJGwovJ RfEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=JJhZlcFH7zjO0ABOmbQ/eZeYMl127kgEki5LZm3bKmk=; b=ZTs9bXMfRzibR0ewWC55sT0FEGO94S18jzADNQIGcf/f2+GOXG+fP+wBDhRYZ44nOP 0pwknOkEUtrbujbgXrm0gKE601nEJAGTvvNOd44qrqGPHX07EjsRUilYeycclQzSMAKx i9FHFRUxTxFFUWkFnhpziUJ8L+Yi/AFckpDMcNwOQrRD2RJ2HgVByRJiLgZh8Rotj2Yc KbvHm0UdC0Sy4SuIUezrNL+IXarkm3lC39n+//uchtWvY9flCUMIvp32FR3xe2UV5tEP D01lG1dWKxh6EE6z8UIbxopip7oq7aFt/6QpurHawrNNigr26cZx64tFW2KfqX2gGf+y +L1Q== X-Gm-Message-State: ALoCoQlho3kIthwTqmACzXpQ5DQYyvDKofs3RVwISpQ0YZLSDtcmxIOOAz/aWKq12zsFYPCQ5VmM X-Received: by 10.194.185.42 with SMTP id ez10mr14382867wjc.82.1447456770084; Fri, 13 Nov 2015 15:19:30 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id gl9sm22012389wjb.10.2015.11.13.15.19.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Nov 2015 15:19:29 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r290403 - head/sys/netinet To: Gleb Smirnoff References: <201511051723.tA5HN24j065530@repo.freebsd.org> <20151113214204.GA73031@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5646700E.4010701@freebsd.org> Date: Fri, 13 Nov 2015 23:19:42 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151113214204.GA73031@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:19:32 -0000 On 13/11/2015 21:42, Gleb Smirnoff wrote: > Steven, > > On Thu, Nov 05, 2015 at 05:23:02PM +0000, Steven Hartland wrote: > S> Author: smh > S> Date: Thu Nov 5 17:23:02 2015 > S> New Revision: 290403 > S> URL: https://svnweb.freebsd.org/changeset/base/290403 > S> > S> Log: > S> Add MTU support to carp interfaces > S> > S> MFC after: 2 weeks > S> Sponsored by: Multiplay > > What is "carp interfaces"? I believe you are committing a patch to FreeBSD 9 > into FreeBSD 11, w/o doing any testing and w/o doing even light review of > surrounding code, which differes a lot from FreeBSD 9. > > Please back this out or correct me being wrong. > You're correct, this was something we've had hanging around from a long time, backed out by r290403. I should have both know that the CARP rework invalided it and also should have re-tested before committing it don't know what I was thinking that day, apologies and thanks for highlighting it. Regards Steve From owner-svn-src-all@freebsd.org Fri Nov 13 23:24:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8682CA2EBE9; Fri, 13 Nov 2015 23:24:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42C12184D; Fri, 13 Nov 2015 23:24:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1C4F21FE022; Sat, 14 Nov 2015 00:23:57 +0100 (CET) Subject: Re: svn commit: r290805 - in head: share/man/man9 sys/kern sys/net sys/netinet sys/netinet6 sys/netpfil/pf To: Gleb Smirnoff , Randall Stewart References: <201511132251.tADMpa8o053824@repo.freebsd.org> <20151113231102.GG73031@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56467173.2020405@selasky.org> Date: Sat, 14 Nov 2015 00:25:39 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151113231102.GG73031@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:24:01 -0000 On 11/14/15 00:11, Gleb Smirnoff wrote: > What about making callout_stop() return value a enum? Hi, If we could make most callout functions return "void" and use mutexes, this will not be an issue any more! --HPS From owner-svn-src-all@freebsd.org Fri Nov 13 23:26:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90567A2EC4B for ; Fri, 13 Nov 2015 23:26:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 1813119E8 for ; Fri, 13 Nov 2015 23:26:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmdw130 with SMTP id w130so47969199wmd.0 for ; Fri, 13 Nov 2015 15:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay_co_uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=RMo9k0X2EJKgXc+BYreEcSakoWDqXd07L6s4j0i0aBs=; b=PzYwKJv+IGeydT01OmRY9eFHhXOBJq9BwYw71mdHFNrPsqvRArAyBzDOurlL4GMaRz BcRw6AElXfc7V4WMW/92aTxNP9IDKKGSCmqNgTRZrrsh0ACPuW8FLTBZ2/SPUNIWbtkw AKzNoF0saGr1Hz263nWz2s0HsZ16E+zzkj28xDvapqi10tOSzkKuztxUWsemYoeTg6px 52kRuLL5ry7sUe6DjLY4VL2IZoPmBbT483Z1ydvgPHHTR7yy0kQ0u2EEhdkO2RN+/UP0 9Wf0J0ir9M9nWviuGNlMhMfE1GueHG79bO0VIhCnfLd2u67Szk4deJeVjHtCn8svWCpf bMSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=RMo9k0X2EJKgXc+BYreEcSakoWDqXd07L6s4j0i0aBs=; b=QoOR7pozZ3hgwLo28TE7mFOfIKpQtChwHIgNQ/Cvp/JJyGKjZUfMyVtM7x6ZAA/khX 3xTemdAiSH9dK36+eu/UzMisuKGqnMH9ZsnZlIjEYfzgvKQn7QhnqW0BGxA0IlzSopy5 DZT8saXitCMj+A+ghouTASrzooFuqijSfPmsRPB4HPPlf+DUP/mJxGvo5eIh1hmOyTbN KtHM0KvfCGzy1/XCSAnS3N2waMSVptPJxMT/0brS7rl53tCxegD68eQGopFJucnNOCRo rwA550un23oxhNaXlnchB8D3MkO6sowIL9/dDvadPUI8Ol8AwzbHhjso3A1CmdbilwLx UDew== X-Gm-Message-State: ALoCoQmxiMix++c5waMOZgNtF9WJM78LNSiJXnN+c4kHcpL5dd+A/ERp/omPUpbhe55U2cb7l9xL X-Received: by 10.28.150.11 with SMTP id y11mr6052448wmd.43.1447457185546; Fri, 13 Nov 2015 15:26:25 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id l1sm6097719wmg.21.2015.11.13.15.26.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Nov 2015 15:26:24 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r290450 - in head: sbin/ifconfig share/man/man4 sys/net To: Gleb Smirnoff References: <201511061533.tA6FXSmq054394@repo.freebsd.org> <20151113223627.GC73031@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <564671AE.1030405@freebsd.org> Date: Fri, 13 Nov 2015 23:26:38 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151113223627.GC73031@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:26:27 -0000 On 13/11/2015 22:36, Gleb Smirnoff wrote: > On Fri, Nov 06, 2015 at 03:33:28PM +0000, Steven Hartland wrote: > S> Author: smh > S> Date: Fri Nov 6 15:33:27 2015 > S> New Revision: 290450 > S> URL: https://svnweb.freebsd.org/changeset/base/290450 > S> > S> Log: > S> Add sysctl to control LACP strict compliance default > S> > S> Add net.link.lagg.lacp.default_strict_mode which defines > S> the default value for LACP strict compliance for created > S> lagg devices. > S> > S> Also: > S> * Add lacp_strict option to ifconfig(8). > S> * Fix lagg(4) creation examples. > S> * Minor style(9) fix. > > AFAIU, you are adding the sysctl to close a very short period > of time between cloning a lagg(4) and configuring it. > > This is not a pretty solution to the problem. But the network > stack has an API for supplying extra parameters at the cloning > time. The lagg_clone_create() accepts the params, that can > be supplied by ifconfig. If you put there the same arguments you > supply with SIOCGLAGGOPTS, you can create and configure a lagg > in one syscall. > In our case strict mode totally breaks for us on some old switches, the only option to restore functionality was to disable it so we use this loader.conf to ensure sysadmins don't mess up when creating new lagg's. So yes we could do that as well but it wouldn't fix the issue we're using the sysctl for. Regards Steve From owner-svn-src-all@freebsd.org Fri Nov 13 23:47:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1610BA2E047; Fri, 13 Nov 2015 23:47:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E429E12F3; Fri, 13 Nov 2015 23:47:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADNlgUL072284; Fri, 13 Nov 2015 23:47:42 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADNlfnB072281; Fri, 13 Nov 2015 23:47:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511132347.tADNlfnB072281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 13 Nov 2015 23:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290807 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:47:43 -0000 Author: gonzo Date: Fri Nov 13 23:47:41 2015 New Revision: 290807 URL: https://svnweb.freebsd.org/changeset/base/290807 Log: - Add driver for System-Reset-Controler i.MX6 module - Add API function to reset IPU1 Added: head/sys/arm/freescale/imx/imx6_src.c (contents, props changed) head/sys/arm/freescale/imx/imx6_src.h (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx6 Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Fri Nov 13 23:14:39 2015 (r290806) +++ head/sys/arm/freescale/imx/files.imx6 Fri Nov 13 23:47:41 2015 (r290807) @@ -19,6 +19,7 @@ arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard +arm/freescale/imx/imx6_src.c standard arm/freescale/imx/imx_iomux.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard Added: head/sys/arm/freescale/imx/imx6_src.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_src.c Fri Nov 13 23:47:41 2015 (r290807) @@ -0,0 +1,173 @@ +/*- + * Copyright (c) 2015 Oleksandr Tymoshenko + * 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$"); + +/* + * System Reset Control for iMX6 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define SRC_SCR 0 +#define SW_IPU1_RST (1 << 3) + +struct src_softc { + device_t dev; + struct resource *mem_res; +}; + +static struct src_softc *src_sc; + +static inline uint32_t +RD4(struct src_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct src_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +int +src_reset_ipu() +{ + uint32_t reg; + int timeout = 10000; + + if (src_sc == NULL) + return (-1); + + reg = RD4(src_sc, SRC_SCR); + reg |= SW_IPU1_RST; + WR4(src_sc, SRC_SCR, reg); + + while (timeout-- > 0) { + reg = RD4(src_sc, SRC_SCR); + if (reg & SW_IPU1_RST) + DELAY(1); + else + break; + } + + if (timeout < 0) + return (-1); + else + return (0); +} + +static int +src_detach(device_t dev) +{ + struct src_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +src_attach(device_t dev) +{ + struct src_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + src_sc = sc; + + err = 0; + +out: + + if (err != 0) + src_detach(dev); + + return (err); +} + +static int +src_probe(device_t dev) +{ + + if ((ofw_bus_is_compatible(dev, "fsl,imx6q-src") == 0) && + (ofw_bus_is_compatible(dev, "fsl,imx6-src") == 0)) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 System Reset Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t src_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, src_probe), + DEVMETHOD(device_attach, src_attach), + DEVMETHOD(device_detach, src_detach), + + DEVMETHOD_END +}; + +static driver_t src_driver = { + "src", + src_methods, + sizeof(struct src_softc) +}; + +static devclass_t src_devclass; + +DRIVER_MODULE(src, simplebus, src_driver, src_devclass, 0, 0); Added: head/sys/arm/freescale/imx/imx6_src.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_src.h Fri Nov 13 23:47:41 2015 (r290807) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2015 Oleksandr Tymoshenko + * 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 __IMX6_SRC_H__ +#define __IMX6_SRC_H__ + +int src_reset_ipu(void); + +#endif /* __IMX6_SRC_H__ */ From owner-svn-src-all@freebsd.org Fri Nov 13 23:52:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A62A7A2E228; Fri, 13 Nov 2015 23:52:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 720F71916; Fri, 13 Nov 2015 23:52:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iofh3 with SMTP id h3so113239534iof.3; Fri, 13 Nov 2015 15:52:45 -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=QtwFM+itwUtD2lmDmorpuRnUJ8n1jWJOCI6bdqYz1hI=; b=0QzLQ8+jQnZ4Aef9iw3m7ZQn0lEgmsbdzG/s+HYd9bWmCCiOaUNjNdsuDt2jNCQdGl cnNxgpy53tb6ReQZVtEV2ZUwoZyNTdBfwJbc1jno48t0cwLCCkNQX1kl4pfuTHqm4yKk aSahhM9wVT7s5Rcz+l6AurSi+yMC1jMWw+whM/FHoS3hkdfvkbIvMAgYTbeiC9LWvf9x HsvZTgjF24zIj5DLNKQK/yondwc8LhN5hEuasuG8sfgyvBILFZZgMXRzccvDnDjlb6jD n2tcIvx6Dp3uDV2BU8B+m+jz1c+M+QZt4Fx7UqEbcTeoVPRcJg0JU/YNpK5aKmn+0fgz Zu7w== MIME-Version: 1.0 X-Received: by 10.107.152.2 with SMTP id a2mr21861461ioe.123.1447458765785; Fri, 13 Nov 2015 15:52:45 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.217.196 with HTTP; Fri, 13 Nov 2015 15:52:45 -0800 (PST) In-Reply-To: <20151113224431.GD73031@FreeBSD.org> References: <201511070404.tA7440RE080849@repo.freebsd.org> <20151113224431.GD73031@FreeBSD.org> Date: Fri, 13 Nov 2015 15:52:45 -0800 X-Google-Sender-Auth: FFgpECMV_8riGiSPonTKMLM1Nhk Message-ID: Subject: Re: svn commit: r290481 - head/sys/kern From: Adrian Chadd To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:52:46 -0000 Peter Holm already approached me to ask about it. The problem has been figuring out how to trigger it in an automated / VM way. :( -a On 13 November 2015 at 14:44, Gleb Smirnoff wrote: > On Sat, Nov 07, 2015 at 04:04:00AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Sat Nov 7 04:04:00 2015 > A> New Revision: 290481 > A> URL: https://svnweb.freebsd.org/changeset/base/290481 > A> > A> Log: > A> Add a sched_yield() to work around low memory conditions in the current code. > A> > A> Things seem to get stuck in low memory conditions where no bufs are available, > A> the reclamation path is called to wakeup the daemon, but no sleeping is done. > A> Because of this, we are stuck in a tight loop in the current process and > A> never run said reclamation path. > A> > A> This was introduced in r289279 . This is only a temporary workaround > A> to restore system usefulness until the more permanent solutions can be > A> found. > A> > A> Tested: > A> > A> * Carambola2, 64MB (and 32MB by manual config.) > A> > A> Modified: > A> head/sys/kern/vfs_bio.c > A> > A> Modified: head/sys/kern/vfs_bio.c > A> ============================================================================== > A> --- head/sys/kern/vfs_bio.c Sat Nov 7 02:18:19 2015 (r290480) > A> +++ head/sys/kern/vfs_bio.c Sat Nov 7 04:04:00 2015 (r290481) > A> @@ -3622,6 +3622,23 @@ loop: > A> if (bp == NULL) { > A> if (slpflag || slptimeo) > A> return NULL; > A> + /* > A> + * XXX This is here until the sleep path is diagnosed > A> + * enough to work under very low memory conditions. > A> + * > A> + * There's an issue on low memory, 4BSD+non-preempt > A> + * systems (eg MIPS routers with 32MB RAM) where buffer > A> + * exhaustion occurs without sleeping for buffer > A> + * reclaimation. This just sticks in a loop and > A> + * constantly attempts to allocate a buffer, which > A> + * hits exhaustion and tries to wakeup bufdaemon. > A> + * This never happens because we never yield. > A> + * > A> + * The real solution is to identify and fix these cases > A> + * so we aren't effectively busy-waiting in a loop > A> + * until the reclaimation path has cycles to run. > A> + */ > A> + kern_yield(PRI_USER); > A> goto loop; > A> } > > It'll be nice if such crutches have a test case in src/tests, and a > reference to it in the comment above. So that in future, someone > considering that the crutch is no longer needed, can quickly check that > assumption. > > -- > Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Sat Nov 14 00:00:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 541AEA2E607 for ; Sat, 14 Nov 2015 00:00:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 E74A71D80 for ; Sat, 14 Nov 2015 00:00:18 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wmww144 with SMTP id w144so51347616wmw.0 for ; Fri, 13 Nov 2015 16:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay_co_uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=7h5Jje11PEIiQiuCfTm3EaB43561fGuXycPfHF970Hc=; b=rxXVUNxt/wWf+ayz0UWH9AWPRapmf58CSjSL+/Gk6zmUGqbMOKtILaaKipni9zNlh6 xYoBcsr1g0MXm3JcxYmZ97W5hBZjTr+92ZdON3LBayPwKJO2Jc34KFJbDwPj2k93J7zF w2Gto+gl0dSDImpf0D6CCZbrbxZd8HNeyHMLb+z+WfU7K0tQtbT9XgwYzVzW5SC76kpR U3ipkjnp/N00FEalv7dsoKJLkfmKAplWmfkqI4sYptr6+j/vCv0uEi2/1MKWZPRPVwjO Eu/hloUxeytupfYm22/a3zpJzAjfkS/ptxBjUbOlF63gMTNz4vndUxB7NpmwF43Y0V/A +DaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=7h5Jje11PEIiQiuCfTm3EaB43561fGuXycPfHF970Hc=; b=ccVt3up2RmZqgFw3QDbvWb9CorBF15S4gISA4CQjeumY24z8ilEoUVNvUmQNPGFq2x RWwtduuPZsAAoez7zfWOJtGPMgmB742XK2XJvZZEIWgGHicQoK14KjfF/HcfWrfJW3Ex SIp1Ine5Lv33TLiRUDKxFuA6ZQ0xhwEzr+qYIvgB/SFuEc0Ko4GNCTXwo8XjHBMkrqlp A/4VSGCz7cu8KYsyn0QXSUZr3XNz8aecS5wZOImUHUEn9zeD5m3PuU49NpUP5hScR5Pc vticvKdvRrE2BKlhcHNhfQLtl2+wuseY0qxVPNJIGZSs7rmz+Ak7QvkkQNzz7pl8azaP loBg== X-Gm-Message-State: ALoCoQm2WpQ0E7tJGldcaPs7ZKXDIcnjIzXeazRniNnDIszc9vOoor+so663x8umBd+jVCIgKFSj X-Received: by 10.28.73.11 with SMTP id w11mr6201386wma.44.1447459217513; Fri, 13 Nov 2015 16:00:17 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q1sm22126130wjy.31.2015.11.13.16.00.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Nov 2015 16:00:16 -0800 (PST) Subject: Re: svn commit: r290603 - in head/sys: net netgraph netinet To: Gleb Smirnoff , "Alexander V. Chernikov" References: <201511091011.tA9ABFWb029549@repo.freebsd.org> <20151113225400.GE73031@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Steven Hartland Message-ID: <5646799E.3030806@multiplay.co.uk> Date: Sat, 14 Nov 2015 00:00:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151113225400.GE73031@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 00:00:19 -0000 On 13/11/2015 22:54, Gleb Smirnoff wrote: > Alexander, > > On Mon, Nov 09, 2015 at 10:11:15AM +0000, Alexander V. Chernikov wrote: > A> Author: melifaro > A> Date: Mon Nov 9 10:11:14 2015 > A> New Revision: 290603 > A> URL: https://svnweb.freebsd.org/changeset/base/290603 > A> > A> Log: > A> Use lladdr_event to propagate gratiotus arp. > A> > A> Differential Revision: https://reviews.freebsd.org/D4019 > > Looking into a diff a lame question emerges: why can't the call > to EVENTHANDLER_INVOKE() moved right into the end of the > if_setlladdr()? > This would indeed be a good change, not only does it eliminate duplicate code, simplifying things but it also ensures the event is fired if more callers are added. Regards Steve From owner-svn-src-all@freebsd.org Sat Nov 14 00:04:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB8AA2E7EB; Sat, 14 Nov 2015 00:04:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE37123F; Sat, 14 Nov 2015 00:04:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE04gBT078653; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE04gJu078651; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140004.tAE04gJu078651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 00:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290808 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 00:04:43 -0000 Author: jhb Date: Sat Nov 14 00:04:42 2015 New Revision: 290808 URL: https://svnweb.freebsd.org/changeset/base/290808 Log: MFC 232472 (partial): Cache the starting location of the PCI-express capability for PCI-express devices in PCI device ivars. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) @@ -798,6 +798,9 @@ pci_read_cap(device_t pcib, pcicfgregs * * at least one PCI-express device. */ pcie_chipset = 1; + cfg->pcie.pcie_location = ptr; + val = REG(ptr + PCIR_EXPRESS_FLAGS, 2); + cfg->pcie.pcie_type = val & PCIM_EXP_FLAGS_TYPE; break; default: break; @@ -1776,10 +1779,12 @@ pci_ht_map_msi(device_t dev, uint64_t ad int pci_get_max_read_req(device_t dev) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); val &= PCIEM_CTL_MAX_READ_REQUEST; @@ -1790,10 +1795,12 @@ pci_get_max_read_req(device_t dev) int pci_set_max_read_req(device_t dev, int size) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); if (size < 128) size = 128; Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) @@ -124,6 +124,12 @@ struct pcicfg_ht { uint64_t ht_msiaddr; /* MSI mapping base address */ }; +/* Interesting values for PCI-express */ +struct pcicfg_pcie { + uint8_t pcie_location; /* Offset of PCI-e capability registers. */ + uint8_t pcie_type; /* Device type. */ +}; + /* config header information common to all header types */ typedef struct pcicfg { struct device *dev; /* device which owns this */ @@ -165,6 +171,7 @@ typedef struct pcicfg { struct pcicfg_msi msi; /* PCI MSI */ struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ + struct pcicfg_pcie pcie; /* PCI Express */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ From owner-svn-src-all@freebsd.org Sat Nov 14 01:06:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B79A2F2C8; Sat, 14 Nov 2015 01:06:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8721B6F; Sat, 14 Nov 2015 01:06:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE16kil097972; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE16j5Q097967; Sat, 14 Nov 2015 01:06:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140106.tAE16j5Q097967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 01:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:06:47 -0000 Author: jhb Date: Sat Nov 14 01:06:45 2015 New Revision: 290809 URL: https://svnweb.freebsd.org/changeset/base/290809 Log: MFC 290414,290415: Additional PCI helper functions. 290414: Add helper routines for PCI device drivers to read, write, and modify PCI-Express capability registers (that is, PCI config registers in the standard PCI config space belonging to the PCI-Express capability register set). Note that all of the current PCI-e registers are either 16 or 32-bits, so only widths of 2 or 4 bytes are supported. 290415: Add a new helper function for PCI devices to locate the upstream PCI-express root port of a given PCI device. Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) @@ -1014,6 +1014,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_device.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ + pci.9 pci_find_pcie_root_port.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ @@ -1028,7 +1029,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ - pci.9 pci_write_config.9 + pci.9 pci_write_config.9 \ + pci.9 pcie_adjust_config.9 \ + pci.9 pcie_read_config.9 \ + pci.9 pcie_write_config.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 5, 2015 .Dt PCI 9 .Os .Sh NAME @@ -42,6 +42,7 @@ .Nm pci_find_device , .Nm pci_find_extcap , .Nm pci_find_htcap , +.Nm pci_find_pcie_root_port , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -56,7 +57,10 @@ .Nm pci_save_state , .Nm pci_set_max_read_req , .Nm pci_set_powerstate , -.Nm pci_write_config +.Nm pci_write_config , +.Nm pcie_adjust_config , +.Nm pcie_read_config , +.Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h @@ -86,6 +90,8 @@ .Fn pci_find_extcap "device_t dev" "int capability" "int *capreg" .Ft int .Fn pci_find_htcap "device_t dev" "int capability" "int *capreg" +.Ft device_t +.Fn pci_find_pcie_root_port "device_t dev" .Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int @@ -116,6 +122,18 @@ .Fn pci_set_powerstate "device_t dev" "int state" .Ft void .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft uint32_t +.Fo pcie_adjust_config +.Fa "device_t dev" +.Fa "int reg" +.Fa "uint32_t mask" +.Fa "uint32_t val" +.Fa "int width" +.Fc +.Ft uint32_t +.Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm @@ -152,6 +170,48 @@ with .Fa width specifying the size of the access. .Pp +The +.Fn pcie_adjust_config +function is used to modify the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +The new value of the register is computed by modifying bits set in +.Fa mask +to the value in +.Fa val . +Any bits not specified in +.Fa mask +are preserved. +The previous value of the register is returned. +.Pp +The +.Fn pcie_read_config +function is used to read the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp +The +.Fn pcie_write_config +function is used to write the value +.Fa val +to a register in the PCI-express capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp .Em NOTE : Device drivers should only use these functions for functionality that is not available via another @@ -274,6 +334,16 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_pcie_root_port +function walks up the PCI device hierarchy to locate the PCI-express root +port upstream of +.Fa dev . +If a root port is not found, +.Fn pci_find_pcie_root_port +returns +.Dv NULL . +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) @@ -1895,6 +1895,63 @@ pci_set_max_read_req(device_t dev, int s return (size); } +uint32_t +pcie_read_config(device_t dev, int reg, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + return (pci_read_config(dev, cap + reg, width)); +} + +void +pcie_write_config(device_t dev, int reg, uint32_t value, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return; + pci_write_config(dev, cap + reg, value, width); +} + +/* + * Adjusts a PCI-e capability register by clearing the bits in mask + * and setting the bits in (value & mask). Bits not set in mask are + * not adjusted. + * + * Returns the old value on success or all ones on failure. + */ +uint32_t +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, + int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint32_t old, new; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + old = pci_read_config(dev, cap + reg, width); + new = old & ~mask; + new |= (value & mask); + pci_write_config(dev, cap + reg, new, width); + return (old); +} + /* * Support for MSI message signalled interrupts. */ @@ -5139,3 +5196,44 @@ pci_get_rid_method(device_t dev, device_ return (PCIB_GET_RID(device_get_parent(dev), child)); } + +/* Find the upstream port of a given PCI device in a root complex. */ +device_t +pci_find_pcie_root_port(device_t dev) +{ + struct pci_devinfo *dinfo; + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* + * Walk the bridge hierarchy until we find a PCI-e root + * port or a non-PCI device. + */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * pcib's parent must be a PCI bus for this to be a + * PCI-PCI bridge. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (NULL); + + dinfo = device_get_ivars(pcib); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) + return (pcib); + + dev = pcib; + } +} Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) @@ -501,10 +501,15 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +device_t pci_find_pcie_root_port(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); +uint32_t pcie_read_config(device_t dev, int reg, int width); +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, + uint32_t value, int width); #ifdef BUS_SPACE_MAXADDR From owner-svn-src-all@freebsd.org Sat Nov 14 01:06:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9161A2F2CC; Sat, 14 Nov 2015 01:06:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82F641B71; Sat, 14 Nov 2015 01:06:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE16k3r097983; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE16koW097979; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140106.tAE16koW097979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 01:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:06:47 -0000 Author: jhb Date: Sat Nov 14 01:06:45 2015 New Revision: 290809 URL: https://svnweb.freebsd.org/changeset/base/290809 Log: MFC 290414,290415: Additional PCI helper functions. 290414: Add helper routines for PCI device drivers to read, write, and modify PCI-Express capability registers (that is, PCI config registers in the standard PCI config space belonging to the PCI-Express capability register set). Note that all of the current PCI-e registers are either 16 or 32-bits, so only widths of 2 or 4 bytes are supported. 290415: Add a new helper function for PCI devices to locate the upstream PCI-express root port of a given PCI device. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) @@ -978,6 +978,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_find_pcie_root_port.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ @@ -992,7 +993,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ - pci.9 pci_write_config.9 + pci.9 pci_write_config.9 \ + pci.9 pcie_adjust_config.9 \ + pci.9 pcie_read_config.9 \ + pci.9 pcie_write_config.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 5, 2015 .Dt PCI 9 .Os .Sh NAME @@ -40,6 +40,7 @@ .Nm pci_find_cap , .Nm pci_find_dbsf , .Nm pci_find_device , +.Nm pci_find_pcie_root_port , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -54,7 +55,10 @@ .Nm pci_save_state , .Nm pci_set_max_read_req , .Nm pci_set_powerstate , -.Nm pci_write_config +.Nm pci_write_config , +.Nm pcie_adjust_config , +.Nm pcie_read_config , +.Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h @@ -80,6 +84,8 @@ .Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t .Fn pci_find_device "uint16_t vendor" "uint16_t device" +.Ft device_t +.Fn pci_find_pcie_root_port "device_t dev" .Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int @@ -110,6 +116,18 @@ .Fn pci_set_powerstate "device_t dev" "int state" .Ft void .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft uint32_t +.Fo pcie_adjust_config +.Fa "device_t dev" +.Fa "int reg" +.Fa "uint32_t mask" +.Fa "uint32_t val" +.Fa "int width" +.Fc +.Ft uint32_t +.Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm @@ -146,6 +164,48 @@ with .Fa width specifying the size of the access. .Pp +The +.Fn pcie_adjust_config +function is used to modify the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +The new value of the register is computed by modifying bits set in +.Fa mask +to the value in +.Fa val . +Any bits not specified in +.Fa mask +are preserved. +The previous value of the register is returned. +.Pp +The +.Fn pcie_read_config +function is used to read the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp +The +.Fn pcie_write_config +function is used to write the value +.Fa val +to a register in the PCI-express capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp .Em NOTE : Device drivers should only use these functions for functionality that is not available via another @@ -225,6 +285,16 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_pcie_root_port +function walks up the PCI device hierarchy to locate the PCI-express root +port upstream of +.Fa dev . +If a root port is not found, +.Fn pci_find_pcie_root_port +returns +.Dv NULL . +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) @@ -1814,6 +1814,63 @@ pci_set_max_read_req(device_t dev, int s return (size); } +uint32_t +pcie_read_config(device_t dev, int reg, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + return (pci_read_config(dev, cap + reg, width)); +} + +void +pcie_write_config(device_t dev, int reg, uint32_t value, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return; + pci_write_config(dev, cap + reg, value, width); +} + +/* + * Adjusts a PCI-e capability register by clearing the bits in mask + * and setting the bits in (value & mask). Bits not set in mask are + * not adjusted. + * + * Returns the old value on success or all ones on failure. + */ +uint32_t +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, + int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint32_t old, new; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + old = pci_read_config(dev, cap + reg, width); + new = old & ~mask; + new |= (value & mask); + pci_write_config(dev, cap + reg, new, width); + return (old); +} + /* * Support for MSI message signalled interrupts. */ @@ -4686,3 +4743,44 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +/* Find the upstream port of a given PCI device in a root complex. */ +device_t +pci_find_pcie_root_port(device_t dev) +{ + struct pci_devinfo *dinfo; + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* + * Walk the bridge hierarchy until we find a PCI-e root + * port or a non-PCI device. + */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * pcib's parent must be a PCI bus for this to be a + * PCI-PCI bridge. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (NULL); + + dinfo = device_get_ivars(pcib); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) + return (pcib); + + dev = pcib; + } +} Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) @@ -475,10 +475,15 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +device_t pci_find_pcie_root_port(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); +uint32_t pcie_read_config(device_t dev, int reg, int width); +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, + uint32_t value, int width); #endif /* _SYS_BUS_H_ */ From owner-svn-src-all@freebsd.org Sat Nov 14 01:23:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E4DFA2F524; Sat, 14 Nov 2015 01:23:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 052D81341; Sat, 14 Nov 2015 01:23:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE1NEu1004248; Sat, 14 Nov 2015 01:23:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE1NEZ9004247; Sat, 14 Nov 2015 01:23:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511140123.tAE1NEZ9004247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 14 Nov 2015 01:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290810 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:23:15 -0000 Author: cem Date: Sat Nov 14 01:23:13 2015 New Revision: 290810 URL: https://svnweb.freebsd.org/changeset/base/290810 Log: if_ntb: Clear the right QP in the free bitmap Now it can ping back and forth. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Sat Nov 14 01:06:45 2015 (r290809) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Sat Nov 14 01:23:13 2015 (r290810) @@ -783,7 +783,7 @@ ntb_transport_create_queue(void *data, s free_queue--; qp = &nt->qp_vec[free_queue]; - clear_bit(1ull << qp->qp_num, &nt->qp_bitmap_free); + clear_bit(qp->qp_num, &nt->qp_bitmap_free); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; From owner-svn-src-all@freebsd.org Sat Nov 14 01:40:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D1EBA2F6CD; Sat, 14 Nov 2015 01:40:14 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5DCB1936; Sat, 14 Nov 2015 01:40:13 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE1eCYM007774; Sat, 14 Nov 2015 01:40:12 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE1eChY007772; Sat, 14 Nov 2015 01:40:12 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201511140140.tAE1eChY007772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 14 Nov 2015 01:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290811 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:40:14 -0000 Author: jtl Date: Sat Nov 14 01:40:12 2015 New Revision: 290811 URL: https://svnweb.freebsd.org/changeset/base/290811 Log: Fix hwpmc "stalled" behavior Currently, there is a single pm_stalled flag that tracks whether a performance monitor was "stalled" due to insufficent ring buffer space for samples. However, because the same performance monitor can run on multiple processes or threads at the same time, a single pm_stalled flag that impacts them all seems insufficient. In particular, you can hit corner cases where the code fails to stop performance monitors during a context switch out, because it thinks the performance monitor is already stopped. However, in reality, it may be that only the monitor running on a different CPU was stalled. This patch attempts to fix that behavior by tracking on a per-CPU basis whether a PM desires to run and whether it is "stalled". This lets the code make better decisions about when to stop PMs and when to try to restart them. Ideally, we should avoid the case where the code fails to stop a PM during a context switch out. Sponsored by: Juniper Networks Reviewed by: jhb Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D4124 Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/sys/pmc.h Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 14 01:23:13 2015 (r290810) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 14 01:40:12 2015 (r290811) @@ -1298,6 +1298,15 @@ pmc_process_csw_in(struct thread *td) PMCDBG3(CSW,SWI,1,"cpu=%d ri=%d new=%jd", cpu, ri, newvalue); pcd->pcd_write_pmc(cpu, adjri, newvalue); + + /* If a sampling mode PMC, reset stalled state. */ + if (PMC_TO_MODE(pm) == PMC_MODE_TS) + CPU_CLR_ATOMIC(cpu, &pm->pm_stalled); + + /* Indicate that we desire this to run. */ + CPU_SET_ATOMIC(cpu, &pm->pm_cpustate); + + /* Start the PMC. */ pcd->pcd_start_pmc(cpu, adjri); } @@ -1392,8 +1401,14 @@ pmc_process_csw_out(struct thread *td) ("[pmc,%d] ri mismatch pmc(%d) ri(%d)", __LINE__, PMC_TO_ROWINDEX(pm), ri)); - /* Stop hardware if not already stopped */ - if (pm->pm_stalled == 0) + /* + * Change desired state, and then stop if not stalled. + * This two-step dance should avoid race conditions where + * an interrupt re-enables the PMC after this code has + * already checked the pm_stalled flag. + */ + CPU_CLR_ATOMIC(cpu, &pm->pm_cpustate); + if (!CPU_ISSET(cpu, &pm->pm_stalled)) pcd->pcd_stop_pmc(cpu, adjri); /* reduce this PMC's runcount */ @@ -2258,8 +2273,9 @@ pmc_release_pmc_descriptor(struct pmc *p pmc_select_cpu(cpu); /* switch off non-stalled CPUs */ + CPU_CLR_ATOMIC(cpu, &pm->pm_cpustate); if (pm->pm_state == PMC_STATE_RUNNING && - pm->pm_stalled == 0) { + !CPU_ISSET(cpu, &pm->pm_stalled)) { phw = pmc_pcpu[cpu]->pc_hwpmcs[ri]; @@ -2695,8 +2711,15 @@ pmc_start(struct pmc *pm) if ((error = pcd->pcd_write_pmc(cpu, adjri, PMC_IS_SAMPLING_MODE(mode) ? pm->pm_sc.pm_reloadcount : - pm->pm_sc.pm_initial)) == 0) + pm->pm_sc.pm_initial)) == 0) { + /* If a sampling mode PMC, reset stalled state. */ + if (PMC_IS_SAMPLING_MODE(mode)) + CPU_CLR_ATOMIC(cpu, &pm->pm_stalled); + + /* Indicate that we desire this to run. Start it. */ + CPU_SET_ATOMIC(cpu, &pm->pm_cpustate); error = pcd->pcd_start_pmc(cpu, adjri); + } critical_exit(); pmc_restore_cpu_binding(&pb); @@ -2758,6 +2781,7 @@ pmc_stop(struct pmc *pm) ri = PMC_TO_ROWINDEX(pm); pcd = pmc_ri_to_classdep(md, ri, &adjri); + CPU_CLR_ATOMIC(cpu, &pm->pm_cpustate); critical_enter(); if ((error = pcd->pcd_stop_pmc(cpu, adjri)) == 0) error = pcd->pcd_read_pmc(cpu, adjri, &pm->pm_sc.pm_initial); @@ -4066,7 +4090,7 @@ pmc_process_interrupt(int cpu, int ring, ps = psb->ps_write; if (ps->ps_nsamples) { /* in use, reader hasn't caught up */ - pm->pm_stalled = 1; + CPU_SET_ATOMIC(cpu, &pm->pm_stalled); atomic_add_int(&pmc_stats.pm_intr_bufferfull, 1); PMCDBG6(SAM,INT,1,"(spc) cpu=%d pm=%p tf=%p um=%d wr=%d rd=%d", cpu, pm, (void *) tf, inuserspace, @@ -4321,10 +4345,11 @@ pmc_process_samples(int cpu, int ring) if (pm == NULL || /* !cfg'ed */ pm->pm_state != PMC_STATE_RUNNING || /* !active */ !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)) || /* !sampling */ - pm->pm_stalled == 0) /* !stalled */ + !CPU_ISSET(cpu, &pm->pm_cpustate) || /* !desired */ + !CPU_ISSET(cpu, &pm->pm_stalled)) /* !stalled */ continue; - pm->pm_stalled = 0; + CPU_CLR_ATOMIC(cpu, &pm->pm_stalled); (*pcd->pcd_start_pmc)(cpu, adjri); } } @@ -4443,23 +4468,31 @@ pmc_process_exit(void *arg __unused, str ("[pmc,%d] pm %p != pp_pmcs[%d] %p", __LINE__, pm, ri, pp->pp_pmcs[ri].pp_pmc)); - (void) pcd->pcd_stop_pmc(cpu, adjri); - KASSERT(pm->pm_runcount > 0, ("[pmc,%d] bad runcount ri %d rc %d", __LINE__, ri, pm->pm_runcount)); - /* Stop hardware only if it is actually running */ - if (pm->pm_state == PMC_STATE_RUNNING && - pm->pm_stalled == 0) { - pcd->pcd_read_pmc(cpu, adjri, &newvalue); - tmp = newvalue - - PMC_PCPU_SAVED(cpu,ri); - - mtx_pool_lock_spin(pmc_mtxpool, pm); - pm->pm_gv.pm_savedvalue += tmp; - pp->pp_pmcs[ri].pp_pmcval += tmp; - mtx_pool_unlock_spin(pmc_mtxpool, pm); + /* + * Change desired state, and then stop if not + * stalled. This two-step dance should avoid + * race conditions where an interrupt re-enables + * the PMC after this code has already checked + * the pm_stalled flag. + */ + if (CPU_ISSET(cpu, &pm->pm_cpustate)) { + CPU_CLR_ATOMIC(cpu, &pm->pm_cpustate); + if (!CPU_ISSET(cpu, &pm->pm_stalled)) { + (void) pcd->pcd_stop_pmc(cpu, adjri); + pcd->pcd_read_pmc(cpu, adjri, + &newvalue); + tmp = newvalue - + PMC_PCPU_SAVED(cpu,ri); + + mtx_pool_lock_spin(pmc_mtxpool, pm); + pm->pm_gv.pm_savedvalue += tmp; + pp->pp_pmcs[ri].pp_pmcval += tmp; + mtx_pool_unlock_spin(pmc_mtxpool, pm); + } } atomic_subtract_rel_int(&pm->pm_runcount,1); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Sat Nov 14 01:23:13 2015 (r290810) +++ head/sys/sys/pmc.h Sat Nov 14 01:40:12 2015 (r290811) @@ -614,6 +614,7 @@ struct pmc_op_getdyneventinfo { #include #include +#include #include @@ -729,7 +730,8 @@ struct pmc { pmc_value_t pm_initial; /* counting PMC modes */ } pm_sc; - uint32_t pm_stalled; /* marks stalled sampling PMCs */ + volatile cpuset_t pm_stalled; /* marks stalled sampling PMCs */ + volatile cpuset_t pm_cpustate; /* CPUs where PMC should be active */ uint32_t pm_caps; /* PMC capabilities */ enum pmc_event pm_event; /* event being measured */ uint32_t pm_flags; /* additional flags PMC_F_... */ From owner-svn-src-all@freebsd.org Sat Nov 14 01:45:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B7FA2F825; Sat, 14 Nov 2015 01:45:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D6E51CEC; Sat, 14 Nov 2015 01:45:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE1jbNr010539; Sat, 14 Nov 2015 01:45:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE1jbDx010538; Sat, 14 Nov 2015 01:45:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511140145.tAE1jbDx010538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 01:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290812 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:45:38 -0000 Author: bdrewery Date: Sat Nov 14 01:45:37 2015 New Revision: 290812 URL: https://svnweb.freebsd.org/changeset/base/290812 Log: Avoid setting schg in the objtree for lib32 build. Reported by: kib Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 14 01:40:12 2015 (r290811) +++ head/Makefile.inc1 Sat Nov 14 01:45:37 2015 (r290812) @@ -716,10 +716,10 @@ build32: .PHONY build-tools .endfor ${_+_}cd ${.CURDIR}; \ - ${LIB32WMAKE} -f Makefile.inc1 libraries + ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries .for _t in obj depend all ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ - DIRPRFX=libexec/rtld-elf/ ${_t} + -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t} ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ DIRPRFX=usr.bin/ldd ${_t} .endfor From owner-svn-src-all@freebsd.org Sat Nov 14 01:45:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10B8FA2F85E; Sat, 14 Nov 2015 01:45:57 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B59851E3F; Sat, 14 Nov 2015 01:45:56 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE1jtLZ010590; Sat, 14 Nov 2015 01:45:55 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE1jtPD010589; Sat, 14 Nov 2015 01:45:55 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201511140145.tAE1jtPD010589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 14 Nov 2015 01:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290813 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:45:57 -0000 Author: jtl Date: Sat Nov 14 01:45:55 2015 New Revision: 290813 URL: https://svnweb.freebsd.org/changeset/base/290813 Log: Optimizations to the way hwpmc gathers user callchains Changes to the code to gather user stacks: * Delay setting pmc_cpumask until we actually have the stack. * When recording user stack traces, only walk the portion of the ring that should have samples for us. Sponsored by: Juniper Networks Approved by: gnn (mentor) MFC after: 1 month Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 14 01:45:37 2015 (r290812) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 14 01:45:55 2015 (r290813) @@ -4096,6 +4096,7 @@ pmc_process_interrupt(int cpu, int ring, cpu, pm, (void *) tf, inuserspace, (int) (psb->ps_write - psb->ps_samples), (int) (psb->ps_read - psb->ps_samples)); + callchaindepth = 1; error = ENOMEM; goto done; } @@ -4153,7 +4154,8 @@ pmc_process_interrupt(int cpu, int ring, done: /* mark CPU as needing processing */ - CPU_SET_ATOMIC(cpu, &pmc_cpumask); + if (callchaindepth != PMC_SAMPLE_INUSE) + CPU_SET_ATOMIC(cpu, &pmc_cpumask); return (error); } @@ -4167,10 +4169,9 @@ pmc_process_interrupt(int cpu, int ring, static void pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) { - int i; struct pmc *pm; struct thread *td; - struct pmc_sample *ps; + struct pmc_sample *ps, *ps_end; struct pmc_samplebuffer *psb; #ifdef INVARIANTS int ncallchains; @@ -4189,15 +4190,17 @@ pmc_capture_user_callchain(int cpu, int /* * Iterate through all deferred callchain requests. + * Walk from the current read pointer to the current + * write pointer. */ - ps = psb->ps_samples; - for (i = 0; i < pmc_nsamples; i++, ps++) { - + ps = psb->ps_read; + ps_end = psb->ps_write; + do { if (ps->ps_nsamples != PMC_SAMPLE_INUSE) - continue; + goto next; if (ps->ps_td != td) - continue; + goto next; KASSERT(ps->ps_cpu == cpu, ("[pmc,%d] cpu mismatch ps_cpu=%d pcpu=%d", __LINE__, @@ -4222,7 +4225,12 @@ pmc_capture_user_callchain(int cpu, int #ifdef INVARIANTS ncallchains++; #endif - } + +next: + /* increment the pointer, modulo sample ring size */ + if (++ps == psb->ps_fence) + ps = psb->ps_samples; + } while (ps != ps_end); KASSERT(ncallchains > 0, ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, @@ -4232,6 +4240,9 @@ pmc_capture_user_callchain(int cpu, int ("[pmc,%d] invalid td_pinned value", __LINE__)); sched_unpin(); /* Can migrate safely now. */ + /* mark CPU as needing processing */ + CPU_SET_ATOMIC(cpu, &pmc_cpumask); + return; } From owner-svn-src-all@freebsd.org Sat Nov 14 03:05:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C89A2E808; Sat, 14 Nov 2015 03:05:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44D5C122A; Sat, 14 Nov 2015 03:05:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE35hS4033815; Sat, 14 Nov 2015 03:05:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE35hTV033812; Sat, 14 Nov 2015 03:05:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511140305.tAE35hTV033812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Nov 2015 03:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290814 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 03:05:44 -0000 Author: gonzo Date: Sat Nov 14 03:05:42 2015 New Revision: 290814 URL: https://svnweb.freebsd.org/changeset/base/290814 Log: Move all HDMI-related stuff to hdmi_if.m, hdmi.h is not required Deleted: head/sys/arm/ti/am335x/hdmi.h Modified: head/sys/arm/ti/am335x/am335x_lcd.c head/sys/arm/ti/am335x/hdmi_if.m head/sys/arm/ti/am335x/tda19988.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sat Nov 14 01:45:55 2015 (r290813) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sat Nov 14 03:05:42 2015 (r290814) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/ti/am335x/hdmi_if.m ============================================================================== --- head/sys/arm/ti/am335x/hdmi_if.m Sat Nov 14 01:45:55 2015 (r290813) +++ head/sys/arm/ti/am335x/hdmi_if.m Sat Nov 14 03:05:42 2015 (r290814) @@ -32,6 +32,13 @@ INTERFACE hdmi; +HEADER { + #include + + typedef void (*hdmi_event_hook)(void *, int); + EVENTHANDLER_DECLARE(hdmi_event, hdmi_event_hook); +} + # # Get EDID info # Modified: head/sys/arm/ti/am335x/tda19988.c ============================================================================== --- head/sys/arm/ti/am335x/tda19988.c Sat Nov 14 01:45:55 2015 (r290813) +++ head/sys/arm/ti/am335x/tda19988.c Sat Nov 14 03:05:42 2015 (r290814) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "iicbus_if.h" #include "hdmi_if.h" From owner-svn-src-all@freebsd.org Sat Nov 14 03:23:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89F79A2EB58; Sat, 14 Nov 2015 03:23:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478AC1A69; Sat, 14 Nov 2015 03:23:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE3MxJA039376; Sat, 14 Nov 2015 03:22:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE3MxM5039374; Sat, 14 Nov 2015 03:22:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511140322.tAE3MxM5039374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Nov 2015 03:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290815 - in head/sys/arm: 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 03:23:00 -0000 Author: gonzo Date: Sat Nov 14 03:22:59 2015 New Revision: 290815 URL: https://svnweb.freebsd.org/changeset/base/290815 Log: hdmi_if.m will be reused by iMX6 IPU code so move it to arm/arm Added: head/sys/arm/arm/hdmi_if.m - copied unchanged from r290814, head/sys/arm/ti/am335x/hdmi_if.m Deleted: head/sys/arm/ti/am335x/hdmi_if.m Modified: head/sys/arm/ti/am335x/files.am335x Copied: head/sys/arm/arm/hdmi_if.m (from r290814, head/sys/arm/ti/am335x/hdmi_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/hdmi_if.m Sat Nov 14 03:22:59 2015 (r290815, copy of r290814, head/sys/arm/ti/am335x/hdmi_if.m) @@ -0,0 +1,57 @@ +#- +# Copyright (c) 2015 Oleksandr Tymoshenko +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include +#include + +INTERFACE hdmi; + +HEADER { + #include + + typedef void (*hdmi_event_hook)(void *, int); + EVENTHANDLER_DECLARE(hdmi_event, hdmi_event_hook); +} + +# +# Get EDID info +# +METHOD int get_edid { + device_t dev; + uint8_t **edid; + uint32_t *edid_length; +}; + +# +# Set videomode +# +METHOD int set_videomode { + device_t dev; + const struct videomode *videomode; +}; Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Sat Nov 14 03:05:42 2015 (r290814) +++ head/sys/arm/ti/am335x/files.am335x Sat Nov 14 03:22:59 2015 (r290815) @@ -17,7 +17,7 @@ arm/ti/am335x/am335x_scm_padconf.c stand arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/am335x/am335x_musb.c optional musb fdt -arm/ti/am335x/hdmi_if.m optional hdmi +arm/arm/hdmi_if.m optional hdmi arm/ti/am335x/tda19988.c optional hdmi arm/ti/ti_edma3.c standard From owner-svn-src-all@freebsd.org Sat Nov 14 03:24:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF0ACA2EBB5; Sat, 14 Nov 2015 03:24:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA24A1C0C; Sat, 14 Nov 2015 03:24:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE3OnEh039540; Sat, 14 Nov 2015 03:24:49 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE3Omno039525; Sat, 14 Nov 2015 03:24:48 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201511140324.tAE3Omno039525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 14 Nov 2015 03:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290816 - in head: . include share/mk tools/build/options usr.bin/xlint/llib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 03:24:51 -0000 Author: sjg Date: Sat Nov 14 03:24:48 2015 New Revision: 290816 URL: https://svnweb.freebsd.org/changeset/base/290816 Log: Rename META_MODE option to DIRDEPS_BUILD This allows META_FILES option to be renamed META_MODE. Also add META_COOKIE_TOUCH for use in targets that can benefit from a cookie when in meta mode. Differential Revision: https://reviews.freebsd.org/D4153 Reviewed by: bdrewery Added: head/tools/build/options/WITH_DIRDEPS_BUILD - copied unchanged from r290801, head/tools/build/options/WITH_META_MODE Replaced: head/tools/build/options/WITH_META_MODE - copied, changed from r290801, head/tools/build/options/WITH_META_FILES Deleted: head/tools/build/options/WITH_META_FILES Modified: head/Makefile head/include/Makefile head/share/mk/bsd.dep.mk head/share/mk/bsd.subdir.mk head/share/mk/local.meta.sys.mk head/share/mk/local.sys.mk head/share/mk/sys.mk head/tools/build/options/WITH_DIRDEPS_CACHE head/tools/build/options/WITH_STAGING head/tools/build/options/WITH_SYSROOT head/usr.bin/xlint/llib/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 14 03:22:59 2015 (r290815) +++ head/Makefile Sat Nov 14 03:24:48 2015 (r290816) @@ -106,7 +106,7 @@ # Note: we use this awkward construct to be compatible with FreeBSD's # old make used in 10.0 and 9.2 and earlier. -.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" && !make(showconfig) +.if defined(MK_DIRDEPS_BUILD) && ${MK_DIRDEPS_BUILD} == "yes" && !make(showconfig) # targets/Makefile plays the role of top-level .include "targets/Makefile" .else @@ -498,15 +498,15 @@ buildLINT: # This makefile does not run in meta mode .MAKE.MODE= normal # Normally the things we run from here don't either. -# Using -DWITH_META_FILES +# Using -DWITH_META_MODE # we can buildworld with meta files created which are useful # for debugging, but without any of the rest of a meta mode build. -MK_META_MODE= no +MK_DIRDEPS_BUILD= no MK_STAGING= no # tell meta.autodep.mk to not even think about updating anything. UPDATE_DEPENDFILE= NO .if !make(showconfig) -.export MK_META_MODE MK_STAGING UPDATE_DEPENDFILE +.export MK_DIRDEPS_BUILD MK_STAGING UPDATE_DEPENDFILE .endif .if make(universe) @@ -516,4 +516,4 @@ MAKE_JOB_ERROR_TOKEN= no .endif .endif # bmake -.endif # META_MODE +.endif # DIRDEPS_BUILD Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Nov 14 03:22:59 2015 (r290815) +++ head/include/Makefile Sat Nov 14 03:24:48 2015 (r290816) @@ -166,7 +166,7 @@ compat: mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ -p ${DESTDIR}${INCLUDEDIR} > /dev/null -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" @touch ${.TARGET} .endif @@ -255,7 +255,7 @@ copies: cd ${.CURDIR}/../sys/teken; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" @touch ${.OBJDIR}/${.TARGET} .endif @@ -372,7 +372,7 @@ symlinks: ln -fs ../../../sys/rpc/$$h \ ${DESTDIR}${INCLUDEDIR}/rpc; \ done -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" @touch ${.OBJDIR}/${.TARGET} .endif Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Nov 14 03:22:59 2015 (r290815) +++ head/share/mk/bsd.dep.mk Sat Nov 14 03:24:48 2015 (r290816) @@ -163,7 +163,7 @@ beforedepend: ${DHDRS} beforebuild: ${DHDRS} .endif -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" .include # this depend: bypasses that below # the dependency helps when bootstrapping Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Sat Nov 14 03:22:59 2015 (r290815) +++ head/share/mk/bsd.subdir.mk Sat Nov 14 03:24:48 2015 (r290816) @@ -49,7 +49,7 @@ STANDALONE_SUBDIR_TARGETS?= obj checkdpa .include .if !defined(NEED_SUBDIR) -.if ${.MAKE.LEVEL} == 0 && ${MK_META_MODE} == "yes" && !empty(SUBDIR) && !(make(clean*) || make(destroy*)) +.if ${.MAKE.LEVEL} == 0 && ${MK_DIRDEPS_BUILD} == "yes" && !empty(SUBDIR) && !(make(clean*) || make(destroy*)) .include # ignore this _SUBDIR: Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Sat Nov 14 03:22:59 2015 (r290815) +++ head/share/mk/local.meta.sys.mk Sat Nov 14 03:24:48 2015 (r290816) @@ -2,7 +2,7 @@ # local configuration specific to meta mode # XXX some of this should be in meta.sys.mk -# we assume that MK_META_MODE=yes +# we assume that MK_DIRDEPS_BUILD=yes # we need this until there is an alternative MK_INSTALL_AS_USER= yes Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Sat Nov 14 03:22:59 2015 (r290815) +++ head/share/mk/local.sys.mk Sat Nov 14 03:24:48 2015 (r290816) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ .MAKE \ @@ -23,3 +23,15 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFIL .endif .include "src.sys.mk" + +.if ${.MAKE.MODE:Unormal:Mmeta*} != "" +# we can afford to use cookies to prevent some targets +# re-running needlessly +META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +# some targets need to be .PHONY - but not in meta mode +META_NOPHONY= +.else +META_COOKIE_TOUCH= +META_NOPHONY= .PHONY +.endif + Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat Nov 14 03:22:59 2015 (r290815) +++ head/share/mk/sys.mk Sat Nov 14 03:24:48 2015 (r290816) @@ -20,14 +20,14 @@ MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n3 # Some options we need now __DEFAULT_NO_OPTIONS= \ DIRDEPS_CACHE \ + DIRDEPS_BUILD \ META_MODE \ - META_FILES \ __DEFAULT_DEPENDENT_OPTIONS= \ - AUTO_OBJ/META_MODE \ - STAGING/META_MODE \ - SYSROOT/META_MODE + AUTO_OBJ/DIRDEPS_BUILD \ + STAGING/DIRDEPS_BUILD \ + SYSROOT/DIRDEPS_BUILD __ENV_ONLY_OPTIONS:= \ ${__DEFAULT_NO_OPTIONS} \ @@ -43,9 +43,9 @@ __ENV_ONLY_OPTIONS:= \ .include -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" .sinclude -.elif ${MK_META_FILES} == "yes" && defined(.MAKEFLAGS) +.elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) .if ${.MAKEFLAGS:M-B} == "" .MAKE.MODE= meta verbose .endif Copied: head/tools/build/options/WITH_DIRDEPS_BUILD (from r290801, head/tools/build/options/WITH_META_MODE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_DIRDEPS_BUILD Sat Nov 14 03:24:48 2015 (r290816, copy of r290801, head/tools/build/options/WITH_META_MODE) @@ -0,0 +1,37 @@ +.\" $FreeBSD$ +Enable building in meta mode. +This is an experimental build feature. +For details see +http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. +.Pp +The build is driven by dirdeps.mk using +.Va DIRDEPS +stored in +Makefile.depend files found in each directory. +.Pp +The build can be started from anywhere, and behaves the same. +The initial instance of +.Xr make 1 +recursively reads +.Va DIRDEPS +from Makefile.depend +computing a graph of tree dependencies from the current origin. +Setting +.Va NO_DIRDEPS +will skip checking dirdep dependencies and will only build in the current +directory. +.Pp +As each target is made +.Xr make 1 +produces a meta file which is used to capture (and compare) +the command line, +as well as any command output. +If +.Xr filemon 4 +is available the meta file will also capture a record of files +used to produce the target by tracking syscalls. +.Pp +The build will hide commands ran unless +.Va NO_SILENT +is defined. +.Pp Modified: head/tools/build/options/WITH_DIRDEPS_CACHE ============================================================================== --- head/tools/build/options/WITH_DIRDEPS_CACHE Sat Nov 14 03:22:59 2015 (r290815) +++ head/tools/build/options/WITH_DIRDEPS_CACHE Sat Nov 14 03:24:48 2015 (r290816) @@ -2,4 +2,4 @@ Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . Copied and modified: head/tools/build/options/WITH_META_MODE (from r290801, head/tools/build/options/WITH_META_FILES) ============================================================================== --- head/tools/build/options/WITH_META_FILES Fri Nov 13 20:25:30 2015 (r290801, copy source) +++ head/tools/build/options/WITH_META_MODE Sat Nov 14 03:24:48 2015 (r290816) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Create meta files during non META_MODE build. +Create meta files when not doing DIRDEPS_BUILD. The meta files can be useful for debugging. Modified: head/tools/build/options/WITH_STAGING ============================================================================== --- head/tools/build/options/WITH_STAGING Sat Nov 14 03:22:59 2015 (r290815) +++ head/tools/build/options/WITH_STAGING Sat Nov 14 03:24:48 2015 (r290816) @@ -4,4 +4,4 @@ This can be best thought of as auto-inst .Va DESTDIR with some extra meta data to ensure dependencies can be tracked. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . Modified: head/tools/build/options/WITH_SYSROOT ============================================================================== --- head/tools/build/options/WITH_SYSROOT Sat Nov 14 03:22:59 2015 (r290815) +++ head/tools/build/options/WITH_SYSROOT Sat Nov 14 03:24:48 2015 (r290816) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Enable use of sysroot during build. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . Modified: head/usr.bin/xlint/llib/Makefile ============================================================================== --- head/usr.bin/xlint/llib/Makefile Sat Nov 14 03:22:59 2015 (r290815) +++ head/usr.bin/xlint/llib/Makefile Sat Nov 14 03:24:48 2015 (r290816) @@ -16,6 +16,6 @@ llib-lstdc.ln: llib-lstdc .include -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" LINTFLAGS+= -I${STAGE_INCLUDEDIR} .endif From owner-svn-src-all@freebsd.org Sat Nov 14 04:50:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EC6A2D6E8; Sat, 14 Nov 2015 04:50:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF6D41EF1; Sat, 14 Nov 2015 04:50:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE4oSQ0067480; Sat, 14 Nov 2015 04:50:28 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE4oSJt067478; Sat, 14 Nov 2015 04:50:28 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201511140450.tAE4oSJt067478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 14 Nov 2015 04:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290817 - in head: share/man/man5 tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 04:50:30 -0000 Author: sjg Date: Sat Nov 14 04:50:28 2015 New Revision: 290817 URL: https://svnweb.freebsd.org/changeset/base/290817 Log: Regen src.conf.5 Modified: head/share/man/man5/src.conf.5 head/tools/build/options/makeman Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Nov 14 03:24:48 2015 (r290816) +++ head/share/man/man5/src.conf.5 Sat Nov 14 04:50:28 2015 (r290817) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 290435 2015-11-06 05:28:08Z bdrewery .\" $FreeBSD$ -.Dd November 7, 2015 +.Dd November 13, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -73,6 +73,7 @@ variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are .Va MAKEOBJDIRPREFIX , +.Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE as they are environment-only variables. @@ -462,12 +463,86 @@ and are located automatically by .It Va WITHOUT_DICT .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. +.It Va WITH_DIRDEPS_BUILD +.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 290816 2015-11-14 03:24:48Z sjg +Enable building in meta mode. +This is an experimental build feature. +For details see +http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. +.Pp +The build is driven by dirdeps.mk using +.Va DIRDEPS +stored in +Makefile.depend files found in each directory. +.Pp +The build can be started from anywhere, and behaves the same. +The initial instance of +.Xr make 1 +recursively reads +.Va DIRDEPS +from Makefile.depend +computing a graph of tree dependencies from the current origin. +Setting +.Va NO_DIRDEPS +will skip checking dirdep dependencies and will only build in the current +directory. +.Pp +As each target is made +.Xr make 1 +produces a meta file which is used to capture (and compare) +the command line, +as well as any command output. +If +.Xr filemon 4 +is available the meta file will also capture a record of files +used to produce the target by tracking syscalls. +.Pp +The build will hide commands ran unless +.Va NO_SILENT +is defined. +.Pp +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITH_INSTALL_AS_USER +.El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITH_AUTO_OBJ +(unless +.Va WITHOUT_AUTO_OBJ +is set explicitly) +.It Va WITH_STAGING +(unless +.Va WITHOUT_STAGING +is set explicitly) +.It Va WITH_STAGING_MAN +(unless +.Va WITHOUT_STAGING_MAN +is set explicitly) +.It Va WITH_STAGING_PROG +(unless +.Va WITHOUT_STAGING_PROG +is set explicitly) +.It Va WITH_SYSROOT +(unless +.Va WITHOUT_SYSROOT +is set explicitly) +.El +.Pp +This must be set in the environment, make command line, or +.Pa /etc/src-env.conf , +not +.Pa /etc/src.conf . .It Va WITH_DIRDEPS_CACHE -.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_CACHE 284708 2015-06-22 20:21:57Z sjg +.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_CACHE 290816 2015-11-14 03:24:48Z sjg Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -950,84 +1025,10 @@ Set to not build utilities for manual pa .Xr whatis 1 , .Xr manctl 8 , and related support files. -.It Va WITH_META_FILES -.\" from FreeBSD: head/tools/build/options/WITH_META_FILES 284708 2015-06-22 20:21:57Z sjg -Create meta files during non META_MODE build. -The meta files can be useful for debugging. -.Pp -This must be set in the environment, make command line, or -.Pa /etc/src-env.conf , -not -.Pa /etc/src.conf . .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 287973 2015-09-18 22:22:32Z bdrewery -Enable building in meta mode. -This is an experimental build feature. -For details see -http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. -.Pp -The build is driven by dirdeps.mk using -.Va DIRDEPS -stored in -Makefile.depend files found in each directory. -.Pp -The build can be started from anywhere, and behaves the same. -The initial instance of -.Xr make 1 -recursively reads -.Va DIRDEPS -from Makefile.depend -computing a graph of tree dependencies from the current origin. -Setting -.Va NO_DIRDEPS -will skip checking dirdep dependencies and will only build in the current -directory. -.Pp -As each target is made -.Xr make 1 -produces a meta file which is used to capture (and compare) -the command line, -as well as any command output. -If -.Xr filemon 4 -is available the meta file will also capture a record of files -used to produce the target by tracking syscalls. -.Pp -The build will hide commands ran unless -.Va NO_SILENT -is defined. -.Pp -When set, it also enforces the following options: -.Pp -.Bl -item -compact -.It -.Va WITH_INSTALL_AS_USER -.El -.Pp -When set, the following options are also in effect: -.Pp -.Bl -inset -compact -.It Va WITH_AUTO_OBJ -(unless -.Va WITHOUT_AUTO_OBJ -is set explicitly) -.It Va WITH_STAGING -(unless -.Va WITHOUT_STAGING -is set explicitly) -.It Va WITH_STAGING_MAN -(unless -.Va WITHOUT_STAGING_MAN -is set explicitly) -.It Va WITH_STAGING_PROG -(unless -.Va WITHOUT_STAGING_PROG -is set explicitly) -.It Va WITH_SYSROOT -(unless -.Va WITHOUT_SYSROOT -is set explicitly) -.El +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 290816 2015-11-14 03:24:48Z sjg +Create meta files when not doing DIRDEPS_BUILD. +The meta files can be useful for debugging. .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1276,13 +1277,13 @@ Set to not build kernel modules that inc .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. .It Va WITH_STAGING -.\" from FreeBSD: head/tools/build/options/WITH_STAGING 284708 2015-06-22 20:21:57Z sjg +.\" from FreeBSD: head/tools/build/options/WITH_STAGING 290816 2015-11-14 03:24:48Z sjg Enable staging of files to a stage tree. This can be best thought of as auto-install to .Va DESTDIR with some extra meta data to ensure dependencies can be tracked. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . When set, the following options are also in effect: .Pp .Bl -inset -compact @@ -1329,10 +1330,10 @@ Set to not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. .It Va WITH_SYSROOT -.\" from FreeBSD: head/tools/build/options/WITH_SYSROOT 284708 2015-06-22 20:21:57Z sjg +.\" from FreeBSD: head/tools/build/options/WITH_SYSROOT 290816 2015-11-14 03:24:48Z sjg Enable use of sysroot during build. Depends on -.Va WITH_META_MODE . +.Va WITH_DIRDEPS_BUILD . .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Sat Nov 14 03:24:48 2015 (r290816) +++ head/tools/build/options/makeman Sat Nov 14 04:50:28 2015 (r290817) @@ -198,6 +198,7 @@ variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are .Va MAKEOBJDIRPREFIX , +.Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE as they are environment-only variables. From owner-svn-src-all@freebsd.org Sat Nov 14 06:18:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D73A2FE23; Sat, 14 Nov 2015 06:18:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEFC61F76; Sat, 14 Nov 2015 06:18:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAE6IoaQ092625; Sat, 14 Nov 2015 06:18:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE6IoSV092624; Sat, 14 Nov 2015 06:18:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201511140618.tAE6IoSV092624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 14 Nov 2015 06:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290818 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 06:18:52 -0000 Author: imp Date: Sat Nov 14 06:18:50 2015 New Revision: 290818 URL: https://svnweb.freebsd.org/changeset/base/290818 Log: Fix URL for powerpc cpu options. Remove reference to ia64 options as no longer relevant. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sat Nov 14 04:50:28 2015 (r290817) +++ head/share/mk/bsd.cpu.mk Sat Nov 14 06:18:50 2015 (r290818) @@ -84,8 +84,7 @@ CPUTYPE = ultrasparc3 # after /etc/make.conf so it can react to the local value of CPUTYPE # defined therein. Consult: # http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/IA_002d64-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html +# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html From owner-svn-src-all@freebsd.org Sat Nov 14 08:31:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32475A2F4E6; Sat, 14 Nov 2015 08:31:42 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) by mx1.freebsd.org (Postfix) with ESMTP id DFD561AC3; Sat, 14 Nov 2015 08:31:41 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id 7938BACAD34; Sat, 14 Nov 2015 09:25:28 +0100 (CET) Subject: Re: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201511140106.tAE16j5Q097967@repo.freebsd.org> From: Michal Meloun Organization: freebsd.org Message-ID: <5646EFF8.1080207@freebsd.org> Date: Sat, 14 Nov 2015 09:25:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511140106.tAE16j5Q097967@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Sat, 14 Nov 2015 09:25:28 +0100 (CET) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 08:31:42 -0000 This commit breaks installworld. Index: share/man/man9/Makefile =================================================================== --- share/man/man9/Makefile (revision 290818) +++ share/man/man9/Makefile (working copy) @@ -1032,7 +1032,7 @@ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Dne 14.11.2015 v 2:06 John Baldwin napsal(a): > Author: jhb > Date: Sat Nov 14 01:06:45 2015 > New Revision: 290809 > URL: https://svnweb.freebsd.org/changeset/base/290809 > > Log: > MFC 290414,290415: > Additional PCI helper functions. > > 290414: > Add helper routines for PCI device drivers to read, write, and modify > PCI-Express capability registers (that is, PCI config registers in the > standard PCI config space belonging to the PCI-Express capability > register set). > > Note that all of the current PCI-e registers are either 16 or 32-bits, > so only widths of 2 or 4 bytes are supported. > > 290415: > Add a new helper function for PCI devices to locate the upstream > PCI-express root port of a given PCI device. > > Modified: > stable/10/share/man/man9/Makefile > stable/10/share/man/man9/pci.9 > stable/10/sys/dev/pci/pci.c > stable/10/sys/dev/pci/pcivar.h > Directory Properties: > stable/10/ (props changed) > > Changes in other areas also in this revision: > Modified: > stable/9/share/man/man9/Makefile > stable/9/share/man/man9/pci.9 > stable/9/sys/dev/pci/pci.c > stable/9/sys/dev/pci/pcivar.h > Directory Properties: > stable/9/share/man/man9/ (props changed) > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) > > Modified: stable/10/share/man/man9/Makefile > ============================================================================== > --- stable/10/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) > @@ -1014,6 +1014,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ > pci.9 pci_find_device.9 \ > pci.9 pci_find_extcap.9 \ > pci.9 pci_find_htcap.9 \ > + pci.9 pci_find_pcie_root_port.9 \ > pci.9 pci_get_max_read_req.9 \ > pci.9 pci_get_powerstate.9 \ > pci.9 pci_get_vpd_ident.9 \ > @@ -1028,7 +1029,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ > pci.9 pci_save_state.9 \ > pci.9 pci_set_powerstate.9 \ > pci.9 pci_set_max_read_req.9 \ > - pci.9 pci_write_config.9 > + pci.9 pci_write_config.9 \ > + pci.9 pcie_adjust_config.9 \ > + pci.9 pcie_read_config.9 \ > + pci.9 pcie_write_config.9 \ > MLINKS+=pfil.9 pfil_add_hook.9 \ > pfil.9 pfil_hook_get.9 \ > pfil.9 pfil_remove_hook.9 > > Modified: stable/10/share/man/man9/pci.9 > ============================================================================== > --- stable/10/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 5, 2012 > +.Dd November 5, 2015 > .Dt PCI 9 > .Os > .Sh NAME > @@ -42,6 +42,7 @@ > .Nm pci_find_device , > .Nm pci_find_extcap , > .Nm pci_find_htcap , > +.Nm pci_find_pcie_root_port , > .Nm pci_get_max_read_req , > .Nm pci_get_powerstate , > .Nm pci_get_vpd_ident , > @@ -56,7 +57,10 @@ > .Nm pci_save_state , > .Nm pci_set_max_read_req , > .Nm pci_set_powerstate , > -.Nm pci_write_config > +.Nm pci_write_config , > +.Nm pcie_adjust_config , > +.Nm pcie_read_config , > +.Nm pcie_write_config > .Nd PCI bus interface > .Sh SYNOPSIS > .In sys/bus.h > @@ -86,6 +90,8 @@ > .Fn pci_find_extcap "device_t dev" "int capability" "int *capreg" > .Ft int > .Fn pci_find_htcap "device_t dev" "int capability" "int *capreg" > +.Ft device_t > +.Fn pci_find_pcie_root_port "device_t dev" > .Ft int > .Fn pci_get_max_read_req "device_t dev" > .Ft int > @@ -116,6 +122,18 @@ > .Fn pci_set_powerstate "device_t dev" "int state" > .Ft void > .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" > +.Ft uint32_t > +.Fo pcie_adjust_config > +.Fa "device_t dev" > +.Fa "int reg" > +.Fa "uint32_t mask" > +.Fa "uint32_t val" > +.Fa "int width" > +.Fc > +.Ft uint32_t > +.Fn pcie_read_config "device_t dev" "int reg" "int width" > +.Ft void > +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" > .Sh DESCRIPTION > The > .Nm > @@ -152,6 +170,48 @@ with > .Fa width > specifying the size of the access. > .Pp > +The > +.Fn pcie_adjust_config > +function is used to modify the value of a register in the PCI-express > +capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +The new value of the register is computed by modifying bits set in > +.Fa mask > +to the value in > +.Fa val . > +Any bits not specified in > +.Fa mask > +are preserved. > +The previous value of the register is returned. > +.Pp > +The > +.Fn pcie_read_config > +function is used to read the value of a register in the PCI-express > +capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +.Pp > +The > +.Fn pcie_write_config > +function is used to write the value > +.Fa val > +to a register in the PCI-express capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +.Pp > .Em NOTE : > Device drivers should only use these functions for functionality that > is not available via another > @@ -274,6 +334,16 @@ If the capability is not found or the de > returns an error. > .Pp > The > +.Fn pci_find_pcie_root_port > +function walks up the PCI device hierarchy to locate the PCI-express root > +port upstream of > +.Fa dev . > +If a root port is not found, > +.Fn pci_find_pcie_root_port > +returns > +.Dv NULL . > +.Pp > +The > .Fn pci_get_vpd_ident > function is used to fetch a device's Vital Product Data > .Pq VPD > > Modified: stable/10/sys/dev/pci/pci.c > ============================================================================== > --- stable/10/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) > @@ -1895,6 +1895,63 @@ pci_set_max_read_req(device_t dev, int s > return (size); > } > > +uint32_t > +pcie_read_config(device_t dev, int reg, int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) { > + if (width == 2) > + return (0xffff); > + return (0xffffffff); > + } > + > + return (pci_read_config(dev, cap + reg, width)); > +} > + > +void > +pcie_write_config(device_t dev, int reg, uint32_t value, int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) > + return; > + pci_write_config(dev, cap + reg, value, width); > +} > + > +/* > + * Adjusts a PCI-e capability register by clearing the bits in mask > + * and setting the bits in (value & mask). Bits not set in mask are > + * not adjusted. > + * > + * Returns the old value on success or all ones on failure. > + */ > +uint32_t > +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, > + int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + uint32_t old, new; > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) { > + if (width == 2) > + return (0xffff); > + return (0xffffffff); > + } > + > + old = pci_read_config(dev, cap + reg, width); > + new = old & ~mask; > + new |= (value & mask); > + pci_write_config(dev, cap + reg, new, width); > + return (old); > +} > + > /* > * Support for MSI message signalled interrupts. > */ > @@ -5139,3 +5196,44 @@ pci_get_rid_method(device_t dev, device_ > > return (PCIB_GET_RID(device_get_parent(dev), child)); > } > + > +/* Find the upstream port of a given PCI device in a root complex. */ > +device_t > +pci_find_pcie_root_port(device_t dev) > +{ > + struct pci_devinfo *dinfo; > + devclass_t pci_class; > + device_t pcib, bus; > + > + pci_class = devclass_find("pci"); > + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, > + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); > + > + /* > + * Walk the bridge hierarchy until we find a PCI-e root > + * port or a non-PCI device. > + */ > + for (;;) { > + bus = device_get_parent(dev); > + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, > + device_get_nameunit(dev))); > + > + pcib = device_get_parent(bus); > + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, > + device_get_nameunit(bus))); > + > + /* > + * pcib's parent must be a PCI bus for this to be a > + * PCI-PCI bridge. > + */ > + if (device_get_devclass(device_get_parent(pcib)) != pci_class) > + return (NULL); > + > + dinfo = device_get_ivars(pcib); > + if (dinfo->cfg.pcie.pcie_location != 0 && > + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) > + return (pcib); > + > + dev = pcib; > + } > +} > > Modified: stable/10/sys/dev/pci/pcivar.h > ============================================================================== > --- stable/10/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) > @@ -501,10 +501,15 @@ int pci_msix_device_blacklisted(device_t > > void pci_ht_map_msi(device_t dev, uint64_t addr); > > +device_t pci_find_pcie_root_port(device_t dev); > int pci_get_max_read_req(device_t dev); > void pci_restore_state(device_t dev); > void pci_save_state(device_t dev); > int pci_set_max_read_req(device_t dev, int size); > +uint32_t pcie_read_config(device_t dev, int reg, int width); > +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); > +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, > + uint32_t value, int width); > > > #ifdef BUS_SPACE_MAXADDR > From owner-svn-src-all@freebsd.org Sat Nov 14 11:32:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CF62A2E233; Sat, 14 Nov 2015 11:32:20 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward12.mail.yandex.net (forward12.mail.yandex.net [IPv6:2a02:6b8:0:801::2]) by mx1.freebsd.org (Postfix) with ESMTP id D78EA1625; Sat, 14 Nov 2015 11:32:19 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web21j.yandex.ru (web21j.yandex.ru [5.45.198.62]) by forward12.mail.yandex.net (Yandex) with ESMTP id 686D2C20E4B; Sat, 14 Nov 2015 14:32:09 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web21j.yandex.ru (Yandex) with ESMTP id 46EA14541648; Sat, 14 Nov 2015 14:32:08 +0300 (MSK) Received: by web21j.yandex.ru with HTTP; Sat, 14 Nov 2015 14:32:07 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <20151113225400.GE73031@FreeBSD.org> References: <201511091011.tA9ABFWb029549@repo.freebsd.org> <20151113225400.GE73031@FreeBSD.org> Subject: Re: svn commit: r290603 - in head/sys: net netgraph netinet MIME-Version: 1.0 Message-Id: <386501447500727@web21j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Nov 2015 14:32:07 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 11:32:20 -0000 14.11.2015, 01:54, "Gleb Smirnoff" : > ššAlexander, > > On Mon, Nov 09, 2015 at 10:11:15AM +0000, Alexander V. Chernikov wrote: > A> Author: melifaro > A> Date: Mon Nov 9 10:11:14 2015 > A> New Revision: 290603 > A> URL: https://svnweb.freebsd.org/changeset/base/290603 > A> > A> Log: > A> Use lladdr_event to propagate gratiotus arp. > A> > A> Differential Revision: https://reviews.freebsd.org/D4019 > > Looking into a diff a lame question emerges: why can't the call > to EVENTHANDLER_INVOKE() moved right into the end of the > if_setlladdr()? Well, initially (in r202588) it was not done due to "risk of the loop" (there was no lagg handler taskqueue). It was not possible until r290239 due to strange lagg(4) logic where eventhandler was not always called after if_setlladdr()). It is possible now. I simply forgot to convert D4019 back to EVENTHANDLER_INVOKE() being inside if_setlladdr() after if_lagg(4) changes. Will commit soon, thanks for the suggestion. > > A> Modified: > A> head/sys/net/if.c > A> head/sys/net/if_vlan.c > A> head/sys/netgraph/ng_eiface.c > A> head/sys/netgraph/ng_ether.c > A> head/sys/netinet/if_ether.c > A> > A> Modified: head/sys/net/if.c > A> ============================================================================== > A> --- head/sys/net/if.c Mon Nov 9 09:39:59 2015 (r290602) > A> +++ head/sys/net/if.c Mon Nov 9 10:11:14 2015 (r290603) > A> @@ -2512,7 +2512,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > A> return (error); > A> error = if_setlladdr(ifp, > A> ifr->ifr_addr.sa_data, ifr->ifr_addr.sa_len); > A> - EVENTHANDLER_INVOKE(iflladdr_event, ifp); > A> + if (error == 0) > A> + EVENTHANDLER_INVOKE(iflladdr_event, ifp); > A> break; > A> > A> case SIOCAIFGROUP: > A> @@ -3375,16 +3376,6 @@ if_setlladdr(struct ifnet *ifp, const u_ > A> ifr.ifr_flagshigh = ifp->if_flags >> 16; > A> (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); > A> } > A> -#ifdef INET > A> - /* > A> - * Also send gratuitous ARPs to notify other nodes about > A> - * the address change. > A> - */ > A> - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > A> - if (ifa->ifa_addr->sa_family == AF_INET) > A> - arp_ifinit(ifp, ifa); > A> - } > A> -#endif > A> } > A> return (0); > A> } > A> > A> Modified: head/sys/net/if_vlan.c > A> ============================================================================== > A> --- head/sys/net/if_vlan.c Mon Nov 9 09:39:59 2015 (r290602) > A> +++ head/sys/net/if_vlan.c Mon Nov 9 10:11:14 2015 (r290603) > A> @@ -523,7 +523,7 @@ vlan_iflladdr(void *arg __unused, struct > A> #ifndef VLAN_ARRAY > A> struct ifvlan *next; > A> #endif > A> - int i; > A> + int error, i; > A> > A> /* > A> * Check if it's a trunk interface first of all > A> @@ -544,8 +544,11 @@ vlan_iflladdr(void *arg __unused, struct > A> LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { > A> #endif /* VLAN_ARRAY */ > A> VLAN_UNLOCK(); > A> - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), > A> + error = if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), > A> ifp->if_addrlen); > A> + if (error == 0) > A> + EVENTHANDLER_INVOKE(iflladdr_event, > A> + ifv->ifv_ifp); > A> VLAN_LOCK(); > A> } > A> VLAN_UNLOCK(); > A> > A> Modified: head/sys/netgraph/ng_eiface.c > A> ============================================================================== > A> --- head/sys/netgraph/ng_eiface.c Mon Nov 9 09:39:59 2015 (r290602) > A> +++ head/sys/netgraph/ng_eiface.c Mon Nov 9 10:11:14 2015 (r290603) > A> @@ -489,7 +489,8 @@ ng_eiface_rcvmsg(node_p node, item_p ite > A> } > A> error = if_setlladdr(priv->ifp, > A> (u_char *)msg->data, ETHER_ADDR_LEN); > A> - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); > A> + if (error == 0) > A> + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); > A> break; > A> } > A> > A> > A> Modified: head/sys/netgraph/ng_ether.c > A> ============================================================================== > A> --- head/sys/netgraph/ng_ether.c Mon Nov 9 09:39:59 2015 (r290602) > A> +++ head/sys/netgraph/ng_ether.c Mon Nov 9 10:11:14 2015 (r290603) > A> @@ -534,7 +534,8 @@ ng_ether_rcvmsg(node_p node, item_p item > A> } > A> error = if_setlladdr(priv->ifp, > A> (u_char *)msg->data, ETHER_ADDR_LEN); > A> - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); > A> + if (error == 0) > A> + EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); > A> break; > A> } > A> case NGM_ETHER_GET_PROMISC: > A> > A> Modified: head/sys/netinet/if_ether.c > A> ============================================================================== > A> --- head/sys/netinet/if_ether.c Mon Nov 9 09:39:59 2015 (r290602) > A> +++ head/sys/netinet/if_ether.c Mon Nov 9 10:11:14 2015 (r290603) > A> @@ -142,7 +142,9 @@ static void in_arpinput(struct mbuf *); > A> static void arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, > A> struct ifnet *ifp, int bridged, struct llentry *la); > A> static void arp_mark_lle_reachable(struct llentry *la); > A> +static void arp_iflladdr(void *arg __unused, struct ifnet *ifp); > A> > A> +static eventhandler_tag iflladdr_tag; > A> > A> static const struct netisr_handler arp_nh = { > A> .nh_name = "arp", > A> @@ -1150,10 +1152,39 @@ arp_ifinit2(struct ifnet *ifp, struct if > A> ifa->ifa_rtrequest = NULL; > A> } > A> > A> +/* > A> + * Sends gratuitous ARPs for each ifaddr to notify other > A> + * nodes about the address change. > A> + */ > A> +static __noinline void > A> +arp_handle_ifllchange(struct ifnet *ifp) > A> +{ > A> + struct ifaddr *ifa; > A> + > A> + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > A> + if (ifa->ifa_addr->sa_family == AF_INET) > A> + arp_ifinit(ifp, ifa); > A> + } > A> +} > A> + > A> +/* > A> + * A handler for interface link layer address change event. > A> + */ > A> +static __noinline void > A> +arp_iflladdr(void *arg __unused, struct ifnet *ifp) > A> +{ > A> + > A> + if ((ifp->if_flags & IFF_UP) != 0) > A> + arp_handle_ifllchange(ifp); > A> +} > A> + > A> static void > A> arp_init(void) > A> { > A> > A> netisr_register(&arp_nh); > A> + if (IS_DEFAULT_VNET(curvnet)) > A> + iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, > A> + arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); > A> } > A> SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); > A> > > -- > Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Sat Nov 14 13:34:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4343EA2DFCA; Sat, 14 Nov 2015 13:34:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1060B11ED; Sat, 14 Nov 2015 13:34:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEDY48X017925; Sat, 14 Nov 2015 13:34:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEDY3AB017919; Sat, 14 Nov 2015 13:34:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511141334.tAEDY3AB017919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 14 Nov 2015 13:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290819 - in head/sys: net netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 13:34:05 -0000 Author: melifaro Date: Sat Nov 14 13:34:03 2015 New Revision: 290819 URL: https://svnweb.freebsd.org/changeset/base/290819 Log: Move iflladdr_event eventhandler invocation to if_setlladdr. Suggested by: glebius Modified: head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if.c Sat Nov 14 13:34:03 2015 (r290819) @@ -2512,8 +2512,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); error = if_setlladdr(ifp, ifr->ifr_addr.sa_data, ifr->ifr_addr.sa_len); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, ifp); break; case SIOCAIFGROUP: @@ -3377,6 +3375,7 @@ if_setlladdr(struct ifnet *ifp, const u_ (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); } } + EVENTHANDLER_INVOKE(iflladdr_event, ifp); return (0); } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if_lagg.c Sat Nov 14 13:34:03 2015 (r290819) @@ -690,7 +690,6 @@ lagg_port_setlladdr(void *arg, int pendi struct lagg_softc *sc = (struct lagg_softc *)arg; struct lagg_llq *llq, *head; struct ifnet *ifp; - int error; /* Grab a local reference of the queue and remove it from the softc */ LAGG_WLOCK(sc); @@ -706,7 +705,6 @@ lagg_port_setlladdr(void *arg, int pendi ifp = llq->llq_ifp; CURVNET_SET(ifp->if_vnet); - error = 0; /* * Set the link layer address on the laggport interface. @@ -714,11 +712,8 @@ lagg_port_setlladdr(void *arg, int pendi * may result in arp transmission / lltable updates. */ if (llq->llq_type == LAGG_LLQTYPE_PHYS) - error = if_setlladdr(ifp, llq->llq_lladdr, + if_setlladdr(ifp, llq->llq_lladdr, ETHER_ADDR_LEN); - if (error) - printf("%s: setlladdr failed on %s\n", __func__, - ifp->if_xname); else EVENTHANDLER_INVOKE(iflladdr_event, ifp); CURVNET_RESTORE(); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if_vlan.c Sat Nov 14 13:34:03 2015 (r290819) @@ -523,7 +523,7 @@ vlan_iflladdr(void *arg __unused, struct #ifndef VLAN_ARRAY struct ifvlan *next; #endif - int error, i; + int i; /* * Check if it's a trunk interface first of all @@ -544,11 +544,8 @@ vlan_iflladdr(void *arg __unused, struct LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { #endif /* VLAN_ARRAY */ VLAN_UNLOCK(); - error = if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), + if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ifp->if_addrlen); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, - ifv->ifv_ifp); VLAN_LOCK(); } VLAN_UNLOCK(); Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/netgraph/ng_eiface.c Sat Nov 14 13:34:03 2015 (r290819) @@ -489,8 +489,6 @@ ng_eiface_rcvmsg(node_p node, item_p ite } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/netgraph/ng_ether.c Sat Nov 14 13:34:03 2015 (r290819) @@ -534,8 +534,6 @@ ng_ether_rcvmsg(node_p node, item_p item } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } case NGM_ETHER_GET_PROMISC: From owner-svn-src-all@freebsd.org Sat Nov 14 14:56:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6852A2F342; Sat, 14 Nov 2015 14:56:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78B551D2C; Sat, 14 Nov 2015 14:56:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEEu1JT041471; Sat, 14 Nov 2015 14:56:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEEu15q041470; Sat, 14 Nov 2015 14:56:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511141456.tAEEu15q041470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Nov 2015 14:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290820 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 14:56:02 -0000 Author: mav Date: Sat Nov 14 14:56:01 2015 New Revision: 290820 URL: https://svnweb.freebsd.org/changeset/base/290820 Log: Add NULL check to make Coverity happy. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Nov 14 13:34:03 2015 (r290819) +++ head/sys/cam/ctl/ctl.c Sat Nov 14 14:56:01 2015 (r290820) @@ -9760,7 +9760,8 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_TPORTGRP; desc->length = 4; - if (softc->is_single || port->status & CTL_PORT_STATUS_HA_SHARED) + if (softc->is_single || + (port && port->status & CTL_PORT_STATUS_HA_SHARED)) g = 1; else g = 2 + ctsio->io_hdr.nexus.targ_port / softc->port_cnt; From owner-svn-src-all@freebsd.org Sat Nov 14 16:06:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4464A2FEF1; Sat, 14 Nov 2015 16:06:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5071ADA; Sat, 14 Nov 2015 16:06:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEG61qp062203; Sat, 14 Nov 2015 16:06:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEG61Rh062202; Sat, 14 Nov 2015 16:06:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511141606.tAEG61Rh062202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Nov 2015 16:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290821 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 16:06:02 -0000 Author: trasz Date: Sat Nov 14 16:06:01 2015 New Revision: 290821 URL: https://svnweb.freebsd.org/changeset/base/290821 Log: Don't try to avoid calling free(3) with NULL argument. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Sat Nov 14 14:56:01 2015 (r290820) +++ head/usr.sbin/ctld/kernel.c Sat Nov 14 16:06:01 2015 (r290821) @@ -515,8 +515,7 @@ retry_port: STAILQ_FOREACH(port, &devlist.port_list, links) { if (strcmp(port->port_frontend, "ha") == 0) continue; - if (name) - free(name); + free(name); if (port->pp == 0 && port->vp == 0) name = checked_strdup(port->port_name); else if (port->vp == 0) @@ -583,8 +582,7 @@ retry_port: } cp->p_ctl_port = port->port_id; } - if (name) - free(name); + free(name); STAILQ_FOREACH(lun, &devlist.lun_list, links) { struct cctl_lun_nv *nv; From owner-svn-src-all@freebsd.org Sat Nov 14 16:12:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908E3A2F035; Sat, 14 Nov 2015 16:12:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 529901E8F; Sat, 14 Nov 2015 16:12:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEGCu36065021; Sat, 14 Nov 2015 16:12:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEGCudQ065019; Sat, 14 Nov 2015 16:12:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511141612.tAEGCudQ065019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Nov 2015 16:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290822 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 16:12:57 -0000 Author: trasz Date: Sat Nov 14 16:12:56 2015 New Revision: 290822 URL: https://svnweb.freebsd.org/changeset/base/290822 Log: Remove unneeded includes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/keys.c head/usr.sbin/iscsid/pdu.c Modified: head/usr.sbin/iscsid/keys.c ============================================================================== --- head/usr.sbin/iscsid/keys.c Sat Nov 14 16:06:01 2015 (r290821) +++ head/usr.sbin/iscsid/keys.c Sat Nov 14 16:12:56 2015 (r290822) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include Modified: head/usr.sbin/iscsid/pdu.c ============================================================================== --- head/usr.sbin/iscsid/pdu.c Sat Nov 14 16:06:01 2015 (r290821) +++ head/usr.sbin/iscsid/pdu.c Sat Nov 14 16:12:56 2015 (r290822) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Sat Nov 14 16:15:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9750AA2F0B0; Sat, 14 Nov 2015 16:15:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64CDE105D; Sat, 14 Nov 2015 16:15:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEGFchv065192; Sat, 14 Nov 2015 16:15:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEGFcBL065191; Sat, 14 Nov 2015 16:15:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511141615.tAEGFcBL065191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Nov 2015 16:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290823 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 16:15:39 -0000 Author: trasz Date: Sat Nov 14 16:15:38 2015 New Revision: 290823 URL: https://svnweb.freebsd.org/changeset/base/290823 Log: Cosmetics; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/keys.c Modified: head/usr.sbin/ctld/keys.c ============================================================================== --- head/usr.sbin/ctld/keys.c Sat Nov 14 16:12:56 2015 (r290822) +++ head/usr.sbin/ctld/keys.c Sat Nov 14 16:15:38 2015 (r290823) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "ctld.h" struct keys * @@ -136,7 +137,7 @@ keys_save(struct keys *keys, struct pdu if (keys->keys_names[i] == NULL) break; data += sprintf(data, "%s=%s", - keys->keys_names[i], keys->keys_values[i]); + keys->keys_names[i], keys->keys_values[i]); data += 1; /* for '\0'. */ } } From owner-svn-src-all@freebsd.org Sat Nov 14 16:18:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 235C1A2F102; Sat, 14 Nov 2015 16:18:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1FF5121B; Sat, 14 Nov 2015 16:18:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEGIMqr065316; Sat, 14 Nov 2015 16:18:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEGIMSU065315; Sat, 14 Nov 2015 16:18:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201511141618.tAEGIMSU065315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Nov 2015 16:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290824 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 16:18:24 -0000 Author: trasz Date: Sat Nov 14 16:18:22 2015 New Revision: 290824 URL: https://svnweb.freebsd.org/changeset/base/290824 Log: Add missing error checks. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Sat Nov 14 16:15:38 2015 (r290823) +++ head/usr.sbin/ctld/kernel.c Sat Nov 14 16:18:22 2015 (r290824) @@ -516,13 +516,19 @@ retry_port: if (strcmp(port->port_frontend, "ha") == 0) continue; free(name); - if (port->pp == 0 && port->vp == 0) + if (port->pp == 0 && port->vp == 0) { name = checked_strdup(port->port_name); - else if (port->vp == 0) - asprintf(&name, "%s/%d", port->port_name, port->pp); - else - asprintf(&name, "%s/%d/%d", port->port_name, port->pp, - port->vp); + } else if (port->vp == 0) { + retval = asprintf(&name, "%s/%d", + port->port_name, port->pp); + if (retval <= 0) + log_err(1, "asprintf"); + } else { + retval = asprintf(&name, "%s/%d/%d", + port->port_name, port->pp, port->vp); + if (retval <= 0) + log_err(1, "asprintf"); + } if (port->cfiscsi_target == NULL) { log_debugx("CTL port %u \"%s\" wasn't managed by ctld; ", From owner-svn-src-all@freebsd.org Sat Nov 14 17:20:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF61A2FAD4; Sat, 14 Nov 2015 17:20:39 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5941EA7; Sat, 14 Nov 2015 17:20:38 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from bender.Home (bcdc67a8.skybroadband.com [188.220.103.168]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id E6226D78E6; Sat, 14 Nov 2015 17:20:31 +0000 (UTC) Date: Sat, 14 Nov 2015 17:20:30 +0000 From: Andrew Turner To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290821 - head/usr.sbin/ctld Message-ID: <20151114172030.7dfc24d0@bender.Home> In-Reply-To: <201511141606.tAEG61Rh062202@repo.freebsd.org> References: <201511141606.tAEG61Rh062202@repo.freebsd.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:20:39 -0000 On Sat, 14 Nov 2015 16:06:01 +0000 (UTC) Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Nov 14 16:06:01 2015 > New Revision: 290821 > URL: https://svnweb.freebsd.org/changeset/base/290821 > > Log: > Don't try to avoid calling free(3) with NULL argument. Why? free(NULL) is documented to be a nop and is safe to rely on this behaviour. Andrew From owner-svn-src-all@freebsd.org Sat Nov 14 17:22:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919C9A2FC40; Sat, 14 Nov 2015 17:22:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7548513C0; Sat, 14 Nov 2015 17:22:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6F0D51F3E; Sat, 14 Nov 2015 17:22:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4253FF15C; Sat, 14 Nov 2015 17:22:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id vyHrMCYpXWBD; Sat, 14 Nov 2015 17:22:22 +0000 (UTC) Subject: Re: svn commit: r290821 - head/usr.sbin/ctld DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 23F3EF154 To: Andrew Turner , Edward Tomasz Napierala References: <201511141606.tAEG61Rh062202@repo.freebsd.org> <20151114172030.7dfc24d0@bender.Home> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56476DD6.5010805@FreeBSD.org> Date: Sat, 14 Nov 2015 09:22:30 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151114172030.7dfc24d0@bender.Home> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bk1SUlSIEpIcFR8KnS8GM9IRhkQJMN0Hp" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:22:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bk1SUlSIEpIcFR8KnS8GM9IRhkQJMN0Hp Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/14/2015 9:20 AM, Andrew Turner wrote: > On Sat, 14 Nov 2015 16:06:01 +0000 (UTC) > Edward Tomasz Napierala wrote: >=20 >> Author: trasz >> Date: Sat Nov 14 16:06:01 2015 >> New Revision: 290821 >> URL: https://svnweb.freebsd.org/changeset/base/290821 >> >> Log: >> Don't try to avoid calling free(3) with NULL argument. >=20 > Why? free(NULL) is documented to be a nop and is safe to rely on this > behaviour. >=20 You read it backwards, see the change. It's doing what you want. --=20 Regards, Bryan Drewery --bk1SUlSIEpIcFR8KnS8GM9IRhkQJMN0Hp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWR23WAAoJEDXXcbtuRpfPLW8H/iesTmMQ5dm0s6gcTehvMzJa MNlJ3Q7tw2Fxxh2BPsdE+iRikf2DDj84btbztZuLmZyEFFOFf68Hup3BHdnQtqtq xkU/JtEpJG4x/aUYwKtgUwU8P5inf4esr0/02O0FA1GfJri+VVsmykmsOXOOOswY 9HY4aHryEL5tTs9ym32PhbHj1IMKF/Od3d2gY7nL24+I+H9aytlcneB1DMdTz0FG nHxehgRC6XvNf+tXDXbuy3x17qZ78/U+kNiybHIoa/pbMUgmno0+ToGlDvbqSqvL CcI++ZeYn7yduIG+HtgRTD5tbxBMqD1zn76iifEA8HnpmqxbNzb/6wSi+Olq+MA= =RabD -----END PGP SIGNATURE----- --bk1SUlSIEpIcFR8KnS8GM9IRhkQJMN0Hp-- From owner-svn-src-all@freebsd.org Sat Nov 14 17:26:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD65AA2FCDF for ; Sat, 14 Nov 2015 17:26:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::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 56949161F for ; Sat, 14 Nov 2015 17:26:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkfo3 with SMTP id o3so77534625qkf.1 for ; Sat, 14 Nov 2015 09:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp_com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=sYiELSpiTefDOQxt48Arc0EIH9fLp4SKlLoTVZBrk+U=; b=Szy+btjXSAp/08t0YAyyA3g6oyMUIBXI+99tCm19JztyNcrfOF7uTtbkf61DygcibG VwlCGyHBnBYaoKqEyoXoHybUvmWIue1E3sTjM8xbPwN1OMtFp49I6mSOLXBxSAxXM23S hmEi4pRxq64PkW38fq+bGRsrd2xCzce/puKg5l0lUqLZ5OXKSAl3fKL86yo9Vzyznh7J CErntfASzT6rNCslCKQcnWZfpkZSlqn4OJYzy4/p3zUjSbw3bkmipPtoiNUzLjibTO/i 3/5e84Tv35I/0qY1AQz/kGRz4JRNx3r7YkSx8PMCln5+sA86aPgsnli60f8oCxBeBPbo r1ag== 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:date :message-id:subject:from:to:cc:content-type; bh=sYiELSpiTefDOQxt48Arc0EIH9fLp4SKlLoTVZBrk+U=; b=AHfqWQdiN+jZEOYhE153C3Pj+2KauvI5o4tUi5mq/UuR4CZktGqYZGOFTc8g1sqGXC tSDeIvI258woMPAysVfsHbZuKcFh4x/FYxvKEBTmRqEFCYcoIcHgzrkRY2zXjj1V+B1+ +7ZECKnDaL3pFUUY4BCwa0Z1WZ2n5tFBUE1y0wTcQ9qdeWFgPQV6P+sIazChqQ6q/lW2 L/g9qTivaQBmkonvXBOvuMBlncUSfZC7fVGqCDr0jt7jw5cCprm13RtcATI7B8vuem59 XH/Jd5wTMfxVDwfK4DDhGV2eD0pWZy5/2d6nF9Xjz5AcrYMIXowww1uGMjilrgKRUN2V Z1CQ== X-Gm-Message-State: ALoCoQl45xFNLvDRsTB4RF1EqVdXz1XLMRVB8cLP062YJj+r71pS0D8niK5XOaDl9On07GJbuoPX MIME-Version: 1.0 X-Received: by 10.140.41.210 with SMTP id z76mr27754201qgz.81.1447521988328; Sat, 14 Nov 2015 09:26:28 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Sat, 14 Nov 2015 09:26:28 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <56476DD6.5010805@FreeBSD.org> References: <201511141606.tAEG61Rh062202@repo.freebsd.org> <20151114172030.7dfc24d0@bender.Home> <56476DD6.5010805@FreeBSD.org> Date: Sat, 14 Nov 2015 10:26:28 -0700 X-Google-Sender-Auth: 6C0iQglL36T-Qo7EZtBIatFS-eM Message-ID: Subject: Re: svn commit: r290821 - head/usr.sbin/ctld From: Warner Losh To: Bryan Drewery Cc: Andrew Turner , Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:26:29 -0000 On Sat, Nov 14, 2015 at 10:22 AM, Bryan Drewery wrote: > On 11/14/2015 9:20 AM, Andrew Turner wrote: > > On Sat, 14 Nov 2015 16:06:01 +0000 (UTC) > > Edward Tomasz Napierala wrote: > > > >> Author: trasz > >> Date: Sat Nov 14 16:06:01 2015 > >> New Revision: 290821 > >> URL: https://svnweb.freebsd.org/changeset/base/290821 > >> > >> Log: > >> Don't try to avoid calling free(3) with NULL argument. > > > > Why? free(NULL) is documented to be a nop and is safe to rely on this > > behaviour. > > > > You read it backwards, see the change. It's doing what you want. > Or rather, its failing to not do what you want. The double negative can be tricky :) Warner From owner-svn-src-all@freebsd.org Sat Nov 14 17:26:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 676C8A2FD03; Sat, 14 Nov 2015 17:26:36 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id DBA3817C1; Sat, 14 Nov 2015 17:26:35 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from bender.Home (bcdc67a8.skybroadband.com [188.220.103.168]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 66C00D78E6; Sat, 14 Nov 2015 17:26:05 +0000 (UTC) Date: Sat, 14 Nov 2015 17:26:04 +0000 From: Andrew Turner To: Bryan Drewery Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290821 - head/usr.sbin/ctld Message-ID: <20151114172604.0b7bfbd5@bender.Home> In-Reply-To: <56476DD6.5010805@FreeBSD.org> References: <201511141606.tAEG61Rh062202@repo.freebsd.org> <20151114172030.7dfc24d0@bender.Home> <56476DD6.5010805@FreeBSD.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:26:36 -0000 On Sat, 14 Nov 2015 09:22:30 -0800 Bryan Drewery wrote: > On 11/14/2015 9:20 AM, Andrew Turner wrote: > > On Sat, 14 Nov 2015 16:06:01 +0000 (UTC) > > Edward Tomasz Napierala wrote: > > > >> Author: trasz > >> Date: Sat Nov 14 16:06:01 2015 > >> New Revision: 290821 > >> URL: https://svnweb.freebsd.org/changeset/base/290821 > >> > >> Log: > >> Don't try to avoid calling free(3) with NULL argument. > > > > Why? free(NULL) is documented to be a nop and is safe to rely on > > this behaviour. > > > > You read it backwards, see the change. It's doing what you want. Yes, I should read the change more than briefly. Andrew From owner-svn-src-all@freebsd.org Sat Nov 14 17:30:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2B9CA2FDA5; Sat, 14 Nov 2015 17:30:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB08E1AAA; Sat, 14 Nov 2015 17:30:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEHUqrw087705; Sat, 14 Nov 2015 17:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEHUqkU087704; Sat, 14 Nov 2015 17:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511141730.tAEHUqkU087704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 17:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290826 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:30:54 -0000 Author: bdrewery Date: Sat Nov 14 17:30:52 2015 New Revision: 290826 URL: https://svnweb.freebsd.org/changeset/base/290826 Log: MFC r290428: remove \, it confuses things. Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Nov 14 17:21:17 2015 (r290825) +++ stable/10/share/man/man9/Makefile Sat Nov 14 17:30:52 2015 (r290826) @@ -1032,7 +1032,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 From owner-svn-src-all@freebsd.org Sat Nov 14 17:31:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C3B3A2FE16; Sat, 14 Nov 2015 17:31:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E38A61C8A; Sat, 14 Nov 2015 17:31:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DCF8D14D3; Sat, 14 Nov 2015 17:31:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 95E6CF1E1; Sat, 14 Nov 2015 17:31:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id CF2epns0_tw6; Sat, 14 Nov 2015 17:31:17 +0000 (UTC) Subject: Re: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CCD59F1DB To: Michal Meloun , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201511140106.tAE16j5Q097967@repo.freebsd.org> <5646EFF8.1080207@freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56476FEC.8070701@FreeBSD.org> Date: Sat, 14 Nov 2015 09:31:24 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5646EFF8.1080207@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:31:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/14/2015 12:25 AM, Michal Meloun wrote: > This commit breaks installworld. Fixed. >=20 > Index: share/man/man9/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 > --- share/man/man9/Makefile (revision 290818) > +++ share/man/man9/Makefile (working copy) > @@ -1032,7 +1032,7 @@ > pci.9 pci_write_config.9 \ > pci.9 pcie_adjust_config.9 \ > pci.9 pcie_read_config.9 \ > - pci.9 pcie_write_config.9 \ > + pci.9 pcie_write_config.9 > MLINKS+=3Dpfil.9 pfil_add_hook.9 \ > pfil.9 pfil_hook_get.9 \ > pfil.9 pfil_remove_hook.9 >=20 >=20 > Dne 14.11.2015 v 2:06 John Baldwin napsal(a): >> Author: jhb >> Date: Sat Nov 14 01:06:45 2015 >> New Revision: 290809 >> URL: https://svnweb.freebsd.org/changeset/base/290809 >> >> Log: >> MFC 290414,290415: >> Additional PCI helper functions. >> =20 --=20 Regards, Bryan Drewery --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWR2/tAAoJEDXXcbtuRpfPfhcH/2BbZI+prm1LlMWxASf6pN8i torO2xHoQd+KnnvVrKaqc1NLRG//Kk7QxFEN2jriLI7z46lNcqBO0TnbkZ1aWRew ruKGf+DnX/fu8ig1qjAcaMAYt43B/5wvPP/3xc06WuxFs/NpbPwbdY8VE7vaBPQj YXdLoM/ApYSsSaeHLIiFBdDHP4ZKDxVUne2T7yT935T0Ph5lqyEO76jLh0VbZr0+ +9oB6fO4zvxd26fS3eRFmb9fbUC85axH1+BO2+05fNocSkvfn+/NcEeuovuTFdvF RKmovBiPs0ooVms4eYqL8feTUljn6Q/mJ9RQwhUYd+Npr+g3xYWEod7b9b/TxGw= =LAXW -----END PGP SIGNATURE----- --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT-- From owner-svn-src-all@freebsd.org Sat Nov 14 17:32:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A46A2FF51; Sat, 14 Nov 2015 17:32:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8E41F7B; Sat, 14 Nov 2015 17:32:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEHWcnj088421; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEHWcdj088420; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511141732.tAEHWcdj088420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 17:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290827 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:32:39 -0000 Author: bdrewery Date: Sat Nov 14 17:32:38 2015 New Revision: 290827 URL: https://svnweb.freebsd.org/changeset/base/290827 Log: MFC r290428: remove \, it confuses things. Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 17:30:52 2015 (r290826) +++ stable/9/share/man/man9/Makefile Sat Nov 14 17:32:38 2015 (r290827) @@ -996,7 +996,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 From owner-svn-src-all@freebsd.org Sat Nov 14 18:16:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB25A2F847; Sat, 14 Nov 2015 18:16:18 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE5E1769; Sat, 14 Nov 2015 18:16:18 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEIGHJo000275; Sat, 14 Nov 2015 18:16:17 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEIGHVO000274; Sat, 14 Nov 2015 18:16:17 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511141816.tAEIGHVO000274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 14 Nov 2015 18:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290828 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 18:16:18 -0000 Author: melifaro Date: Sat Nov 14 18:16:17 2015 New Revision: 290828 URL: https://svnweb.freebsd.org/changeset/base/290828 Log: Pass provided af instead of AF_UNSPEC to setwa_f callback. Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Nov 14 17:32:38 2015 (r290827) +++ head/sys/net/route.c Sat Nov 14 18:16:17 2015 (r290828) @@ -845,7 +845,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t if (rnh == NULL) continue; if (setwa_f != NULL) - setwa_f(rnh, fibnum, AF_UNSPEC, arg); + setwa_f(rnh, fibnum, af, arg); RADIX_NODE_HEAD_LOCK(rnh); rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); From owner-svn-src-all@freebsd.org Sat Nov 14 18:30:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80303A2FBE3; Sat, 14 Nov 2015 18:30:29 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 505261DB1; Sat, 14 Nov 2015 18:30:28 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id tAEIUKAI086032 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Nov 2015 18:30:22 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk From: David Chisnall In-Reply-To: <201510261621.t9QGLuL2028872@repo.freebsd.org> Date: Sat, 14 Nov 2015 18:30:13 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <71109998-711D-4ECA-9B44-5A7B1F8705F3@FreeBSD.org> References: <201510261621.t9QGLuL2028872@repo.freebsd.org> To: Eric van Gyzen X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 18:30:29 -0000 On 26 Oct 2015, at 16:21, Eric van Gyzen wrote: >=20 > One counter-argument to this change is that most applications already > use SIMD, and the number of applications and amount of SIMD usage > are only increasing. Note that SSE and SIMD are not the same thing. The x86-64 ABI uses SSE = registers for floating point arguments, so even a purely scalar = application that uses floating point will end up faulting in the SSE = state. This is not the case on IA32, where x87 registers are used = (though when compiling for i686, SSE is used by default because register = allocation for x87 is a huge pain). I believe that the no-sse option for clang is ABI-preserving, so will = not actually disable all SSE unless you also specify -msoft-float. I = don=E2=80=99t think that libthr uses floating point anywhere, but libc = does and you only need to call one function that takes a floating point = argument in between context switches to lose this gain on x86-64. With = this change, we=E2=80=99re making the compiler emit less efficient code, = on the assumption that nothing will touch the fpu in the quantum before = the next context switch. I=E2=80=99d really like to see the set of = applications that you benchmarked the change with on x86-64 to reach the = conclusion that this is a net win overall.=20 Or, to put it another way: How many applications are multithreaded but = don=E2=80=99t use any floating point code? David From owner-svn-src-all@freebsd.org Sat Nov 14 19:47:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 074BBA2F959; Sat, 14 Nov 2015 19:47:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D48F7119F; Sat, 14 Nov 2015 19:47:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEJlHH1027424; Sat, 14 Nov 2015 19:47:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEJlHId027422; Sat, 14 Nov 2015 19:47:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511141947.tAEJlHId027422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Nov 2015 19:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290830 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 19:47:19 -0000 Author: mav Date: Sat Nov 14 19:47:17 2015 New Revision: 290830 URL: https://svnweb.freebsd.org/changeset/base/290830 Log: Fix/improve CRN tracking. Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sat Nov 14 19:45:04 2015 (r290829) +++ head/sys/dev/isp/isp_freebsd.c Sat Nov 14 19:47:17 2015 (r290830) @@ -4249,16 +4249,9 @@ 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) { @@ -4269,14 +4262,13 @@ isp_action(struct cam_sim *sim, union cc * 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); + if (IS_FC(isp)) + isp_fcp_reset_crn(isp, bus, 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; @@ -4854,7 +4846,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Starting Loop Down Timer @ %lu", (unsigned long) time_uptime); } } - isp_fcp_reset_crn(fc, /*tgt*/0, /*tgt_set*/ 0); + isp_fcp_reset_crn(isp, bus, /*tgt*/0, /*tgt_set*/ 0); isp_prt(isp, ISP_LOGINFO, "Chan %d: %s", bus, msg); break; @@ -4887,7 +4879,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->prli_word3 & PRLI_WD3_TARGET_FUNCTION)) { lp->is_target = 1; - isp_fcp_reset_crn(fc, tgt, /*tgt_set*/ 1); + isp_fcp_reset_crn(isp, bus, tgt, /*tgt_set*/ 1); isp_make_here(isp, lp, bus, tgt); } if ((FCPARAM(isp, bus)->role & ISP_ROLE_TARGET) && @@ -4917,11 +4909,11 @@ changed: (lp->new_prli_word3 & PRLI_WD3_TARGET_FUNCTION))) { lp->is_target = !lp->is_target; if (lp->is_target) { - isp_fcp_reset_crn(fc, tgt, /*tgt_set*/ 1); + isp_fcp_reset_crn(isp, bus, tgt, /*tgt_set*/ 1); isp_make_here(isp, lp, bus, tgt); } else { isp_make_gone(isp, lp, bus, tgt); - isp_fcp_reset_crn(fc, tgt, /*tgt_set*/ 1); + isp_fcp_reset_crn(isp, bus, tgt, /*tgt_set*/ 1); } } if (lp->is_initiator != @@ -5490,23 +5482,23 @@ isp_common_dmateardown(ispsoftc_t *isp, * (needed for events like a LIP). */ void -isp_fcp_reset_crn(struct isp_fc *fc, uint32_t tgt, int tgt_set) +isp_fcp_reset_crn(ispsoftc_t *isp, int chan, uint32_t tgt, int tgt_set) { - int i; + struct isp_fc *fc = ISP_FC_PC(isp, chan); struct isp_nexus *nxp; + int i; if (tgt_set == 0) - isp_prt(fc->isp, ISP_LOG_SANCFG, "resetting CRN on all targets"); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d resetting CRN on all targets", chan); else - isp_prt(fc->isp, ISP_LOG_SANCFG, "resetting CRN target %u", tgt); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d resetting CRN on target %u", chan, tgt); for (i = 0; i < NEXUS_HASH_WIDTH; i++) { - nxp = fc->nexus_hash[i]; - while (nxp) { - if ((tgt_set != 0) && (tgt == nxp->tgt)) + for (nxp = fc->nexus_hash[i]; nxp != NULL; nxp = nxp->next) { + if (tgt_set == 0 || tgt == nxp->tgt) nxp->crnseed = 0; - - nxp = nxp->next; } } } @@ -5550,15 +5542,11 @@ isp_fcp_next_crn(ispsoftc_t *isp, uint8_ nxp->next = fc->nexus_hash[idx]; fc->nexus_hash[idx] = nxp; } - if (nxp) { - if (nxp->crnseed == 0) - nxp->crnseed = 1; - if (cmd) - PISP_PCMD(cmd)->crn = nxp->crnseed; - *crnp = nxp->crnseed++; - return (0); - } - return (-1); + if (nxp->crnseed == 0) + nxp->crnseed = 1; + PISP_PCMD(cmd)->crn = nxp->crnseed; + *crnp = nxp->crnseed++; + return (0); } /* Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sat Nov 14 19:45:04 2015 (r290829) +++ head/sys/dev/isp/isp_freebsd.h Sat Nov 14 19:47:17 2015 (r290830) @@ -745,7 +745,7 @@ int isp_fc_scratch_acquire(ispsoftc_t *, int isp_mstohz(int); void isp_platform_intr(void *); void isp_common_dmateardown(ispsoftc_t *, struct ccb_scsiio *, uint32_t); -void isp_fcp_reset_crn(struct isp_fc *, uint32_t, int); +void isp_fcp_reset_crn(ispsoftc_t *, int, uint32_t, int); int isp_fcp_next_crn(ispsoftc_t *, uint8_t *, XS_T *); /* From owner-svn-src-all@freebsd.org Sat Nov 14 21:01:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15ABDA2FA1A; Sat, 14 Nov 2015 21:01:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B810B1D56; Sat, 14 Nov 2015 21:01:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEL1ZSV051126; Sat, 14 Nov 2015 21:01:35 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEL1Zhs051123; Sat, 14 Nov 2015 21:01:35 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511142101.tAEL1Zhs051123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Nov 2015 21:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290831 - in head/sys/arm: 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 21:01:37 -0000 Author: gonzo Date: Sat Nov 14 21:01:35 2015 New Revision: 290831 URL: https://svnweb.freebsd.org/changeset/base/290831 Log: Somewhat improve HDMI event API - Pass device_t for HDMI framer as an argument for event hook - Use #define for event values, instead of opaque (and unused) 0 Modified: head/sys/arm/arm/hdmi_if.m head/sys/arm/ti/am335x/am335x_lcd.c head/sys/arm/ti/am335x/tda19988.c Modified: head/sys/arm/arm/hdmi_if.m ============================================================================== --- head/sys/arm/arm/hdmi_if.m Sat Nov 14 19:47:17 2015 (r290830) +++ head/sys/arm/arm/hdmi_if.m Sat Nov 14 21:01:35 2015 (r290831) @@ -35,8 +35,10 @@ INTERFACE hdmi; HEADER { #include - typedef void (*hdmi_event_hook)(void *, int); + typedef void (*hdmi_event_hook)(void *, device_t, int); EVENTHANDLER_DECLARE(hdmi_event, hdmi_event_hook); + + #define HDMI_EVENT_CONNECTED 0 } # Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sat Nov 14 19:47:17 2015 (r290830) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sat Nov 14 21:01:35 2015 (r290831) @@ -800,7 +800,7 @@ done: } static void -am335x_lcd_hdmi_event(void *arg) +am335x_lcd_hdmi_event(void *arg, device_t hdmi, int event) { struct am335x_lcd_softc *sc; const struct videomode *videomode; @@ -1001,7 +1001,7 @@ am335x_lcd_attach(device_t dev) am335x_lcd_configure(sc); else sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event, - am335x_lcd_hdmi_event, sc, 0); + am335x_lcd_hdmi_event, sc, EVENTHANDLER_PRI_ANY); return (0); } Modified: head/sys/arm/ti/am335x/tda19988.c ============================================================================== --- head/sys/arm/ti/am335x/tda19988.c Sat Nov 14 19:47:17 2015 (r290830) +++ head/sys/arm/ti/am335x/tda19988.c Sat Nov 14 21:01:35 2015 (r290831) @@ -635,7 +635,7 @@ tda19988_read_edid(struct tda19988_softc } } - EVENTHANDLER_INVOKE(hdmi_event, 0); + EVENTHANDLER_INVOKE(hdmi_event, sc->sc_dev, HDMI_EVENT_CONNECTED); done: if (sc->sc_version == TDA19988) tda19988_reg_set(sc, TDA_TX4, TX4_PD_RAM); From owner-svn-src-all@freebsd.org Sat Nov 14 21:25:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE796A2FE37; Sat, 14 Nov 2015 21:25:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9696E1B7C; Sat, 14 Nov 2015 21:25:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8F1391E2D; Sat, 14 Nov 2015 21:25:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 47A40F6E1; Sat, 14 Nov 2015 21:25:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id cNd5unZjd19k; Sat, 14 Nov 2015 21:25:13 +0000 (UTC) Subject: Re: svn commit: r290828 - head/sys/net DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 2764CF6D7 To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511141816.tAEIGHVO000274@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5647A6BE.3070408@FreeBSD.org> Date: Sat, 14 Nov 2015 13:25:18 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201511141816.tAEIGHVO000274@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dRCJuXhPHxqHBkfpDlvIoWTrjIdrxSOWN" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 21:25:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dRCJuXhPHxqHBkfpDlvIoWTrjIdrxSOWN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/14/2015 10:16 AM, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Nov 14 18:16:17 2015 > New Revision: 290828 > URL: https://svnweb.freebsd.org/changeset/base/290828 >=20 > Log: > Pass provided af instead of AF_UNSPEC to setwa_f callback. >=20 > Modified: > head/sys/net/route.c >=20 > Modified: head/sys/net/route.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/net/route.c Sat Nov 14 17:32:38 2015 (r290827) > +++ head/sys/net/route.c Sat Nov 14 18:16:17 2015 (r290828) > @@ -845,7 +845,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t > if (rnh =3D=3D NULL) > continue; > if (setwa_f !=3D NULL) > - setwa_f(rnh, fibnum, AF_UNSPEC, arg); > + setwa_f(rnh, fibnum, af, arg); > =20 > RADIX_NODE_HEAD_LOCK(rnh); > rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); >=20 Ah damn. I mis-read the 'if' a few lines up when fixing the coverity warning. Sorry about that. At least none of the callbacks were using it y= et. --=20 Regards, Bryan Drewery --dRCJuXhPHxqHBkfpDlvIoWTrjIdrxSOWN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWR6a+AAoJEDXXcbtuRpfPqrAH/RfJiJ2YJ7jXBeMa36J4Snz8 oE8VGBjJkn0Fe8p7+i+MBWvpDIlAHesIb+Pt25A4Opj4EFZ4tZXp2NEEerVNX9/8 5poc+vU2N8txQsJWJJy19VPUy8mUjPJH+dEX+uYqgVkMhjoa9+BnGPrqfBCOnt4j PDTV4bit93H+ZLHxrJSn3eVGFjbGA14CHgibG4g0dDCaV/peG1IQx7NL8W2APU98 psz4fXNig34CsYHvQa9Zjvp6jur5Ex47ir/rWja1Zhk3FIvDiJDR0cU29fjnUrJN tGqFHktfop4QLrpUQ0+Ka477bhp3wVG808Ct064/Cg5R3RJ2rYSXtk7T6VxrAgk= =a1zW -----END PGP SIGNATURE----- --dRCJuXhPHxqHBkfpDlvIoWTrjIdrxSOWN-- From owner-svn-src-all@freebsd.org Sat Nov 14 22:46:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F856A2FC9C; Sat, 14 Nov 2015 22:46:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 023AA1288; Sat, 14 Nov 2015 22:46:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEMkp93081402; Sat, 14 Nov 2015 22:46:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEMkoeR081399; Sat, 14 Nov 2015 22:46:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511142246.tAEMkoeR081399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Nov 2015 22:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290834 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 22:46:52 -0000 Author: gonzo Date: Sat Nov 14 22:46:50 2015 New Revision: 290834 URL: https://svnweb.freebsd.org/changeset/base/290834 Log: Replace magic numbers for CCGRx registers with more descriptive names Modified: head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Sat Nov 14 22:22:18 2015 (r290833) +++ head/sys/arm/freescale/imx/imx6_ccm.c Sat Nov 14 22:46:50 2015 (r290834) @@ -88,14 +88,42 @@ WR4(struct ccm_softc *sc, bus_size_t off static void ccm_init_gates(struct ccm_softc *sc) { - /* Turns on... */ - WR4(sc, CCM_CCGR0, 0x0000003f); /* ahpbdma, aipstz 1 & 2 busses */ - WR4(sc, CCM_CCGR1, 0x00300c00); /* gpt, enet */ - 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, 0x0ffc00c0); /* uarts, ssi, sdma */ - WR4(sc, CCM_CCGR6, 0x000003ff); /* usdhc 1-4, usboh3 */ + uint32_t reg; + + /* ahpbdma, aipstz 1 & 2 busses */ + reg = CCGR0_AIPS_TZ1 | CCGR0_AIPS_TZ2 | CCGR0_ABPHDMA; + WR4(sc, CCM_CCGR0, reg); + + /* gpt, enet */ + reg = CCGR1_ENET | CCGR1_GPT; + WR4(sc, CCM_CCGR1, reg); + + /* ipmux & ipsync (bridges), iomux, i2c */ + reg = CCGR2_I2C1 | CCGR2_I2C2 | CCGR2_I2C3 | CCGR2_IIM | + CCGR2_IOMUX_IPT | CCGR2_IPMUX1 | CCGR2_IPMUX2 | CCGR2_IPMUX3 | + CCGR2_IPSYNC_IP2APB_TZASC1 | CCGR2_IPSYNC_IP2APB_TZASC2 | + CCGR2_IPSYNC_VDOA; + WR4(sc, CCM_CCGR2, reg); + + /* DDR memory controller */ + reg = CCGR3_OCRAM | CCGR3_MMDC_CORE_IPG | + CCGR3_MMDC_CORE_ACLK_FAST | CCGR3_CG11 | CCGR3_CG13; + WR4(sc, CCM_CCGR3, reg); + + /* pl301 bus crossbar */ + reg = CCGR4_PL301_MX6QFAST1_S133 | + CCGR4_PL301_MX6QPER1_BCH | CCGR4_PL301_MX6QPER2_MAIN; + WR4(sc, CCM_CCGR4, reg); + + /* uarts, ssi, sdma */ + reg = CCGR5_SDMA | CCGR5_SSI1 | CCGR5_SSI2 | CCGR5_SSI3 | + CCGR5_UART | CCGR5_UART_SERIAL; + WR4(sc, CCM_CCGR5, reg); + + /* usdhc 1-4, usboh3 */ + reg = CCGR6_USBOH3 | CCGR6_USDHC1 | CCGR6_USDHC2 | + CCGR6_USDHC3 | CCGR6_USDHC4; + WR4(sc, CCM_CCGR6, reg); } static int Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Sat Nov 14 22:22:18 2015 (r290833) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Sat Nov 14 22:46:50 2015 (r290834) @@ -58,12 +58,57 @@ #define CCM_CGPR 0x064 #define CCM_CGPR_INT_MEM_CLK_LPM (1 << 17) #define CCM_CCGR0 0x068 +#define CCGR0_AIPS_TZ1 (0x3 << 0) +#define CCGR0_AIPS_TZ2 (0x3 << 2) +#define CCGR0_ABPHDMA (0x3 << 4) #define CCM_CCGR1 0x06C +#define CCGR1_ENET (0x3 << 10) +#define CCGR1_GPT (0x3 << 20) #define CCM_CCGR2 0x070 +#define CCGR2_HDMI_TX (0x3 << 0) +#define CCGR2_HDMI_TX_ISFR (0x3 << 4) +#define CCGR2_I2C1 (0x3 << 6) +#define CCGR2_I2C2 (0x3 << 8) +#define CCGR2_I2C3 (0x3 << 10) +#define CCGR2_IIM (0x3 << 12) +#define CCGR2_IOMUX_IPT (0x3 << 14) +#define CCGR2_IPMUX1 (0x3 << 16) +#define CCGR2_IPMUX2 (0x3 << 18) +#define CCGR2_IPMUX3 (0x3 << 20) +#define CCGR2_IPSYNC_IP2APB_TZASC1 (0x3 << 22) +#define CCGR2_IPSYNC_IP2APB_TZASC2 (0x3 << 24) +#define CCGR2_IPSYNC_VDOA (0x3 << 26) #define CCM_CCGR3 0x074 +#define CCGR3_IPU1_IPU (0x3 << 0) +#define CCGR3_IPU1_DI0 (0x3 << 2) +#define CCGR3_IPU1_DI1 (0x3 << 4) +#define CCGR3_IPU2_IPU (0x3 << 6) +#define CCGR3_IPU2_DI0 (0x3 << 8) +#define CCGR3_IPU2_DI1 (0x3 << 10) +#define CCGR3_LDB_DI0 (0x3 << 12) +#define CCGR3_LDB_DI1 (0x3 << 14) +#define CCGR3_MMDC_CORE_ACLK_FAST (0x3 << 20) +#define CCGR3_CG11 (0x3 << 22) +#define CCGR3_MMDC_CORE_IPG (0x3 << 24) +#define CCGR3_CG13 (0x3 << 26) +#define CCGR3_OCRAM (0x3 << 28) #define CCM_CCGR4 0x078 +#define CCGR4_PL301_MX6QFAST1_S133 (0x3 << 8) +#define CCGR4_PL301_MX6QPER1_BCH (0x3 << 12) +#define CCGR4_PL301_MX6QPER2_MAIN (0x3 << 14) #define CCM_CCGR5 0x07C +#define CCGR5_SDMA (0x3 << 6) +#define CCGR5_SSI1 (0x3 << 18) +#define CCGR5_SSI2 (0x3 << 20) +#define CCGR5_SSI3 (0x3 << 22) +#define CCGR5_UART (0x3 << 24) +#define CCGR5_UART_SERIAL (0x3 << 26) #define CCM_CCGR6 0x080 +#define CCGR6_USBOH3 (0x3 << 0) +#define CCGR6_USDHC1 (0x3 << 2) +#define CCGR6_USDHC2 (0x3 << 4) +#define CCGR6_USDHC3 (0x3 << 6) +#define CCGR6_USDHC4 (0x3 << 8) #define CCM_CMEOR 0x088 #endif From owner-svn-src-all@freebsd.org Sat Nov 14 23:07:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CBA3A2FF9D; Sat, 14 Nov 2015 23:07:40 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB2E1BB5; Sat, 14 Nov 2015 23:07:40 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEN7dAk087589; Sat, 14 Nov 2015 23:07:39 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEN7cZN087586; Sat, 14 Nov 2015 23:07:38 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201511142307.tAEN7cZN087586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 14 Nov 2015 23:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290835 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:07:40 -0000 Author: rodrigc Date: Sat Nov 14 23:07:38 2015 New Revision: 290835 URL: https://svnweb.freebsd.org/changeset/base/290835 Log: Implemtn getdtablecount() to count open file descriptors for current process. Use underlying sysctl implemented by mjg in r290473. PR: 194985 Reviewed by: bapt, mjg Differential Revision: https://reviews.freebsd.org/D4084 Added: head/lib/libopenbsd/getdtablecount.c (contents, props changed) head/lib/libopenbsd/unistd.h (contents, props changed) Modified: head/lib/libopenbsd/Makefile Modified: head/lib/libopenbsd/Makefile ============================================================================== --- head/lib/libopenbsd/Makefile Sat Nov 14 22:46:50 2015 (r290834) +++ head/lib/libopenbsd/Makefile Sat Nov 14 23:07:38 2015 (r290835) @@ -1,9 +1,12 @@ # $FreeBSD$ LIB= openbsd -SRCS= ohash.c +SRCS= getdtablecount.c \ + ohash.c INTERNALLIB= +CFLAGS+= -I${.CURDIR} + WARNS= 3 .include Added: head/lib/libopenbsd/getdtablecount.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libopenbsd/getdtablecount.c Sat Nov 14 23:07:38 2015 (r290835) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2015 Craig Rodrigues + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +int getdtablecount(void); + +/* + * Return the count of open file descriptors for this process. + * + */ +int +getdtablecount(void) +{ + int mib[4]; + int error; + int nfds; + size_t len; + + len = sizeof(nfds); + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_NFDS; + mib[3] = 0; + + error = sysctl(mib, 4, &nfds, &len, NULL, 0); + if (error) + return (-1); + return (nfds); +} Added: head/lib/libopenbsd/unistd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libopenbsd/unistd.h Sat Nov 14 23:07:38 2015 (r290835) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2015 Craig Rodrigues + * 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 _LIBOPENBSD_UNISTD_H_ +#define _LIBOPENBSD_UNISTD_H_ + +#include_next + +int getdtablecount(void); + +#endif From owner-svn-src-all@freebsd.org Sat Nov 14 23:13:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD24A2D149; Sat, 14 Nov 2015 23:13:16 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24D7E1062; Sat, 14 Nov 2015 23:13:16 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAENDFni090397; Sat, 14 Nov 2015 23:13:15 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAENDFsD090396; Sat, 14 Nov 2015 23:13:15 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201511142313.tAENDFsD090396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 14 Nov 2015 23:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290836 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:13:16 -0000 Author: rodrigc Date: Sat Nov 14 23:13:15 2015 New Revision: 290836 URL: https://svnweb.freebsd.org/changeset/base/290836 Log: Add imsg to libopenbsd. This will help with importing OpenBSD programs such as ypldap into the base system. Modified: head/lib/libopenbsd/Makefile Modified: head/lib/libopenbsd/Makefile ============================================================================== --- head/lib/libopenbsd/Makefile Sat Nov 14 23:07:38 2015 (r290835) +++ head/lib/libopenbsd/Makefile Sat Nov 14 23:13:15 2015 (r290836) @@ -2,6 +2,8 @@ LIB= openbsd SRCS= getdtablecount.c \ + imsg-buffer.c \ + imsg.c \ ohash.c INTERNALLIB= @@ -9,4 +11,5 @@ CFLAGS+= -I${.CURDIR} WARNS= 3 +NO_WERROR= .include From owner-svn-src-all@freebsd.org Sat Nov 14 23:24:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79FCCA2D3E3; Sat, 14 Nov 2015 23:24:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::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 44C40189F; Sat, 14 Nov 2015 23:24:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacdm15 with SMTP id dm15so135526015pac.3; Sat, 14 Nov 2015 15:24:18 -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 :content-transfer-encoding:message-id:references:to; bh=kI7xYX8HpV7du10qpQn1bifxbYuTf1K6jcbMsR1b+Ik=; b=Xr02fmhNVr29/Gv8AMFk3vrU65WXnnLdWGOgXQxauz/MKvWk/XmVImRbEWTKPOwkcA zvo4gi/VEKOkSXTDo4EeXwqD285mTbcVCRnuZKrXi5AKoUxYNlli2B8dgGa0zDsXYBXg 8sBRMuL79c2ahmj49YQP2A3gScdCcMG+RaIcKHqQlbgHw6HoOnRD7UfV1opIFTadJpay 4+Td67Z1IReB9LRzmHpKvd256cHFW/UxHTl7NpesvmjTWGTYwCE6Ry+lI4wgtBkcLHtg 437gDM00zPVds2qQgB5Tc/zFyaNWqE6Noy4pv7PzYNXdyovo/1tjKce7iHIWA1j2SMNn 0OXw== X-Received: by 10.68.216.100 with SMTP id op4mr42824760pbc.47.1447543458742; Sat, 14 Nov 2015 15:24:18 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:1591:4178:5777:4e52? ([2601:601:800:126d:1591:4178:5777:4e52]) by smtp.gmail.com with ESMTPSA id fx3sm27762986pbb.60.2015.11.14.15.24.16 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Nov 2015 15:24:17 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290835 - head/lib/libopenbsd From: NGie Cooper In-Reply-To: <201511142307.tAEN7cZN087586@repo.freebsd.org> Date: Sat, 14 Nov 2015 15:24:17 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7BA865DA-98E0-4BA3-8F03-1FD26A87B785@gmail.com> References: <201511142307.tAEN7cZN087586@repo.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:24:19 -0000 > On Nov 14, 2015, at 15:07, Craig Rodrigues = wrote: >=20 > Author: rodrigc > Date: Sat Nov 14 23:07:38 2015 > New Revision: 290835 > URL: https://svnweb.freebsd.org/changeset/base/290835 >=20 > Log: > Implemtn getdtablecount() to count open file descriptors for current = process. >=20 > Use underlying sysctl implemented by mjg in r290473. >=20 > PR: 194985 > Reviewed by: bapt, mjg > Differential Revision: https://reviews.freebsd.org/D4084 This broke the build on old versions of the OS because sys/sysctl.h = isn't installed to WORLDTMP before bootstrap-tools: 231 # 1. legacy stage [BMAKE] 232 # This stage is responsible for creating compatibility 233 # shims that are needed by the bootstrap-tools, 234 # build-tools and cross-tools stages. These are generally 235 # APIs that tools from one of those three stages need to 236 # build that aren't present on the host. 237 # 1. bootstrap-tools stage [BMAKE] 238 # This stage is responsible for creating programs that 239 # are needed for backward compatibility reasons. They 240 # are not built as cross-tools. See: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/1663/consoleFull Cheers, -NGie= From owner-svn-src-all@freebsd.org Sat Nov 14 23:37:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 313F8A2D606; Sat, 14 Nov 2015 23:37:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0446B1D88; Sat, 14 Nov 2015 23:37:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabfh17 with SMTP id fh17so136859728pab.0; Sat, 14 Nov 2015 15:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nkkv4rxJDNIF+FwKktBySrYpwDBPZn2xiHoWLMnZz2g=; b=tMBUB4a+dq4iMB0affXQcOMmyk8sQwerkAkkVPfvSk+7HUr2Imfo9h339ODUYHvdqK updxv9SAfoERvpVlMarjFpz3UjO0hXskEyFtSAWHwVSbN1MKvjDbbmjGw/tDliuPll1C BN7HqGBi01g8Pvp4hhla5kIs+FDszijRCv37D4oebotEmNJ8bvQXN/DAEf4GU7RzvNFt KSK2stKV1DIOuqFnzOw8rUv9VC4KqjU3nzqEgQSy4ufxSKPNGUpBK/yOvC8HdsBl5KfH St+lMweIGTQb+8X7YJNH2EwZzTEkI7CSq9bLS5z/eTfXQqXxSLgxpc8wzAosohcYnvaq ynHw== X-Received: by 10.68.69.106 with SMTP id d10mr42748527pbu.143.1447544244437; Sat, 14 Nov 2015 15:37:24 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id xe1sm27813722pbc.4.2015.11.14.15.37.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Nov 2015 15:37:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290835 - head/lib/libopenbsd From: NGie Cooper In-Reply-To: <7BA865DA-98E0-4BA3-8F03-1FD26A87B785@gmail.com> Date: Sat, 14 Nov 2015 15:37:23 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <27E18130-829D-41A4-BFCA-1818774E976A@gmail.com> References: <201511142307.tAEN7cZN087586@repo.freebsd.org> <7BA865DA-98E0-4BA3-8F03-1FD26A87B785@gmail.com> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:37:25 -0000 > On Nov 14, 2015, at 15:24, NGie Cooper wrote: >=20 >=20 >> On Nov 14, 2015, at 15:07, Craig Rodrigues = wrote: >>=20 >> Author: rodrigc >> Date: Sat Nov 14 23:07:38 2015 >> New Revision: 290835 >> URL: https://svnweb.freebsd.org/changeset/base/290835 >>=20 >> Log: >> Implemtn getdtablecount() to count open file descriptors for current = process. >>=20 >> Use underlying sysctl implemented by mjg in r290473. >>=20 >> PR: 194985 >> Reviewed by: bapt, mjg >> Differential Revision: https://reviews.freebsd.org/D4084 >=20 > This broke the build on old versions of the OS because sys/sysctl.h = isn't installed to WORLDTMP before bootstrap-tools: >=20 > 231 # 1. legacy stage [BMAKE] > 232 # This stage is responsible for creating compatibility > 233 # shims that are needed by the bootstrap-tools, > 234 # build-tools and cross-tools stages. These are generally > 235 # APIs that tools from one of those three stages need to > 236 # build that aren't present on the host. > 237 # 1. bootstrap-tools stage [BMAKE] > 238 # This stage is responsible for creating programs that > 239 # are needed for backward compatibility reasons. They > 240 # are not built as cross-tools. >=20 > See: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/1663/consoleFull This should fix it (and other style bugs / other issues): = https://people.freebsd.org/~ngie/fix-r290835.patch . Going to try it out = on ref11-amd64..= From owner-svn-src-all@freebsd.org Sat Nov 14 23:44:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C789A2D7C3; Sat, 14 Nov 2015 23:44:00 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D071124D; Sat, 14 Nov 2015 23:44:00 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAENhxJY099367; Sat, 14 Nov 2015 23:43:59 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAENhxvG099366; Sat, 14 Nov 2015 23:43:59 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201511142343.tAENhxvG099366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 14 Nov 2015 23:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290838 - head/lib/libopenbsd/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:44:00 -0000 Author: rodrigc Date: Sat Nov 14 23:43:59 2015 New Revision: 290838 URL: https://svnweb.freebsd.org/changeset/base/290838 Log: Fix bootstrapping of libopenbsd on build hosts where KERN_PROC_NFDS it not defined. Added: head/lib/libopenbsd/sys/ head/lib/libopenbsd/sys/sysctl.h (contents, props changed) Added: head/lib/libopenbsd/sys/sysctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libopenbsd/sys/sysctl.h Sat Nov 14 23:43:59 2015 (r290838) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2015 Craig Rodrigues + * 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 _LIBOPENBSD_SYS_SYSCTL_H_ +#define _LIBOPENBSD_SYS_SYSCTL_H_ + +#include_next + +#ifndef KERN_PROC_NFDS +#define KERN_PROC_NFDS 43 /* number of open file descriptors */ +#endif + +#endif /* _LIBOPENBSD_SYS_SYSCTL_H_ */ From owner-svn-src-all@freebsd.org Sat Nov 14 23:49:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D106FA2D82F; Sat, 14 Nov 2015 23:49:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9958C13D5; Sat, 14 Nov 2015 23:49:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by padhx2 with SMTP id hx2so135997776pad.1; Sat, 14 Nov 2015 15:49:58 -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 :content-transfer-encoding:message-id:references:to; bh=bKBlxyNDi38EK4bWvUhdhNLv3OvXLNw3O9HHMJw65iU=; b=okaVnr0XNNJfDSvmlcONV6UyES1ABPA1Bq8uvHnKwQG5VwNvw6BY42tiZdrTaQFaoa E0cCUmDxxRRPYUEMFPf/P+NHAcsgIUL92fhTgV6Xh6VQQGDgzx4YdR9NaeUB1aFnjWZd fYpctDJi4JL+Kl+3Tx3DI2lcGi6BnTmkMlpu5rFq7FAs3OKH5kRFOWwO/4jVpPNuFc3j rk9dYrgOqTtPJM9NIv5IBK/XGM64bh5n6RhJtDCyHIaN016y2sLllVs3OekB6wTE31VI lbWCRI838tHZ8a36d92aExu7Gxx7j+vwtX6FrN9NxIB4qFd4mKZFfDN0GqScujwho75D 1CRQ== X-Received: by 10.66.221.163 with SMTP id qf3mr13861410pac.121.1447544998190; Sat, 14 Nov 2015 15:49:58 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id fp2sm27820876pbb.34.2015.11.14.15.49.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Nov 2015 15:49:57 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290836 - head/lib/libopenbsd From: NGie Cooper In-Reply-To: <201511142313.tAENDFsD090396@repo.freebsd.org> Date: Sat, 14 Nov 2015 15:49:58 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8807CA4F-B91B-41E0-A3A9-469A0F7ADB05@gmail.com> References: <201511142313.tAENDFsD090396@repo.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 23:49:58 -0000 > On Nov 14, 2015, at 15:13, Craig Rodrigues = wrote: =E2=80=A6 > +NO_WERROR=3D NO_WERROR? Really :(? It=E2=80=99s just a -Wsign-compare issue...