From owner-svn-src-head@freebsd.org Sun Nov 8 00:08:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:15:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:50:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:50:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:50:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:50:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 00:54:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 01:36:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 01:38:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 01:41:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 01:43:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 02:06:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 03:34:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 03:53:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 03:54:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 04:15:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 06:37:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 07:03:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 07:53:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 08:27:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 08:31:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 09:37:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 09:45:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 11:50:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 12:24:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 13:44:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 14:26:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 17:33:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 17:57:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 17:59:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:00:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:02:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:08:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:11:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:48:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 18:49:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042BDA297D7 for ; Sun, 8 Nov 2015 18:49:45 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) 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 A1ECC126A for ; Sun, 8 Nov 2015 18:49:44 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmdw130 with SMTP id w130so13777971wmd.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=A/l3cjH7R1t2zJDUxiJgdoJ7M2QJgog/jZAFtc73n4ukNbUoahxPd+hFDWYHYgZydo EvzrvmStbd5EEJlLWMUzk32yW3toEMp6shnoCoNlpDMihHDErMF8xuWvzECJ1ybp2gIw 9YRJGd9xFEUtgIE+Dk2IPgkANY9m92NCbSum+PmZkWIclEsnL34oARfWnuYrnc+PVNv4 dYcGatsFMK77GWKXwz0Of/SoiXO/0d14lVBA++7Pr/1rlswV0TGh7lxalc7YCn5kKEtl BAjL9g1yuVqYlho3605DuZ2N2i5Y5EyLGkydwvrck3bbzIiI3wNSQFMw/J5bi3JlkVCp 1pFw== X-Gm-Message-State: ALoCoQlv4+nhZp0TLZcZqSakUnghK9VNhsoiioZtqnNhOaAlUBiE9Ahx/AxO/PwfFjqgbOevc95M 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 19:08:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 19:24:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 19:26:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D633CA29266 for ; Sun, 8 Nov 2015 19:26:57 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c: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 5DC531C24 for ; Sun, 8 Nov 2015 19:26:57 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wiby19 with SMTP id y19so4138743wib.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=B3fG5LCx8fJJYMFwnZWHakfaBY+AEEvs+3gHTQEUp1QLIVEA+pM7WMJ+qARuqCEuqy ijREADCxbc1BMLbQrm7+Wei5USOIFxm96sBhbypaa38OoRBkszLwlxWcTUxzmQHVzngU CcZFGMK46MJGa9SrAimmtsPq9GoM/tzekCZWiSeTPuyOCojI3hgAOqpG7kIeu77BpoAk GBOtBx3a2lE+RKtKZBWIZ1P6JywWgDEDhcI8aEURPqEz30s/XPLrxzj1tfAqic2SdXad z2iWbHYZ4NCMT2n5RAob48i2u4Hlz7spH/nK+dsz+N+J7uHi2Uw8UD8p8q8s2wbcBtxH goRA== X-Gm-Message-State: ALoCoQlNDPyUUTB4sXhN42w9Xo9CkZQv2m36kYnkrfTgcy3StkW6NmeFg/1XtzljbFhoQFjoeLn/ 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 19:27:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 142ADA292AE for ; Sun, 8 Nov 2015 19:27:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c: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 8EDBA1D81 for ; Sun, 8 Nov 2015 19:27:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmnn186 with SMTP id n186so82082918wmn.1 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=Nq/JElsEZhRg2y0zllIAiotq92nG4z4lToX26pvrlbarkmiWNsGvWaZPL9RvYlrFuP Ndj6gk7xXswyNuxvoyCLftlVh44xXYTu6KNDwgW7F8OFLxWSn9+AcYj48QJ9wojFTQ+/ wO0XImyJXYwSn0q6s6qfKuJX5399py/+gcIh/5UXOKkrXODp1AzCGGT2EG4uJD2JnrZb pq7J+TdeJoF802zUT0xGsWHj/u16nbCInIt3vbvLREncPykeYZbWXaUCDn0Z1bBQJ1fL HoXyXvHC94RQqo7K0cvMoiEJ9+Z0G6lnl7M4PPqgooboMlR+eg5wIt/CL6A8PyL/OzD6 +S3w== X-Gm-Message-State: ALoCoQk9+CGiT4HzzhavyBrVkyA7i8ixD1h1q2927qOwrgEpWF2DLmhi9JpXLReynxLWgoa8MIjD 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 19:29:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 20:04:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A76FA29C23 for ; Sun, 8 Nov 2015 20:04:46 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 162EB1F02 for ; Sun, 8 Nov 2015 20:04:45 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so60542198lfs.3 for ; Sun, 08 Nov 2015 12:04:38 -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=GXdMVjxT2Rgkn7jlpjVfXWX6WIYv1AhB6OYKHpqvvplldV8sR0hJjLqWYnFX7kfMsB JEnateTrw2h4J0UhfG60JVCp6ajghBrlJpK84RJdn76SMCN4CkXTK07sqNDKRRN7q+vu uBqyqrLx/+ie0AaGls+INQhe+K2+FDbdVGgxpnwd+IYHe/barVcmESUrX1jc99iD92Bu j8POBDy3s3SAAR0pIa+2KErDijjoLvSYge5oC3VGoZR0hfcKwUCYDiAFNthk24hp0oES lJ75bqdPLM99NSIWnHxErAxsV1tBM12yJLSUUyxs62L6DuA+JcPqBmenT1V3vrNcWQGt 4dqw== X-Gm-Message-State: ALoCoQmCA6T0BcxUfkwvBRXmb5S+ZesR4ABRK3Jm66IPfSQI8K1No5/xEomQBKKPGLA5csyYRa6x 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 20:04:46 -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-head@freebsd.org Sun Nov 8 20:09:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 20:56:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:06:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:08:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:22:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:38:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:41:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 21:57:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 22:23:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 22:23:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93847A29638 for ; Sun, 8 Nov 2015 22:23:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) (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 46260142F for ; Sun, 8 Nov 2015 22:23:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbbkw15 with SMTP id kw15so81316733lbb.0 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=ZUTI9LOlBkUrlo8uneBSZJzFCm45Gm7Ez0JKTMZZgBVTpYltU6UzgyTWow87/v++T9 2eXYHioqDrORSigRIyvp51zvUMVRgCH+p+J0ueNqpTAWeLzbxY6jU0EiDD96t/eON2Ks iZ5vpLUUuV5WW+SSdz8VIEJFoIq6kLqj8Xf77ghb4lXG+Tgk1JwlT1icyv17taNwAgxT Op/t7ivmKyajk/IpS/+r/eyesQFbslxBJBzs5R/oQh4qIam2IsU+V9aT0mZ6DeXDqvvk kj92/EPhyF4NcNVSlkuu/0SpzUgLBrgCtwDSea1QAdnlPb/g0WKVy5hG9J0s6RINiw/e PHSw== X-Gm-Message-State: ALoCoQkqoZK8HWhIxJxJ1DZkG+qc2TsfxAd6l2QfMahENHx+Aw2tKGHIZaL8T4oFIhcUOY2AtDP4 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 22:28:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 22:28:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 23:06:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 23:21:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 23:46:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Nov 8 23:52:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Mon Nov 9 00:19:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 01:05:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 01:49:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 02:29:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 05:49:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 06:16:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 06:24:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 06:30:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 06:31:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 09:39:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 09:39:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 09:40:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 10:11:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 10:35:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 10:40:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 10:41:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 12:03:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 12:20:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 12:22:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 12:29:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 15:42:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 15:59:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 16:50:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 16:51:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 16:58:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 17:08:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 17:45:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 17:57:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 18:33:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 19:17:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 19:19:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1226BA2A616 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 E8A29153A 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 20:03:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 20:23:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 20:24:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 21:04:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 21:17:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 21:53:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:06:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:09:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:11:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:12:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:18:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:19:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:22:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 22:29:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:08:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:10:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:11:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:19:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:20:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:23:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:24:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:36:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:36:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:37:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:37:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:38:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Nov 9 23:46:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Tue Nov 10 00:12:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 00:37:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 00:42:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 00:44:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 02:29:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 07:34:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 07:42:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 08:11:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 09:27:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 10:49:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 10:50:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 10:55:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 10:56:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 10:59:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 11:04:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 11:19:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 11:28:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 11:45:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:02:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:15:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:20:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:27:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:52:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 12:54:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 276B0A2B92E for ; Tue, 10 Nov 2015 12:54:22 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.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 BEBCA15D0 for ; Tue, 10 Nov 2015 12:54:21 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lffz63 with SMTP id z63so47325456lff.0 for ; Tue, 10 Nov 2015 04:54:13 -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=jBrwFYRwRiRz8DnHhe3K7SPlbepXaUphqmYRuxnu0svDhQDPoqjPuQTjPY5yty4+cy as7gZcgRWEuhi0F9128CX/cxfZgk2EoJJH6IzwKlWLl+im3oqEet8eQqHovYTdjdIX12 KQgQ2naJG2wtnn097ef/mqM4PrZ7Oynf3/4Pub3CWYTbc39sBm2FAi2xyiIlZ9AOwgCY 0GgPTswALbP7IGpzENOWI9Njf3MrufloIY5QygOLKGufE/vWpOL6f3e960agAONLLAhE Fu+FLaT7aagF8Nt5O5mu1JcAqiFIBp6LvEPYxOcMcvF6+zTe8cSgL/43xomPnbdTHixn 70mA== X-Gm-Message-State: ALoCoQlwNHaTrBkoMe4DMLzEPo5rns4PQXXpZ45aPHbspN/9aK+7fLploZUU0ahnhDXT5lObX9b0 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 12:54:22 -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-head@freebsd.org Tue Nov 10 13:04:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:15:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:20:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:20:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45262A2A502 for ; Tue, 10 Nov 2015 13:20:48 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (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 BFAA31CC6 for ; Tue, 10 Nov 2015 13:20:47 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so85233234lfs.3 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=j/s9YoifR8rDG4OS1+/72R88x06gHLbepj3TKmdhDbOjxobJVSf8GomJ8nd76xw7MT KtAZCpngodiK8TPDkdHghdFOuWB7ndpyaMi8Bd12Gobz1W+/qtdZKxsx6kIvIV3x3Q8C zaycwnGcJnRC0hAxfybVj+vz2tFCLnaisyqHmvg9nygJji5En2prAFd6nxPKds6LsSdY Rh+vjxFbnXIR4Iakc/5p8AcFwGwf/nGOaUy2GdtMQGx15ixejscT1NK9m/lznvWiMR3b NPTPuC2p1gfc1GVNah98Uy4KDc8OHgUH/FLcmYqoN7mhupHAVnO7IRADfLfLa6SjCv24 nXHw== X-Gm-Message-State: ALoCoQmGlyECBJV0D0RmgNxVGyXS564tpK7+whZqW3al38a+gOEBMue6KVK4q4ZqMLRJiY7WJ87B 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:28:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:32:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:36:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 13:47:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 14:14:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 14:14:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 14:49:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 14:57:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 15:03:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE674A2A5A9 for ; Tue, 10 Nov 2015 15:03:31 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::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 B88E713B5 for ; Tue, 10 Nov 2015 15:03:31 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so212484954pac.3 for ; Tue, 10 Nov 2015 07:03:31 -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=DVl7AqxguffrKd2takq1xxlcLvsjINft9q5aHL55BtK7JusG0XPGhzLgbmTa7VphQ7 /4CeBFMmj86gXtkt3ToC9sbrG4cC5DOXEyyewHITPjj+KYXbWO8r+zlPI3Ar6iU5kl5N 44wH7d9Q6poSV/lsS4o2T15+De+aY0+FY+TfJtJjaHBh8sdtfR7zuD+Cusl8Dq8FIK6q a8O0RZ44vSYhmvoubAZx7w5M4NntR0npVc7Xw4BHY5ZdVaNKFUx5ObQ+AvTNsLdEKITj ic287Jz3sybIMzuNd2fCVvMf4O5+7Gpa61kwF1BFoUTpkOVdhQYEA0nETiWQF3obD2dC Gmkw== X-Gm-Message-State: ALoCoQk+ERSTfiluuvwTWax36tsFH/GEkgCvR73qY0nu0f+aoyuRzF2loExyWruH4NwWM7ulCw3k 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 15:08:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB62A2A8DD 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 4DC2E18BA 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 15:18:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 15:29:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 15:42:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 16:07:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A690A2B888 for ; Tue, 10 Nov 2015 16:07:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (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 C6F121DAE for ; Tue, 10 Nov 2015 16:07:30 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lffu14 with SMTP id u14so778418lff.1 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=I25oz0Ya7GwhyCwsIYdr9Br1nUPJgmyj06BeU2dB9hJr+17TzYCm/IVccCc2ssVvjW MBPHlxEIVJgNK6uQbpwpE9t3+nqDU/eVp3QBok7k9UXLyA9x1QwQqns5CLXaq8IWWLTT 7ZL4Pem5wZyuoDDUmx0MxQtWLf37KmYTXUANQIP/m/VgGnmzSKiWZAW4/Z571wjAl8pG NndsSC4xXoBzPFoo3FZ0150Apl54VUKhdRil7ewACEVp9SjEa4Md6hfF5KCL1qaUDww0 L7kTLY0rOREf2S80j3GSgnK2wkQDC+g4stQcdCchgWkqZjDNBs/1oLwgTLobcwD0tgA5 XcyA== X-Gm-Message-State: ALoCoQkQoSWo6J5CzzflgROfS/bJ+ryuBDPuqo3TekGT+hsFD6Te8lwR5d6xp9g8RpGOF6HKPmU0 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 16:12:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 16:15:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 16:19:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA28A2BECE for ; Tue, 10 Nov 2015 16:19:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.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 631F91C04 for ; Tue, 10 Nov 2015 16:19:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lfs39 with SMTP id 39so935342lfs.3 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=cJpuX/E8+JxWfB4lqwQBw/y1B2ykwJD2j1pybHtjU3nL1W546D16bQPej77Zmh7SOX KSxyL+BRWPVUC9EGEFz4+akyQHm3KIivZ1yMAgBh3Zu7JvXEGoNicPA61Rsy8sA5o0fR RWZMrZJZ8LHP9F4nuorDe7prGKxlefShcgvxjXxNiaTpf5eyOCvQ8464fdDr15gu2imp Z6MqSWaeBs27AdjHQaFNazXNNmkYKniA0wvWk8EDisqejxqSS7tO0P1EjmOk3RJaGCHD DuaAR1SqMj3r6mcIzM2ek/RzFQfjqxUQj77kfumRQ1D29UwXlnC4AMR2tj12gZb8OWJs exdQ== X-Gm-Message-State: ALoCoQmwC2+SMXig/W8ZMamqg/fGBtMxmpRHE0Hztw7mLF9CbXtsWgx+CQxYMvCXWGm4+vbEp/fm 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 16:19:51 -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-head@freebsd.org Tue Nov 10 16:33:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC060A2B43D for ; Tue, 10 Nov 2015 16:33:27 +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 7497E15E7 for ; Tue, 10 Nov 2015 16:33:27 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lffz63 with SMTP id z63so1296057lff.0 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=XKyZ07uVh73452mytCTCpG017WCJvin0qEnbOBm46hPIQ2r2S8Ceja2g/F4ddXP/te cgEbkk7d8gFLtn4RSD++98fmcyiD5hVH3t+XsGeHI1Ptt/6hdED90UAlvxGJmRn2n7g0 vNOSQfnlN5eREeByo9UMXAxpgODu8L6z4T7zJ1nt6aL2v37cdeC/x6dQzqZeZWQBiZLi lP1C61u8ip0PrsjHn01XKiy8inwNEDWDoLZ4Yn3irlBsj5gX72NFuOkpk+MbO37Q5y2K oXvaNqBxzU3zTc37YfC/ssDm4nfeFv3RSS+KbLNQjhFzf6vSADa1DJAojdAWcELe9wjX vLFQ== X-Gm-Message-State: ALoCoQk9njQOqPrnR+urItqvpMiJ2YwgqHz62gvp5zmZd54ExfTZie9/8lQiPixIn7IpYeQb6eU4 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 16:35:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 17:15:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 17:25:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 17:29:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 17:50:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 18:23:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 20:20:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Nov 10 21:50:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Wed Nov 11 00:41:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 00:45:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 03:21:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4695A29084 for ; Wed, 11 Nov 2015 03:21:44 +0000 (UTC) (envelope-from maik88@gator3209.hostgator.com) Received: from gator3209.hostgator.com (gator3209.hostgator.com [198.57.247.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93B631635 for ; Wed, 11 Nov 2015 03:21:44 +0000 (UTC) (envelope-from maik88@gator3209.hostgator.com) Received: from maik88 by gator3209.hostgator.com with local (Exim 4.85) (envelope-from ) id 1ZwJTa-000Eoy-Cy for svn-src-head@freebsd.org; Tue, 10 Nov 2015 18:41:26 -0600 To: svn-src-head@freebsd.org Subject: You have received fax, document 00000997007 X-PHP-Script: www.lagunabyte.com/post.php for 213.198.64.144 Date: Tue, 10 Nov 2015 18:41:26 -0600 From: "Interfax Service" Reply-To: "Interfax Service" Message-ID: <571be349eb2b83631e44eb9a222bf1a1@lagunabyte.com> X-Priority: 3 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3209.hostgator.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [32473 500] / [47 12] X-AntiAbuse: Sender Address Domain - gator3209.hostgator.com X-BWhitelist: no X-Source-IP: X-Exim-ID: 1ZwJTa-000Eoy-Cy X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: X-Source-Auth: maik88 X-Email-Count: 90 X-Source-Cap: bWFpazg4O21haWs4ODtnYXRvcjMyMDkuaG9zdGdhdG9yLmNvbQ== Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 03:21:44 -0000 You have a new fax! To view it please open the attachment. Pages: 6 From: Armando Parrish Resolution: 600 DPI Scanned: Tue, 10 Nov 2015 04:32:32 +0300 Scanned in: 10 seconds Filename: fax_00000997007.doc Filesize: 117 Kb Thanks for using Interfax service! From owner-svn-src-head@freebsd.org Wed Nov 11 08:30:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 09:38:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 09:55:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 13:18:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 13:23:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 13:26:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 13:28:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 13:47:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 16:23:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 16:24:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 16:24:54 -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-head@freebsd.org Wed Nov 11 18:45:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:54:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:54:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:55:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:56:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:56:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 18:56:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 19:29:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 21:48:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 23:00:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 23:10:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Nov 11 23:52:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Thu Nov 12 00:26:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 00:30:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 03:25:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 03:37:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 05:53:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 09:18:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 09:20:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 09:45:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 09:52:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 09:56:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 10:12:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 10:31:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 10:48:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 11:42:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 14:42:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 16:08:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 16:15:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:01:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:10:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:11:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:11:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:13:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:15:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:15:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:17:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:23:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 17:46:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 18:10:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 18:42:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 19:07:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 20:14:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 21:37:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 22:01:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Nov 12 22:09:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3219A2D862 for ; Thu, 12 Nov 2015 22:09:02 +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 9D1F7109A for ; Thu, 12 Nov 2015 22:09:02 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacdm15 with SMTP id dm15so77414612pac.3 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=Yq53FrmlSDQXGro3+70ZEN3bkMBTGf+mND8biEMWI8brl4/ZI8U5/zrP+u3W9kXrVH jFfPtOL0eFEoy/B2JusA+91jHzFL/DXeaa4HmZgHNlst5VWb4Pb7dC4KPNjfkWBNh4vg 3e9e1PJQAiOy4ZdwYkCW9UDPSQuY4dDyY1VvHoIxyOdzySQy5eyFYiRlkHjlZnP1Vdve FHggixtCFO0xPpgmZX6tazBniOzYUNoWjDURbsPDiIHXmhHdwmHc22y12MpKMoVD5piz j0MWSl0N4mv4hado4AJ41ZE+VVDAt7pVHPElSTmQFn3AF0ifI6MtrDLsHzFQjk7ojtSN AsrA== X-Gm-Message-State: ALoCoQn3U9sjug/tm1fh6oQ1yFUS92tGZHNqSke4Hal9uBJiHQzWnF5AuaXs32/jkQi/6ksVe4NK 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:09:03 -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-head@freebsd.org Thu Nov 12 22:24:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Fri Nov 13 00:48:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 01:11:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D18AA2CDC1 for ; Fri, 13 Nov 2015 01:11:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE36C1A32 for ; Fri, 13 Nov 2015 01:11:28 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmvv187 with SMTP id v187so59719953wmv.1 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=T1isvlC6CawxIY/IFk3CFSWgKF28BMtR2v1rMdbfPiqrb2JRpG5nsVKID5FwUiWxaf XqX/njRI7V1AzZTLcP49RSsWHGVuYDCg73QbMEapv3n1SSxh0j4mljTqeLG2L0SHu6S2 R0NwEioqLvJeuPe0A2NYZhFeGDhSY5lzA7W7Ns4hEA1YP4/rips6+fyea4/u0XpFUGKr oFUMsSmNPIYcG9OJ817wXcZCVWqeE40DNQT51t9f/E7M9/f35pHcs8wEVD+tb0OIlNd6 PcLRrMeigyRMtNVL3AmaLOxe5tEFaClMvwpRPxj7sUjkqh+ZRlAVZij3nyijVYeRMuQX jduw== X-Gm-Message-State: ALoCoQkW8caQhooAmzpu9wqJAeJy9hBJta2SueaMJKdI2kPH5stgELWx/f1bUC25DDU6Nou1AG7F 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 01:47:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 05:06:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 06:16:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 06:20:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 08:17:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 08:35:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 09:00:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 11:16:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 14:10:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 14:53:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 15:36:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 16:26:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 17:25:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 17:27:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 18:51:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 18:57:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 19:01:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 20:25:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 20:39:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 20:49:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 20:59:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9FDBA2E8B1 for ; Fri, 13 Nov 2015 20:59:07 +0000 (UTC) (envelope-from rrs@netflix.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 6FFAE1218 for ; Fri, 13 Nov 2015 20:59:07 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pabfh17 with SMTP id fh17so110862638pab.0 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=Fn5J8jbnDCWZZ7m7XDoY7nZEEMAQBq6nKOGxBnoVltthrn7fX3q1ni02r58wo9SMOr +P6OrLr2+lSuKyQ9tOXab/ZF8l0By2H8c2CXM1+Kb63AsbvbXSu7L+kFTtPqqU9ozmsE O5th35vnV0sV4OYuKfVkQCRpOM7Pp8tCKqM6rNAc4s6/kBG8fwJ4igIZQ7+OQdXySWo6 IJ1izJH02ukSSsSssZBOSAmn8a8gPstvpQ8BXRi0W+L0XysEOMVChFdL7wxbxVc/iVcb EZICY27R/BoE2C3w1yOju+4/Kphfk68zO9tjz76UTRomYmQpbBLB84rh1CowDeILlSDl UVLA== X-Gm-Message-State: ALoCoQnMTLAVdeni0W+5yhxZ002C+m6aHgC6QsnNVJJMst67HdIpxzq3AfcSyUSln5OsMM699O+z 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:00:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB197A2E926 for ; Fri, 13 Nov 2015 21:00:00 +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 A18F01381 for ; Fri, 13 Nov 2015 21:00:00 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so3908179pac.2 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=kKrC/GRw/l+UbHk6M7yHwEzezG/u3IZa4BNnr/6yNSNQLH8P3Rqbiq+NuFxoKqMK1E tzcQ3rHQs2e1AdThC1RpCu2DUyxvjVLIQy1EI4EGS8PXGDnQ3RE+WyYBq4vV9UgDkiP4 6ZcMCtS/3VBKmopcFx/UjcDvhOqIiSHctkRKZBVjt392jgGxHBjWIb3Na8N6eIeJ6EIK F5oMtLckMFfVUmuwLvb0/Ck8+XKcu2LJox/MIYAtmkdn6MPVA4fHnFZjFpsqy4a2DfFj C50hgdldlDj1KDfZJIcqQpocYQn+i2AHBcWrRWl9setv1P+3p/1bknms5/xCsu/C6bKf NhLg== X-Gm-Message-State: ALoCoQmDpgVOFZ9b79SQ7hem3c8YNxK+4Q83zrLYesHOzDJ2zJgJ9rcEX2TCVvMomhoRxGKkujwi 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:03:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:14:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:14:07 -0000 From owner-svn-src-head@freebsd.org Fri Nov 13 21:19:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C759A2EC42 for ; Fri, 13 Nov 2015 21:19:44 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::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 3EAB71E42 for ; Fri, 13 Nov 2015 21:19:44 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pabfh17 with SMTP id fh17so111331096pab.0 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=OkENW6EMmyLWmBVe/KEUH56Ma9+QFV4AWCq3TcQfU2yzfglQpYPeRyLgSiTp1+F7rc MiaDU4wA3IRKluuZFn5Uugzqjmvat2QkJS9XC+OAvtfCv2lDH0RYi0TtnvxhbeSKztvM sb1I/gpOwDF83GvXc0ffEozR0oaR4kLtcEbtXz3OzA1/5nWVMz6l5PaIK3VX/ith+wuT JV+Hw9A7O7OS86Cm4kgcxYCHWM3Dmr2b6bkGjtT+dXfOrrlg+uPKeUWmQGdDvRraflP4 rphMzdHNUVD3sRqZa62KC95b3lmuFjfEZ0cgUds7VoMTV8qjJctJATcVLCGR3l7oWznp 7Zzg== X-Gm-Message-State: ALoCoQm/Rx8SKafJZ6uW8IykfPOr939q83C4ntxhf8JLfss3R19roUeqmcGwXGrE7PvmIVyiP4DO 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:20:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E9C3A2ECF8 for ; Fri, 13 Nov 2015 21:20:43 +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 56D371FF8 for ; Fri, 13 Nov 2015 21:20:43 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pabfh17 with SMTP id fh17so111351785pab.0 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=CzhntsPc9kW15Tn1AAvMnyiGZongGnBeK38U906/Ro7NqB4k+plMNfZgLjFmR4wsO1 j+rn6HYScz85gQM5kSJwYHK++oDtisInVWhJL8jWaCIcKo9pZiaq7EdYcwaN484HVRi7 y4eHFjaOIqVPXATXZUuSW1LCW+FID8mOHwgXYPBn8UANy7ZA+ORbHkNBsUxkfxYrmaGK M+JWIAcswEOMzAoReC2EY9WcnpAMINXYKIT2k93Z8tk8/T1xoKzUpw+/z+rGNob0OSDN 7xprzgpJMOLhqEPtk388nfgssezYkhf3a9oSDt90304dE0cC0+dKq7KRLcFOwH2F6bpp J19w== X-Gm-Message-State: ALoCoQndOhJnaPud3nN0r9tTE+v3WKJcFGUHb7GiJBTS5HZMFAi+dlF7RJCPrC/KWaX1UAjva3HR 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:24:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF605A2EEC0 for ; Fri, 13 Nov 2015 21:24:47 +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 74E24142B for ; Fri, 13 Nov 2015 21:24:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so4446994pac.2 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=H2Q174Nn37BL+sjgxuwI4iac2bb/Lh2/O+3BIW9UvOEPhUf7cQ4VCIW7r+sdrCDNil sWF3ujc7TZmGqo8nW1brDr71vydLbWTAqc9198e9uNxiYQHrODJiYEVWGm//H30IlBeW ArLmwfYgnZ2JAIHhv/+C5PYU9yStJvayHKt4uDktIRinqcLTYpOYMGWiVYsbNlFNqpzT 9CrTM0JdiG4hAenvO96GxOS7MY7NEs8KrOZKI9qikvFzu7J0WW02/gXii9NTesPgOX43 /bxbJcwZ0xoCnKiaGXYs6/mr11MNKIiyL/nNN71+tMlJJKsMRLy4ZLQhq1lC8zePKe2g 1dBA== X-Gm-Message-State: ALoCoQl/+4ppRaf7G56E5iVT2Qh7uvDOeb7WTzuY7x3txFiPua6qHvY2a0qfTeH61xiIiWj+qQhC 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:32:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:32:07 -0000 From owner-svn-src-head@freebsd.org Fri Nov 13 21:34:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10CA2A2E0EA for ; Fri, 13 Nov 2015 21:34:13 +0000 (UTC) (envelope-from rrs@netflix.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 C9A571BE7 for ; Fri, 13 Nov 2015 21:34:12 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so4640283pac.2 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=TExNtGFs7/AgRw2MThtlT80fYbC5hF+JDIIjuxAdEvspSWiNCmpNN2TibpeaM9F+Zj SypEoe1X3OrTDq13JYbKN1LsCCQfbDeTHmbt6YR1p83Ls01FGi5tnZ19SoUO4PW30uxY eoFh/isnCe3y0GeFWTEbsPkavjx/p7gejvxSrwjgCG8OwKXfeTeHzbyTXa+pwvoHemF0 sKW75n8e3hMsFCFRTkthNNzX11GKNNKz8mpxbCpbP5GS4+7+N1lWbXKjCI9ILJcaxXoO KUOVdzMSL6Tj8PDVZbI8Xi67v3inlzrw0RZ8WDNC0uUlERDjs2w+e5Vu/rOzkVa2pZpP Fxew== X-Gm-Message-State: ALoCoQluLhdTbwkWyVCcKXOaVsjrHji1jiqC8zirV4hCcttRVoOexDnDPEQiSE6nd7mq7ji+/x0l 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:41:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F88A2E343 for ; Fri, 13 Nov 2015 21:41:45 +0000 (UTC) (envelope-from rrs@netflix.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 6700D1FE6 for ; Fri, 13 Nov 2015 21:41:45 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so4792408pac.2 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=SQpB6FnV9RaI+8D6rAsjWQq65JkIP9gEdhhlsfnWE+VAFRrfyUmlFSRlmdtVXYSMNx oApPccpIIX4McEQJQNeLkyJZUWv2ZdlK2oOmG1P/4iOYsWSYIFy7kCfo1awf890hxz/r a5lU7oGdHCQXlRMGjCuiNd7zjbxins3LLCLe513qEHkHYPUpfaNBIRWVhxhAdEpUhoPe WtKRRqMxiXbjsxK/SGppZrVngoZepznN48tt9b23BkNcCQqF/e2kk+HcQouBdsLhUlKl cBZHq51ovlEThAxr1dVvpvYrv6e7XHWgwH429swY0Yz4+KtfNfudi0fdPz1Gfjw66VVN 3ebQ== X-Gm-Message-State: ALoCoQl1oxvKOih3SMbpfaG0qPHpXpj7ANc1UNUPiXmLnRwwBch932KL3fowo4rC8vSSbj1Z6KWA 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:42:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:43:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:47:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 764BDA2E451 for ; Fri, 13 Nov 2015 21:47: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 36D711761 for ; Fri, 13 Nov 2015 21:47:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by padhx2 with SMTP id hx2so111686961pad.1 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=QWvLYs0fg9u25339ErAvGXKSsRs6l+1WOCm9Yz3rDLwV55odndB1NcbGzHxRRtAUri MN+rw41vHXx9qO5efZGE0DYqHvjtKrXGCnhJTEiElM9zxKOMSp1wVmfeO04dYPyGISG+ sBrN/gnM2D63tPT2CrclQMvGNRakCF1+D1JE9jt5qwWN5tMmoazJtkgOoN+4b5Mx1YSb 04Gfiq2lq/g/DU6jmghO+5TNU+h1HHnUqV/8NbPUEofxHMYz1nViGLFdAuMgJ7tcivOp sTj3yNddpTwsuZ+NBIhntEJv1pXj/4Wp64gg2ic3GNzd/tFiRRSGLhbpewxuqXXjZDB/ sOkA== X-Gm-Message-State: ALoCoQmZlnzxI/rEguEn6iTbimunn7UNJAnH6WmxK/1LgGMLBM+bYTeeGCevnzE5I+g5T5E2hVJb 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:49:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 21:51:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 21:51:52 -0000 From owner-svn-src-head@freebsd.org Fri Nov 13 22:27:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:36:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:44:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:45:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D434CA2E277 for ; Fri, 13 Nov 2015 22:45:01 +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 991181C0D for ; Fri, 13 Nov 2015 22:45:01 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so6081342pac.2 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=aKcZrL8l9A6bYKZlPPKc7vjkhVGInudxsoOiBZe3NQ+bZKmz7IShvwpMLQ/QL/q2zb pEGT+J/jU9/oxOdQ3Pm+nltZkCDOXzJSV7cwuckuNAlwDmsev9Ww9nVexsEemzcen/cz rtAAs07KBQLU7WDcTm4/XK8zYOfp1Lt9ZGpofx2Z10dsDxPEwCtzghNji/iiQi/rsiak 5+/DvDUE1TBh7qYIYmKQM6MnuNzTgB1yefaZ0npv2oqUEyeO4ymo69aKfzq9WJPjZiku tJ3qZdwLQ60inIxKq4t3Lx9UQFURld/jsCVeat0GUEo+Zpnl1aJhuV1n53xW+AbyoWNx YcIA== X-Gm-Message-State: ALoCoQk4QkEWSycdj40CgmcYWjuWbLwd2T8Re83Oc9vilBB75Vtk3edMkLZmGs5ZaGUboEwsJZJH 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:51:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:52:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E1B8A2E42E for ; Fri, 13 Nov 2015 22:52:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::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 52C0D11C1 for ; Fri, 13 Nov 2015 22:52:55 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by pacej9 with SMTP id ej9so6238219pac.2 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=TkkYjt3wVV4b4VhjmAJEgEN1TPmdPUFtEIdbbU1zLvbATFT5WzhMzJmzeJtusWYASO SC09fOTrR7PTAa8iuj205qliUO3UMM5w8Brl0RalGaLHgNMlOMyn1Fe0L2NMxTRIzhRJ Kni6wxCkaQIJDrh3hnmgy3eZuafkCGMuetFQF57Tk8XBbEA4LRD4S5bhb/wIR+fS0UK+ EQRQv5rGVtZ4S4EFvDJsrI0kAvzOEH5KXVrt3JrPPSmziDi2c+DHNrwkWlNWDcPoA6z7 GTmPeO5XAqhbi9m77pMpeDATNjgi5KxoOBjDy2fBRHg8ZM1Th2zm3TJWex20wzQxQQHa YCNQ== X-Gm-Message-State: ALoCoQkA6bR6xVi6EXeJYmTXT28YeiLJPYJZHhHjrjpSt42AVIywol1FINZjxKAqv8VDBmFs3b1Y 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 22:54:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:02:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5109CA2E69E for ; Fri, 13 Nov 2015 23:02:06 +0000 (UTC) (envelope-from Cheng.Cui@netapp.com) Received: from mx144.netapp.com (mx144.netapp.com [216.240.21.25]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx144.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2C418E8 for ; Fri, 13 Nov 2015 23:02:04 +0000 (UTC) (envelope-from Cheng.Cui@netapp.com) X-IronPort-AV: E=Sophos;i="5.20,289,1444719600"; d="pcap'?zip'48?scan'48,48,208";a="80197906" Received: from hioexcmbx05-prd.hq.netapp.com ([10.122.105.38]) by mx144-out.netapp.com with ESMTP; 13 Nov 2015 15:00:38 -0800 Received: from HIOEXCMBX03-PRD.hq.netapp.com (10.122.105.36) by hioexcmbx05-prd.hq.netapp.com (10.122.105.38) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Fri, 13 Nov 2015 15:00:37 -0800 Received: from HIOEXCMBX03-PRD.hq.netapp.com ([::1]) by hioexcmbx03-prd.hq.netapp.com ([fe80::652e:2f89:cba3:5531%21]) with mapi id 15.00.1130.005; Fri, 13 Nov 2015 15:00:37 -0800 From: "Cui, Cheng" To: Hans Petter Selasky CC: "svn-src-head@freebsd.org" Subject: Re: question about trimning data "len" conditions in TSO in tcp_output.c Thread-Topic: question about trimning data "len" conditions in TSO in tcp_output.c Thread-Index: AQHRGNRH3ZqdnMKQ9kSAjiggGnHKap6QBSEAgAALXQCAAAv6AIAKslAA Date: Fri, 13 Nov 2015 23:00:37 +0000 Message-ID: References: <563D1892.3050406@selasky.org> <563D2C26.2070300@selasky.org> In-Reply-To: <563D2C26.2070300@selasky.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 23:02:06 -0000 T24gMTEvNi8xNSwgNTozOSBQTSwgIkhhbnMgUGV0dGVyIFNlbGFza3kiIDxocHNAc2VsYXNreS5v cmc+IHdyb3RlOg0KDQoNCj5PbiAxMS8wNi8xNSAyMjo1NiwgQ3VpLCBDaGVuZyB3cm90ZToNCj4+ IE9uIE5vdiA2LCAyMDE1LCBhdCA0OjE2IFBNLCBIYW5zIFBldHRlciBTZWxhc2t5IDxocHNAc2Vs YXNreS5vcmc+IHdyb3RlOg0KPj4NCj4+PiBPbiAxMS8wNi8xNSAyMTo0NiwgQ3VpLCBDaGVuZyB3 cm90ZToNCj4+Pj4gSGVsbG8gSGFucywNCj4+Pj4NCj4+Pj4gU29ycnkgaWYgbXkgcHJldmlvdXMg ZW1haWwgZG9lcyBub3QgcmVhY2ggeW91IGJlY2F1c2Ugb2YgYSBiYWQNCj4+Pj5zdWJqZWN0Lg0K Pj4+Pg0KPj4+PiBUaGlzIGlzIENoZW5nIEN1aS4gSSBhbSByZWFkaW5nIHRoZSBDVVJSRU5UIEZy ZWVCU0QgY29kZSBpbg0KPj4+PnRjcF9vdXRwdXQuYywgYW5kIGZpbmQgdGhpcyBxdWVzdGlvbiBy ZWdhcmRpbmcgeW91ciBjaGFuZ2UgaW4gcmV2aXNpb24NCj4+Pj4yNzE5NDYuDQo+Pj4+IA0KPj4+ Pmh0dHBzOi8vc3Zud2ViLmZyZWVic2Qub3JnL2Jhc2UvaGVhZC9zeXMvbmV0aW5ldC90Y3Bfb3V0 cHV0LmM/cjE9MjcxOTQ2DQo+Pj4+JnIyPTI3MTk0NSZwYXRocmV2PTI3MTk0Ng0KPj4+Pg0KPj4+ PiB0cmltIGRhdGEgImxlbiIgdW5kZXIgVFNPOg0KPj4+Pg0KPj4+PiA4ODUJICAgICAgICAgICAg ICAgICAgICAgICAgLyoNCj4+Pj4gODg2CSAgICAgICAgICAgICAgICAgICAgICAgICAqIFByZXZl bnQgdGhlIGxhc3Qgc2VnbWVudCBmcm9tIGJlaW5nDQo+Pj4+IDg4NwkgICAgICAgICAgICAgICAg ICAgICAgICAgKiBmcmFjdGlvbmFsIHVubGVzcyB0aGUgc2VuZCBzb2NrYnVmIGNhbg0KPj4+PmJl DQo+Pj4+IDg4OAkgICAgICAgICAgICAgICAgICAgICAgICAgKiBlbXB0aWVkOg0KPj4+PiA4ODkJ ICAgICAgICAgICAgICAgICAgICAgICAgICovDQo+Pj4+IDg5MAkgICAgICAgICAgICAgICAgICAg ICAgICBtYXhfbGVuID0gKHRwLT50X21heG9wZCAtIG9wdGxlbik7DQo+Pj4+IDg5MQkgICAgICAg ICAgICAgICAgICAgICAgICBpZiAoKG9mZiArIGxlbikgPCBzYmF2YWlsKCZzby0+c29fc25kKSkg ew0KPj4+PiAgIDw9PQ0KPj4+PiA4OTIJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt b2ZmID0gbGVuICUgbWF4X2xlbjsNCj4+Pj4gODkzCSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKG1vZmYgIT0gMCkgew0KPj4+PiA4OTQJICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGxlbiAtPSBtb2ZmOw0KPj4+PiA4OTUJICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHNlbmRhbG90ID0gMTsNCj4+Pj4gODk2CSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KPj4+PiA4OTcJICAgICAgICAgICAgICAgICAgICAgICAg fQ0KPj4+Pg0KPj4+PiBJcyB0aGVyZSBhIHNwZWNpZmljIHJlYXNvbiB0aGF0IGl0IHNob3VsZCBz a2lwIHRyaW1taW5nIHRoZSBkYXRhDQo+Pj4+ImxlbiIgdW5kZXIgdGhlIGNvbmRpdGlvbiBvZiAi KG9mZiArIGxlbikgPT0gc2JhdmFpbCgmc28tPnNvX3NuZCkiIGluDQo+Pj4+VFNPPw0KPj4+PiBC ZWNhdXNlIEkgYW0gd29uZGVyaW5nIGlmIHdlIGNhbiB0cmltIHRoZSBkYXRhICJsZW4iIGRpcmVj dGx5IHdpdGhvdXQNCj4+Pj5jaGVja2luZyB0aGUgIihvZmYgKyBsZW4pIiBjb25kaXRpb24uDQo+ Pj4NCj4+PiBIaSBDaGVuZywNCj4+Pg0KPj4+IEkgYmVsaWV2ZSB0aGUgcmVhc29uIGlzIHRvIGF2 b2lkIGxvb3Bpbmcgb25lIG1vcmUgdGltZSBvdXRwdXR0aW5nIGENCj4+PnNpbmdsZSBwYWNrZXQg Y29udGFpbmluZyB0aGUgcmVtYWluZGVyIG9mIHRoZSBhdmFpbGFibGUgZGF0YSwgd2l0aA0KPj4+ cmVnYXJkIHRvIG1heF9sZW4uDQo+ID4gSG93IGRpZCB5b3UgZW52aXNpb24gdGhlIHJlbW92YWwg b2YgdGhpcyBjaGVjayB3b3VsZCBpbmZsdWVuY2UgdGhlDQo+Z2VuZXJhdGVkIHBhY2tldCBzZXF1 ZW5jZT8NCj4+Pg0KPj4+IC0tSFBTDQo+Pj4NCj4+IEhpIEhhbnMsDQo+Pg0KPj4gSSBtYXkgYmUg d3JvbmcgYnV0IG15IGFzc3VtcHRpb24gaXMgdGhhdCB0aGUgcmVtYWluZGVyIG9mIHRoZSBhdmFp bGFibGUNCj4+ZGF0YSBtYXkgYmUgbGFyZ2VyIHRoYW4gb25lIHNpbmdsZSBwYWNrZXQuDQo+Pg0K Pj4gU3VwcG9zZSBtYXhfbGVuPT0xNTAwLCBzYl9hY2M9PTMwMDEsIG9mZj09MiwgYW5kIChvZmYr bGVuKT09MzAwMS4gSW4NCj4+dGhpcyBjYXNlLCB0aGUgY3VycmVudCBjb2RlIHdpbGwgbm90IHRy aW0gdGhlICJsZW4iDQo+PiBhbmQgbGV0IGl0IGdvIGRpcmVjdGx5IHRvIHRoZSBOSUMuIEkgdGhp bmsgaXQgc2tpcHMgdGhlIE5hZ2xlJ3MNCj4+YWxnb3JpdGhtLiBBcyBsZW49PTI5OTksIHRoZSBs YXN0IHBhY2tldCBpcyAxNDk5LA0KPj4gaXQgaXMgc3VwcG9zZWQgdG8gYmUgaGVsZCB1bnRpbCBh bGwgb3V0c3RhbmRpbmcgZGF0YSBhcmUgQUNLZWQsIGJ1dCBpdA0KPj5oYXMgYmVlbiBzZW50IG91 dC4NCj4NCj5IaSBDaGVuZywNCj4NCj5UaGF0IGlzIGNvcnJlY3QuIE5hZ2xlJ3MgYWxnb3JpdGht IGlzIG5vdCBhY3RpdmUgd2hlbiAiKG9mZitsZW4pID09DQo+c2JfYWNjIi4gQW55aG93LCB0aGUg Y2hlY2sgZm9yICIob2ZmK2xlbikgPT0gc2JfYWNjIiBkb2VzIG5vdCBnbyBhd2F5Lg0KPkl0IGhh cyB0byBiZSBwdXQgYmVmb3JlIHNlbmRhbG90ID0gMSB0byBhdm9pZCBzZW5kaW5nIHRoZSBzby1j YWxsZWQNCj4ic21hbGwgcGFja2V0IiBpbiB0aGUgbmV4dCBpdGVyYXRpb24uIFBvc3NpYmx5IHlv dSB3aWxsIG5lZWQgdG8gYWRkIGENCj5jaGVjayBmb3IgVENQIG5vZGVsYXkgYmVpbmcgYWN0aXZl LCB3aGljaCBkaXNhYmxlIE5hZ2xlJ3MgYWxnb3JpdGhtLg0KPkhhdmUgeW91IGRvbmUgYW55IHRl c3RzIHJlbW92aW5nIHRoaXMgY2hlY2s/DQo+DQo+LS1IUFMNCkhpIEhhbnMsDQoNClNvcnJ5IGZv ciB0aGUgZGVsYXkgdG8gY29udGludWUgdGhpcyBkaXNjdXNzaW9uLiBJIGRpZCBzb21lIHRlc3Rz IGFuZA0KY29sbGVjdGVkIA0Kc29tZSB0cmFjZSBmaWxlcyBieSB1c2luZyBpcGVyZiBhbmQgdGNw ZHVtcC4NCg0KV2VsbCwgSSBkaWQgbm90IGZpbmQgYW55dGhpbmcgd3Jvbmcgd2l0aCB0aGUgTmFn bGUncyBhbGdvcml0aG0uIEJ1dCBJDQpmb3VuZCB0aGUgDQpyZW1haW5kZXIgY2h1bmsgb2YgZGF0 YSBjb3VsZCBiZSBsYXJnZXIgdGhhbiBhIHNpbmdsZSBwYWNrZXQsIHdoaWNoIHdpbGwNCnB1c2gg DQpOSUMgdG8gc2VuZCBleHRyYSBmcmFjdGlvbmFsIHBhY2tldCwgaWYgdGhlIHNlbmQgYnVmIHNp emUgaXMgdW5kZXIgYQ0KY2VydGFpbiANCmNvbmRpdGlvbi4NCg0KSGVyZSBpcyBteSB0ZXN0LiBU aGUgaXBlcmYgY29tbWFuZCBJIGNob29zZSBwdXNoZXMgNTc5MyBieXRlcyBkYXRhIHRvIHRoZQ0K NzI0MGJ5dGVzIHdyaXRlIGJ1ZmZlciBieSBzZXR0aW5nIHRoZSAiLWwiIG9wdGlvbiBhbmQgdGhl ICItdyIgb3B0aW9uLiBJDQp0ZXN0ZWQgdGhpcyBUQ1AgY29ubmVjdGlvbiBwZXJmb3JtYW5jZSBv biBhIHBhaXIgb2YgRnJlZUJTRCAxMC4yIG5vZGVzIChzMQ0KYW5kIA0KcjEpIHdpdGggYSBzd2l0 Y2ggaW4gYmV0d2Vlbi4gQm90aCBub2RlcyBoYXZlIFRTTyBhbmQgZGVsYXllZCBBQ0sgZW5hYmxl ZC4NCg0Kcm9vdEBzMTp+ICMgcGluZyAtYyAzIHIxDQpQSU5HIHIxLWxpbmsxICgxMC4xLjIuMyk6 IDU2IGRhdGEgYnl0ZXMNCjY0IGJ5dGVzIGZyb20gMTAuMS4yLjM6IGljbXBfc2VxPTAgdHRsPTY0 IHRpbWU9MC4xNTQgbXMNCjY0IGJ5dGVzIGZyb20gMTAuMS4yLjM6IGljbXBfc2VxPTEgdHRsPTY0 IHRpbWU9MC4xNDQgbXMNCjY0IGJ5dGVzIGZyb20gMTAuMS4yLjM6IGljbXBfc2VxPTIgdHRsPTY0 IHRpbWU9MC4xNDIgbXMNCg0KLS0tIHIxLWxpbmsxIHBpbmcgc3RhdGlzdGljcyAtLS0NCjMgcGFj a2V0cyB0cmFuc21pdHRlZCwgMyBwYWNrZXRzIHJlY2VpdmVkLCAwLjAlIHBhY2tldCBsb3NzDQpy b3VuZC10cmlwIG1pbi9hdmcvbWF4L3N0ZGRldiA9IDAuMTQyLzAuMTQ3LzAuMTU0LzAuMDA1IG1z DQoNCnJvb3RAcjE6fiAjIHBpbmcgLWMgMyBzMQ0KUElORyBzMS1saW5rMSAoMTAuMS4yLjIpOiA1 NiBkYXRhIGJ5dGVzDQo2NCBieXRlcyBmcm9tIDEwLjEuMi4yOiBpY21wX3NlcT0wIHR0bD02NCB0 aW1lPTAuMTYzIG1zDQo2NCBieXRlcyBmcm9tIDEwLjEuMi4yOiBpY21wX3NlcT0xIHR0bD02NCB0 aW1lPTAuMTQ1IG1zDQo2NCBieXRlcyBmcm9tIDEwLjEuMi4yOiBpY21wX3NlcT0yIHR0bD02NCB0 aW1lPTAuMTQzIG1zDQoNCi0tLSBzMS1saW5rMSBwaW5nIHN0YXRpc3RpY3MgLS0tDQozIHBhY2tl dHMgdHJhbnNtaXR0ZWQsIDMgcGFja2V0cyByZWNlaXZlZCwgMC4wJSBwYWNrZXQgbG9zcw0Kcm91 bmQtdHJpcCBtaW4vYXZnL21heC9zdGRkZXYgPSAwLjE0My8wLjE1MC8wLjE2My8wLjAwOSBtcw0K DQppcGVyZiAtcyAgPD09IGlwZXJmIGNvbW1hbmRAcmVjZWl2ZXINCmlwZXJmIC1jIDEwLjEuMi4z IC1sIDU3OTMgLXcgNTc5MyAtbiAxME0gLW0gLWYgQiAgPD09IGlwZXJmIGNvbW1hbmRAc2VuZGVy DQoNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KQ2xpZW50IGNvbm5lY3RpbmcgdG8gMTAuMS4yLjMsIFRDUCBwb3J0IDUwMDENClRD UCB3aW5kb3cgc2l6ZTogNzI0MCBCeXRlIChXQVJOSU5HOiByZXF1ZXN0ZWQgNTc5MyBCeXRlKQ0K LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tDQpbICAzXSBsb2NhbCAxMC4xLjIuMiBwb3J0IDE2MzM4IGNvbm5lY3RlZCB3aXRoIDEwLjEu Mi4zIHBvcnQgNTAwMQ0KWyBJRF0gSW50ZXJ2YWwgICAgICAgVHJhbnNmZXIgICAgIEJhbmR3aWR0 aA0KWyAgM10gIDAuMC0gMC41IHNlYyAgMTA0OTExMjMgQnl0ZXMgIDIyNjE1NTg5IEJ5dGVzL3Nl Yw0KWyAgM10gTVNTIHNpemUgMTQ0OCBieXRlcyAoTVRVIDE1MDAgYnl0ZXMsIGV0aGVybmV0KQ0K DQpJIHNlbnQgMTBNQnl0ZXMgb2YgZGF0YSwgYW5kIGNvbGxlY3RlZCB0aGUgcGFja2V0IHRyYWNl IGZyb20gYm90aCBub2RlcyBieQ0KdGNwZHVtcC4gSSBkaWQgdGhpcyB0ZXN0IHR3aWNlIHRvIGNv bmZpcm0gdGhlIHJlc3VsdCBjYW4gYmUgcmVwcm9kdWNlZC4NCg0KRnJvbSB0aGUgdHJhY2UgZmls ZXMgb2YgYm90aCBub2RlcyBiZWZvcmUgbXkgY29kZSBjaGFuZ2UsIEkgc2VlIGEgbG90IG9mDQpm cmFjdGlvbmFsIHBhY2tldHMuIFNlZSB0aGUgYXR0YWNoZWQgdHJhY2UgZmlsZXMgaW4NCiJiZWZv cmVfY29kZV9jaGFuZ2UuemlwIi4NCg0KVGhlbiwgSSBkaWQgbXkgY29kZSBjaGFuZ2UgaW4gMTAu MiBzcmMgYnkgY29tbWVudGluZyBvdXQgdGhlIGRhdGEgdHJpbQ0KY29uZGl0aW9uIA0KYmVsb3c6 DQo4NjggICAgICAgICAgICAgICAgICAgICAgICAgLyoNCiA4NjkgKiBQcmV2ZW50IHRoZSBsYXN0 IHNlZ21lbnQgZnJvbSBiZWluZw0KIDg3MCAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmcmFj dGlvbmFsIHVubGVzcyB0aGUgc2VuZCBzb2NrYnVmIGNhbiBiZQ0KIDg3MSAgICAgICAgICAgICAg ICAgICAgICAgICAgKiBlbXB0aWVkOg0KIDg3MiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8N CiA4NzMgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X2xlbiA9ICh0cC0+dF9tYXhvcGQgLSBv cHRsZW4pOw0KIDg3NCAvLyAgICAgICAgICAgICAgICAgICAgICBpZiAoKG9mZiArIGxlbikgPCBz by0+c29fc25kLnNiX2NjKSB7DQogODc1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bW9mZiA9IGxlbiAlIG1heF9sZW47DQogODc2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaWYgKG1vZmYgIT0gMCkgew0KIDg3NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbGVuIC09IG1vZmY7DQogODc4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzZW5kYWxvdCA9IDE7DQogODc5ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfQ0KIDg4MCAvLyAgICAgICAgICAgICAgICAgICAgICB9DQoNCg0KQW5kIEkgZGlkIHRo ZSBzYW1lIGlwZXJmIHRlc3QgYW5kIGdhdGhlcmVkIHRyYWNlIGZpbGVzLiBJIGRpZCBub3QgZmlu ZA0KbWFueSANCmZyYWN0aW9uYWwgcGFja2V0cyB0aGlzIHRpbWUuIFNlZSB0aGUgYXR0YWNoZWQg dHJhY2UgZmlsZXMgaW4NCiJhZnRlcl9jb2RlX2NoYW5nZS56aXAiLg0KDQpDb21wYXJlZCB3aXRo IHRoZSByZWNlaXZlciB0cmFjZXMsIEkgc2VlIHJlY2VpdmVyIGdvdCB0aGUgc2FtZSA3MjUxDQpw YWNrZXRzIGluIA0KdGhlIHR3byB0ZXN0cywgaW5zdGVhZCBvZiA5MDYwIHBhY2tldHMgYmVmb3Jl IHRoZSBjaGFuZ2UuIFRoYXQncyBhIHNhdmUgb2YNCjIwJQ0Kb24gdGhlIHdpcmUuDQoNCkNvbXBh cmVkIHdpdGggdGhlIHNlbmRlciB0cmFjZXMsIEkgc2VlIHNlbmRlcidzIFRTTyBoYW5kbGVkIDIx ODUgcGFja2V0cw0KYW5kIA0KMTgzOSBwYWNrZXRzIGluIHRoZSB0d28gdGVzdHMsIGluc3RlYWQg b2YgNDQ5OCBwYWNrZXRzIGFuZCA0NDczIHBhY2tldHMNCmJlZm9yZSANCnRoZSBjaGFuZ2UuIFRo YXQncyBhbHNvIGEgc2F2ZSBvZiByb3VnaGx5IG1vcmUgdGhhbiA0MCUgb24gdGhlIGhhbmRsaW5n IG9mDQpUU08NCmNodW5rcy4NCg0KVGhlcmUgbWF5IGJlIG90aGVyIGNvbmRpdGlvbnMgSSBkaWQg bm90IGNvdmVyLCBidXQgSSB0aGluayB0aGUgY3VycmVudA0KZGF0YSANCnRyaW1lIGNhbiBiZSBp bXByb3ZlZCBpbiBUU08gYnkgcmVtb3ZpbmcgdGhlIGFib3ZlIGNvbmRpdGlvbi4NCg0KVHJhY2Ug ZmlsZXMgYmVmb3JlL2FmdGVyIGNvZGUgY2hhbmdlIGFyZSBhdHRhY2hlZC4NCg0KDQoNCg0KDQoN Cg== From owner-svn-src-head@freebsd.org Fri Nov 13 23:10:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:11:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:14:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:19:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6321CA2EA9C for ; Fri, 13 Nov 2015 23:19:32 +0000 (UTC) (envelope-from steven@multiplay.co.uk) 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 F03F11363 for ; Fri, 13 Nov 2015 23:19:31 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmww144 with SMTP id w144so47497334wmw.1 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=kqnyg/Xo48O1XDxtdyjqEbQPSkHH86A1vZXFL5FO+ZXzylxvcIm3vUwE5IqqYwmh1n enpDVL6556Ry1mrWI1THWr6tJ4fG7HHzc8Si+DDaf0RSzGwLbboWh9bhFRX6kUwrkKQZ 44BLohW53Zj/sPVxEGbL+7+nQnjWQ2OtIInMoJWEKJ6tb9vQXE+z2quQCmv1A3yrZXlI 46ehsrn4yxvx7uKvGbKwxd5inI7ZnhDbQQGwMuApYkgab3gUOtz5u01Ia7NqtlIzzdYG bwjtmMNLlGDq3Z8vvg67uVf8rYnwIojBtdsqEk2/OFRtUUCq5SFR6SAPG2K7RXlhXH78 Pftg== X-Gm-Message-State: ALoCoQnNtI+luXoxUYy/QU25Un0a0fIjMMZUlLEkHBE3zMHF95wxTwMjISpmlcd0IdHiV3jcK1kQ 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:24:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:26:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E7BDA2EC4A for ; Fri, 13 Nov 2015 23:26:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c: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 1385A19E6 for ; Fri, 13 Nov 2015 23:26:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmdw130 with SMTP id w130so47969198wmd.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=Qj9/5g7404RQjQPBULb643nXuxo62/qYfwC5CW2t8vGJ6PgsD4TPXPg4YscPWjGLiO 88oWlmeZcxrUrbt/4S5CB0U+zywY8bGl9A1nz517k0+vRDH0t4yY3JaqsJNmeW7+pFxn R+Mamcmx89tjI+8YF4UqtteJ/MIyEU6Rn70u3vSIL4IqtT0Y9oNKCbZNPn1qYnoI4643 98UVp93RJ2vI4XQhKsTVjDDP+sMRZwigJG/91noClB1ZlsjVKbboUVKh/xzxhpSZ3guH GTqWIJ2KTO1dLZ5vwrGfQv5LJjcRvwl69+9dbI87W6VSUGrXsw0kuUzyzSHFVn2PnSSq 4hMQ== X-Gm-Message-State: ALoCoQl9fXu/a9Ne+r9YvLsIVDwKJijP7rjcFxvVPyXyMSFaUu4lVKWzgQuL9Cd0TCNgRxZ/pPYn 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:47:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Nov 13 23:52:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Sat Nov 14 00:00:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733FBA2E609 for ; Sat, 14 Nov 2015 00:00:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::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 026BA1D82 for ; Sat, 14 Nov 2015 00:00:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wmec201 with SMTP id c201so104073045wme.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=lLf4I/2H8clXgtkKpcVg9mZijChbp5BKlZxPngp6lra0+WzODzERBD5nIcXViVmDll Wy0Nc0hbM38esfANYo5ByX/oOebnRZZeuCEc73bKxa/ifhCDztETJXSIGecGen7Q8U6N g0yVNjchzFzG9XQ8WA4O7pbVAYHsqiQfM2Pjb9OTSiWVoHFET9Ue1nFCQviqh1lkJxET 1uhLuoAwu1nYTfxhIbimx/9k7awlJBc01n/r4RM9GwN2rSyBrU2n9z1gPDkUx0z13T+l O39vR9GCXkrnWluiJMBJ4bEULTDplFNSxI+LvC128jNyUFg9R1kMfBT1A51X+A/1H3dB yhnA== X-Gm-Message-State: ALoCoQkJ2gt6jKj2S9/exW5lh5KDZXnzL7qN4gj+2zg8ruS54i2Q0qKqFWIR66hdYoJLXtQIAD6w 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 01:23:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 01:40:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 01:45:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 01:45:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 03:05:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 03:23:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 03:24:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 04:50:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 06:18:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 11:32:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 13:34:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 14:56:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 16:06:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 16:12:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 16:15:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 16:18:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 17:20:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 17:22:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 17:26:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 965D7A2FCDD for ; Sat, 14 Nov 2015 17:26:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d: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 418B8161E for ; Sat, 14 Nov 2015 17:26:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkda6 with SMTP id a6so3198651qkd.3 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=TaBkDDM5OmkKaaAaW+5z0ijZxIcIbqKpvYNK6vF6LyCRUIVA4ANVVMgjeaZneUUlkm MTAIdChPT6jt6v7x+wvk0b85cKb6QNH0TPq+/xyai5bVK9SI5gctfNF37fBL8mJh9lnI qI0Gz9sUJRhQqWAAvQM6m9wva0aZKE/jZVracdVvIgPSTf/dPYkPnDCUEozMbYlLEBcu jMSXGPA3Uxaeld837dE+9RKJfGvNf6F7fU1W2E3qSgGp2n83Owgf+75sJq4BpopguGRF rg4K3Am/GT0ibxAFfvfmncOFA33wWm005t0RC5TFrTze75fsrVGvai9Ey76sdSwsOdER BYhA== X-Gm-Message-State: ALoCoQnt7YygoMF7J+kUPLPtA3Hd504QPLY6xVxdjhkWj/krTiT4XK+Z0SGkUDA08MBIjs0jz16b 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 17:26:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 18:16:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 19:47:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 21:01:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 21:25:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 22:46:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:07:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:13:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:24:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:37:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:44:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Nov 14 23:49:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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...