From owner-svn-src-stable-11@freebsd.org Sun Sep 18 02:41:52 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586C6BD61A2; Sun, 18 Sep 2016 02:41: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 1528E994; Sun, 18 Sep 2016 02:41: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 u8I2fpQH085987; Sun, 18 Sep 2016 02:41:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I2fpgU085984; Sun, 18 Sep 2016 02:41:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180241.u8I2fpgU085984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 18 Sep 2016 02:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305909 - in stable/11/cddl/usr.sbin/zfsd: . tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 02:41:52 -0000 Author: ngie Date: Sun Sep 18 02:41:50 2016 New Revision: 305909 URL: https://svnweb.freebsd.org/changeset/base/305909 Log: MFC r305018,r305019,r305020: r305018: Use SRCTOP instead of a homegrown definition for it (SRCDIR) r305019: Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common r305020: Remove redundant declarations and simplify ../ in pathing - TESTSBASE and LOCALBASE are already defined in bsd.tests.mk - TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after r289158. - Replace SRCDIR with SRCTOP Modified: stable/11/cddl/usr.sbin/zfsd/Makefile stable/11/cddl/usr.sbin/zfsd/Makefile.common stable/11/cddl/usr.sbin/zfsd/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/Makefile Sat Sep 17 23:08:49 2016 (r305908) +++ stable/11/cddl/usr.sbin/zfsd/Makefile Sun Sep 18 02:41:50 2016 (r305909) @@ -1,6 +1,5 @@ # $FreeBSD$ -SRCDIR=${.CURDIR}/../../.. .include "Makefile.common" PROG_CXX= zfsd Modified: stable/11/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/Makefile.common Sat Sep 17 23:08:49 2016 (r305908) +++ stable/11/cddl/usr.sbin/zfsd/Makefile.common Sun Sep 18 02:41:50 2016 (r305909) @@ -15,20 +15,20 @@ WARNS?= 3 # Ignore warnings about Solaris specific pragmas. IGNORE_PRAGMA= YES -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzpool/common -INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/include -INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/lib/libumem -INCFLAGS+= -I${SRCDIR}/sys/cddl/compat/opensolaris -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/head -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libuutil/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libumem/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs_core/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libnvpair -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/common/zfs -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/sys +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +INCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +INCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +INCFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} Modified: stable/11/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/zfsd/tests/Makefile Sat Sep 17 23:08:49 2016 (r305908) +++ stable/11/cddl/usr.sbin/zfsd/tests/Makefile Sun Sep 18 02:41:50 2016 (r305909) @@ -1,10 +1,7 @@ # $FreeBSD$ -SRCDIR=${.CURDIR}/../../../.. .include "${.CURDIR}/../Makefile.common" -.PATH: ${.CURDIR}/.. - -TESTSDIR?= ${TESTSBASE}/cddl/usr.sbin/zfsd +.PATH: ${.CURDIR:H} PLAIN_TESTS_CXX= zfsd_unittest SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} @@ -12,7 +9,7 @@ SRCS.zfsd_unittest+= libmocks.c zfsd_un SRCS= # Use #include in test programs. -INCFLAGS+= -I${.CURDIR}/../.. +INCFLAGS+= -I${.CURDIR:H:H} .if defined(DESTDIR) INCFLAGS+= -I${DESTDIR}/usr/include @@ -27,7 +24,6 @@ LIBRARY_PATH= .endif # Googletest options -LOCALBASE?= /usr/local INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a @@ -39,7 +35,4 @@ LDADD.zfsd_unittest+= ${LOCALBASE}/lib/l # https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD -# Install the tests -TESTSBASE?= /usr/tests - .include From owner-svn-src-stable-11@freebsd.org Sun Sep 18 02:45:36 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C1D6BD63B1; Sun, 18 Sep 2016 02:45:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 165E9C8B; Sun, 18 Sep 2016 02:45: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 u8I2jZFH086812; Sun, 18 Sep 2016 02:45:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I2jZq7086810; Sun, 18 Sep 2016 02:45:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180245.u8I2jZq7086810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 18 Sep 2016 02:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305910 - in stable/11/lib/atf: libatf-c libatf-c++ X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 02:45:36 -0000 Author: ngie Date: Sun Sep 18 02:45:35 2016 New Revision: 305910 URL: https://svnweb.freebsd.org/changeset/base/305910 Log: MFC r305033,r305041,r305170: r305033: Minor Makefile simplifications for lib/atf/... - Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP} - Use built-in :H operator instead of ".." when enumerating paths. r305041: Filter certain compile-time options into -DATF_BUILD_* Items filtered through are: - Constant defines (-D) - Include flags (-I) - Linker flags (-L) - Optimization level (-O) - Warnings / linker flags (-W) - Preprocessor options (-f) This fixes the scenario hit by the Jenkins job where it's infecting the build with --sysroot, etc options from the Jenkins build in the tests. Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*]. Requested by: jmmv r305170: Don't bake all of CC/CPP/CXX into CFLAGS Capture executable names for CC, CPP, CXX (assumed to be the first non-CCACHE_BIN word). This change strips out all of the cross-compiler arguments, (-target, -B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it doesn't infect the build and subsequently the test. Add comments noting why this logic is being added, and why the logic in r305041 was necessary/what it was trying to achieve. This is required after recent changes made to the toolchain to always specify --sysroot, -target, -B, etc with clang in buildworld (presumably r304681). Modified: stable/11/lib/atf/libatf-c++/Makefile stable/11/lib/atf/libatf-c/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/atf/libatf-c++/Makefile ============================================================================== --- stable/11/lib/atf/libatf-c++/Makefile Sun Sep 18 02:41:50 2016 (r305909) +++ stable/11/lib/atf/libatf-c++/Makefile Sun Sep 18 02:45:35 2016 (r305910) @@ -35,15 +35,15 @@ SHLIB_MAJOR= 2 # libatf-c++ depends on the C version of the ATF library to build. LIBADD+= atf_c -LDFLAGS+= -L${.OBJDIR}/../libatf-c +LDFLAGS+= -L${.OBJDIR:H}/libatf-c -ATF= ${.CURDIR:H:H:H}/contrib/atf +ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c++ .PATH: ${ATF}/atf-c++/detail CFLAGS+= -I${ATF} -CFLAGS+= -I${.CURDIR}/../libatf-c +CFLAGS+= -I${.CURDIR:H}/libatf-c CFLAGS+= -I. CFLAGS+= -DHAVE_CONFIG_H Modified: stable/11/lib/atf/libatf-c/Makefile ============================================================================== --- stable/11/lib/atf/libatf-c/Makefile Sun Sep 18 02:41:50 2016 (r305909) +++ stable/11/lib/atf/libatf-c/Makefile Sun Sep 18 02:45:35 2016 (r305910) @@ -28,25 +28,37 @@ .include .include -_CFLAGS:= ${CFLAGS} -_CPPFLAGS:= ${CPPFLAGS} -_CXXFLAGS:= ${CXXFLAGS} +# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure other +# values -- like -target, -B ..., etc -- don't get leaked into the tests. +# +# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it gets +# automatically appended to the variables in bsd.compiler.mk when +# ${MK_CCACHE_BUILD} != no. +ATF_BUILD_CC:= ${CC:N${CCACHE_BIN}:[1]} +ATF_BUILD_CPP:= ${CPP:N${CCACHE_BIN}:[1]} +ATF_BUILD_CXX:= ${CXX:N${CCACHE_BIN}:[1]} + +# Only capture defines, includes, linker flags, optimization levels, warnings +# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. +ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} +ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} +ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} LIB= atf-c PRIVATELIB= true SHLIB_MAJOR= 1 -ATF= ${.CURDIR:H:H:H}/contrib/atf +ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail -CFLAGS+= -DATF_BUILD_CC='"${CC}"' -CFLAGS+= -DATF_BUILD_CFLAGS='"${_CFLAGS}"' -CFLAGS+= -DATF_BUILD_CPP='"${CPP}"' -CFLAGS+= -DATF_BUILD_CPPFLAGS='"${_CPPFLAGS}"' -CFLAGS+= -DATF_BUILD_CXX='"${CXX}"' -CFLAGS+= -DATF_BUILD_CXXFLAGS='"${_CXXFLAGS}"' +CFLAGS+= -DATF_BUILD_CC='"${ATF_BUILD_CC}"' +CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' +CFLAGS+= -DATF_BUILD_CPP='"${ATF_BUILD_CPP}"' +CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' +CFLAGS+= -DATF_BUILD_CXX='"${ATF_BUILD_CXX}"' +CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} CFLAGS+= -I. From owner-svn-src-stable-11@freebsd.org Sun Sep 18 02:56:17 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A69CBD66BC; Sun, 18 Sep 2016 02:56:17 +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 375F728D; Sun, 18 Sep 2016 02:56: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 u8I2uGOm090601; Sun, 18 Sep 2016 02:56:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I2uG4f090600; Sun, 18 Sep 2016 02:56:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180256.u8I2uG4f090600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 18 Sep 2016 02:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305912 - stable/11/tests/sys/acl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 02:56:17 -0000 Author: ngie Date: Sun Sep 18 02:56:16 2016 New Revision: 305912 URL: https://svnweb.freebsd.org/changeset/base/305912 Log: MFC r305356: Add a missing "Bail out!" if zpool create fails This will make the exit info more meaningful if/when zpool create fails, and establishes parity with the other 2 zfs acl testcases (01, 03). Modified: stable/11/tests/sys/acl/04.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/acl/04.sh ============================================================================== --- stable/11/tests/sys/acl/04.sh Sun Sep 18 02:51:18 2016 (r305911) +++ stable/11/tests/sys/acl/04.sh Sun Sep 18 02:56:16 2016 (r305912) @@ -50,6 +50,7 @@ MNT=`mktemp -dt acltools` zpool create -m $MNT acltools /dev/$MD if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." + echo 'Bail out!' exit 1 fi From owner-svn-src-stable-11@freebsd.org Sun Sep 18 04:19:44 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85674BDF286; Sun, 18 Sep 2016 04:19:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 384A4FAF; Sun, 18 Sep 2016 04:19:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8I4Jh1D021261; Sun, 18 Sep 2016 04:19:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I4JhTj021260; Sun, 18 Sep 2016 04:19:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180419.u8I4JhTj021260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 18 Sep 2016 04:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305914 - stable/11/tests/sys/mac/bsdextended X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 04:19:44 -0000 Author: ngie Date: Sun Sep 18 04:19:43 2016 New Revision: 305914 URL: https://svnweb.freebsd.org/changeset/base/305914 Log: MFC r305357: Skip testcases 9/10 if jail(8) isn't installed These testcases require jail support Modified: stable/11/tests/sys/mac/bsdextended/matches_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/mac/bsdextended/matches_test.sh ============================================================================== --- stable/11/tests/sys/mac/bsdextended/matches_test.sh Sun Sep 18 03:00:46 2016 (r305913) +++ stable/11/tests/sys/mac/bsdextended/matches_test.sh Sun Sep 18 04:19:43 2016 (r305914) @@ -144,30 +144,36 @@ else fail $desc fi -# -# Subject Match on jail -# -rm -f $playground/test-jail - -desc="subject matching jailid" -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` -ugidfw set 1 subject jailid $jailid object mode rasx -sleep 10 - -if [ -f $playground/test-jail ]; then - fail "TODO $desc: this testcase fails (see bug # 205481)" -else - pass $desc -fi - -rm -f $playground/test-jail -desc="subject nonmatching jailid" -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` -sleep 10 -if [ -f $playground/test-jail ]; then - pass $desc -else - fail $desc +if which jail >/dev/null; then + # + # Subject Match on jail + # + rm -f $playground/test-jail + + desc="subject matching jailid" + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` + ugidfw set 1 subject jailid $jailid object mode rasx + sleep 10 + + if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" + else + pass $desc + fi + + rm -f $playground/test-jail + desc="subject nonmatching jailid" + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` + sleep 10 + if [ -f $playground/test-jail ]; then + pass $desc + else + fail $desc + fi +else + # XXX: kyua is too dumb to parse skip ranges, still.. + pass "skip jail(8) not installed" + pass "skip jail(8) not installed" fi # From owner-svn-src-stable-11@freebsd.org Mon Sep 19 12:34:30 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23C6FBE1CB3; Mon, 19 Sep 2016 12:34:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA888E5F; Mon, 19 Sep 2016 12:34:29 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8JCYTO4052935; Mon, 19 Sep 2016 12:34:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8JCYTUo052934; Mon, 19 Sep 2016 12:34:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609191234.u8JCYTUo052934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 19 Sep 2016 12:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305971 - stable/11/lib/msun/src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2016 12:34:30 -0000 Author: bde Date: Mon Sep 19 12:34:28 2016 New Revision: 305971 URL: https://svnweb.freebsd.org/changeset/base/305971 Log: MFC r305380: Fix missing fmodl() on arches with 53-bit long doubles. PR: 199422, 211965 Modified: stable/11/lib/msun/src/e_fmod.c Modified: stable/11/lib/msun/src/e_fmod.c ============================================================================== --- stable/11/lib/msun/src/e_fmod.c Mon Sep 19 09:15:12 2016 (r305970) +++ stable/11/lib/msun/src/e_fmod.c Mon Sep 19 12:34:28 2016 (r305971) @@ -20,6 +20,8 @@ __FBSDID("$FreeBSD$"); * Method: shift and subtract */ +#include + #include "math.h" #include "math_private.h" @@ -130,3 +132,7 @@ __ieee754_fmod(double x, double y) } return x; /* exact output */ } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(fmod, fmodl); +#endif From owner-svn-src-stable-11@freebsd.org Mon Sep 19 18:58:00 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69D57BE00AF for ; Mon, 19 Sep 2016 18:58:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::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 29B698ED for ; Mon, 19 Sep 2016 18:58:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22b.google.com with SMTP id u82so154796297ywc.2 for ; Mon, 19 Sep 2016 11:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cEPK4PYnnaCY3Z6GN82XRMS9f5gM627duQc+WWrtCuU=; b=Ma2Ve4PWArde7KqFzP+guYQ7G0gs+Zc2hmHg2HVwqxSL6wSZsbX5LUpcM89kJRmhY7 VYHb3FP7QhwWzPCCPAPn67mLo8sAlFWX74DxAS7uuh5vhCda1wy/h7fKs08Jw/4c8z3C bJ2QD6pJERXQroPrlOC1kzu8dGTzVsoSI/IwO7dBHLtPR2FXU1l0a8gCiaLwI2tmEEVl rbdgbrfdbNH1Oc5H6MR5UxELsnhVOBMOf+gf36kAwNJt5mfYmpDBfRUfB/VfGnmdBHzS nIsTTj51N/GJHBHKgLfv3AW/Mg8CMWwC8PQOKPmenHfaEUU7TpIY7j3RSTnaPtJUFtcn neqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cEPK4PYnnaCY3Z6GN82XRMS9f5gM627duQc+WWrtCuU=; b=WHIldTNvMNnlvT3XxoN/q3Pl5BVZUl5jL/vpK9kxq2+gsAUjmKXJUY4cjP9xlaGbcC aNWM3Q+TB6hzTj513b23DT5B6LnLMbu6TP0Pw0rPdbkNSXltHxt72MX0lA+U+GzuPl3X nZ1F07gQllrqY4xtvMGP62WoheZyAV6s7Cp1V22qx4xdL0HBT5UWqhzC1VctLRVYLx6b 1fqtn5jOB2a9ekwbm1OJzOXlrXGlHecLvAnnBhGUAUt4/jHQVK688c1POnrTj06Y+R6j sky64x61vbjPLUQVmHSm3vxkz/F560oaZbJUhscdchvv+GjKmRdDYZMUbdzGi/2AYLfv UJyQ== X-Gm-Message-State: AE9vXwPUCYC/OeBkk+36febgShtBvopc04OJI4DGwVCmPrxBnubjnwnjqk8yEJgTLPi9ZgouTvHriAqZMpSFCA== X-Received: by 10.13.255.69 with SMTP id p66mr28378734ywf.173.1474311479217; Mon, 19 Sep 2016 11:57:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Mon, 19 Sep 2016 11:57:58 -0700 (PDT) In-Reply-To: <201609191234.u8JCYTUo052934@repo.freebsd.org> References: <201609191234.u8JCYTUo052934@repo.freebsd.org> From: Ed Schouten Date: Mon, 19 Sep 2016 20:57:58 +0200 Message-ID: Subject: Re: svn commit: r305971 - stable/11/lib/msun/src To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2016 18:58:00 -0000 Hi Bruce, 2016-09-19 14:34 GMT+02:00 Bruce Evans : > +#if (LDBL_MANT_DIG == 53) > +__weak_reference(fmod, fmodl); > +#endif I've noticed that libm uses __weak_reference() all over the place, but I guess that in this specific case there is no reason to use them, right? Wouldn't it make more sense to use strong references here, so that they are consistent with other architectures? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-stable-11@freebsd.org Tue Sep 20 06:15:03 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A29BE1436; Tue, 20 Sep 2016 06:15:03 +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 A1663FF5; Tue, 20 Sep 2016 06:15:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id EECC6D60C24; Tue, 20 Sep 2016 15:46:20 +1000 (AEST) Date: Tue, 20 Sep 2016 15:46:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r305971 - stable/11/lib/msun/src In-Reply-To: Message-ID: <20160920144731.P1129@besplex.bde.org> References: <201609191234.u8JCYTUo052934@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=6kdLHU8h-LnCs2dJQkkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 06:15:03 -0000 On Mon, 19 Sep 2016, Ed Schouten wrote: > 2016-09-19 14:34 GMT+02:00 Bruce Evans : >> +#if (LDBL_MANT_DIG == 53) >> +__weak_reference(fmod, fmodl); >> +#endif > > I've noticed that libm uses __weak_reference() all over the place, but > I guess that in this specific case there is no reason to use them, > right? Wouldn't it make more sense to use strong references here, so > that they are consistent with other architectures? I just copied what das did here. Weak symbols are less portable in theory but more portable in practice: - the ifdefs depend on compiler support for __strong_reference() but not for __weak_reference - there was apparently no compiler support for __strong_reference() in icc, and it is still not defined if __INTEL_COMPILER (so the hundreds of other __INTEL_COMPILER ifdefs are nonsense, since __strong_reference() is now used all over the place) - __weak_reference() was implemented in FreeBSD in 1994 but __strong_reference() was not implemented until 2000 -- it is barely in FreeBSD-4 - however, it is __strong_reference() that requires less toolchain support. I think just asm() with ".globl" and ".equ" or ".set" would work for it. __weak_reference() needs the less portable ".weak" instead of ".globl". The compiler __alias__ attribute used to define __strong_reference() just generates these directives on x86, except clang spells ".equ" worse as "=" (it even rewrites ".equ" in the asm to "=") and also generates ".type", and gcc-4.2.1 generates ".set" instead of ".equ" (it doesn't rewrite the asm). - at least, with ELF. Old versions of FreeBSD including FreeBSD-3 have even uglier ifdefs for this involving AOUT. Apparently, a magic ".stab" was needed instead of ".weak". A magic ".stab" was also used for aliasing. Perhaps ".equ" was not powerful enough, and IIRC it indeed isn't in my aout implementation (IIRC it is not exported). In direct asm, it is not needed for mere aliases for functions since you can just duplicate labels as needed. The strong reference is also technically more correct in theory but less useful in practice. With non-broken (static) linkers, it gives an error if the user tries to replace the library function by his own function. An error is technically correct. But the user should be allowed to do this. Libraries should have only one API per object file, to allow the user to replace one function at a time (and to not bloat the linked executable with unused functions). libm mostly does this. However, for these aliases, it puts the alias in the same file as the main function for convenience. With strong aliases, this would prevent the user from replacing the alias without also replacing the main function. Compiler support for aliases gives mere aliases. It doesn't generate extra code like the kernel ALTENTRY() macros to disambiguate the aliases for -pg. Compilers should optionally also generate such code (or duplicate the function for small functions) for -g and -finstrument- functions (so that you can put a breakpoint in fmodl() without hitting in when you only call fmod() ...). ALTENTRY() and END() are perhaps not careful enough with ".type" and ".size" directives for the not-quite- alias. Compilers don't generate ".size" for the alias. Bruce From owner-svn-src-stable-11@freebsd.org Tue Sep 20 13:23:10 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B0E9BE10B6; Tue, 20 Sep 2016 13:23:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E070DA02; Tue, 20 Sep 2016 13:23:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8KDN9Sf017569; Tue, 20 Sep 2016 13:23:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8KDN9Ps017568; Tue, 20 Sep 2016 13:23:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201609201323.u8KDN9Ps017568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Sep 2016 13:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306025 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 13:23:10 -0000 Author: ae Date: Tue Sep 20 13:23:08 2016 New Revision: 306025 URL: https://svnweb.freebsd.org/changeset/base/306025 Log: MFC r305778: Fix swap tables between sets when this functional is enabled. We have 6 opcode rewriters for table opcodes. When `set swap' command invoked, it is called for each rewriter, so at the end we get the same result, because opcode rewriter uses ETLV type to match opcode. And all tables opcodes have the same ETLV type. To solve this problem, use separate sets handler for one opcode rewriter. Use it to handle TEST_ALL, SWAP_ALL and MOVE_ALL commands. PR: 212630 Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 20 12:59:30 2016 (r306024) +++ stable/11/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 20 13:23:08 2016 (r306025) @@ -2825,13 +2825,12 @@ table_manage_sets(struct ip_fw_chain *ch switch (cmd) { case SWAP_ALL: case TEST_ALL: + case MOVE_ALL: /* - * Return success for TEST_ALL, since nothing prevents - * move rules from one set to another. All tables are - * accessible from all sets when per-set tables sysctl - * is disabled. + * Always return success, the real action and decision + * should make table_manage_sets_all(). */ - case MOVE_ALL: + return (0); case TEST_ONE: case MOVE_ONE: /* @@ -2856,6 +2855,39 @@ table_manage_sets(struct ip_fw_chain *ch set, new_set, cmd)); } +/* + * We register several opcode rewriters for lookup tables. + * All tables opcodes have the same ETLV type, but different subtype. + * To avoid invoking sets handler several times for XXX_ALL commands, + * we use separate manage_sets handler. O_RECV has the lowest value, + * so it should be called first. + */ +static int +table_manage_sets_all(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, + enum ipfw_sets_cmd cmd) +{ + + switch (cmd) { + case SWAP_ALL: + case TEST_ALL: + /* + * Return success for TEST_ALL, since nothing prevents + * move rules from one set to another. All tables are + * accessible from all sets when per-set tables sysctl + * is disabled. + */ + case MOVE_ALL: + if (V_fw_tables_sets == 0) + return (0); + break; + default: + return (table_manage_sets(ch, set, new_set, cmd)); + } + /* Use generic sets handler when per-set sysctl is enabled. */ + return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, + set, new_set, cmd)); +} + static struct opcode_obj_rewrite opcodes[] = { { .opcode = O_IP_SRC_LOOKUP, @@ -2905,7 +2937,7 @@ static struct opcode_obj_rewrite opcodes .find_byname = table_findbyname, .find_bykidx = table_findbykidx, .create_object = create_table_compat, - .manage_sets = table_manage_sets, + .manage_sets = table_manage_sets_all, }, { .opcode = O_VIA, From owner-svn-src-stable-11@freebsd.org Wed Sep 21 00:06:51 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04062BE3EA5; Wed, 21 Sep 2016 00:06:51 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B084F10B; Wed, 21 Sep 2016 00:06:50 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L06n6K063230; Wed, 21 Sep 2016 00:06:49 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L06n7t063228; Wed, 21 Sep 2016 00:06:49 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201609210006.u8L06n7t063228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Wed, 21 Sep 2016 00:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306060 - stable/11/sys/netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 00:06:51 -0000 Author: karels Date: Wed Sep 21 00:06:49 2016 New Revision: 306060 URL: https://svnweb.freebsd.org/changeset/base/306060 Log: MFC r304713: Fix L2 caching for UDP over IPv6 ip6_output() was missing cache invalidation code analougous to ip_output.c. r304545 disabled L2 caching for UDP/IPv6 as a workaround. This change adds the missing cache invalidation code and reverts r304545. Reviewed by: gnn Approved by: gnn (mentor) Tested by: peter@, Mike Andrews Differential Revision: https://reviews.freebsd.org/D7591 Modified: stable/11/sys/netinet6/ip6_output.c stable/11/sys/netinet6/udp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/ip6_output.c ============================================================================== --- stable/11/sys/netinet6/ip6_output.c Tue Sep 20 23:16:36 2016 (r306059) +++ stable/11/sys/netinet6/ip6_output.c Wed Sep 21 00:06:49 2016 (r306060) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -552,6 +553,9 @@ again: rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; } else { + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; if (fwd_tag == NULL) { bzero(&dst_sa, sizeof(dst_sa)); dst_sa.sin6_family = AF_INET6; @@ -821,6 +825,9 @@ again: } else { RO_RTFREE(ro); needfiblookup = 1; /* Redo the routing table lookup. */ + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; } } /* See if fib was changed by packet filter. */ @@ -829,6 +836,9 @@ again: fibnum = M_GETFIB(m); RO_RTFREE(ro); needfiblookup = 1; + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; } if (needfiblookup) goto again; Modified: stable/11/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/udp6_usrreq.c Tue Sep 20 23:16:36 2016 (r306059) +++ stable/11/sys/netinet6/udp6_usrreq.c Wed Sep 21 00:06:49 2016 (r306060) @@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, NULL, flags, + error = ip6_output(m, optp, &inp->inp_route6, flags, inp->in6p_moptions, NULL, inp); break; case AF_INET: From owner-svn-src-stable-11@freebsd.org Wed Sep 21 08:09:34 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64A2ABE3B94; Wed, 21 Sep 2016 08:09:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 308611B91; Wed, 21 Sep 2016 08:09:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L89XRW043972; Wed, 21 Sep 2016 08:09:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L89XDW043971; Wed, 21 Sep 2016 08:09:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609210809.u8L89XDW043971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Sep 2016 08:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306078 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 08:09:34 -0000 Author: kib Date: Wed Sep 21 08:09:33 2016 New Revision: 306078 URL: https://svnweb.freebsd.org/changeset/base/306078 Log: MFC r305939: Remove trailing space. Modified: stable/11/sys/amd64/amd64/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Wed Sep 21 07:25:05 2016 (r306077) +++ stable/11/sys/amd64/amd64/machdep.c Wed Sep 21 08:09:33 2016 (r306078) @@ -1098,7 +1098,7 @@ add_efi_map_entries(struct efi_map_heade * Boot Services API. */ efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; - map = (struct efi_md *)((uint8_t *)efihdr + efisz); + map = (struct efi_md *)((uint8_t *)efihdr + efisz); if (efihdr->descriptor_size == 0) return; From owner-svn-src-stable-11@freebsd.org Wed Sep 21 08:12:40 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B94BE3D94; Wed, 21 Sep 2016 08:12:40 +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 678691F2C; Wed, 21 Sep 2016 08:12:40 +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 u8L8Cd21047447; Wed, 21 Sep 2016 08:12:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L8Cd26047446; Wed, 21 Sep 2016 08:12:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609210812.u8L8Cd26047446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Sep 2016 08:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306079 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 08:12:40 -0000 Author: kib Date: Wed Sep 21 08:12:39 2016 New Revision: 306079 URL: https://svnweb.freebsd.org/changeset/base/306079 Log: Record mergeinfo for the r305971 commit, merge of r305380 Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-11@freebsd.org Wed Sep 21 09:06:07 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 352DFBE239E; Wed, 21 Sep 2016 09:06:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0745836E; Wed, 21 Sep 2016 09:06:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L966qP067034; Wed, 21 Sep 2016 09:06:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L9664R067033; Wed, 21 Sep 2016 09:06:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609210906.u8L9664R067033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 21 Sep 2016 09:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306084 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 09:06:07 -0000 Author: andrew Date: Wed Sep 21 09:06:06 2016 New Revision: 306084 URL: https://svnweb.freebsd.org/changeset/base/306084 Log: MFC r304892: Print both the kernel read and write translation in DDB when asking for a virtual to physical translation. These may be different, e.g. when a page is mapped as read-only. Sponsored by: ABT Systems Ltd Modified: stable/11/sys/arm64/arm64/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/machdep.c Wed Sep 21 08:54:08 2016 (r306083) +++ stable/11/sys/arm64/arm64/machdep.c Wed Sep 21 09:06:06 2016 (r306084) @@ -1011,7 +1011,9 @@ DB_SHOW_COMMAND(vtop, db_show_vtop) if (have_addr) { phys = arm64_address_translate_s1e1r(addr); - db_printf("Physical address reg: 0x%016lx\n", phys); + db_printf("Physical address reg (read): 0x%016lx\n", phys); + phys = arm64_address_translate_s1e1w(addr); + db_printf("Physical address reg (write): 0x%016lx\n", phys); } else db_printf("show vtop \n"); } From owner-svn-src-stable-11@freebsd.org Wed Sep 21 09:45:15 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5412BE303F; Wed, 21 Sep 2016 09:45:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4C6B9C4; Wed, 21 Sep 2016 09:45:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L9jEmU082125; Wed, 21 Sep 2016 09:45:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L9jEe8082123; Wed, 21 Sep 2016 09:45:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609210945.u8L9jEe8082123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 21 Sep 2016 09:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306085 - in stable/11/sys/arm64: arm64 include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 09:45:15 -0000 Author: andrew Date: Wed Sep 21 09:45:14 2016 New Revision: 306085 URL: https://svnweb.freebsd.org/changeset/base/306085 Log: MFC 305285: Add a pc_clock pcpu field and use it to implement cpu_est_clockrate. This will allow drivers that manage the clock frequency to communicate this with the reset of the kernel. Sponsored by: ABT Systems Ltd Modified: stable/11/sys/arm64/arm64/machdep.c stable/11/sys/arm64/include/pcpu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/machdep.c Wed Sep 21 09:06:06 2016 (r306084) +++ stable/11/sys/arm64/arm64/machdep.c Wed Sep 21 09:45:14 2016 (r306085) @@ -407,8 +407,17 @@ cpu_flush_dcache(void *ptr, size_t len) int cpu_est_clockrate(int cpu_id, uint64_t *rate) { + struct pcpu *pc; - panic("ARM64TODO: cpu_est_clockrate"); + pc = pcpu_find(cpu_id); + if (pc == NULL || rate == NULL) + return (EINVAL); + + if (pc->pc_clock == 0) + return (EOPNOTSUPP); + + *rate = pc->pc_clock; + return (0); } void Modified: stable/11/sys/arm64/include/pcpu.h ============================================================================== --- stable/11/sys/arm64/include/pcpu.h Wed Sep 21 09:06:06 2016 (r306084) +++ stable/11/sys/arm64/include/pcpu.h Wed Sep 21 09:45:14 2016 (r306085) @@ -38,7 +38,8 @@ #define PCPU_MD_FIELDS \ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_midr; /* stored MIDR value */ \ - char __pad[121] + uint64_t pc_clock; \ + char __pad[113] #ifdef _KERNEL From owner-svn-src-stable-11@freebsd.org Wed Sep 21 09:50:52 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03128BE3252; Wed, 21 Sep 2016 09:50:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7EE4CA0; Wed, 21 Sep 2016 09:50:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L9opCx083074; Wed, 21 Sep 2016 09:50:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L9op73083073; Wed, 21 Sep 2016 09:50:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609210950.u8L9op73083073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 21 Sep 2016 09:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306086 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 09:50:52 -0000 Author: andrew Date: Wed Sep 21 09:50:50 2016 New Revision: 306086 URL: https://svnweb.freebsd.org/changeset/base/306086 Log: MFC 304799: Map coherent memory in a non-coherent dma tag as uncached. This is similar to what the 32-bit arm code does, with the exception that it always assumes the tag is non-coherent. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm64/arm64/busdma_bounce.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- stable/11/sys/arm64/arm64/busdma_bounce.c Wed Sep 21 09:45:14 2016 (r306085) +++ stable/11/sys/arm64/arm64/busdma_bounce.c Wed Sep 21 09:50:50 2016 (r306086) @@ -438,6 +438,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm mflags |= M_ZERO; if (flags & BUS_DMA_NOCACHE) attr = VM_MEMATTR_UNCACHEABLE; + else if ((flags & BUS_DMA_COHERENT) != 0 && + (dmat->bounce_flags & BF_COHERENT) == 0) + /* + * If we have a non-coherent tag, and are trying to allocate + * a coherent block of memory it needs to be uncached. + */ + attr = VM_MEMATTR_UNCACHEABLE; else attr = VM_MEMATTR_DEFAULT; From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:05:48 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54113BE45D3; Wed, 21 Sep 2016 16:05:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1551493D; Wed, 21 Sep 2016 16:05:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LG5lah029402; Wed, 21 Sep 2016 16:05:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LG5le9029401; Wed, 21 Sep 2016 16:05:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211605.u8LG5le9029401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306110 - stable/11/sys/dev/amdsbwd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:05:48 -0000 Author: avg Date: Wed Sep 21 16:05:47 2016 New Revision: 306110 URL: https://svnweb.freebsd.org/changeset/base/306110 Log: MFC r305535: amdsbwd: add support for FCH in family 16h models 30h-3Fh processors Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/11/sys/dev/amdsbwd/amdsbwd.c Wed Sep 21 15:47:40 2016 (r306109) +++ stable/11/sys/dev/amdsbwd/amdsbwd.c Wed Sep 21 16:05:47 2016 (r306110) @@ -108,6 +108,21 @@ __FBSDID("$FreeBSD$"); #define AMDSB8_SMBUS_REVID 0x40 #define AMDHUDSON_SMBUS_DEVID 0x780b1022 #define AMDKERNCZ_SMBUS_DEVID 0x790b1022 +/* BKDG Family 16h Models 30h - 3Fh */ +#define AMDFCH16H3XH_PM_WDT_EN 0x00 +#define AMDFCH_WDT_DEC_EN 0x80 +#define AMDFCH16H3XH_PM_WDT_CTRL 0x03 +#define AMDFCH_WDT_RES_MASK 0x03 +#define AMDFCH_WDT_RES_32US 0x00 +#define AMDFCH_WDT_RES_10MS 0x01 +#define AMDFCH_WDT_RES_100MS 0x02 +#define AMDFCH_WDT_RES_1S 0x03 +#define AMDFCH_WDT_ENABLE_MASK 0x0c +#define AMDFCH_WDT_ENABLE 0x00 +#define AMDFCH16H3XH_PM_MMIO_CTRL 0x04 +#define AMDFCH_WDT_MMIO_EN 0x02 +#define AMDFCH16H3XH_WDT_ADDR1 0xfed80b00u +#define AMDFCH16H3XH_WDT_ADDR2 0xfeb00000u #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -295,8 +310,8 @@ amdsbwd_identify(driver_t *driver, devic static void amdsbwd_probe_sb7xx(device_t dev, struct resource *pmres, uint32_t *addr) { - uint32_t val; - int i; + uint8_t val; + int i; /* Report cause of previous reset for user's convenience. */ val = pmio_read(pmres, AMDSB_PM_RESET_STATUS0); @@ -336,8 +351,8 @@ amdsbwd_probe_sb7xx(device_t dev, struct static void amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr) { - uint32_t val; - int i; + uint8_t val; + int i; /* Report cause of previous reset for user's convenience. */ val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0); @@ -363,7 +378,7 @@ amdsbwd_probe_sb8xx(device_t dev, struct pmio_write(pmres, AMDSB8_PM_WDT_CTRL, val); #ifdef AMDSBWD_DEBUG val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL); - amdsbwd_verbose_printf(dev, "AMDSB8_PM_WDT_CTRL value = %#02x\n", val); + amdsbwd_verbose_printf(dev, "AMDSB8_PM_WDT_CTRL value = %#04x\n", val); #endif /* @@ -376,11 +391,56 @@ amdsbwd_probe_sb8xx(device_t dev, struct pmio_write(pmres, AMDSB8_PM_WDT_EN, val); #ifdef AMDSBWD_DEBUG val = pmio_read(pmres, AMDSB8_PM_WDT_EN); - device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); + device_printf(dev, "AMDSB8_PM_WDT_EN value = %#04x\n", val); #endif device_set_desc(dev, "AMD SB8xx/SB9xx/Axx Watchdog Timer"); } +static void +amdsbwd_probe_fch_16h_3xh(device_t dev, struct resource *pmres, uint32_t *addr) +{ + uint8_t val; + + val = pmio_read(pmres, AMDFCH16H3XH_PM_MMIO_CTRL); + if ((val & AMDFCH_WDT_MMIO_EN) != 0) { + /* Fixed offset for the watchdog within ACPI MMIO range. */ + amdsbwd_verbose_printf(dev, "ACPI MMIO range is enabled\n"); + *addr = AMDFCH16H3XH_WDT_ADDR1; + } else { + /* + * Enable decoding of watchdog MMIO address. + */ + val = pmio_read(pmres, AMDFCH16H3XH_PM_WDT_EN); + val |= AMDFCH_WDT_DEC_EN; + pmio_write(pmres, AMDFCH16H3XH_PM_WDT_EN, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDFCH16H3XH_PM_WDT_EN); + device_printf(dev, "AMDFCH16H3XH_PM_WDT_EN value = %#04x\n", + val); +#endif + + /* Special fixed MMIO range for the watchdog. */ + *addr = AMDFCH16H3XH_WDT_ADDR2; + } + + /* + * Set watchdog timer tick to 1s and + * enable the watchdog device (in stopped state). + */ + val = pmio_read(pmres, AMDFCH16H3XH_PM_WDT_CTRL); + val &= ~AMDFCH_WDT_RES_MASK; + val |= AMDFCH_WDT_RES_1S; + val &= ~AMDFCH_WDT_ENABLE_MASK; + val |= AMDFCH_WDT_ENABLE; + pmio_write(pmres, AMDFCH16H3XH_PM_WDT_CTRL, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDFCH16H3XH_PM_WDT_CTRL); + amdsbwd_verbose_printf(dev, "AMDFCH16H3XH_PM_WDT_CTRL value = %#04x\n", + val); +#endif + device_set_desc(dev, "AMD FCH Rev 42h+ Watchdog Timer"); +} + static int amdsbwd_probe(device_t dev) { @@ -389,6 +449,8 @@ amdsbwd_probe(device_t dev) uint32_t addr; int rid; int rc; + uint32_t devid; + uint8_t revid; /* Do not claim some ISA PnP device by accident. */ if (isa_get_logicalid(dev) != 0) @@ -410,11 +472,15 @@ amdsbwd_probe(device_t dev) smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_devid(smb_dev) == AMDSB_SMBUS_DEVID && - pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + devid = pci_get_devid(smb_dev); + revid = pci_get_revid(smb_dev); + if (devid == AMDSB_SMBUS_DEVID && revid < AMDSB8_SMBUS_REVID) amdsbwd_probe_sb7xx(dev, res, &addr); - else + else if (devid == AMDSB_SMBUS_DEVID || devid == AMDKERNCZ_SMBUS_DEVID || + (devid == AMDHUDSON_SMBUS_DEVID && revid < 0x42)) amdsbwd_probe_sb8xx(dev, res, &addr); + else + amdsbwd_probe_fch_16h_3xh(dev, res, &addr); bus_release_resource(dev, SYS_RES_IOPORT, rid, res); bus_delete_resource(dev, SYS_RES_IOPORT, rid); @@ -439,14 +505,11 @@ amdsbwd_probe(device_t dev) static int amdsbwd_attach_sb(device_t dev, struct amdsbwd_softc *sc) { - device_t smb_dev; sc->max_ticks = UINT16_MAX; sc->rid_ctrl = 0; sc->rid_count = 1; - smb_dev = pci_find_bsf(0, 20, 0); - KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); sc->ms_per_tick = 1000; sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:12:28 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 348EBBE47FB; Wed, 21 Sep 2016 16:12:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04683FC2; Wed, 21 Sep 2016 16:12:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGCRU5033229; Wed, 21 Sep 2016 16:12:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGCRpE033228; Wed, 21 Sep 2016 16:12:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211612.u8LGCRpE033228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306112 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:12:28 -0000 Author: avg Date: Wed Sep 21 16:12:26 2016 New Revision: 306112 URL: https://svnweb.freebsd.org/changeset/base/306112 Log: MFC r303111: Document list of supported chipsets. Modified: stable/11/share/man/man4/intpm.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/intpm.4 ============================================================================== --- stable/11/share/man/man4/intpm.4 Wed Sep 21 16:06:00 2016 (r306111) +++ stable/11/share/man/man4/intpm.4 Wed Sep 21 16:12:26 2016 (r306112) @@ -24,25 +24,39 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 1999 +.Dd July 20, 2016 .Dt INTPM 4 .Os .Sh NAME .Nm intpm .Nd Intel PIIX4 Power Management controller driver .Sh SYNOPSIS +.Cd device pci .Cd device smbus .Cd device smb .Cd device intpm .Sh DESCRIPTION -This driver provides access to -.Tn Intel PIIX4 PCI Controller function 3 , -Power management controller. -Currently, only smbus controller -function is implemented. -But it also have bus idle monitoring function. -It -will display mapped I/O address for bus monitoring function when attaching. +The +.Nm +driver provides access to +.Tn Intel PIIX4 +compatible Power Management controllers. +Currently, only +.Xr smbus 4 +controller function is implemented. +.Sh HARDWARE +The +.Nm +driver supports the following chipsets: +.Pp +.Bl -bullet -compact +.It +Intel 82371AB/82443MX +.It +ATI IXP400 +.It +AMD SB600/700/710/750 +.El .Sh SEE ALSO .Xr smb 4 , .Xr smbus 4 From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:14:00 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1574CBE48DE; Wed, 21 Sep 2016 16:14:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCC2398; Wed, 21 Sep 2016 16:13:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGDxKK033392; Wed, 21 Sep 2016 16:13:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGDwpa033387; Wed, 21 Sep 2016 16:13:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211613.u8LGDwpa033387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306114 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:14:00 -0000 Author: avg Date: Wed Sep 21 16:13:58 2016 New Revision: 306114 URL: https://svnweb.freebsd.org/changeset/base/306114 Log: MFC r303113: Cross-link some SMBus controller drivers man pages. Modified: stable/11/share/man/man4/amdpm.4 stable/11/share/man/man4/amdsmb.4 stable/11/share/man/man4/ichsmb.4 stable/11/share/man/man4/intpm.4 stable/11/share/man/man4/ismt.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/amdpm.4 ============================================================================== --- stable/11/share/man/man4/amdpm.4 Wed Sep 21 16:12:34 2016 (r306113) +++ stable/11/share/man/man4/amdpm.4 Wed Sep 21 16:13:58 2016 (r306114) @@ -51,6 +51,7 @@ for writing user code to fetch voltages, monitoring chip of your mainboard. .Sh SEE ALSO .Xr amdsmb 4 , +.Xr intpm 4 , .Xr smb 4 , .Xr smbus 4 .Sh HISTORY Modified: stable/11/share/man/man4/amdsmb.4 ============================================================================== --- stable/11/share/man/man4/amdsmb.4 Wed Sep 21 16:12:34 2016 (r306113) +++ stable/11/share/man/man4/amdsmb.4 Wed Sep 21 16:13:58 2016 (r306114) @@ -31,6 +31,7 @@ .Nm amdsmb .Nd "AMD-8111 SMBus 2.0 controller driver" .Sh SYNOPSIS +.Cd "device pci" .Cd "device smbus" .Cd "device smb" .Cd "device amdsmb" @@ -39,6 +40,8 @@ The .Nm driver provides access to the AMD-8111 SMBus 2.0 controller. .Sh SEE ALSO +.Xr amdpm 4 , +.Xr intpm 4 , .Xr smb 4 , .Xr smbus 4 .Sh HISTORY Modified: stable/11/share/man/man4/ichsmb.4 ============================================================================== --- stable/11/share/man/man4/ichsmb.4 Wed Sep 21 16:12:34 2016 (r306113) +++ stable/11/share/man/man4/ichsmb.4 Wed Sep 21 16:13:58 2016 (r306114) @@ -51,6 +51,8 @@ device contained in the Intel 82801AA (I 82801BA (ICH2), 82801CA (ICH3), 82801DC (ICH4), 82801EB (ICH5), 82801FB (ICH6) and 82801GB (ICH7) PCI chips. .Sh SEE ALSO +.Xr intpm 4 , +.Xr ismt 4 , .Xr smb 4 , .Xr smbus 4 .Sh AUTHORS Modified: stable/11/share/man/man4/intpm.4 ============================================================================== --- stable/11/share/man/man4/intpm.4 Wed Sep 21 16:12:34 2016 (r306113) +++ stable/11/share/man/man4/intpm.4 Wed Sep 21 16:13:58 2016 (r306114) @@ -58,6 +58,9 @@ ATI IXP400 AMD SB600/700/710/750 .El .Sh SEE ALSO +.Xr amdpm 4 , +.Xr amdsmb 4 , +.Xr ichsmb 4 , .Xr smb 4 , .Xr smbus 4 .Sh HISTORY Modified: stable/11/share/man/man4/ismt.4 ============================================================================== --- stable/11/share/man/man4/ismt.4 Wed Sep 21 16:12:34 2016 (r306113) +++ stable/11/share/man/man4/ismt.4 Wed Sep 21 16:13:58 2016 (r306114) @@ -48,6 +48,7 @@ This driver provides access to the SMBus 2.0 controller device contained in the Intel Atom S1200 and C2000 CPUs. .Sh SEE ALSO +.Xr ichsmb 4 , .Xr smb 4 , .Xr smbus 4 .Sh HISTORY From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:15:31 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EB5BE4997; Wed, 21 Sep 2016 16:15:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C268A90A; Wed, 21 Sep 2016 16:15:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGFVXG033565; Wed, 21 Sep 2016 16:15:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGFV4E033564; Wed, 21 Sep 2016 16:15:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211615.u8LGFV4E033564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306116 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:15:32 -0000 Author: avg Date: Wed Sep 21 16:15:30 2016 New Revision: 306116 URL: https://svnweb.freebsd.org/changeset/base/306116 Log: MFC r305596: intpm.4 update supported hardware list Modified: stable/11/share/man/man4/intpm.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/intpm.4 ============================================================================== --- stable/11/share/man/man4/intpm.4 Wed Sep 21 16:14:02 2016 (r306115) +++ stable/11/share/man/man4/intpm.4 Wed Sep 21 16:15:30 2016 (r306116) @@ -55,7 +55,11 @@ Intel 82371AB/82443MX .It ATI IXP400 .It -AMD SB600/700/710/750 +AMD SB600/7x0/8x0/9x0 southbridges +.It +AMD Axx/Hudson/Bolton FCHs +.It +AMD FCH integrated into Family 16h Models 00h-0Fh Processors .El .Sh SEE ALSO .Xr amdpm 4 , From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:17:18 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71DE0BE4A5B; Wed, 21 Sep 2016 16:17:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44221BE4; Wed, 21 Sep 2016 16:17:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGHHOU033733; Wed, 21 Sep 2016 16:17:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGHHGE033732; Wed, 21 Sep 2016 16:17:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211617.u8LGHHGE033732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306118 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:17:18 -0000 Author: avg Date: Wed Sep 21 16:17:17 2016 New Revision: 306118 URL: https://svnweb.freebsd.org/changeset/base/306118 Log: MFC r305600: amdsbwd.4: update supported hardware list Modified: stable/11/share/man/man4/amdsbwd.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/amdsbwd.4 ============================================================================== --- stable/11/share/man/man4/amdsbwd.4 Wed Sep 21 16:15:35 2016 (r306117) +++ stable/11/share/man/man4/amdsbwd.4 Wed Sep 21 16:17:17 2016 (r306118) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2016 +.Dd September 8, 2016 .Dt AMDSBWD 4 .Os .Sh NAME @@ -51,7 +51,22 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600, SB7xx, SB8xx and SB9xx southbridges and Axx FCHs. +the supported chipsets. +.Sh HARDWARE +The +.Nm +driver supports the following chipsets: +.Pp +.Bl -bullet -compact +.It +AMD SB600/7x0/8x0/9x0 southbridges +.It +AMD Axx/Hudson/Bolton FCHs +.It +AMD FCHs integrated into Family 15h Models 60h-6Fh, 70h-7Fh Processors +.It +AMD FCHs integrated into Family 16h Models 00h-0Fh, 30h-3Fh Processors +.El .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:19:28 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49567BE4B3C; Wed, 21 Sep 2016 16:19:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BDE0EF3; Wed, 21 Sep 2016 16:19:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGJR0B033912; Wed, 21 Sep 2016 16:19:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGJRf8033911; Wed, 21 Sep 2016 16:19:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211619.u8LGJRf8033911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306120 - stable/11/sys/dev/intpm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:19:28 -0000 Author: avg Date: Wed Sep 21 16:19:27 2016 New Revision: 306120 URL: https://svnweb.freebsd.org/changeset/base/306120 Log: MFC r305603: intpm: do not try attaching to unsupported controller revisions Modified: stable/11/sys/dev/intpm/intpm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/intpm/intpm.c ============================================================================== --- stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:17:22 2016 (r306119) +++ stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:19:27 2016 (r306120) @@ -104,9 +104,12 @@ intsmb_probe(device_t dev) device_set_desc(dev, "ATI IXP400 SMBus Controller"); break; case 0x43851002: - case 0x780b1022: /* AMD Hudson */ - device_set_desc(dev, "AMD SB600/7xx/8xx SMBus Controller"); - /* XXX Maybe force polling right here? */ + device_set_desc(dev, "AMD SB600/7xx/8xx/9xx SMBus Controller"); + break; + case 0x780b1022: /* AMD FCH */ + if (pci_get_revid(dev) < 0x40) + return (ENXIO); + device_set_desc(dev, "AMD FCH SMBus Controller"); break; default: return (ENXIO); From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:27:01 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EF5BE4E16; Wed, 21 Sep 2016 16:27:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFDE11641; Wed, 21 Sep 2016 16:27:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGR0iY038119; Wed, 21 Sep 2016 16:27:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGR0SN038118; Wed, 21 Sep 2016 16:27:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211627.u8LGR0SN038118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306122 - stable/11/sys/dev/intpm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:27:01 -0000 Author: avg Date: Wed Sep 21 16:26:59 2016 New Revision: 306122 URL: https://svnweb.freebsd.org/changeset/base/306122 Log: MFC r305604: intpm: better clean up resources after a failed attachment Modified: stable/11/sys/dev/intpm/intpm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/intpm/intpm.c ============================================================================== --- stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:23:31 2016 (r306121) +++ stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:26:59 2016 (r306122) @@ -199,6 +199,23 @@ sb8xx_attach(device_t dev) return (0); } +static void +intsmb_release_resources(device_t dev) +{ + struct intsmb_softc *sc = device_get_softc(dev); + + if (sc->smbus) + device_delete_child(dev, sc->smbus); + if (sc->irq_hand) + bus_teardown_intr(dev, sc->irq_res, sc->irq_hand); + if (sc->irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->io_res) + bus_release_resource(dev, SYS_RES_IOPORT, sc->io_rid, + sc->io_res); + mtx_destroy(&sc->lock); +} + static int intsmb_attach(device_t dev) { @@ -309,12 +326,15 @@ no_intr: sc->isbusy = 0; sc->smbus = device_add_child(dev, "smbus", -1); if (sc->smbus == NULL) { + device_printf(dev, "failed to add smbus child\n"); error = ENXIO; goto fail; } error = device_probe_and_attach(sc->smbus); - if (error) + if (error) { + device_printf(dev, "failed to probe+attach smbus child\n"); goto fail; + } #ifdef ENABLE_ALART /* Enable Arart */ @@ -323,30 +343,22 @@ no_intr: return (0); fail: - intsmb_detach(dev); + intsmb_release_resources(dev); return (error); } static int intsmb_detach(device_t dev) { - struct intsmb_softc *sc = device_get_softc(dev); int error; error = bus_generic_detach(dev); - if (error) + if (error) { + device_printf(dev, "bus detach failed\n"); return (error); + } - if (sc->smbus) - device_delete_child(dev, sc->smbus); - if (sc->irq_hand) - bus_teardown_intr(dev, sc->irq_res, sc->irq_hand); - if (sc->irq_res) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); - if (sc->io_res) - bus_release_resource(dev, SYS_RES_IOPORT, sc->io_rid, - sc->io_res); - mtx_destroy(&sc->lock); + intsmb_release_resources(dev); return (0); } From owner-svn-src-stable-11@freebsd.org Wed Sep 21 16:29:06 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145C8BE4FA0; Wed, 21 Sep 2016 16:29:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D58C41977; Wed, 21 Sep 2016 16:29:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LGT5oo038401; Wed, 21 Sep 2016 16:29:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGT5bV038400; Wed, 21 Sep 2016 16:29:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211629.u8LGT5bV038400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 16:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306124 - stable/11/sys/dev/intpm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:29:06 -0000 Author: avg Date: Wed Sep 21 16:29:04 2016 New Revision: 306124 URL: https://svnweb.freebsd.org/changeset/base/306124 Log: MFC r305606: intpm: make sure to register smbus driver before intpm driver Modified: stable/11/sys/dev/intpm/intpm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/intpm/intpm.c ============================================================================== --- stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:27:09 2016 (r306123) +++ stable/11/sys/dev/intpm/intpm.c Wed Sep 21 16:29:04 2016 (r306124) @@ -922,7 +922,8 @@ static driver_t intsmb_driver = { sizeof(struct intsmb_softc), }; -DRIVER_MODULE(intsmb, pci, intsmb_driver, intsmb_devclass, 0, 0); +DRIVER_MODULE_ORDERED(intsmb, pci, intsmb_driver, intsmb_devclass, 0, 0, + SI_ORDER_ANY); DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0); MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(intsmb, 1); From owner-svn-src-stable-11@freebsd.org Wed Sep 21 19:52:00 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54E97BE46A0; Wed, 21 Sep 2016 19:52:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B33DC7; Wed, 21 Sep 2016 19:52:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LJpxhY018484; Wed, 21 Sep 2016 19:51:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LJpxdL018483; Wed, 21 Sep 2016 19:51:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211951.u8LJpxdL018483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 21 Sep 2016 19:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306140 - stable/11/sys/dev/intpm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 19:52:00 -0000 Author: avg Date: Wed Sep 21 19:51:59 2016 New Revision: 306140 URL: https://svnweb.freebsd.org/changeset/base/306140 Log: MFC r305602: intpm: fix attachment to supported AMD FCHs Modified: stable/11/sys/dev/intpm/intpm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/intpm/intpm.c ============================================================================== --- stable/11/sys/dev/intpm/intpm.c Wed Sep 21 19:48:07 2016 (r306139) +++ stable/11/sys/dev/intpm/intpm.c Wed Sep 21 19:51:59 2016 (r306140) @@ -238,10 +238,12 @@ intsmb_attach(device_t dev) break; #endif case 0x43851002: - case 0x780b1022: if (pci_get_revid(dev) >= 0x40) sc->sb8xx = 1; break; + case 0x780b1022: + sc->sb8xx = 1; + break; } if (sc->sb8xx) { From owner-svn-src-stable-11@freebsd.org Thu Sep 22 03:28:44 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 467C3BE281E; Thu, 22 Sep 2016 03:28:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 246938C4; Thu, 22 Sep 2016 03:28:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M3Shi6088253; Thu, 22 Sep 2016 03:28:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3Sh5J088251; Thu, 22 Sep 2016 03:28:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220328.u8M3Sh5J088251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Sep 2016 03:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306150 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:28:44 -0000 Author: mav Date: Thu Sep 22 03:28:43 2016 New Revision: 306150 URL: https://svnweb.freebsd.org/changeset/base/306150 Log: MFC r305591: Decode ATA Status Return descriptor. Modified: stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/cam/scsi/scsi_all.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 00:25:23 2016 (r306149) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 03:28:43 2016 (r306150) @@ -4652,6 +4652,53 @@ scsi_sense_progress_sbuf(struct sbuf *sb scsi_progress_sbuf(sb, progress_val); } +void +scsi_sense_ata_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, + u_int sense_len, uint8_t *cdb, int cdb_len, + struct scsi_inquiry_data *inq_data, + struct scsi_sense_desc_header *header) +{ + struct scsi_sense_ata_ret_desc *res; + + res = (struct scsi_sense_ata_ret_desc *)header; + + sbuf_printf(sb, "ATA status: %02x (%s%s%s%s%s%s%s%s), ", + res->status, + (res->status & 0x80) ? "BSY " : "", + (res->status & 0x40) ? "DRDY " : "", + (res->status & 0x20) ? "DF " : "", + (res->status & 0x10) ? "SERV " : "", + (res->status & 0x08) ? "DRQ " : "", + (res->status & 0x04) ? "CORR " : "", + (res->status & 0x02) ? "IDX " : "", + (res->status & 0x01) ? "ERR" : ""); + if (res->status & 1) { + sbuf_printf(sb, "error: %02x (%s%s%s%s%s%s%s%s), ", + res->error, + (res->error & 0x80) ? "ICRC " : "", + (res->error & 0x40) ? "UNC " : "", + (res->error & 0x20) ? "MC " : "", + (res->error & 0x10) ? "IDNF " : "", + (res->error & 0x08) ? "MCR " : "", + (res->error & 0x04) ? "ABRT " : "", + (res->error & 0x02) ? "NM " : "", + (res->error & 0x01) ? "ILI" : ""); + } + + if (res->flags & SSD_DESC_ATA_FLAG_EXTEND) { + sbuf_printf(sb, "count: %02x%02x, ", + res->count_15_8, res->count_7_0); + sbuf_printf(sb, "LBA: %02x%02x%02x%02x%02x%02x, ", + res->lba_47_40, res->lba_39_32, res->lba_31_24, + res->lba_23_16, res->lba_15_8, res->lba_7_0); + } else { + sbuf_printf(sb, "count: %02x, ", res->count_7_0); + sbuf_printf(sb, "LBA: %02x%02x%02x, ", + res->lba_23_16, res->lba_15_8, res->lba_7_0); + } + sbuf_printf(sb, "device: %02x, ", res->device); +} + /* * Generic sense descriptor printing routine. This is used when we have * not yet implemented a specific printing routine for this descriptor. @@ -4698,6 +4745,7 @@ struct scsi_sense_desc_printer { {SSD_DESC_FRU, scsi_sense_fru_sbuf}, {SSD_DESC_STREAM, scsi_sense_stream_sbuf}, {SSD_DESC_BLOCK, scsi_sense_block_sbuf}, + {SSD_DESC_ATA, scsi_sense_ata_sbuf}, {SSD_DESC_PROGRESS, scsi_sense_progress_sbuf} }; Modified: stable/11/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.h Thu Sep 22 00:25:23 2016 (r306149) +++ stable/11/sys/cam/scsi/scsi_all.h Thu Sep 22 03:28:43 2016 (r306150) @@ -3682,6 +3682,10 @@ void scsi_sense_progress_sbuf(struct sbu u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header); +void scsi_sense_ata_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, + u_int sense_len, uint8_t *cdb, int cdb_len, + struct scsi_inquiry_data *inq_data, + struct scsi_sense_desc_header *header); void scsi_sense_generic_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, From owner-svn-src-stable-11@freebsd.org Thu Sep 22 03:29:48 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27DABE2920; Thu, 22 Sep 2016 03:29:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1742A33; Thu, 22 Sep 2016 03:29:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M3TlQe088349; Thu, 22 Sep 2016 03:29:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3TlIh088348; Thu, 22 Sep 2016 03:29:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220329.u8M3TlIh088348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Sep 2016 03:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306151 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:29:48 -0000 Author: mav Date: Thu Sep 22 03:29:47 2016 New Revision: 306151 URL: https://svnweb.freebsd.org/changeset/base/306151 Log: MFC r305608: "ATA pass through information available" is not an error. Modified: stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 03:28:43 2016 (r306150) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 03:29:47 2016 (r306151) @@ -1056,7 +1056,7 @@ static struct asc_table_entry asc_table[ { SST(0x00, 0x1C, SS_RDEF, /* XXX TBD */ "Verify operation in progress") }, /* DT B */ - { SST(0x00, 0x1D, SS_RDEF, /* XXX TBD */ + { SST(0x00, 0x1D, SS_NOP, "ATA pass through information available") }, /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ From owner-svn-src-stable-11@freebsd.org Thu Sep 22 03:30:30 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B798BE29F5; Thu, 22 Sep 2016 03:30:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF8BCBA7; Thu, 22 Sep 2016 03:30:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M3UTPm088450; Thu, 22 Sep 2016 03:30:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3UT9X088449; Thu, 22 Sep 2016 03:30:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220330.u8M3UT9X088449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Sep 2016 03:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306152 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:30:30 -0000 Author: mav Date: Thu Sep 22 03:30:28 2016 New Revision: 306152 URL: https://svnweb.freebsd.org/changeset/base/306152 Log: MFC r305609: "Extended copy information available" is not an error either. Modified: stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 03:29:47 2016 (r306151) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Sep 22 03:30:28 2016 (r306152) @@ -1065,7 +1065,7 @@ static struct asc_table_entry asc_table[ { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ "Logical unit transitioning to another power condition") }, /* DT P B */ - { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + { SST(0x00, 0x20, SS_NOP, "Extended copy information available") }, /* D */ { SST(0x00, 0x21, SS_RDEF, /* XXX TBD */ From owner-svn-src-stable-11@freebsd.org Thu Sep 22 03:31:15 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC65BE2ABD; Thu, 22 Sep 2016 03:31:15 +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 A9C2ED9C; Thu, 22 Sep 2016 03:31:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M3VECZ089999; Thu, 22 Sep 2016 03:31:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3VEJb089998; Thu, 22 Sep 2016 03:31:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220331.u8M3VEJb089998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Sep 2016 03:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306153 - stable/11/sys/cam X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:31:16 -0000 Author: mav Date: Thu Sep 22 03:31:14 2016 New Revision: 306153 URL: https://svnweb.freebsd.org/changeset/base/306153 Log: MFC r305610: Don't report to devd statuses that CAM doesn't consider errors. Some statuses, such as "ATA pass through information available", are part part of absolutely normal operation and do not worth reporting. Modified: stable/11/sys/cam/cam_periph.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_periph.c ============================================================================== --- stable/11/sys/cam/cam_periph.c Thu Sep 22 03:30:28 2016 (r306152) +++ stable/11/sys/cam/cam_periph.c Thu Sep 22 03:31:14 2016 (r306153) @@ -1772,7 +1772,7 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Retrying command\n"); } - if (devctl_err) + if (devctl_err && (error != 0 || (action & SSQ_PRINT_SENSE) != 0)) cam_periph_devctl_notify(orig_ccb); if ((action & SSQ_LOST) != 0) { From owner-svn-src-stable-11@freebsd.org Thu Sep 22 08:56:55 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86811BE4FE5; Thu, 22 Sep 2016 08:56:55 +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 4A942AE7; Thu, 22 Sep 2016 08:56:55 +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 u8M8usb3011440; Thu, 22 Sep 2016 08:56:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M8usi1011435; Thu, 22 Sep 2016 08:56:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220856.u8M8usi1011435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 08:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306165 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 08:56:55 -0000 Author: kib Date: Thu Sep 22 08:56:54 2016 New Revision: 306165 URL: https://svnweb.freebsd.org/changeset/base/306165 Log: MFC r305592: Partially lift suspension when ffs_reload() finished with cgs and going to re-read inodes. Modified: stable/11/sys/ufs/ffs/ffs_extern.h stable/11/sys/ufs/ffs/ffs_suspend.c stable/11/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/11/sys/ufs/ffs/ffs_extern.h Thu Sep 22 08:51:42 2016 (r306164) +++ stable/11/sys/ufs/ffs/ffs_extern.h Thu Sep 22 08:56:54 2016 (r306165) @@ -106,6 +106,9 @@ void ffs_susp_uninitialize(void); #define FFSV_FORCEINSMQ 0x0001 +#define FFSR_FORCE 0x0001 +#define FFSR_UNSUSPEND 0x0002 + extern struct vop_vector ffs_vnodeops1; extern struct vop_vector ffs_fifoops1; extern struct vop_vector ffs_vnodeops2; Modified: stable/11/sys/ufs/ffs/ffs_suspend.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_suspend.c Thu Sep 22 08:51:42 2016 (r306164) +++ stable/11/sys/ufs/ffs/ffs_suspend.c Thu Sep 22 08:56:54 2016 (r306165) @@ -235,7 +235,7 @@ ffs_susp_dtor(void *data) KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0, ("MNTK_SUSPEND not set")); - error = ffs_reload(mp, curthread, 1); + error = ffs_reload(mp, curthread, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) panic("failed to unsuspend writes on %s", fs->fs_fsmnt); Modified: stable/11/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vfsops.c Thu Sep 22 08:51:42 2016 (r306164) +++ stable/11/sys/ufs/ffs/ffs_vfsops.c Thu Sep 22 08:56:54 2016 (r306165) @@ -573,11 +573,13 @@ ffs_cmount(struct mntarg *ma, void *data * 2) re-read superblock from disk. * 3) re-read summary information from disk. * 4) invalidate all inactive vnodes. - * 5) invalidate all cached file data. - * 6) re-read inode data for all active vnodes. + * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary + * writers, if requested. + * 6) invalidate all cached file data. + * 7) re-read inode data for all active vnodes. */ int -ffs_reload(struct mount *mp, struct thread *td, int force) +ffs_reload(struct mount *mp, struct thread *td, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; @@ -592,7 +594,7 @@ ffs_reload(struct mount *mp, struct thre ump = VFSTOUFS(mp); MNT_ILOCK(mp); - if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) { + if ((mp->mnt_flag & MNT_RDONLY) == 0 && (flags & FFSR_FORCE) == 0) { MNT_IUNLOCK(mp); return (EINVAL); } @@ -682,6 +684,12 @@ ffs_reload(struct mount *mp, struct thre size = fs->fs_ncg * sizeof(u_int8_t); fs->fs_contigdirs = (u_int8_t *)space; bzero(fs->fs_contigdirs, size); + if ((flags & FFSR_UNSUSPEND) != 0) { + MNT_ILOCK(mp); + mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); + wakeup(&mp->mnt_flag); + MNT_IUNLOCK(mp); + } loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { From owner-svn-src-stable-11@freebsd.org Thu Sep 22 08:59:59 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56167BE527B; Thu, 22 Sep 2016 08:59:59 +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 0883FCEA; Thu, 22 Sep 2016 08:59:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M8xwAS011590; Thu, 22 Sep 2016 08:59:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M8xwsJ011589; Thu, 22 Sep 2016 08:59:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220859.u8M8xwsJ011589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 08:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306166 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 08:59:59 -0000 Author: kib Date: Thu Sep 22 08:59:58 2016 New Revision: 306166 URL: https://svnweb.freebsd.org/changeset/base/306166 Log: MFC r305593: There is no need to upgrade the last dvp lock on lookups for modifying operations. Instead of upgrading, assert that the lock is exclusive. Explain the cause in comments. Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 08:56:54 2016 (r306165) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 08:59:58 2016 (r306166) @@ -76,32 +76,6 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, C /* true if old FS format...*/ #define OFSFMT(vp) ((vp)->v_mount->mnt_maxsymlinklen <= 0) -#ifdef QUOTA -static int -ufs_lookup_upgrade_lock(struct vnode *vp) -{ - int error; - - ASSERT_VOP_LOCKED(vp, __FUNCTION__); - if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) - return (0); - - error = 0; - - /* - * Upgrade vnode lock, since getinoquota() - * requires exclusive lock to modify inode. - */ - vhold(vp); - vn_lock(vp, LK_UPGRADE | LK_RETRY); - VI_LOCK(vp); - if (vp->v_iflag & VI_DOOMED) - error = ENOENT; - vdropl(vp); - return (error); -} -#endif - static int ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred, struct thread *td) @@ -259,12 +233,25 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread); bmask = VFSTOUFS(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; -#ifdef QUOTA - if ((nameiop == DELETE || nameiop == RENAME) && (flags & ISLASTCN)) { - error = ufs_lookup_upgrade_lock(vdp); - if (error != 0) - return (error); - } + +#ifdef DEBUG_VFS_LOCKS + /* + * Assert that the directory vnode is locked, and locked + * exclusively for the last component lookup for modifying + * operations. + * + * The directory-modifying operations need to save + * intermediate state in the inode between namei() call and + * actual directory manipulations. See fields in the struct + * inode marked as 'used during directory lookup'. We must + * ensure that upgrade in namei() does not happen, since + * upgrade might need to unlock vdp. If quotas are enabled, + * getinoquota() also requires exclusive lock to modify inode. + */ + ASSERT_VOP_LOCKED(vdp, "ufs_lookup1"); + if ((nameiop == CREATE || nameiop == DELETE || nameiop == RENAME) && + (flags & (LOCKPARENT | ISLASTCN)) == (LOCKPARENT | ISLASTCN)) + ASSERT_VOP_ELOCKED(vdp, "ufs_lookup2"); #endif restart: From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:02:05 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F1FBE5626; Thu, 22 Sep 2016 09:02:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19F631B4; Thu, 22 Sep 2016 09:02:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M924TN015371; Thu, 22 Sep 2016 09:02:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M924xe015370; Thu, 22 Sep 2016 09:02:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220902.u8M924xe015370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306167 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:02:05 -0000 Author: kib Date: Thu Sep 22 09:02:04 2016 New Revision: 306167 URL: https://svnweb.freebsd.org/changeset/base/306167 Log: MFC r305594: In softdep_prealloc(), return early not only for snapshots, but for the quota files as well. Modified: stable/11/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 08:59:58 2016 (r306166) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 09:02:04 2016 (r306167) @@ -2997,10 +2997,13 @@ softdep_prealloc(vp, waitok) ("softdep_prealloc called on non-softdep filesystem")); /* * Nothing to do if we are not running journaled soft updates. - * If we currently hold the snapshot lock, we must avoid handling - * other resources that could cause deadlock. + * If we currently hold the snapshot lock, we must avoid + * handling other resources that could cause deadlock. Do not + * touch quotas vnode since it is typically recursed with + * other vnode locks held. */ - if (DOINGSUJ(vp) == 0 || IS_SNAPSHOT(VTOI(vp))) + if (DOINGSUJ(vp) == 0 || IS_SNAPSHOT(VTOI(vp)) || + (vp->v_vflag & VV_SYSTEM) != 0) return (0); ump = VFSTOUFS(vp->v_mount); ACQUIRE_LOCK(ump); From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:04:06 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C81BE58F5; Thu, 22 Sep 2016 09:04:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A19AA6E3; Thu, 22 Sep 2016 09:04:06 +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 u8M945OJ015486; Thu, 22 Sep 2016 09:04:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M9451s015485; Thu, 22 Sep 2016 09:04:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220904.u8M9451s015485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306168 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:04:06 -0000 Author: kib Date: Thu Sep 22 09:04:05 2016 New Revision: 306168 URL: https://svnweb.freebsd.org/changeset/base/306168 Log: MFC r305595: In dqsync(), when called from quotactl(), um_quotas entry might appear cleared since nothing prevents completion of the parallel quotaoff. There is nothing to sync in this case, and no reason to panic. Modified: stable/11/sys/ufs/ufs/ufs_quota.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_quota.c Thu Sep 22 09:02:04 2016 (r306167) +++ stable/11/sys/ufs/ufs/ufs_quota.c Thu Sep 22 09:04:05 2016 (r306168) @@ -1538,8 +1538,13 @@ dqsync(struct vnode *vp, struct dquot *d if ((ump = dq->dq_ump) == NULL) return (0); UFS_LOCK(ump); - if ((dqvp = ump->um_quotas[dq->dq_type]) == NULLVP) - panic("dqsync: file"); + if ((dqvp = ump->um_quotas[dq->dq_type]) == NULLVP) { + if (vp == NULL) { + UFS_UNLOCK(ump); + return (0); + } else + panic("dqsync: file"); + } vref(dqvp); UFS_UNLOCK(ump); From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:06:02 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41CF4BE5A5B; Thu, 22 Sep 2016 09:06:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11E688DA; Thu, 22 Sep 2016 09:06:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M961kr015606; Thu, 22 Sep 2016 09:06:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M961U0015605; Thu, 22 Sep 2016 09:06:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220906.u8M961U0015605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306169 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:06:02 -0000 Author: kib Date: Thu Sep 22 09:06:01 2016 New Revision: 306169 URL: https://svnweb.freebsd.org/changeset/base/306169 Log: MFC r305597: When extending directory inode in ufs_direnter(), adjust i_endoff. Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 09:04:05 2016 (r306168) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 09:06:01 2016 (r306169) @@ -908,6 +908,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir } dp->i_size = dp->i_offset + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); + dp->i_endoff = dp->i_size; dp->i_flag |= IN_CHANGE | IN_UPDATE; dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:08:12 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9962BE5BF9; Thu, 22 Sep 2016 09:08:12 +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 88BE4ABC; Thu, 22 Sep 2016 09:08:12 +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 u8M98BZX015733; Thu, 22 Sep 2016 09:08:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M98B0r015732; Thu, 22 Sep 2016 09:08:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220908.u8M98B0r015732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306170 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:08:12 -0000 Author: kib Date: Thu Sep 22 09:08:11 2016 New Revision: 306170 URL: https://svnweb.freebsd.org/changeset/base/306170 Log: MFC r305598: When logging unlikely UFS_TRUNCATE() failure in ufs_direnter(), include error code. Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 09:06:01 2016 (r306169) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 09:08:11 2016 (r306170) @@ -1124,7 +1124,8 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) - vn_printf(dvp, "ufs_direnter: failed to truncate "); + vn_printf(dvp, "ufs_direnter: failed to truncate " + "err %d", error); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:10:32 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11F2FBE5E24; Thu, 22 Sep 2016 09:10:32 +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 D334CC98; Thu, 22 Sep 2016 09:10:31 +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 u8M9AVEq015878; Thu, 22 Sep 2016 09:10:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M9AUh6015877; Thu, 22 Sep 2016 09:10:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220910.u8M9AUh6015877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306171 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:10:32 -0000 Author: kib Date: Thu Sep 22 09:10:30 2016 New Revision: 306171 URL: https://svnweb.freebsd.org/changeset/base/306171 Log: MFC r305599: Do not leak transient ENOLCK error from flush_newblk_dep() loop. Modified: stable/11/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 09:08:11 2016 (r306170) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 09:10:30 2016 (r306171) @@ -12852,6 +12852,7 @@ flush_newblk_dep(vp, mp, lbn) LK_INTERLOCK, BO_LOCKPTR(bo)); if (error == ENOLCK) { ACQUIRE_LOCK(ump); + error = 0; continue; /* Slept, retry */ } if (error != 0) From owner-svn-src-stable-11@freebsd.org Thu Sep 22 09:14:05 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91111BE42B8; Thu, 22 Sep 2016 09:14:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63AA5149; Thu, 22 Sep 2016 09:14:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M9E4rO019334; Thu, 22 Sep 2016 09:14:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M9E4Ep019333; Thu, 22 Sep 2016 09:14:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609220914.u8M9E4Ep019333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Sep 2016 09:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306172 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 09:14:05 -0000 Author: kib Date: Thu Sep 22 09:14:04 2016 New Revision: 306172 URL: https://svnweb.freebsd.org/changeset/base/306172 Log: MFC r305601: On rename, do not perform truncation of dirhash if the vnode truncation failed. Modified: stable/11/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Thu Sep 22 09:10:30 2016 (r306171) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Thu Sep 22 09:14:04 2016 (r306172) @@ -1529,11 +1529,21 @@ unlockout: * are no longer needed. */ if (error == 0 && endoff != 0) { + error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, + tcnp->cn_cred); + if (error != 0) + vn_printf(tdvp, "ufs_rename: failed to truncate " + "err %d", error); #ifdef UFS_DIRHASH - if (tdp->i_dirhash != NULL) + else if (tdp->i_dirhash != NULL) ufsdirhash_dirtrunc(tdp, endoff); #endif - UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred); + /* + * Even if the directory compaction failed, rename was + * succesful. Do not propagate a UFS_TRUNCATE() error + * to the caller. + */ + error = 0; } if (error == 0 && tdp->i_flag & IN_NEEDSYNC) error = VOP_FSYNC(tdvp, MNT_WAIT, td); From owner-svn-src-stable-11@freebsd.org Thu Sep 22 14:57:52 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB50BE5F87; Thu, 22 Sep 2016 14:57:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D49989; Thu, 22 Sep 2016 14:57:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8MEvpjZ052589; Thu, 22 Sep 2016 14:57:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MEvndR052567; Thu, 22 Sep 2016 14:57:49 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201609221457.u8MEvndR052567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 22 Sep 2016 14:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306195 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 14:57:52 -0000 Author: jkim Date: Thu Sep 22 14:57:48 2016 New Revision: 306195 URL: https://svnweb.freebsd.org/changeset/base/306195 Log: MFC: r306193 Merge OpenSSL 1.0.2u. Added: stable/11/crypto/openssl/doc/crypto/d2i_PrivateKey.pod - copied unchanged from r306193, head/crypto/openssl/doc/crypto/d2i_PrivateKey.pod stable/11/crypto/openssl/ssl/bad_dtls_test.c - copied unchanged from r306193, head/crypto/openssl/ssl/bad_dtls_test.c stable/11/crypto/openssl/ssl/dtlstest.c - copied unchanged from r306193, head/crypto/openssl/ssl/dtlstest.c stable/11/secure/lib/libcrypto/man/d2i_PrivateKey.3 - copied unchanged from r306193, head/secure/lib/libcrypto/man/d2i_PrivateKey.3 Modified: stable/11/crypto/openssl/CHANGES stable/11/crypto/openssl/CONTRIBUTING stable/11/crypto/openssl/Configure stable/11/crypto/openssl/Makefile stable/11/crypto/openssl/Makefile.org stable/11/crypto/openssl/Makefile.shared stable/11/crypto/openssl/NEWS stable/11/crypto/openssl/README stable/11/crypto/openssl/apps/CA.pl stable/11/crypto/openssl/apps/CA.pl.in stable/11/crypto/openssl/apps/apps.c stable/11/crypto/openssl/apps/apps.h stable/11/crypto/openssl/apps/ca.c stable/11/crypto/openssl/apps/dgst.c stable/11/crypto/openssl/apps/enc.c stable/11/crypto/openssl/apps/passwd.c stable/11/crypto/openssl/apps/pkcs12.c stable/11/crypto/openssl/apps/req.c stable/11/crypto/openssl/apps/s_apps.h stable/11/crypto/openssl/apps/s_cb.c stable/11/crypto/openssl/apps/s_client.c stable/11/crypto/openssl/apps/s_server.c stable/11/crypto/openssl/apps/speed.c stable/11/crypto/openssl/apps/srp.c stable/11/crypto/openssl/apps/verify.c stable/11/crypto/openssl/apps/x509.c stable/11/crypto/openssl/crypto/LPdir_unix.c stable/11/crypto/openssl/crypto/aes/asm/bsaes-armv7.pl stable/11/crypto/openssl/crypto/asn1/a_bytes.c stable/11/crypto/openssl/crypto/asn1/a_object.c stable/11/crypto/openssl/crypto/asn1/a_set.c stable/11/crypto/openssl/crypto/asn1/a_strex.c stable/11/crypto/openssl/crypto/asn1/a_strnid.c stable/11/crypto/openssl/crypto/asn1/ameth_lib.c stable/11/crypto/openssl/crypto/asn1/asn1_lib.c stable/11/crypto/openssl/crypto/asn1/asn_mime.c stable/11/crypto/openssl/crypto/asn1/bio_asn1.c stable/11/crypto/openssl/crypto/asn1/bio_ndef.c stable/11/crypto/openssl/crypto/asn1/charmap.pl stable/11/crypto/openssl/crypto/asn1/d2i_pr.c stable/11/crypto/openssl/crypto/asn1/f_enum.c stable/11/crypto/openssl/crypto/asn1/f_int.c stable/11/crypto/openssl/crypto/asn1/f_string.c stable/11/crypto/openssl/crypto/asn1/i2d_pr.c stable/11/crypto/openssl/crypto/asn1/p5_pbe.c stable/11/crypto/openssl/crypto/asn1/p5_pbev2.c stable/11/crypto/openssl/crypto/asn1/t_req.c stable/11/crypto/openssl/crypto/asn1/tasn_dec.c stable/11/crypto/openssl/crypto/asn1/tasn_enc.c stable/11/crypto/openssl/crypto/asn1/tasn_prn.c stable/11/crypto/openssl/crypto/asn1/tasn_utl.c stable/11/crypto/openssl/crypto/asn1/x_bignum.c stable/11/crypto/openssl/crypto/asn1/x_name.c stable/11/crypto/openssl/crypto/asn1/x_x509.c stable/11/crypto/openssl/crypto/bio/b_print.c stable/11/crypto/openssl/crypto/bio/bf_nbio.c stable/11/crypto/openssl/crypto/bio/bio.h stable/11/crypto/openssl/crypto/bio/bss_bio.c stable/11/crypto/openssl/crypto/bio/bss_file.c stable/11/crypto/openssl/crypto/bio/bss_rtcp.c stable/11/crypto/openssl/crypto/bn/asm/x86-mont.pl stable/11/crypto/openssl/crypto/bn/asm/x86_64-gcc.c stable/11/crypto/openssl/crypto/bn/asm/x86_64-mont.pl stable/11/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl stable/11/crypto/openssl/crypto/bn/bn.h stable/11/crypto/openssl/crypto/bn/bn_div.c stable/11/crypto/openssl/crypto/bn/bn_lib.c stable/11/crypto/openssl/crypto/bn/bn_print.c stable/11/crypto/openssl/crypto/bn/bn_rand.c stable/11/crypto/openssl/crypto/bn/bn_word.c stable/11/crypto/openssl/crypto/bn/bntest.c stable/11/crypto/openssl/crypto/cms/cms_enc.c stable/11/crypto/openssl/crypto/cms/cms_ess.c stable/11/crypto/openssl/crypto/cms/cms_lib.c stable/11/crypto/openssl/crypto/cms/cms_pwri.c stable/11/crypto/openssl/crypto/comp/comp.h stable/11/crypto/openssl/crypto/conf/conf_def.h stable/11/crypto/openssl/crypto/conf/conf_mod.c stable/11/crypto/openssl/crypto/conf/keysets.pl stable/11/crypto/openssl/crypto/des/asm/dest4-sparcv9.pl stable/11/crypto/openssl/crypto/des/des.c stable/11/crypto/openssl/crypto/des/enc_writ.c stable/11/crypto/openssl/crypto/dh/dh_ameth.c stable/11/crypto/openssl/crypto/dsa/dsa_ameth.c stable/11/crypto/openssl/crypto/dsa/dsa_gen.c stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c stable/11/crypto/openssl/crypto/ec/Makefile stable/11/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl stable/11/crypto/openssl/crypto/ec/ec_ameth.c stable/11/crypto/openssl/crypto/ec/ec_key.c stable/11/crypto/openssl/crypto/ec/ecp_nistz256.c stable/11/crypto/openssl/crypto/engine/eng_cryptodev.c stable/11/crypto/openssl/crypto/evp/bio_enc.c stable/11/crypto/openssl/crypto/evp/bio_ok.c stable/11/crypto/openssl/crypto/evp/c_all.c stable/11/crypto/openssl/crypto/evp/digest.c stable/11/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c stable/11/crypto/openssl/crypto/evp/e_seed.c stable/11/crypto/openssl/crypto/evp/evp_enc.c stable/11/crypto/openssl/crypto/evp/evp_test.c stable/11/crypto/openssl/crypto/evp/openbsd_hw.c stable/11/crypto/openssl/crypto/evp/p_lib.c stable/11/crypto/openssl/crypto/evp/pmeth_gn.c stable/11/crypto/openssl/crypto/evp/pmeth_lib.c stable/11/crypto/openssl/crypto/hmac/hmac.c stable/11/crypto/openssl/crypto/jpake/jpake.c stable/11/crypto/openssl/crypto/lhash/lhash.c stable/11/crypto/openssl/crypto/md2/md2_dgst.c stable/11/crypto/openssl/crypto/md32_common.h stable/11/crypto/openssl/crypto/mdc2/mdc2dgst.c stable/11/crypto/openssl/crypto/mem.c stable/11/crypto/openssl/crypto/mem_clr.c stable/11/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl stable/11/crypto/openssl/crypto/o_init.c stable/11/crypto/openssl/crypto/o_time.c stable/11/crypto/openssl/crypto/objects/o_names.c stable/11/crypto/openssl/crypto/ocsp/ocsp_cl.c stable/11/crypto/openssl/crypto/ocsp/ocsp_ext.c stable/11/crypto/openssl/crypto/ocsp/ocsp_lib.c stable/11/crypto/openssl/crypto/opensslv.h stable/11/crypto/openssl/crypto/ossl_typ.h stable/11/crypto/openssl/crypto/pem/pem.h stable/11/crypto/openssl/crypto/pem/pem_err.c stable/11/crypto/openssl/crypto/pem/pem_lib.c stable/11/crypto/openssl/crypto/pem/pvkfmt.c stable/11/crypto/openssl/crypto/perlasm/sparcv9_modes.pl stable/11/crypto/openssl/crypto/pkcs12/p12_mutl.c stable/11/crypto/openssl/crypto/pkcs12/p12_npas.c stable/11/crypto/openssl/crypto/pkcs12/p12_utl.c stable/11/crypto/openssl/crypto/pkcs12/pkcs12.h stable/11/crypto/openssl/crypto/pkcs7/pk7_doit.c stable/11/crypto/openssl/crypto/rand/md_rand.c stable/11/crypto/openssl/crypto/rand/rand_unix.c stable/11/crypto/openssl/crypto/rand/randfile.c stable/11/crypto/openssl/crypto/rsa/rsa_ameth.c stable/11/crypto/openssl/crypto/rsa/rsa_chk.c stable/11/crypto/openssl/crypto/rsa/rsa_lib.c stable/11/crypto/openssl/crypto/rsa/rsa_pmeth.c stable/11/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl stable/11/crypto/openssl/crypto/sparccpuid.S stable/11/crypto/openssl/crypto/srp/srp_lib.c stable/11/crypto/openssl/crypto/srp/srp_vfy.c stable/11/crypto/openssl/crypto/ts/ts.h stable/11/crypto/openssl/crypto/ts/ts_lib.c stable/11/crypto/openssl/crypto/ts/ts_rsp_verify.c stable/11/crypto/openssl/crypto/ui/ui_lib.c stable/11/crypto/openssl/crypto/whrlpool/wp_dgst.c stable/11/crypto/openssl/crypto/x509/by_dir.c stable/11/crypto/openssl/crypto/x509/x509.h stable/11/crypto/openssl/crypto/x509/x509_att.c stable/11/crypto/openssl/crypto/x509/x509_err.c stable/11/crypto/openssl/crypto/x509/x509_obj.c stable/11/crypto/openssl/crypto/x509/x509_r2x.c stable/11/crypto/openssl/crypto/x509/x509_txt.c stable/11/crypto/openssl/crypto/x509/x509_vfy.c stable/11/crypto/openssl/crypto/x509/x509_vfy.h stable/11/crypto/openssl/crypto/x509/x509spki.c stable/11/crypto/openssl/crypto/x509v3/v3_addr.c stable/11/crypto/openssl/crypto/x509v3/v3_alt.c stable/11/crypto/openssl/crypto/x509v3/v3_conf.c stable/11/crypto/openssl/doc/apps/cms.pod stable/11/crypto/openssl/doc/apps/s_client.pod stable/11/crypto/openssl/doc/apps/s_server.pod stable/11/crypto/openssl/doc/apps/smime.pod stable/11/crypto/openssl/doc/apps/verify.pod stable/11/crypto/openssl/doc/apps/x509.pod stable/11/crypto/openssl/doc/apps/x509v3_config.pod stable/11/crypto/openssl/doc/crypto/BIO_s_bio.pod stable/11/crypto/openssl/doc/crypto/BN_bn2bin.pod stable/11/crypto/openssl/doc/crypto/BN_rand.pod stable/11/crypto/openssl/doc/crypto/EVP_EncryptInit.pod stable/11/crypto/openssl/doc/crypto/EVP_PKEY_cmp.pod stable/11/crypto/openssl/doc/crypto/OBJ_nid2obj.pod stable/11/crypto/openssl/doc/crypto/OPENSSL_config.pod stable/11/crypto/openssl/doc/crypto/OPENSSL_ia32cap.pod stable/11/crypto/openssl/doc/crypto/X509_verify_cert.pod stable/11/crypto/openssl/doc/crypto/d2i_X509.pod stable/11/crypto/openssl/doc/crypto/hmac.pod stable/11/crypto/openssl/doc/crypto/rand.pod stable/11/crypto/openssl/doc/crypto/ui.pod stable/11/crypto/openssl/engines/ccgost/gost2001.c stable/11/crypto/openssl/engines/ccgost/gost2001_keyx.c stable/11/crypto/openssl/engines/ccgost/gost94_keyx.c stable/11/crypto/openssl/engines/ccgost/gost_ameth.c stable/11/crypto/openssl/engines/ccgost/gost_pmeth.c stable/11/crypto/openssl/engines/e_4758cca.c stable/11/crypto/openssl/engines/e_aep.c stable/11/crypto/openssl/engines/e_capi.c stable/11/crypto/openssl/engines/e_chil.c stable/11/crypto/openssl/ssl/Makefile stable/11/crypto/openssl/ssl/d1_both.c stable/11/crypto/openssl/ssl/d1_clnt.c stable/11/crypto/openssl/ssl/d1_lib.c stable/11/crypto/openssl/ssl/d1_pkt.c stable/11/crypto/openssl/ssl/d1_srvr.c stable/11/crypto/openssl/ssl/s23_clnt.c stable/11/crypto/openssl/ssl/s2_clnt.c stable/11/crypto/openssl/ssl/s2_srvr.c stable/11/crypto/openssl/ssl/s3_both.c stable/11/crypto/openssl/ssl/s3_clnt.c stable/11/crypto/openssl/ssl/s3_enc.c stable/11/crypto/openssl/ssl/s3_lib.c stable/11/crypto/openssl/ssl/s3_pkt.c stable/11/crypto/openssl/ssl/s3_srvr.c stable/11/crypto/openssl/ssl/ssl.h stable/11/crypto/openssl/ssl/ssl_asn1.c stable/11/crypto/openssl/ssl/ssl_ciph.c stable/11/crypto/openssl/ssl/ssl_err.c stable/11/crypto/openssl/ssl/ssl_lib.c stable/11/crypto/openssl/ssl/ssl_locl.h stable/11/crypto/openssl/ssl/ssl_rsa.c stable/11/crypto/openssl/ssl/ssl_sess.c stable/11/crypto/openssl/ssl/ssltest.c stable/11/crypto/openssl/ssl/sslv2conftest.c stable/11/crypto/openssl/ssl/t1_enc.c stable/11/crypto/openssl/ssl/t1_lib.c stable/11/crypto/openssl/util/mk1mf.pl stable/11/crypto/openssl/util/mkerr.pl stable/11/crypto/openssl/util/ssleay.num stable/11/secure/lib/libcrypto/Makefile.inc stable/11/secure/lib/libcrypto/Makefile.man stable/11/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S stable/11/secure/lib/libcrypto/amd64/sha1-x86_64.S stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/11/secure/lib/libcrypto/arm/bsaes-armv7.S stable/11/secure/lib/libcrypto/i386/x86-mont.S stable/11/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/11/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/11/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/11/secure/lib/libcrypto/man/BIO_ctrl.3 stable/11/secure/lib/libcrypto/man/BIO_f_base64.3 stable/11/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/11/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/11/secure/lib/libcrypto/man/BIO_f_md.3 stable/11/secure/lib/libcrypto/man/BIO_f_null.3 stable/11/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/11/secure/lib/libcrypto/man/BIO_find_type.3 stable/11/secure/lib/libcrypto/man/BIO_new.3 stable/11/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/11/secure/lib/libcrypto/man/BIO_push.3 stable/11/secure/lib/libcrypto/man/BIO_read.3 stable/11/secure/lib/libcrypto/man/BIO_s_accept.3 stable/11/secure/lib/libcrypto/man/BIO_s_bio.3 stable/11/secure/lib/libcrypto/man/BIO_s_connect.3 stable/11/secure/lib/libcrypto/man/BIO_s_fd.3 stable/11/secure/lib/libcrypto/man/BIO_s_file.3 stable/11/secure/lib/libcrypto/man/BIO_s_mem.3 stable/11/secure/lib/libcrypto/man/BIO_s_null.3 stable/11/secure/lib/libcrypto/man/BIO_s_socket.3 stable/11/secure/lib/libcrypto/man/BIO_set_callback.3 stable/11/secure/lib/libcrypto/man/BIO_should_retry.3 stable/11/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_start.3 stable/11/secure/lib/libcrypto/man/BN_add.3 stable/11/secure/lib/libcrypto/man/BN_add_word.3 stable/11/secure/lib/libcrypto/man/BN_bn2bin.3 stable/11/secure/lib/libcrypto/man/BN_cmp.3 stable/11/secure/lib/libcrypto/man/BN_copy.3 stable/11/secure/lib/libcrypto/man/BN_generate_prime.3 stable/11/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/11/secure/lib/libcrypto/man/BN_new.3 stable/11/secure/lib/libcrypto/man/BN_num_bytes.3 stable/11/secure/lib/libcrypto/man/BN_rand.3 stable/11/secure/lib/libcrypto/man/BN_set_bit.3 stable/11/secure/lib/libcrypto/man/BN_swap.3 stable/11/secure/lib/libcrypto/man/BN_zero.3 stable/11/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/11/secure/lib/libcrypto/man/CMS_compress.3 stable/11/secure/lib/libcrypto/man/CMS_decrypt.3 stable/11/secure/lib/libcrypto/man/CMS_encrypt.3 stable/11/secure/lib/libcrypto/man/CMS_final.3 stable/11/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_type.3 stable/11/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/11/secure/lib/libcrypto/man/CMS_sign.3 stable/11/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/11/secure/lib/libcrypto/man/CMS_uncompress.3 stable/11/secure/lib/libcrypto/man/CMS_verify.3 stable/11/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/11/secure/lib/libcrypto/man/CONF_modules_free.3 stable/11/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/11/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/11/secure/lib/libcrypto/man/DH_generate_key.3 stable/11/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DH_new.3 stable/11/secure/lib/libcrypto/man/DH_set_method.3 stable/11/secure/lib/libcrypto/man/DH_size.3 stable/11/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/11/secure/lib/libcrypto/man/DSA_do_sign.3 stable/11/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/11/secure/lib/libcrypto/man/DSA_generate_key.3 stable/11/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DSA_new.3 stable/11/secure/lib/libcrypto/man/DSA_set_method.3 stable/11/secure/lib/libcrypto/man/DSA_sign.3 stable/11/secure/lib/libcrypto/man/DSA_size.3 stable/11/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/11/secure/lib/libcrypto/man/EC_KEY_new.3 stable/11/secure/lib/libcrypto/man/EC_POINT_add.3 stable/11/secure/lib/libcrypto/man/EC_POINT_new.3 stable/11/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/11/secure/lib/libcrypto/man/ERR_clear_error.3 stable/11/secure/lib/libcrypto/man/ERR_error_string.3 stable/11/secure/lib/libcrypto/man/ERR_get_error.3 stable/11/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/11/secure/lib/libcrypto/man/ERR_load_strings.3 stable/11/secure/lib/libcrypto/man/ERR_print_errors.3 stable/11/secure/lib/libcrypto/man/ERR_put_error.3 stable/11/secure/lib/libcrypto/man/ERR_remove_state.3 stable/11/secure/lib/libcrypto/man/ERR_set_mark.3 stable/11/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/11/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/11/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/11/secure/lib/libcrypto/man/EVP_SealInit.3 stable/11/secure/lib/libcrypto/man/EVP_SignInit.3 stable/11/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/11/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/11/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/11/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/11/secure/lib/libcrypto/man/OPENSSL_config.3 stable/11/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/11/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/11/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/11/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/11/secure/lib/libcrypto/man/PKCS12_create.3 stable/11/secure/lib/libcrypto/man/PKCS12_parse.3 stable/11/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/11/secure/lib/libcrypto/man/PKCS7_verify.3 stable/11/secure/lib/libcrypto/man/RAND_add.3 stable/11/secure/lib/libcrypto/man/RAND_bytes.3 stable/11/secure/lib/libcrypto/man/RAND_cleanup.3 stable/11/secure/lib/libcrypto/man/RAND_egd.3 stable/11/secure/lib/libcrypto/man/RAND_load_file.3 stable/11/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/11/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/11/secure/lib/libcrypto/man/RSA_check_key.3 stable/11/secure/lib/libcrypto/man/RSA_generate_key.3 stable/11/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/RSA_new.3 stable/11/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/11/secure/lib/libcrypto/man/RSA_print.3 stable/11/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_set_method.3 stable/11/secure/lib/libcrypto/man/RSA_sign.3 stable/11/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/11/secure/lib/libcrypto/man/RSA_size.3 stable/11/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/11/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/11/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/11/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/11/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/11/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/11/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/11/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/11/secure/lib/libcrypto/man/X509_check_host.3 stable/11/secure/lib/libcrypto/man/X509_new.3 stable/11/secure/lib/libcrypto/man/X509_verify_cert.3 stable/11/secure/lib/libcrypto/man/bio.3 stable/11/secure/lib/libcrypto/man/blowfish.3 stable/11/secure/lib/libcrypto/man/bn.3 stable/11/secure/lib/libcrypto/man/bn_internal.3 stable/11/secure/lib/libcrypto/man/buffer.3 stable/11/secure/lib/libcrypto/man/crypto.3 stable/11/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/11/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/11/secure/lib/libcrypto/man/d2i_DHparams.3 stable/11/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_ECPKParameters.3 stable/11/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_X509.3 stable/11/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/11/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/11/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/11/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/11/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/11/secure/lib/libcrypto/man/des.3 stable/11/secure/lib/libcrypto/man/dh.3 stable/11/secure/lib/libcrypto/man/dsa.3 stable/11/secure/lib/libcrypto/man/ec.3 stable/11/secure/lib/libcrypto/man/ecdsa.3 stable/11/secure/lib/libcrypto/man/engine.3 stable/11/secure/lib/libcrypto/man/err.3 stable/11/secure/lib/libcrypto/man/evp.3 stable/11/secure/lib/libcrypto/man/hmac.3 stable/11/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/11/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/11/secure/lib/libcrypto/man/lh_stats.3 stable/11/secure/lib/libcrypto/man/lhash.3 stable/11/secure/lib/libcrypto/man/md5.3 stable/11/secure/lib/libcrypto/man/mdc2.3 stable/11/secure/lib/libcrypto/man/pem.3 stable/11/secure/lib/libcrypto/man/rand.3 stable/11/secure/lib/libcrypto/man/rc4.3 stable/11/secure/lib/libcrypto/man/ripemd.3 stable/11/secure/lib/libcrypto/man/rsa.3 stable/11/secure/lib/libcrypto/man/sha.3 stable/11/secure/lib/libcrypto/man/threads.3 stable/11/secure/lib/libcrypto/man/ui.3 stable/11/secure/lib/libcrypto/man/ui_compat.3 stable/11/secure/lib/libcrypto/man/x509.3 stable/11/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/11/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 stable/11/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/11/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/11/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_free.3 stable/11/secure/lib/libssl/man/SSL_CTX_get0_param.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/11/secure/lib/libssl/man/SSL_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_curves.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 stable/11/secure/lib/libssl/man/SSL_SESSION_free.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/11/secure/lib/libssl/man/SSL_accept.3 stable/11/secure/lib/libssl/man/SSL_alert_type_string.3 stable/11/secure/lib/libssl/man/SSL_check_chain.3 stable/11/secure/lib/libssl/man/SSL_clear.3 stable/11/secure/lib/libssl/man/SSL_connect.3 stable/11/secure/lib/libssl/man/SSL_do_handshake.3 stable/11/secure/lib/libssl/man/SSL_free.3 stable/11/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/11/secure/lib/libssl/man/SSL_get_ciphers.3 stable/11/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/11/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/11/secure/lib/libssl/man/SSL_get_error.3 stable/11/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/11/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_get_fd.3 stable/11/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/11/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/11/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/11/secure/lib/libssl/man/SSL_get_rbio.3 stable/11/secure/lib/libssl/man/SSL_get_session.3 stable/11/secure/lib/libssl/man/SSL_get_verify_result.3 stable/11/secure/lib/libssl/man/SSL_get_version.3 stable/11/secure/lib/libssl/man/SSL_library_init.3 stable/11/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/11/secure/lib/libssl/man/SSL_new.3 stable/11/secure/lib/libssl/man/SSL_pending.3 stable/11/secure/lib/libssl/man/SSL_read.3 stable/11/secure/lib/libssl/man/SSL_rstate_string.3 stable/11/secure/lib/libssl/man/SSL_session_reused.3 stable/11/secure/lib/libssl/man/SSL_set_bio.3 stable/11/secure/lib/libssl/man/SSL_set_connect_state.3 stable/11/secure/lib/libssl/man/SSL_set_fd.3 stable/11/secure/lib/libssl/man/SSL_set_session.3 stable/11/secure/lib/libssl/man/SSL_set_shutdown.3 stable/11/secure/lib/libssl/man/SSL_set_verify_result.3 stable/11/secure/lib/libssl/man/SSL_shutdown.3 stable/11/secure/lib/libssl/man/SSL_state_string.3 stable/11/secure/lib/libssl/man/SSL_want.3 stable/11/secure/lib/libssl/man/SSL_write.3 stable/11/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/11/secure/lib/libssl/man/ssl.3 stable/11/secure/usr.bin/openssl/man/CA.pl.1 stable/11/secure/usr.bin/openssl/man/asn1parse.1 stable/11/secure/usr.bin/openssl/man/c_rehash.1 stable/11/secure/usr.bin/openssl/man/ca.1 stable/11/secure/usr.bin/openssl/man/ciphers.1 stable/11/secure/usr.bin/openssl/man/cms.1 stable/11/secure/usr.bin/openssl/man/crl.1 stable/11/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/11/secure/usr.bin/openssl/man/dgst.1 stable/11/secure/usr.bin/openssl/man/dhparam.1 stable/11/secure/usr.bin/openssl/man/dsa.1 stable/11/secure/usr.bin/openssl/man/dsaparam.1 stable/11/secure/usr.bin/openssl/man/ec.1 stable/11/secure/usr.bin/openssl/man/ecparam.1 stable/11/secure/usr.bin/openssl/man/enc.1 stable/11/secure/usr.bin/openssl/man/errstr.1 stable/11/secure/usr.bin/openssl/man/gendsa.1 stable/11/secure/usr.bin/openssl/man/genpkey.1 stable/11/secure/usr.bin/openssl/man/genrsa.1 stable/11/secure/usr.bin/openssl/man/nseq.1 stable/11/secure/usr.bin/openssl/man/ocsp.1 stable/11/secure/usr.bin/openssl/man/openssl.1 stable/11/secure/usr.bin/openssl/man/passwd.1 stable/11/secure/usr.bin/openssl/man/pkcs12.1 stable/11/secure/usr.bin/openssl/man/pkcs7.1 stable/11/secure/usr.bin/openssl/man/pkcs8.1 stable/11/secure/usr.bin/openssl/man/pkey.1 stable/11/secure/usr.bin/openssl/man/pkeyparam.1 stable/11/secure/usr.bin/openssl/man/pkeyutl.1 stable/11/secure/usr.bin/openssl/man/rand.1 stable/11/secure/usr.bin/openssl/man/req.1 stable/11/secure/usr.bin/openssl/man/rsa.1 stable/11/secure/usr.bin/openssl/man/rsautl.1 stable/11/secure/usr.bin/openssl/man/s_client.1 stable/11/secure/usr.bin/openssl/man/s_server.1 stable/11/secure/usr.bin/openssl/man/s_time.1 stable/11/secure/usr.bin/openssl/man/sess_id.1 stable/11/secure/usr.bin/openssl/man/smime.1 stable/11/secure/usr.bin/openssl/man/speed.1 stable/11/secure/usr.bin/openssl/man/spkac.1 stable/11/secure/usr.bin/openssl/man/ts.1 stable/11/secure/usr.bin/openssl/man/tsget.1 stable/11/secure/usr.bin/openssl/man/verify.1 stable/11/secure/usr.bin/openssl/man/version.1 stable/11/secure/usr.bin/openssl/man/x509.1 stable/11/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/openssl/CHANGES ============================================================================== --- stable/11/crypto/openssl/CHANGES Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/CHANGES Thu Sep 22 14:57:48 2016 (r306195) @@ -2,6 +2,166 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2h and 1.0.2i [22 Sep 2016] + + *) OCSP Status Request extension unbounded memory growth + + A malicious client can send an excessively large OCSP Status Request + extension. If that client continually requests renegotiation, sending a + large OCSP Status Request extension each time, then there will be unbounded + memory growth on the server. This will eventually lead to a Denial Of + Service attack through memory exhaustion. Servers with a default + configuration are vulnerable even if they do not support OCSP. Builds using + the "no-ocsp" build time option are not affected. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6304) + [Matt Caswell] + + *) In order to mitigate the SWEET32 attack, the DES ciphers were moved from + HIGH to MEDIUM. + + This issue was reported to OpenSSL Karthikeyan Bhargavan and Gaetan + Leurent (INRIA) + (CVE-2016-2183) + [Rich Salz] + + *) OOB write in MDC2_Update() + + An overflow can occur in MDC2_Update() either if called directly or + through the EVP_DigestUpdate() function using MDC2. If an attacker + is able to supply very large amounts of input data after a previous + call to EVP_EncryptUpdate() with a partial block then a length check + can overflow resulting in a heap corruption. + + The amount of data needed is comparable to SIZE_MAX which is impractical + on most platforms. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6303) + [Stephen Henson] + + *) Malformed SHA512 ticket DoS + + If a server uses SHA512 for TLS session ticket HMAC it is vulnerable to a + DoS attack where a malformed ticket will result in an OOB read which will + ultimately crash. + + The use of SHA512 in TLS session tickets is comparatively rare as it requires + a custom server callback and ticket lookup mechanism. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6302) + [Stephen Henson] + + *) OOB write in BN_bn2dec() + + The function BN_bn2dec() does not check the return value of BN_div_word(). + This can cause an OOB write if an application uses this function with an + overly large BIGNUM. This could be a problem if an overly large certificate + or CRL is printed out from an untrusted source. TLS is not affected because + record limits will reject an oversized certificate before it is parsed. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-2182) + [Stephen Henson] + + *) OOB read in TS_OBJ_print_bio() + + The function TS_OBJ_print_bio() misuses OBJ_obj2txt(): the return value is + the total length the OID text representation would use and not the amount + of data written. This will result in OOB reads when large OIDs are + presented. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-2180) + [Stephen Henson] + + *) Pointer arithmetic undefined behaviour + + Avoid some undefined pointer arithmetic + + A common idiom in the codebase is to check limits in the following manner: + "p + len > limit" + + Where "p" points to some malloc'd data of SIZE bytes and + limit == p + SIZE + + "len" here could be from some externally supplied data (e.g. from a TLS + message). + + The rules of C pointer arithmetic are such that "p + len" is only well + defined where len <= SIZE. Therefore the above idiom is actually + undefined behaviour. + + For example this could cause problems if some malloc implementation + provides an address for "p" such that "p + len" actually overflows for + values of len that are too big and therefore p + len < limit. + + This issue was reported to OpenSSL by Guido Vranken + (CVE-2016-2177) + [Matt Caswell] + + *) Constant time flag not preserved in DSA signing + + Operations in the DSA signing algorithm should run in constant time in + order to avoid side channel attacks. A flaw in the OpenSSL DSA + implementation means that a non-constant time codepath is followed for + certain operations. This has been demonstrated through a cache-timing + attack to be sufficient for an attacker to recover the private DSA key. + + This issue was reported by César Pereida (Aalto University), Billy Brumley + (Tampere University of Technology), and Yuval Yarom (The University of + Adelaide and NICTA). + (CVE-2016-2178) + [César Pereida] + + *) DTLS buffered message DoS + + In a DTLS connection where handshake messages are delivered out-of-order + those messages that OpenSSL is not yet ready to process will be buffered + for later use. Under certain circumstances, a flaw in the logic means that + those messages do not get removed from the buffer even though the handshake + has been completed. An attacker could force up to approx. 15 messages to + remain in the buffer when they are no longer required. These messages will + be cleared when the DTLS connection is closed. The default maximum size for + a message is 100k. Therefore the attacker could force an additional 1500k + to be consumed per connection. By opening many simulataneous connections an + attacker could cause a DoS attack through memory exhaustion. + + This issue was reported to OpenSSL by Quan Luo. + (CVE-2016-2179) + [Matt Caswell] + + *) DTLS replay protection DoS + + A flaw in the DTLS replay attack protection mechanism means that records + that arrive for future epochs update the replay protection "window" before + the MAC for the record has been validated. This could be exploited by an + attacker by sending a record for the next epoch (which does not have to + decrypt or have a valid MAC), with a very large sequence number. This means + that all subsequent legitimate packets are dropped causing a denial of + service for a specific DTLS connection. + + This issue was reported to OpenSSL by the OCAP audit team. + (CVE-2016-2181) + [Matt Caswell] + + *) Certificate message OOB reads + + In OpenSSL 1.0.2 and earlier some missing message length checks can result + in OOB reads of up to 2 bytes beyond an allocated buffer. There is a + theoretical DoS risk but this has not been observed in practice on common + platforms. + + The messages affected are client certificate, client certificate request + and server certificate. As a result the attack can only be performed + against a client or a server which enables client authentication. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6306) + [Stephen Henson] + Changes between 1.0.2g and 1.0.2h [3 May 2016] *) Prevent padding oracle in AES-NI CBC MAC check Modified: stable/11/crypto/openssl/CONTRIBUTING ============================================================================== --- stable/11/crypto/openssl/CONTRIBUTING Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/CONTRIBUTING Thu Sep 22 14:57:48 2016 (r306195) @@ -1,38 +1,75 @@ -HOW TO CONTRIBUTE TO OpenSSL ----------------------------- +HOW TO CONTRIBUTE TO PATCHES OpenSSL +------------------------------------ -Development is coordinated on the openssl-dev mailing list (see -http://www.openssl.org for information on subscribing). If you -would like to submit a patch, send it to rt@openssl.org with -the string "[PATCH]" in the subject. Please be sure to include a -textual explanation of what your patch does. - -You can also make GitHub pull requests. If you do this, please also send -mail to rt@openssl.org with a brief description and a link to the PR so -that we can more easily keep track of it. +(Please visit https://www.openssl.org/community/getting-started.html for +other ideas about how to contribute.) +Development is coordinated on the openssl-dev mailing list (see the +above link or https://mta.openssl.org for information on subscribing). If you are unsure as to whether a feature will be useful for the general -OpenSSL community please discuss it on the openssl-dev mailing list first. -Someone may be already working on the same thing or there may be a good -reason as to why that feature isn't implemented. - -Patches should be as up to date as possible, preferably relative to the -current Git or the last snapshot. They should follow our coding style -(see https://www.openssl.org/policies/codingstyle.html) and compile without -warnings using the --strict-warnings flag. OpenSSL compiles on many varied -platforms: try to ensure you only use portable features. - -Our preferred format for patch files is "git format-patch" output. For example -to provide a patch file containing the last commit in your local git repository -use the following command: +OpenSSL community you might want to discuss it on the openssl-dev mailing +list first. Someone may be already working on the same thing or there +may be a good reason as to why that feature isn't implemented. + +The best way to submit a patch is to make a pull request on GitHub. +(It is not necessary to send mail to rt@openssl.org to open a ticket!) +If you think the patch could use feedback from the community, please +start a thread on openssl-dev. + +You can also submit patches by sending it as mail to rt@openssl.org. +Please include the word "PATCH" and an explanation of what the patch +does in the subject line. If you do this, our preferred format is "git +format-patch" output. For example to provide a patch file containing the +last commit in your local git repository use the following command: -# git format-patch --stdout HEAD^ >mydiffs.patch + % git format-patch --stdout HEAD^ >mydiffs.patch Another method of creating an acceptable patch file without using git is as follows: -# cd openssl-work -# [your changes] -# ./Configure dist; make clean -# cd .. -# diff -ur openssl-orig openssl-work > mydiffs.patch + % cd openssl-work + ...make your changes... + % ./Configure dist; make clean + % cd .. + % diff -ur openssl-orig openssl-work >mydiffs.patch + +Note that pull requests are generally easier for the team, and community, to +work with. Pull requests benefit from all of the standard GitHub features, +including code review tools, simpler integration, and CI build support. + +No matter how a patch is submitted, the following items will help make +the acceptance and review process faster: + + 1. Anything other than trivial contributions will require a contributor + licensing agreement, giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. + + 2. All source files should start with the following text (with + appropriate comment characters at the start of each line and the + year(s) updated): + + Copyright 20xx-20yy The OpenSSL Project Authors. All Rights Reserved. + + Licensed under the OpenSSL license (the "License"). You may not use + this file except in compliance with the License. You can obtain a copy + in the file LICENSE in the source distribution or at + https://www.openssl.org/source/license.html + + 3. Patches should be as current as possible. When using GitHub, please + expect to have to rebase and update often. Note that we do not accept merge + commits. You will be asked to remove them before a patch is considered + acceptable. + + 4. Patches should follow our coding style (see + https://www.openssl.org/policies/codingstyle.html) and compile without + warnings. Where gcc or clang is availble you should use the + --strict-warnings Configure option. OpenSSL compiles on many varied + platforms: try to ensure you only use portable features. + + 5. When at all possible, patches should include tests. These can either be + added to an existing test, or completely new. Please see test/README + for information on the test framework. + + 6. New features or changed functionality must include documentation. Please + look at the "pod" files in doc/apps, doc/crypto and doc/ssl for examples of + our style. Modified: stable/11/crypto/openssl/Configure ============================================================================== --- stable/11/crypto/openssl/Configure Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/Configure Thu Sep 22 14:57:48 2016 (r306195) @@ -799,7 +799,7 @@ my @experimental = (); # This is what $depflags will look like with the above defaults # (we need this to see if we should advise the user to run "make depend"): -my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST"; +my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS"; # Explicit "no-..." options will be collected in %disabled along with the defaults. # To remove something from %disabled, use "enable-foo" (unless it's experimental). @@ -1082,11 +1082,6 @@ if (defined($disabled{"md5"}) || defined $disabled{"tls1"} = "forced"; } -if (defined($disabled{"tls1"})) - { - $disabled{"tlsext"} = "forced"; - } - if (defined($disabled{"ec"}) || defined($disabled{"dsa"}) || defined($disabled{"dh"})) { @@ -1254,6 +1249,7 @@ my $shared_extension = $fields[$idx_shar my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib]; my $ar = $ENV{'AR'} || "ar"; my $arflags = $fields[$idx_arflags]; +my $windres = $ENV{'RC'} || $ENV{'WINDRES'} || "windres"; my $multilib = $fields[$idx_multilib]; # if $prefix/lib$multilib is not an existing directory, then @@ -1562,8 +1558,15 @@ $cpuid_obj="mem_clr.o" unless ($cpuid_ob $des_obj=$des_enc unless ($des_obj =~ /\.o$/); $bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); $cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/); -$rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/); $rc5_obj=$rc5_enc unless ($rc5_obj =~ /\.o$/); +if ($rc4_obj =~ /\.o$/) + { + $cflags.=" -DRC4_ASM"; + } +else + { + $rc4_obj=$rc4_enc; + } if ($sha1_obj =~ /\.o$/) { # $sha1_obj=$sha1_enc; @@ -1717,12 +1720,14 @@ while () s/^AR=\s*/AR= \$\(CROSS_COMPILE\)/; s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/; + s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc"; } else { s/^CC=.*$/CC= $cc/; s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; + s/^RC=.*/RC= $windres/; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang"; } Modified: stable/11/crypto/openssl/Makefile ============================================================================== --- stable/11/crypto/openssl/Makefile Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/Makefile Thu Sep 22 14:57:48 2016 (r306195) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2h +VERSION=1.0.2i MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -68,6 +68,7 @@ EXE_EXT= ARFLAGS= AR= ar $(ARFLAGS) r RANLIB= /usr/bin/ranlib +RC= windres NM= nm PERL= /usr/bin/perl TAR= tar @@ -210,6 +211,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM) CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ + RC='$(RC)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ @@ -368,6 +370,7 @@ libcrypto.pc: Makefile echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ + echo 'enginesdir=$${libdir}/engines'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ Modified: stable/11/crypto/openssl/Makefile.org ============================================================================== --- stable/11/crypto/openssl/Makefile.org Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/Makefile.org Thu Sep 22 14:57:48 2016 (r306195) @@ -66,6 +66,7 @@ EXE_EXT= ARFLAGS?= r AR=ar $(ARFLAGS) RANLIB= ranlib +RC= windres NM= nm PERL= perl TAR= tar @@ -208,6 +209,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM) CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ + RC='$(RC)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ @@ -366,6 +368,7 @@ libcrypto.pc: Makefile echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ + echo 'enginesdir=$${libdir}/engines'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ Modified: stable/11/crypto/openssl/Makefile.shared ============================================================================== --- stable/11/crypto/openssl/Makefile.shared Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/Makefile.shared Thu Sep 22 14:57:48 2016 (r306195) @@ -293,7 +293,7 @@ link_a.cygwin: fi; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ $(PERL) util/mkrc.pl $$dll_name | \ - $(CROSS_COMPILE)windres -o rc.o; \ + $(RC) -o rc.o; \ extras="$$extras rc.o"; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ Modified: stable/11/crypto/openssl/NEWS ============================================================================== --- stable/11/crypto/openssl/NEWS Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/NEWS Thu Sep 22 14:57:48 2016 (r306195) @@ -5,6 +5,20 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2h and OpenSSL 1.0.2i [22 Sep 2016] + + o OCSP Status Request extension unbounded memory growth (CVE-2016-6304) + o SWEET32 Mitigation (CVE-2016-2183) + o OOB write in MDC2_Update() (CVE-2016-6303) + o Malformed SHA512 ticket DoS (CVE-2016-6302) + o OOB write in BN_bn2dec() (CVE-2016-2182) + o OOB read in TS_OBJ_print_bio() (CVE-2016-2180) + o Pointer arithmetic undefined behaviour (CVE-2016-2177) + o Constant time flag not preserved in DSA signing (CVE-2016-2178) + o DTLS buffered message DoS (CVE-2016-2179) + o DTLS replay protection DoS (CVE-2016-2181) + o Certificate message OOB reads (CVE-2016-6306) + Major changes between OpenSSL 1.0.2g and OpenSSL 1.0.2h [3 May 2016] o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) Modified: stable/11/crypto/openssl/README ============================================================================== --- stable/11/crypto/openssl/README Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/README Thu Sep 22 14:57:48 2016 (r306195) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2h 3 May 2016 + OpenSSL 1.0.2i 22 Sep 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/11/crypto/openssl/apps/CA.pl ============================================================================== --- stable/11/crypto/openssl/apps/CA.pl Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/CA.pl Thu Sep 22 14:57:48 2016 (r306195) @@ -64,7 +64,7 @@ $RET = 0; foreach (@ARGV) { if ( /^(-\?|-h|-help)$/ ) { - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n"; exit 0; } elsif (/^-newcert$/) { # create a certificate @@ -186,4 +186,3 @@ while () { } } } - Modified: stable/11/crypto/openssl/apps/CA.pl.in ============================================================================== --- stable/11/crypto/openssl/apps/CA.pl.in Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/CA.pl.in Thu Sep 22 14:57:48 2016 (r306195) @@ -64,7 +64,7 @@ $RET = 0; foreach (@ARGV) { if ( /^(-\?|-h|-help)$/ ) { - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n"; exit 0; } elsif (/^-newcert$/) { # create a certificate @@ -186,4 +186,3 @@ while () { } } } - Modified: stable/11/crypto/openssl/apps/apps.c ============================================================================== --- stable/11/crypto/openssl/apps/apps.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/apps.c Thu Sep 22 14:57:48 2016 (r306195) @@ -215,7 +215,8 @@ int args_from_file(char *file, int *argc if (arg != NULL) OPENSSL_free(arg); arg = (char **)OPENSSL_malloc(sizeof(char *) * (i * 2)); - + if (arg == NULL) + return 0; *argv = arg; num = 0; p = buf; @@ -2374,6 +2375,8 @@ int args_verify(char ***pargs, int *parg flags |= X509_V_FLAG_PARTIAL_CHAIN; else if (!strcmp(arg, "-no_alt_chains")) flags |= X509_V_FLAG_NO_ALT_CHAINS; + else if (!strcmp(arg, "-allow_proxy_certs")) + flags |= X509_V_FLAG_ALLOW_PROXY_CERTS; else return 0; @@ -3195,6 +3198,36 @@ int app_isdir(const char *name) #endif /* raw_read|write section */ +#if defined(__VMS) +# include "vms_term_sock.h" +static int stdin_sock = -1; + +static void close_stdin_sock(void) +{ + TerminalSocket (TERM_SOCK_DELETE, &stdin_sock); +} + +int fileno_stdin(void) +{ + if (stdin_sock == -1) { + TerminalSocket(TERM_SOCK_CREATE, &stdin_sock); + atexit(close_stdin_sock); + } + + return stdin_sock; +} +#else +int fileno_stdin(void) +{ + return fileno(stdin); +} +#endif + +int fileno_stdout(void) +{ + return fileno(stdout); +} + #if defined(_WIN32) && defined(STD_INPUT_HANDLE) int raw_read_stdin(void *buf, int siz) { @@ -3204,10 +3237,17 @@ int raw_read_stdin(void *buf, int siz) else return (-1); } +#elif defined(__VMS) +#include + +int raw_read_stdin(void *buf, int siz) +{ + return recv(fileno_stdin(), buf, siz, 0); +} #else int raw_read_stdin(void *buf, int siz) { - return read(fileno(stdin), buf, siz); + return read(fileno_stdin(), buf, siz); } #endif @@ -3223,6 +3263,6 @@ int raw_write_stdout(const void *buf, in #else int raw_write_stdout(const void *buf, int siz) { - return write(fileno(stdout), buf, siz); + return write(fileno_stdout(), buf, siz); } #endif Modified: stable/11/crypto/openssl/apps/apps.h ============================================================================== --- stable/11/crypto/openssl/apps/apps.h Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/apps.h Thu Sep 22 14:57:48 2016 (r306195) @@ -375,6 +375,8 @@ void store_setup_crl_download(X509_STORE # define SERIAL_RAND_BITS 64 int app_isdir(const char *); +int fileno_stdin(void); +int fileno_stdout(void); int raw_read_stdin(void *, int); int raw_write_stdout(const void *, int); Modified: stable/11/crypto/openssl/apps/ca.c ============================================================================== --- stable/11/crypto/openssl/apps/ca.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/ca.c Thu Sep 22 14:57:48 2016 (r306195) @@ -2103,25 +2103,23 @@ static int do_body(X509 **xret, EVP_PKEY goto err; /* We now just add it to the database */ - row[DB_type] = (char *)OPENSSL_malloc(2); - tm = X509_get_notAfter(ret); - row[DB_exp_date] = (char *)OPENSSL_malloc(tm->length + 1); - memcpy(row[DB_exp_date], tm->data, tm->length); - row[DB_exp_date][tm->length] = '\0'; - - row[DB_rev_date] = NULL; - - /* row[DB_serial] done already */ - row[DB_file] = (char *)OPENSSL_malloc(8); + row[DB_type] = OPENSSL_malloc(2); + row[DB_exp_date] = OPENSSL_malloc(tm->length + 1); + row[DB_rev_date] = OPENSSL_malloc(1); + row[DB_file] = OPENSSL_malloc(8); row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0); - if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) || + (row[DB_rev_date] == NULL) || (row[DB_file] == NULL) || (row[DB_name] == NULL)) { BIO_printf(bio_err, "Memory allocation failure\n"); goto err; } - BUF_strlcpy(row[DB_file], "unknown", 8); + + memcpy(row[DB_exp_date], tm->data, tm->length); + row[DB_exp_date][tm->length] = '\0'; + row[DB_rev_date][0] = '\0'; + strcpy(row[DB_file], "unknown"); row[DB_type][0] = 'V'; row[DB_type][1] = '\0'; @@ -2307,6 +2305,7 @@ static int certify_spkac(X509 **xret, ch j = NETSCAPE_SPKI_verify(spki, pktmp); if (j <= 0) { + EVP_PKEY_free(pktmp); BIO_printf(bio_err, "signature verification failed on SPKAC public key\n"); goto err; Modified: stable/11/crypto/openssl/apps/dgst.c ============================================================================== --- stable/11/crypto/openssl/apps/dgst.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/dgst.c Thu Sep 22 14:57:48 2016 (r306195) @@ -243,6 +243,11 @@ int MAIN(int argc, char **argv) argv++; } + if (keyfile != NULL && argc > 1) { + BIO_printf(bio_err, "Can only sign or verify one file\n"); + goto end; + } + if (do_verify && !sigfile) { BIO_printf(bio_err, "No signature to verify: use the -signature option\n"); Modified: stable/11/crypto/openssl/apps/enc.c ============================================================================== --- stable/11/crypto/openssl/apps/enc.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/enc.c Thu Sep 22 14:57:48 2016 (r306195) @@ -509,7 +509,7 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err, "invalid hex salt value\n"); goto end; } - } else if (RAND_pseudo_bytes(salt, sizeof salt) < 0) + } else if (RAND_bytes(salt, sizeof salt) <= 0) goto end; /* * If -P option then don't bother writing Modified: stable/11/crypto/openssl/apps/passwd.c ============================================================================== --- stable/11/crypto/openssl/apps/passwd.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/passwd.c Thu Sep 22 14:57:48 2016 (r306195) @@ -416,7 +416,7 @@ static int do_passwd(int passed_salt, ch if (*salt_malloc_p == NULL) goto err; } - if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0) + if (RAND_bytes((unsigned char *)*salt_p, 2) <= 0) goto err; (*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */ (*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */ @@ -437,7 +437,7 @@ static int do_passwd(int passed_salt, ch if (*salt_malloc_p == NULL) goto err; } - if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0) + if (RAND_bytes((unsigned char *)*salt_p, 8) <= 0) goto err; for (i = 0; i < 8; i++) Modified: stable/11/crypto/openssl/apps/pkcs12.c ============================================================================== --- stable/11/crypto/openssl/apps/pkcs12.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/pkcs12.c Thu Sep 22 14:57:48 2016 (r306195) @@ -832,6 +832,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 EVP_PKEY *pkey; PKCS8_PRIV_KEY_INFO *p8; X509 *x509; + int ret = 0; switch (M_PKCS12_bag_type(bag)) { case NID_keyBag: @@ -844,7 +845,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 if (!(pkey = EVP_PKCS82PKEY(p8))) return 0; print_attribs(out, p8->attributes, "Key Attributes"); - PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); + ret = PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); EVP_PKEY_free(pkey); break; @@ -864,7 +865,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 } print_attribs(out, p8->attributes, "Key Attributes"); PKCS8_PRIV_KEY_INFO_free(p8); - PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); + ret = PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); EVP_PKEY_free(pkey); break; @@ -884,7 +885,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 if (!(x509 = PKCS12_certbag2x509(bag))) return 0; dump_cert_text(out, x509); - PEM_write_bio_X509(out, x509); + ret = PEM_write_bio_X509(out, x509); X509_free(x509); break; @@ -902,7 +903,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 return 1; break; } - return 1; + return ret; } /* Given a single certificate return a verified chain or NULL if error */ @@ -931,16 +932,70 @@ static int get_cert_chain(X509 *cert, X5 int alg_print(BIO *x, X509_ALGOR *alg) { - PBEPARAM *pbe; - const unsigned char *p; - p = alg->parameter->value.sequence->data; - pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length); - if (!pbe) - return 1; - BIO_printf(bio_err, "%s, Iteration %ld\n", - OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), - ASN1_INTEGER_get(pbe->iter)); - PBEPARAM_free(pbe); + int pbenid, aparamtype; + ASN1_OBJECT *aoid; + void *aparam; + PBEPARAM *pbe = NULL; + + X509_ALGOR_get0(&aoid, &aparamtype, &aparam, alg); + + pbenid = OBJ_obj2nid(aoid); + + BIO_printf(x, "%s", OBJ_nid2ln(pbenid)); + + /* + * If PBE algorithm is PBES2 decode algorithm parameters + * for additional details. + */ + if (pbenid == NID_pbes2) { + PBE2PARAM *pbe2 = NULL; + int encnid; + if (aparamtype == V_ASN1_SEQUENCE) + pbe2 = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBE2PARAM)); + if (pbe2 == NULL) { + BIO_puts(x, ""); + goto done; + } + X509_ALGOR_get0(&aoid, &aparamtype, &aparam, pbe2->keyfunc); + pbenid = OBJ_obj2nid(aoid); + X509_ALGOR_get0(&aoid, NULL, NULL, pbe2->encryption); + encnid = OBJ_obj2nid(aoid); + BIO_printf(x, ", %s, %s", OBJ_nid2ln(pbenid), + OBJ_nid2sn(encnid)); + /* If KDF is PBKDF2 decode parameters */ + if (pbenid == NID_id_pbkdf2) { + PBKDF2PARAM *kdf = NULL; + int prfnid; + if (aparamtype == V_ASN1_SEQUENCE) + kdf = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBKDF2PARAM)); + if (kdf == NULL) { + BIO_puts(x, ""); + goto done; + } + + if (kdf->prf == NULL) { + prfnid = NID_hmacWithSHA1; + } else { + X509_ALGOR_get0(&aoid, NULL, NULL, kdf->prf); + prfnid = OBJ_obj2nid(aoid); + } + BIO_printf(x, ", Iteration %ld, PRF %s", + ASN1_INTEGER_get(kdf->iter), OBJ_nid2sn(prfnid)); + PBKDF2PARAM_free(kdf); + } + PBE2PARAM_free(pbe2); + } else { + if (aparamtype == V_ASN1_SEQUENCE) + pbe = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBEPARAM)); + if (pbe == NULL) { + BIO_puts(x, ""); + goto done; + } + BIO_printf(x, ", Iteration %ld", ASN1_INTEGER_get(pbe->iter)); + PBEPARAM_free(pbe); + } + done: + BIO_puts(x, "\n"); return 1; } Modified: stable/11/crypto/openssl/apps/req.c ============================================================================== --- stable/11/crypto/openssl/apps/req.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/req.c Thu Sep 22 14:57:48 2016 (r306195) @@ -332,9 +332,10 @@ int MAIN(int argc, char **argv) subject = 1; else if (strcmp(*argv, "-text") == 0) text = 1; - else if (strcmp(*argv, "-x509") == 0) + else if (strcmp(*argv, "-x509") == 0) { + newreq = 1; x509 = 1; - else if (strcmp(*argv, "-asn1-kludge") == 0) + } else if (strcmp(*argv, "-asn1-kludge") == 0) kludge = 1; else if (strcmp(*argv, "-no-asn1-kludge") == 0) kludge = 0; @@ -756,7 +757,7 @@ int MAIN(int argc, char **argv) } } - if (newreq || x509) { + if (newreq) { if (pkey == NULL) { BIO_printf(bio_err, "you need to specify a private key\n"); goto end; @@ -1331,12 +1332,11 @@ static int auto_info(X509_REQ *req, STAC break; } #ifndef CHARSET_EBCDIC - if (*p == '+') + if (*type == '+') { #else - if (*p == os_toascii['+']) + if (*type == os_toascii['+']) { #endif - { - p++; + type++; mval = -1; } else mval = 0; Modified: stable/11/crypto/openssl/apps/s_apps.h ============================================================================== --- stable/11/crypto/openssl/apps/s_apps.h Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/s_apps.h Thu Sep 22 14:57:48 2016 (r306195) @@ -199,7 +199,8 @@ int load_excert(SSL_EXCERT **pexc, BIO * void print_ssl_summary(BIO *bio, SSL *s); #ifdef HEADER_SSL_H int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx, - int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr); + int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr, + int *no_prot_opt); int args_ssl_call(SSL_CTX *ctx, BIO *err, SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, int no_ecdhe, int no_jpake); int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, Modified: stable/11/crypto/openssl/apps/s_cb.c ============================================================================== --- stable/11/crypto/openssl/apps/s_cb.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/s_cb.c Thu Sep 22 14:57:48 2016 (r306195) @@ -1507,11 +1507,18 @@ void print_ssl_summary(BIO *bio, SSL *s) } int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx, - int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr) + int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr, + int *no_prot_opt) { char *arg = **pargs, *argn = (*pargs)[1]; int rv; + if (strcmp(arg, "-no_ssl2") == 0 || strcmp(arg, "-no_ssl3") == 0 + || strcmp(arg, "-no_tls1") == 0 || strcmp(arg, "-no_tls1_1") == 0 + || strcmp(arg, "-no_tls1_2") == 0) { + *no_prot_opt = 1; + } + /* Attempt to run SSL configuration command */ rv = SSL_CONF_cmd_argv(cctx, pargc, pargs); /* If parameter not recognised just return */ Modified: stable/11/crypto/openssl/apps/s_client.c ============================================================================== --- stable/11/crypto/openssl/apps/s_client.c Thu Sep 22 13:59:27 2016 (r306194) +++ stable/11/crypto/openssl/apps/s_client.c Thu Sep 22 14:57:48 2016 (r306195) @@ -242,9 +242,9 @@ static unsigned int psk_client_cb(SSL *s unsigned char *psk, unsigned int max_psk_len) { - unsigned int psk_len = 0; int ret; - BIGNUM *bn = NULL; + long key_len; + unsigned char *key; if (c_debug) BIO_printf(bio_c_out, "psk_client_cb\n"); @@ -265,32 +265,29 @@ static unsigned int psk_client_cb(SSL *s if (c_debug) BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity, ret); - ret = BN_hex2bn(&bn, psk_key); - if (!ret) { - BIO_printf(bio_err, "Could not convert PSK key '%s' to BIGNUM\n", + + /* convert the PSK key to binary */ + key = string_to_hex(psk_key, &key_len); + if (key == NULL) { + BIO_printf(bio_err, "Could not convert PSK key '%s' to buffer\n", psk_key); - if (bn) - BN_free(bn); return 0; } - - if ((unsigned int)BN_num_bytes(bn) > max_psk_len) { + if ((unsigned long)key_len > (unsigned long)max_psk_len) { BIO_printf(bio_err, - "psk buffer of callback is too small (%d) for key (%d)\n", - max_psk_len, BN_num_bytes(bn)); - BN_free(bn); + "psk buffer of callback is too small (%d) for key (%ld)\n", + max_psk_len, key_len); + OPENSSL_free(key); return 0; } - psk_len = BN_bn2bin(bn, psk); - BN_free(bn); - if (psk_len == 0) - goto out_err; + memcpy(psk, key, key_len); + OPENSSL_free(key); if (c_debug) - BIO_printf(bio_c_out, "created PSK len=%d\n", psk_len); + BIO_printf(bio_c_out, "created PSK len=%ld\n", key_len); - return psk_len; + return key_len; out_err: if (c_debug) BIO_printf(bio_err, "Error in PSK client callback\n"); @@ -747,6 +744,7 @@ int MAIN(int argc, char **argv) int crl_format = FORMAT_PEM; int crl_download = 0; STACK_OF(X509_CRL) *crls = NULL; + int prot_opt = 0, no_prot_opt = 0; meth = SSLv23_client_method(); @@ -850,7 +848,8 @@ int MAIN(int argc, char **argv) if (badarg) goto bad; continue; - } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args)) { + } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args, + &no_prot_opt)) { if (badarg) goto bad; continue; @@ -942,31 +941,42 @@ int MAIN(int argc, char **argv) } #endif #ifndef OPENSSL_NO_SSL2 - else if (strcmp(*argv, "-ssl2") == 0) + else if (strcmp(*argv, "-ssl2") == 0) { meth = SSLv2_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_SSL3_METHOD - else if (strcmp(*argv, "-ssl3") == 0) + else if (strcmp(*argv, "-ssl3") == 0) { meth = SSLv3_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_TLS1 - else if (strcmp(*argv, "-tls1_2") == 0) + else if (strcmp(*argv, "-tls1_2") == 0) { meth = TLSv1_2_client_method(); - else if (strcmp(*argv, "-tls1_1") == 0) + prot_opt++; + } else if (strcmp(*argv, "-tls1_1") == 0) { meth = TLSv1_1_client_method(); - else if (strcmp(*argv, "-tls1") == 0) + prot_opt++; + } else if (strcmp(*argv, "-tls1") == 0) { meth = TLSv1_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_DTLS1 else if (strcmp(*argv, "-dtls") == 0) { meth = DTLS_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1") == 0) { meth = DTLSv1_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1_2") == 0) { meth = DTLSv1_2_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-timeout") == 0) enable_timeouts = 1; else if (strcmp(*argv, "-mtu") == 0) { @@ -1149,6 +1159,17 @@ int MAIN(int argc, char **argv) } #endif + if (prot_opt > 1) { + BIO_printf(bio_err, "Cannot supply multiple protocol flags\n"); + goto end; + } + + if (prot_opt == 1 && no_prot_opt) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Thu Sep 22 15:27:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CCDEBE5538; Thu, 22 Sep 2016 15:27:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB84FCB; Thu, 22 Sep 2016 15:27:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r306195 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto... To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201609221457.u8MEvndR052567@repo.freebsd.org> From: Jung-uk Kim Message-ID: <37fa9e53-3cb0-1e41-38f1-cce64c6c5636@FreeBSD.org> Date: Thu, 22 Sep 2016 11:27:40 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <201609221457.u8MEvndR052567@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uooUtaMj5eQ3Iul0DMUvcBDWQGKKTuFkE" X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 15:27:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uooUtaMj5eQ3Iul0DMUvcBDWQGKKTuFkE Content-Type: multipart/mixed; boundary="Ip9eXp3biHXqfO7VNqMUhm4ELmSJ7D9xQ"; protected-headers="v1" From: Jung-uk Kim To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Message-ID: <37fa9e53-3cb0-1e41-38f1-cce64c6c5636@FreeBSD.org> Subject: Re: svn commit: r306195 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto... References: <201609221457.u8MEvndR052567@repo.freebsd.org> In-Reply-To: <201609221457.u8MEvndR052567@repo.freebsd.org> --Ip9eXp3biHXqfO7VNqMUhm4ELmSJ7D9xQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2016 10:57, Jung-uk Kim wrote: > Author: jkim > Date: Thu Sep 22 14:57:48 2016 > New Revision: 306195 > URL: https://svnweb.freebsd.org/changeset/base/306195 >=20 > Log: > MFC: r306193 > =20 > Merge OpenSSL 1.0.2u. ^^^^^^ Sorry, it should be read 1.0.2i. Jung-uk Kim --Ip9eXp3biHXqfO7VNqMUhm4ELmSJ7D9xQ-- --uooUtaMj5eQ3Iul0DMUvcBDWQGKKTuFkE 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 iQEcBAEBCAAGBQJX4/hxAAoJEHyflib82/FGTeMH/jpu+lwM/m4yspuuef0tOxg0 AhnzRUftHbXyVGYC5ubLtKtt0YFxKkfwAfO4gMvcDYqtP7qgOjVYaeKaHrpF3s2a ofwA9xTaHyeHKnPv2FaaDFrSXQj+jr7wRnL7XGEzKPzepnfQIrcrFhqdIYxdMAYc rjwj79jQOki1d3eTxSUoBCE4euPuItu4BorJJolSfHOBC5CWIxdz01IDNRHah8ew 1GMAZo2ZvvWopKoyxn8a1zPVbcoM8UmTF4zQEmbyhdOqZinoR7zPINEUSAQL5QKH hrqg0T8dLG7Fl/PlN2ivPy0rEXxJMoYWQs/EZkdNOeVZaFkZIRuub/S1T8pUYxk= =6cbg -----END PGP SIGNATURE----- --uooUtaMj5eQ3Iul0DMUvcBDWQGKKTuFkE-- From owner-svn-src-stable-11@freebsd.org Thu Sep 22 16:49:54 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AFFABE6558; Thu, 22 Sep 2016 16:49:54 +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 41A69F70; Thu, 22 Sep 2016 16:49:54 +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 u8MGnrV4095920; Thu, 22 Sep 2016 16:49:53 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MGnrh9095919; Thu, 22 Sep 2016 16:49:53 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609221649.u8MGnrh9095919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 22 Sep 2016 16:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306201 - stable/11/bin/cat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 16:49:54 -0000 Author: ache Date: Thu Sep 22 16:49:53 2016 New Revision: 306201 URL: https://svnweb.freebsd.org/changeset/base/306201 Log: MFC r305841 Implement multibyte encoding support for -v with fallback Modified: stable/11/bin/cat/cat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/cat/cat.c ============================================================================== --- stable/11/bin/cat/cat.c Thu Sep 22 16:46:59 2016 (r306200) +++ stable/11/bin/cat/cat.c Thu Sep 22 16:49:53 2016 (r306201) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int bflag, eflag, lflag, nflag, sflag, tflag, vflag; static int rval; @@ -207,6 +209,7 @@ static void cook_cat(FILE *fp) { int ch, gobble, line, prev; + wint_t wch; /* Reset EOF condition on stdin. */ if (fp == stdin && feof(stdin)) @@ -239,18 +242,40 @@ cook_cat(FILE *fp) continue; } } else if (vflag) { - if (!isascii(ch) && !isprint(ch)) { + (void)ungetc(ch, fp); + /* + * Our getwc(3) doesn't change file position + * on error. + */ + if ((wch = getwc(fp)) == WEOF) { + if (ferror(fp) && errno == EILSEQ) { + clearerr(fp); + /* Resync attempt. */ + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + if ((ch = getc(fp)) == EOF) + break; + wch = ch; + goto ilseq; + } else + break; + } + if (!iswascii(wch) && !iswprint(wch)) { +ilseq: if (putchar('M') == EOF || putchar('-') == EOF) break; - ch = toascii(ch); + wch = toascii(wch); } - if (iscntrl(ch)) { - if (putchar('^') == EOF || - putchar(ch == '\177' ? '?' : - ch | 0100) == EOF) + if (iswcntrl(wch)) { + ch = toascii(wch); + ch = (ch == '\177') ? '?' : (ch | 0100); + if (putchar('^') == EOF || putchar(ch) == EOF) break; continue; } + if (putwchar(wch) == WEOF) + break; + ch = -1; + continue; } if (putchar(ch) == EOF) break; From owner-svn-src-stable-11@freebsd.org Thu Sep 22 21:05:22 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4654BE471F; Thu, 22 Sep 2016 21:05:22 +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 86D961D14; Thu, 22 Sep 2016 21:05:22 +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 u8ML5LBg093826; Thu, 22 Sep 2016 21:05:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ML5LLe093825; Thu, 22 Sep 2016 21:05:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609222105.u8ML5LLe093825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Sep 2016 21:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306213 - stable/11/usr.bin/bsdiff/bspatch X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 21:05:22 -0000 Author: emaste Date: Thu Sep 22 21:05:21 2016 New Revision: 306213 URL: https://svnweb.freebsd.org/changeset/base/306213 Log: MFC bspatch Capsicumization, sanity checks, and other improvements r304691: bspatch: apply style(9) Make style changes (and trivial refactoring of open calls) now in order to reduce noise in diffs for future capsicum changes. r304807 (allanjude): Capsicumize bspatch Move all of the fopen() and open() calls to the top of main() Restrict each FD to least privilege (read/seek only, write only, etc) cap_enter(), and make all except the output FD read/seek only. r304821: bspatch: remove output file in the case of error r305486: bspatch: add sanity checks on sizes to avoid integer overflow Note that this introduces an explicit 2GB limit, but this was already implicit in variable and function argument types. This is based on the "non-cryptanalytic attacks against freebsd update components" anonymous gist. Further refinement is planned. r305737: bspatch: remove superfluous newlines from errx strings r305822: bspatch: use #define for header size instead of magic number r306026: bspatch: Remove backwards-compatibility sys/capability.h support bspatch previously included sys/capability.h or sys/capsicum.h based on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may see this file incorporated into other third-party software. The Capsicum header is now installed as sys/capsicum.h in stable/10 and FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic. Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/11/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 20:34:44 2016 (r306212) +++ stable/11/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 21:05:21 2016 (r306213) @@ -27,34 +27,60 @@ #include __FBSDID("$FreeBSD$"); +#if defined(__FreeBSD__) +#include +#if __FreeBSD_version >= 1001511 +#include +#define HAVE_CAPSICUM +#endif +#endif + #include -#include +#include +#include +#include +#include +#include +#include #include +#include #include -#include #include -#include #ifndef O_BINARY #define O_BINARY 0 #endif +#define HEADER_SIZE 32 + +static char *newfile; +static int dirfd = -1; + +static void +exit_cleanup(void) +{ + + if (dirfd != -1 && newfile != NULL) + if (unlinkat(dirfd, newfile, 0)) + warn("unlinkat"); +} static off_t offtin(u_char *buf) { off_t y; - y=buf[7]&0x7F; - y=y*256;y+=buf[6]; - y=y*256;y+=buf[5]; - y=y*256;y+=buf[4]; - y=y*256;y+=buf[3]; - y=y*256;y+=buf[2]; - y=y*256;y+=buf[1]; - y=y*256;y+=buf[0]; + y = buf[7] & 0x7F; + y = y * 256; y += buf[6]; + y = y * 256; y += buf[5]; + y = y * 256; y += buf[4]; + y = y * 256; y += buf[3]; + y = y * 256; y += buf[2]; + y = y * 256; y += buf[1]; + y = y * 256; y += buf[0]; - if(buf[7]&0x80) y=-y; + if (buf[7] & 0x80) + y = -y; - return y; + return (y); } static void @@ -65,20 +91,23 @@ usage(void) exit(1); } -int main(int argc,char * argv[]) +int main(int argc, char *argv[]) { - FILE * f, * cpf, * dpf, * epf; - BZFILE * cpfbz2, * dpfbz2, * epfbz2; + FILE *f, *cpf, *dpf, *epf; + BZFILE *cpfbz2, *dpfbz2, *epfbz2; + char *directory, *namebuf; int cbz2err, dbz2err, ebz2err; - int fd; - ssize_t oldsize,newsize; - ssize_t bzctrllen,bzdatalen; - u_char header[32],buf[8]; + int newfd, oldfd; + off_t oldsize, newsize; + off_t bzctrllen, bzdatalen; + u_char header[HEADER_SIZE], buf[8]; u_char *old, *new; - off_t oldpos,newpos; + off_t oldpos, newpos; off_t ctrl[3]; - off_t lenread; - off_t i; + off_t i, lenread, offset; +#ifdef HAVE_CAPSICUM + cap_rights_t rights_dir, rights_ro, rights_wr; +#endif if (argc != 4) usage(); @@ -86,6 +115,54 @@ int main(int argc,char * argv[]) /* Open patch file */ if ((f = fopen(argv[3], "rb")) == NULL) err(1, "fopen(%s)", argv[3]); + /* Open patch file for control block */ + if ((cpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open patch file for diff block */ + if ((dpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open patch file for extra block */ + if ((epf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open oldfile */ + if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0) + err(1, "open(%s)", argv[1]); + /* open directory where we'll write newfile */ + if ((namebuf = strdup(argv[2])) == NULL || + (directory = dirname(namebuf)) == NULL || + (dirfd = open(directory, O_DIRECTORY)) < 0) + err(1, "open %s", argv[2]); + free(namebuf); + if ((newfile = basename(argv[2])) == NULL) + err(1, "basename"); + /* open newfile */ + if ((newfd = openat(dirfd, newfile, + O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) + err(1, "open(%s)", argv[2]); + atexit(exit_cleanup); + +#ifdef HAVE_CAPSICUM + if (cap_enter() < 0) { + /* Failed to sandbox, fatal if CAPABILITY_MODE enabled */ + if (errno != ENOSYS) + err(1, "failed to enter security sandbox"); + } else { + /* Capsicum Available */ + cap_rights_init(&rights_ro, CAP_READ, CAP_FSTAT, CAP_SEEK); + cap_rights_init(&rights_wr, CAP_WRITE); + cap_rights_init(&rights_dir, CAP_UNLINKAT); + + if (cap_rights_limit(fileno(f), &rights_ro) < 0 || + cap_rights_limit(fileno(cpf), &rights_ro) < 0 || + cap_rights_limit(fileno(dpf), &rights_ro) < 0 || + cap_rights_limit(fileno(epf), &rights_ro) < 0 || + cap_rights_limit(oldfd, &rights_ro) < 0 || + cap_rights_limit(newfd, &rights_wr) < 0 || + cap_rights_limit(dirfd, &rights_dir) < 0) + err(1, "cap_rights_limit() failed, could not restrict" + " capabilities"); + } +#endif /* File format: @@ -102,99 +179,99 @@ int main(int argc,char * argv[]) */ /* Read header */ - if (fread(header, 1, 32, f) < 32) { + if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) { if (feof(f)) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); err(1, "fread(%s)", argv[3]); } /* Check for appropriate magic */ if (memcmp(header, "BSDIFF40", 8) != 0) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read lengths from header */ - bzctrllen=offtin(header+8); - bzdatalen=offtin(header+16); - newsize=offtin(header+24); - if((bzctrllen<0) || (bzdatalen<0) || (newsize<0)) - errx(1,"Corrupt patch\n"); + bzctrllen = offtin(header + 8); + bzdatalen = offtin(header + 16); + newsize = offtin(header + 24); + if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE || + bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen || + newsize < 0 || newsize > SSIZE_MAX) + errx(1, "Corrupt patch"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) err(1, "fclose(%s)", argv[3]); - if ((cpf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); - if (fseeko(cpf, 32, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)32); + offset = HEADER_SIZE; + if (fseeko(cpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - if ((dpf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); - if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen)); + offset += bzctrllen; + if (fseeko(dpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - if ((epf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); - if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen + bzdatalen)); + offset += bzdatalen; + if (fseeko(epf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); - if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) || - ((oldsize=lseek(fd,0,SEEK_END))==-1) || - ((old=malloc(oldsize+1))==NULL) || - (lseek(fd,0,SEEK_SET)!=0) || - (read(fd,old,oldsize)!=oldsize) || - (close(fd)==-1)) err(1,"%s",argv[1]); - if((new=malloc(newsize+1))==NULL) err(1,NULL); - - oldpos=0;newpos=0; - while(newpos SSIZE_MAX || + (old = malloc(oldsize)) == NULL || + lseek(oldfd, 0, SEEK_SET) != 0 || + read(oldfd, old, oldsize) != oldsize || + close(oldfd) == -1) + err(1, "%s", argv[1]); + if ((new = malloc(newsize)) == NULL) + err(1, NULL); + + oldpos = 0; + newpos = 0; + while (newpos < newsize) { /* Read control data */ - for(i=0;i<=2;i++) { + for (i = 0; i <= 2; i++) { lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8); if ((lenread < 8) || ((cbz2err != BZ_OK) && (cbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); - ctrl[i]=offtin(buf); + errx(1, "Corrupt patch"); + ctrl[i] = offtin(buf); } /* Sanity-check */ - if ((ctrl[0] < 0) || (ctrl[1] < 0)) - errx(1,"Corrupt patch\n"); + if (ctrl[0] < 0 || ctrl[0] > INT_MAX || + ctrl[1] < 0 || ctrl[1] > INT_MAX) + errx(1, "Corrupt patch"); /* Sanity-check */ - if(newpos+ctrl[0]>newsize) - errx(1,"Corrupt patch\n"); + if (newpos + ctrl[0] > newsize) + errx(1, "Corrupt patch"); /* Read diff string */ lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); if ((lenread < ctrl[0]) || ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Add old data to diff string */ - for(i=0;i=0) && (oldpos+i= 0) && (oldpos + i < oldsize)) + new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos+=ctrl[0]; - oldpos+=ctrl[0]; + newpos += ctrl[0]; + oldpos += ctrl[0]; /* Sanity-check */ - if(newpos+ctrl[1]>newsize) - errx(1,"Corrupt patch\n"); + if (newpos + ctrl[1] > newsize) + errx(1, "Corrupt patch"); /* Read extra string */ lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); if ((lenread < ctrl[1]) || ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Adjust pointers */ newpos+=ctrl[1]; @@ -209,12 +286,13 @@ int main(int argc,char * argv[]) err(1, "fclose(%s)", argv[3]); /* Write the new file */ - if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY|O_BINARY,0666))<0) || - (write(fd,new,newsize)!=newsize) || (close(fd)==-1)) - err(1,"%s",argv[2]); + if (write(newfd, new, newsize) != newsize || close(newfd) == -1) + err(1, "%s", argv[2]); + /* Disable atexit cleanup */ + newfile = NULL; free(new); free(old); - return 0; + return (0); } From owner-svn-src-stable-11@freebsd.org Fri Sep 23 03:21:41 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C87DBE5D42; Fri, 23 Sep 2016 03:21:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BED0EDB; Fri, 23 Sep 2016 03:21:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8N3Lemm035987; Fri, 23 Sep 2016 03:21:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N3Leqh035986; Fri, 23 Sep 2016 03:21:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609230321.u8N3Leqh035986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 23 Sep 2016 03:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306223 - stable/11/sys/dev/hyperv/storvsc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 03:21:41 -0000 Author: sephe Date: Fri Sep 23 03:21:40 2016 New Revision: 306223 URL: https://svnweb.freebsd.org/changeset/base/306223 Log: MFC 306015 hyperv/storvsc: Fix SRB length setting. This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued us since 10.2-release. Reported by: many Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Sep 23 01:52:06 2016 (r306222) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Sep 23 03:21:40 2016 (r306223) @@ -751,7 +751,8 @@ hv_storvsc_io_request(struct hv_device * vstor_packet->flags |= REQUEST_COMPLETION_FLAG; - vstor_packet->u.vm_srb.length = VSTOR_PKT_SIZE; + vstor_packet->u.vm_srb.length = + sizeof(struct vmscsi_req) - vmscsi_size_delta; vstor_packet->u.vm_srb.sense_info_len = sense_buffer_size; From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:17:54 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B78BE6ECB; Fri, 23 Sep 2016 08:17: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 B4DC711F; Fri, 23 Sep 2016 08:17: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 u8N8Hrmk046041; Fri, 23 Sep 2016 08:17:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8HqWK046028; Fri, 23 Sep 2016 08:17:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230817.u8N8HqWK046028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306233 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:17:54 -0000 Author: hselasky Date: Fri Sep 23 08:17:51 2016 New Revision: 306233 URL: https://svnweb.freebsd.org/changeset/base/306233 Log: MFC r305867: Update the MLX5 core module: - Add new firmware commands and update existing ones. - Add more firmware related structures and update existing ones. - Some minor fixes, like adding missing \n to some prints. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/cq.h stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/flow_table.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_fw.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_mr.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_qp.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_srq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_uar.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/11/sys/dev/mlx5/mlx5_core/transobj.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_ifc.h stable/11/sys/dev/mlx5/qp.h stable/11/sys/dev/mlx5/vport.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/cq.h ============================================================================== --- stable/11/sys/dev/mlx5/cq.h Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/cq.h Fri Sep 23 08:17:51 2016 (r306233) @@ -49,6 +49,8 @@ struct mlx5_core_cq { unsigned arm_sn; struct mlx5_rsc_debug *dbg; int pid; + int reset_notify_added; + struct list_head reset_notify; }; Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/device.h Fri Sep 23 08:17:51 2016 (r306233) @@ -57,6 +57,7 @@ #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_ST_SZ_QW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 64) #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) @@ -112,6 +113,10 @@ enum { }; enum { + MLX5_CQ_FLAGS_OI = 2, +}; + +enum { MLX5_STAT_RATE_OFFSET = 5, }; @@ -129,6 +134,10 @@ enum { }; enum { + MLX5_MKEY_INBOX_PG_ACCESS = 1 << 31 +}; + +enum { MLX5_PERM_LOCAL_READ = 1 << 2, MLX5_PERM_LOCAL_WRITE = 1 << 3, MLX5_PERM_REMOTE_READ = 1 << 4, @@ -184,6 +193,25 @@ enum { }; enum { + MLX5_UMR_TRANSLATION_OFFSET_EN = (1 << 4), + + MLX5_UMR_CHECK_NOT_FREE = (1 << 5), + MLX5_UMR_CHECK_FREE = (2 << 5), + + MLX5_UMR_INLINE = (1 << 7), +}; + +#define MLX5_UMR_MTT_ALIGNMENT 0x40 +#define MLX5_UMR_MTT_MASK (MLX5_UMR_MTT_ALIGNMENT - 1) +#define MLX5_UMR_MTT_MIN_CHUNK_SIZE MLX5_UMR_MTT_ALIGNMENT + +enum { + MLX5_EVENT_QUEUE_TYPE_QP = 0, + MLX5_EVENT_QUEUE_TYPE_RQ = 1, + MLX5_EVENT_QUEUE_TYPE_SQ = 2, +}; + +enum { MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1, MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4, MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5, @@ -194,19 +222,28 @@ enum { }; enum { + MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX = 1, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE, + MLX5_MAX_INLINE_RECEIVE_SIZE = 64 +}; + +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_ATOMIC = 1LL << 33, 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, + MLX5_DEV_CAP_FLAG_DRAIN_SIGERR = 1LL << 48, }; enum { @@ -263,6 +300,7 @@ enum { MLX5_OPCODE_UMR = 0x25, + MLX5_OPCODE_SIGNATURE_CANCELED = (1 << 15), }; enum { @@ -299,6 +337,18 @@ struct mlx5_outbox_hdr { __be32 syndrome; }; +struct mlx5_cmd_set_dc_cnak_mbox_in { + struct mlx5_inbox_hdr hdr; + u8 enable; + u8 reserved[47]; + __be64 pa; +}; + +struct mlx5_cmd_set_dc_cnak_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + struct mlx5_cmd_layout { u8 type; u8 rsvd0[3]; @@ -339,9 +389,12 @@ struct mlx5_init_seg { __be32 rsvd1[120]; __be32 initializing; struct mlx5_health_buffer health; - __be32 rsvd2[884]; + __be32 rsvd2[880]; + __be32 internal_timer_h; + __be32 internal_timer_l; + __be32 rsvd3[2]; __be32 health_counter; - __be32 rsvd3[1019]; + __be32 rsvd4[1019]; __be64 ieee1588_clk; __be32 ieee1588_clk_type; __be32 clr_intx; @@ -420,6 +473,7 @@ enum { MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4, MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, + MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, }; struct mlx5_eqe_port_module_event { @@ -832,6 +886,10 @@ struct mlx5_query_eq_mbox_out { struct mlx5_eq_context ctx; }; +enum { + MLX5_MKEY_STATUS_FREE = 1 << 6, +}; + struct mlx5_mkey_seg { /* This is a two bit field occupying bits 31-30. * bit 31 is always 0, @@ -868,7 +926,7 @@ struct mlx5_query_special_ctxs_mbox_out struct mlx5_create_mkey_mbox_in { struct mlx5_inbox_hdr hdr; __be32 input_mkey_index; - u8 rsvd0[4]; + __be32 flags; struct mlx5_mkey_seg seg; u8 rsvd1[16]; __be32 xlat_oct_act_size; @@ -971,6 +1029,17 @@ struct mlx5_destroy_psv_out { u8 rsvd[8]; }; +static inline int mlx5_host_is_le(void) +{ +#if defined(__LITTLE_ENDIAN) + return 1; +#elif defined(__BIG_ENDIAN) + return 0; +#else +#error Host endianness not defined +#endif +} + #define MLX5_CMD_OP_MAX 0x939 enum { @@ -1008,6 +1077,8 @@ enum { MLX5_FLOW_TABLE_TYPE_EGRESS_ACL = 2, MLX5_FLOW_TABLE_TYPE_INGRESS_ACL = 3, MLX5_FLOW_TABLE_TYPE_ESWITCH = 4, + MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 5, + MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 6, }; enum { @@ -1062,6 +1133,10 @@ enum mlx5_cap_type { MLX5_CAP_FLOW_TABLE, MLX5_CAP_ESWITCH_FLOW_TABLE, MLX5_CAP_ESWITCH, + MLX5_CAP_SNAPSHOT, + MLX5_CAP_VECTOR_CALC, + MLX5_CAP_QOS, + MLX5_CAP_DEBUG, /* NUM OF CAP Types */ MLX5_CAP_NUM }; @@ -1107,21 +1182,23 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_ingress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_ingress.cap) +#define MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_FDB_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_ingress.cap) #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ @@ -1137,6 +1214,38 @@ enum mlx5_cap_type { #define MLX5_CAP_ODP_MAX(mdev, cap)\ MLX5_GET(odp_cap, mdev->hca_caps_max[MLX5_CAP_ODP], cap) +#define MLX5_CAP_SNAPSHOT(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_cur[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_SNAPSHOT_MAX(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_max[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_EOIB_OFFLOADS(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_cur[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_EOIB_OFFLOADS_MAX(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_max[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_DEBUG(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_cur[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_DEBUG_MAX(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_max[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_QOS(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_cur[MLX5_CAP_QOS], cap) + +#define MLX5_CAP_QOS_MAX(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_max[MLX5_CAP_QOS], cap) + enum { MLX5_CMD_STAT_OK = 0x0, MLX5_CMD_STAT_INT_ERR = 0x1, @@ -1168,6 +1277,22 @@ enum { }; enum { + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP = 0x0, + MLX5_PCIE_LANE_COUNTERS_GROUP = 0x1, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP = 0x2, +}; + +enum { + MLX5_NUM_UUARS_PER_PAGE = MLX5_NON_FP_BF_REGS_PER_PAGE, + MLX5_DEF_TOT_UUARS = 8 * MLX5_NUM_UUARS_PER_PAGE, +}; + +enum { + NUM_DRIVER_UARS = 4, + NUM_LOW_LAT_UUARS = 4, +}; + +enum { MLX5_CAP_PORT_TYPE_IB = 0x0, MLX5_CAP_PORT_TYPE_ETH = 0x1, }; @@ -1252,4 +1377,7 @@ static inline int mlx5_get_cqe_format(co return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } +/* 8 regular priorities + 1 for multicast */ +#define MLX5_NUM_BYPASS_FTS 9 + #endif /* MLX5_DEVICE_H */ Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/driver.h Fri Sep 23 08:17:51 2016 (r306233) @@ -42,16 +42,15 @@ #include #include +#define MLX5_QCOUNTER_SETS_NETDEV 64 + enum { MLX5_BOARD_ID_LEN = 64, MLX5_MAX_NAME_LEN = 16, }; enum { - /* one minute for the sake of bringup. Generally, commands must always - * complete and we may need to increase this timeout value - */ - MLX5_CMD_TIMEOUT_MSEC = 7200 * 1000, + MLX5_CMD_TIMEOUT_MSEC = 8 * 60 * 1000, MLX5_CMD_WQ_MAX_NAME = 32, }; @@ -85,20 +84,44 @@ enum { }; enum { - MLX5_ATOMIC_MODE_IB_COMP = 1 << 16, - MLX5_ATOMIC_MODE_CX = 2 << 16, - MLX5_ATOMIC_MODE_8B = 3 << 16, - MLX5_ATOMIC_MODE_16B = 4 << 16, - MLX5_ATOMIC_MODE_32B = 5 << 16, - MLX5_ATOMIC_MODE_64B = 6 << 16, - MLX5_ATOMIC_MODE_128B = 7 << 16, - MLX5_ATOMIC_MODE_256B = 8 << 16, + MLX5_ATOMIC_MODE_OFF = 16, + MLX5_ATOMIC_MODE_NONE = 0 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_IB_COMP = 1 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_CX = 2 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_8B = 3 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_16B = 4 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_32B = 5 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_64B = 6 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_128B = 7 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_256B = 8 << MLX5_ATOMIC_MODE_OFF, +}; + +enum { + MLX5_ATOMIC_MODE_DCT_OFF = 20, + MLX5_ATOMIC_MODE_DCT_NONE = 0 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_IB_COMP = 1 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_CX = 2 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_8B = 3 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_16B = 4 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_32B = 5 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_64B = 6 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_128B = 7 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_256B = 8 << MLX5_ATOMIC_MODE_DCT_OFF, +}; + +enum { + MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, + MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, + MLX5_ATOMIC_OPS_MASKED_CMP_SWAP = 1 << 2, + MLX5_ATOMIC_OPS_MASKED_FETCH_ADD = 1 << 3, }; enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP = 0x4007, MLX5_REG_QTCT = 0x400A, + MLX5_REG_DCBX_PARAM = 0x4020, + MLX5_REG_DCBX_APP = 0x4021, MLX5_REG_PCAP = 0x5001, MLX5_REG_PMTU = 0x5003, MLX5_REG_PTYS = 0x5004, @@ -116,6 +139,7 @@ enum { MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MCIA = 0x9014, + MLX5_REG_MPCNT = 0x9051, }; enum dbg_rsc_type { @@ -124,6 +148,12 @@ enum dbg_rsc_type { MLX5_DBG_RSC_CQ, }; +enum { + MLX5_INTERFACE_PROTOCOL_IB = 0, + MLX5_INTERFACE_PROTOCOL_ETH = 1, + MLX5_INTERFACE_NUMBER = 2, +}; + struct mlx5_field_desc { struct dentry *dent; int i; @@ -147,6 +177,10 @@ enum mlx5_dev_event { MLX5_DEV_EVENT_GUID_CHANGE, MLX5_DEV_EVENT_CLIENT_REREG, MLX5_DEV_EVENT_VPORT_CHANGE, + MLX5_DEV_EVENT_ERROR_STATE_DCBX, + MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE, + MLX5_DEV_EVENT_LOCAL_OPER_CHANGE, + MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE, }; enum mlx5_port_status { @@ -375,9 +409,12 @@ struct mlx5_core_mr { }; enum mlx5_res_type { - MLX5_RES_QP, - MLX5_RES_SRQ, - MLX5_RES_XSRQ, + MLX5_RES_QP = MLX5_EVENT_QUEUE_TYPE_QP, + MLX5_RES_RQ = MLX5_EVENT_QUEUE_TYPE_RQ, + MLX5_RES_SQ = MLX5_EVENT_QUEUE_TYPE_SQ, + MLX5_RES_SRQ = 3, + MLX5_RES_XSRQ = 4, + MLX5_RES_DCT = 5, }; struct mlx5_core_rsc_common { @@ -413,8 +450,6 @@ struct mlx5_eq_table { struct mlx5_uar { u32 index; - struct list_head bf_list; - unsigned free_bf_bmap; void __iomem *bf_map; void __iomem *map; }; @@ -461,7 +496,7 @@ struct mlx5_srq_table { struct mlx5_mr_table { /* protect radix tree */ - rwlock_t lock; + spinlock_t lock; struct radix_tree_root tree; }; @@ -483,7 +518,7 @@ struct mlx5_priv { struct workqueue_struct *pg_wq; struct rb_root page_root; int fw_pages; - int reg_pages; + atomic_t reg_pages; struct list_head free_list; struct mlx5_core_health health; @@ -521,6 +556,12 @@ struct mlx5_priv { struct list_head dev_list; struct list_head ctx_list; spinlock_t ctx_lock; + unsigned long pci_dev_data; +}; + +enum mlx5_device_state { + MLX5_DEVICE_STATE_UP, + MLX5_DEVICE_STATE_INTERNAL_ERROR, }; struct mlx5_special_contexts { @@ -535,6 +576,7 @@ struct mlx5_core_dev { u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; struct mlx5_init_seg __iomem *iseg; + enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, enum mlx5_dev_event event, unsigned long param); @@ -544,6 +586,7 @@ struct mlx5_core_dev { u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; + u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; }; enum { @@ -573,6 +616,8 @@ struct mlx5_net_counters { }; struct mlx5_ptys_reg { + u8 an_dis_admin; + u8 an_dis_ap; u8 local_port; u8 proto_mask; u32 eth_proto_cap; @@ -620,6 +665,15 @@ enum { MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, }; +struct mlx5_core_dct { + struct mlx5_core_rsc_common common; /* must be first */ + void (*event)(struct mlx5_core_dct *, int); + int dctn; + struct completion drained; + struct mlx5_rsc_debug *dbg; + int pid; +}; + enum { MLX5_COMP_EQ_SIZE = 1024, }; @@ -725,9 +779,14 @@ static inline void *mlx5_vzalloc(unsigne return rtn; } -static inline u32 mlx5_base_mkey(const u32 key) +static inline void *mlx5_vmalloc(unsigned long size) { - return key & 0xffffff00u; + void *rtn; + + rtn = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); + if (!rtn) + rtn = vmalloc(size); + return rtn; } int mlx5_cmd_init(struct mlx5_core_dev *dev); @@ -809,6 +868,8 @@ int mlx5_stop_eqs(struct mlx5_core_dev * int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, int *irqn); int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); +int mlx5_core_set_dc_cnak_trace(struct mlx5_core_dev *dev, int enable, + u64 addr); int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev); void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev); @@ -816,11 +877,16 @@ int mlx5_core_access_reg(struct mlx5_cor int size_in, void *data_out, int size_out, u16 reg_num, int arg, int write); +void mlx5_toggle_port_link(struct mlx5_core_dev *dev); int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, int ptys_size, int proto_mask); int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev, u32 *proto_cap, int proto_mask); +int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask, + u8 *an_disable_cap, u8 *an_disable_status); +int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable, + u32 eth_proto_admin, int proto_mask); int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev, u32 *proto_admin, int proto_mask); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, @@ -828,10 +894,14 @@ int mlx5_set_port_proto(struct mlx5_core int mlx5_set_port_status(struct mlx5_core_dev *dev, enum mlx5_port_status status); int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); +int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, + enum mlx5_port_status *status); int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, u32 rx_pause, u32 tx_pause); int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, u32 *rx_pause, u32 *tx_pause); +int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); +int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); @@ -884,6 +954,9 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); +int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); +int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, + u16 sample_index, void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; @@ -905,12 +978,7 @@ enum { }; enum { - MAX_MR_CACHE_ENTRIES = 16, -}; - -enum { - MLX5_INTERFACE_PROTOCOL_IB = 0, - MLX5_INTERFACE_PROTOCOL_ETH = 1, + MAX_MR_CACHE_ENTRIES = 15, }; struct mlx5_interface { @@ -936,6 +1004,14 @@ struct mlx5_profile { } mr_cache[MAX_MR_CACHE_ENTRIES]; }; +enum { + MLX5_PCI_DEV_IS_VF = 1 << 0, +}; + +static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev) +{ + return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF); +} #define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff Modified: stable/11/sys/dev/mlx5/flow_table.h ============================================================================== --- stable/11/sys/dev/mlx5/flow_table.h Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/flow_table.h Fri Sep 23 08:17:51 2016 (r306233) @@ -30,6 +30,9 @@ #include +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET 0x0 +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_RESET 0x1 + struct mlx5_flow_table_group { u8 log_sz; u8 match_criteria_enable; @@ -44,7 +47,10 @@ void mlx5_destroy_flow_table(void *flow_ int mlx5_add_flow_table_entry(void *flow_table, u8 match_criteria_enable, void *match_criteria, void *flow_context, u32 *flow_index); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); u32 mlx5_get_flow_table_id(void *flow_table); +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn); #endif /* MLX5_FLOW_TABLE_H */ Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 23 08:17:51 2016 (r306233) @@ -121,7 +121,7 @@ static int alloc_ent(struct mlx5_cmd *cm clear_bit(ret, &cmd->bitmask); spin_unlock_irqrestore(&cmd->alloc_lock, flags); - return ret < cmd->max_reg_cmds ? ret : -ENOMEM; + return ret < cmd->max_reg_cmds ? ret : -1; } static void free_ent(struct mlx5_cmd *cmd, int idx) @@ -396,6 +396,9 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_CREATE_DCT: return "CREATE_DCT"; + case MLX5_CMD_OP_SET_DC_CNAK_TRACE: + return "SET_DC_CNAK_TRACE"; + case MLX5_CMD_OP_DESTROY_DCT: return "DESTROY_DCT"; @@ -639,6 +642,12 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: return "DELETE_FLOW_TABLE_ENTRY"; + case MLX5_CMD_OP_SET_DIAGNOSTICS: + return "MLX5_CMD_OP_SET_DIAGNOSTICS"; + + case MLX5_CMD_OP_QUERY_DIAGNOSTICS: + return "MLX5_CMD_OP_QUERY_DIAGNOSTICS"; + default: return "unknown command opcode"; } } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 23 08:17:51 2016 (r306233) @@ -64,6 +64,8 @@ enum { MLX5_CMD_TIME, /* print command execution time */ }; +struct mlx5_core_dev; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 23 08:17:51 2016 (r306233) @@ -187,10 +187,12 @@ int mlx5_core_destroy_cq(struct mlx5_cor in.cqn = cpu_to_be32(cq->cqn); err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); if (err) - return err; + goto out; - if (out.hdr.status) - return mlx5_cmd_status_to_err(&out.hdr); + if (out.hdr.status) { + err = mlx5_cmd_status_to_err(&out.hdr); + goto out; + } synchronize_irq(cq->irqn); @@ -198,7 +200,9 @@ int mlx5_core_destroy_cq(struct mlx5_cor complete(&cq->free); wait_for_completion(&cq->free); - return 0; +out: + + return err; } EXPORT_SYMBOL(mlx5_core_destroy_cq); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 23 08:17:51 2016 (r306233) @@ -155,6 +155,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_PAGE_REQUEST"; case MLX5_EVENT_TYPE_NIC_VPORT_CHANGE: return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; default: return "Unrecognized event"; } @@ -181,6 +183,21 @@ static enum mlx5_dev_event port_subtype_ return -1; } +static enum mlx5_dev_event dcbx_subevent(u8 subtype) +{ + switch (subtype) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + return MLX5_DEV_EVENT_ERROR_STATE_DCBX; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + return MLX5_DEV_EVENT_LOCAL_OPER_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE; + } + return -1; +} + static void eq_update_ci(struct mlx5_eq *eq, int arm) { __be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2); @@ -259,6 +276,26 @@ static int mlx5_eq_int(struct mlx5_core_ port, eqe->sub_type); } break; + + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + port = (eqe->data.port.port >> 4) & 0xf; + switch (eqe->sub_type) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + if (dev->event) + dev->event(dev, + dcbx_subevent(eqe->sub_type), + 0); + break; + default: + mlx5_core_warn(dev, + "dcbx event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + } + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -476,6 +513,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + if (MLX5_CAP_GEN(dev, dcbx)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); @@ -573,6 +614,8 @@ static const char *mlx5_port_module_even return "Unknown identifier"; case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE: return "High Temperature"; + case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: + return "Cable is shorted"; default: return "Unknown error type"; @@ -605,19 +648,19 @@ static void mlx5_port_module_event(struc switch (module_status) { case MLX5_MODULE_STATUS_PLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged\n", module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged\n", module_num); break; case MLX5_MODULE_STATUS_ERROR: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s", module_num, mlx5_port_module_event_error_type_to_string(error_type)); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); break; default: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status\n", module_num); } /* store module status */ if (module_num < MLX5_MAX_PORTS) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 23 08:17:51 2016 (r306233) @@ -96,10 +96,10 @@ static int mlx5_vacl_table_allow_vlan(vo MLX5_SET(flow_context, flow_context, action, MLX5_FLOW_CONTEXT_ACTION_ALLOW); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_value, outer_headers.first_vid, vlan); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_criteria, outer_headers.first_vid, 0xfff); if (acl_table->spoofchk_enabled) { @@ -255,8 +255,8 @@ static int mlx5_vacl_table_apply_untagge /* Apply new untagged rule */ MLX5_SET(flow_context, flow_context, action, new_action); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 0); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 0); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); if (acl_table->spoofchk_enabled) { smac = MLX5_ADDR_OF(fte_match_param, in_match_value, @@ -549,7 +549,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); if (spoofchk) { smac = MLX5_ADDR_OF(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx] @@ -564,7 +564,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, outer_headers.first_vid, 0xfff); @@ -627,10 +627,10 @@ void *mlx5_vacl_table_create(struct mlx5 struct mlx5_vacl_table *acl_table; int err = 0; - if (is_egress && !MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, ft_support)) + if (is_egress && !MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) return NULL; - if (!is_egress && !MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, ft_support)) + if (!is_egress && !MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) return NULL; acl_table = kzalloc(sizeof(*acl_table), GFP_KERNEL); @@ -640,9 +640,9 @@ void *mlx5_vacl_table_create(struct mlx5 acl_table->acl_type = is_egress ? MLX5_FLOW_TABLE_TYPE_EGRESS_ACL : MLX5_FLOW_TABLE_TYPE_INGRESS_ACL; acl_table->max_ft_size = (is_egress ? - MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, + MLX5_CAP_ESW_EGRESS_ACL(dev, log_max_ft_size) : - MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, + MLX5_CAP_ESW_INGRESS_ACL(dev, log_max_ft_size)); acl_table->dev = dev; acl_table->vport = vport; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 23 08:17:51 2016 (r306233) @@ -87,7 +87,7 @@ static int mlx5_set_flow_entry_cmd(struc return err; } -static void mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) +static int mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) { u32 in[MLX5_ST_SZ_DW(delete_fte_in)]; u32 out[MLX5_ST_SZ_DW(delete_fte_out)]; @@ -103,7 +103,8 @@ static void mlx5_del_flow_entry_cmd(stru MLX5_SET_DFTEI(in, flow_index, flow_index); MLX5_SET_DFTEI(in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); - mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, sizeof(out)); + return mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, + sizeof(out)); } static void mlx5_destroy_flow_group_cmd(struct mlx5_flow_table *ft, int i) @@ -343,12 +344,15 @@ int mlx5_add_flow_table_entry(void *flow } EXPORT_SYMBOL(mlx5_add_flow_table_entry); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) { struct mlx5_flow_table *ft = flow_table; + int ret; - mlx5_del_flow_entry_cmd(ft, flow_index); - mlx5_free_flow_index(ft, flow_index); + ret = mlx5_del_flow_entry_cmd(ft, flow_index); + if (!ret) + mlx5_free_flow_index(ft, flow_index); + return ret; } EXPORT_SYMBOL(mlx5_del_flow_table_entry); @@ -430,3 +434,46 @@ u32 mlx5_get_flow_table_id(void *flow_ta return ft->id; } EXPORT_SYMBOL(mlx5_get_flow_table_id); + +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn) +{ + u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)]; + u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)]; + int err; + int is_group_manager; + + is_group_manager = MLX5_CAP_GEN(mdev, vport_group_manager); + + memset(in, 0, sizeof(in)); + + MLX5_SET(set_flow_table_root_in, in, op_mod, op_mod); + MLX5_SET(set_flow_table_root_in, in, table_type, table_type); + MLX5_SET(set_flow_table_root_in, in, underlay_qpn, underlay_qpn); + if (op_mod == MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET) + MLX5_SET(set_flow_table_root_in, in, table_id, table_id); + + MLX5_SET(set_flow_table_root_in, in, opcode, + MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); + + if (vport_num) { + if (is_group_manager) { + MLX5_SET(set_flow_table_root_in, in, other_vport, + 1); + MLX5_SET(set_flow_table_root_in, in, vport_number, + vport_num); + } else { + return -EPERM; + } + } + + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, + sizeof(out)); + if (err) + return err; + + return 0; +} +EXPORT_SYMBOL(mlx5_set_flow_table_root); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 23 08:13:46 2016 (r306232) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 23 08:17:51 2016 (r306233) @@ -201,6 +201,50 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } + if (MLX5_CAP_GEN(dev, snapshot)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_MAX); + if (err) + return err; + } + + if (MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_MAX); + if (err) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:19:24 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21ECBBE6FF1; Fri, 23 Sep 2016 08:19: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 D79222D1; Fri, 23 Sep 2016 08:19: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 u8N8JN9P046150; Fri, 23 Sep 2016 08:19:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8JMpq046146; Fri, 23 Sep 2016 08:19:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230819.u8N8JMpq046146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306234 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:19:24 -0000 Author: hselasky Date: Fri Sep 23 08:19:22 2016 New Revision: 306234 URL: https://svnweb.freebsd.org/changeset/base/306234 Log: MFC r305868: mlx5en: Separate the sendqueue from using the mlx5e_channel structure. This change allows for reusing the transmit path for so called rate limited senqueues. While at it optimise some pointer lookups in the fast path. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:17:51 2016 (r306233) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:19:22 2016 (r306234) @@ -433,9 +433,9 @@ struct mlx5e_cq { /* data path - accessed per HW polling */ struct mlx5_core_cq mcq; - struct mlx5e_channel *channel; /* control */ + struct mlx5e_priv *priv; struct mlx5_wq_ctrl wq_ctrl; } __aligned(MLX5E_CACHELINE_SIZE); @@ -515,6 +515,7 @@ struct mlx5e_sq { struct mlx5_wq_cyc wq; void __iomem *uar_map; void __iomem *uar_bf_map; + struct ifnet *ifp; u32 sqn; u32 bf_buf_size; struct device *pdev; @@ -523,7 +524,7 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; struct mlx5_uar uar; - struct mlx5e_channel *channel; + struct mlx5e_priv *priv; int tc; unsigned int queue_state; } __aligned(MLX5E_CACHELINE_SIZE); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:17:51 2016 (r306233) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:19:22 2016 (r306234) @@ -982,7 +982,8 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; - sq->channel = c; + sq->ifp = priv->ifp; + sq->priv = priv; sq->tc = tc; sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, @@ -1039,15 +1040,12 @@ done: static void mlx5e_destroy_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - /* destroy all sysctl nodes */ sysctl_ctx_free(&sq->stats.ctx); mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); - mlx5_unmap_free_uar(priv->mdev, &sq->uar); + mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); taskqueue_drain(sq->sq_tq, &sq->sq_task); taskqueue_free(sq->sq_tq); buf_ring_free(sq->br, M_MLX5EN); @@ -1056,10 +1054,6 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) static int mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; void *wq; @@ -1077,8 +1071,8 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, priv->tisn[sq->tc]); - MLX5_SET(sqc, sqc, cqn, c->sq[sq->tc].cq.mcq.cqn); + MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); MLX5_SET(sqc, sqc, flush_in_error_en, 1); @@ -1092,7 +1086,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str mlx5_fill_page_array(&sq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(wq, wq, pas)); - err = mlx5_core_create_sq(mdev, in, inlen, &sq->sqn); + err = mlx5_core_create_sq(sq->priv->mdev, in, inlen, &sq->sqn); kvfree(in); @@ -1102,10 +1096,6 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str static int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; int inlen; @@ -1122,7 +1112,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int MLX5_SET(modify_sq_in, in, sq_state, curr_state); MLX5_SET(sqc, sqc, state, next_state); - err = mlx5_core_modify_sq(mdev, in, inlen); + err = mlx5_core_modify_sq(sq->priv->mdev, in, inlen); kvfree(in); @@ -1132,11 +1122,8 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int static void mlx5e_disable_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_sq(mdev, sq->sqn); + mlx5_core_destroy_sq(sq->priv->mdev, sq->sqn); } static int @@ -1302,7 +1289,7 @@ mlx5e_create_cq(struct mlx5e_channel *c, cqe->op_own = 0xf1; } - cq->channel = c; + cq->priv = priv; return (0); } @@ -1317,9 +1304,6 @@ static int mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, u8 moderation_mode) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; void *in; void *cqc; @@ -1341,7 +1325,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); @@ -1350,7 +1334,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str PAGE_SHIFT); MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma); - err = mlx5_core_create_cq(mdev, mcq, in, inlen); + err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen); kvfree(in); @@ -1365,11 +1349,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str static void mlx5e_disable_cq(struct mlx5e_cq *cq) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_cq(mdev, &cq->mcq); + mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } static int Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:17:51 2016 (r306233) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:19:22 2016 (r306234) @@ -233,7 +233,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Setup local variables */ pi = sq->pc & sq->wq.sz_m1; wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); - ifp = sq->channel->ifp; + ifp = sq->ifp; memset(wqe, 0, sizeof(*wqe)); @@ -534,7 +534,7 @@ void mlx5e_tx_que(void *context, int pending) { struct mlx5e_sq *sq = context; - struct ifnet *ifp = sq->channel->ifp; + struct ifnet *ifp = sq->ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sq->lock); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 23 08:17:51 2016 (r306233) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 23 08:19:22 2016 (r306234) @@ -47,10 +47,7 @@ void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int event) { struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct ifnet *ifp = priv->ifp; - if_printf(ifp, "%s: cqn=0x%.6x event=0x%.2x\n", + if_printf(cq->priv->ifp, "%s: cqn=0x%.6x event=0x%.2x\n", __func__, mcq->cqn, event); } From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:20:17 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BF9BE608C; Fri, 23 Sep 2016 08:20:17 +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 2C84C65B; Fri, 23 Sep 2016 08:20:17 +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 u8N8KGPZ046265; Fri, 23 Sep 2016 08:20:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8KGmX046264; Fri, 23 Sep 2016 08:20:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230820.u8N8KGmX046264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306235 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:20:17 -0000 Author: hselasky Date: Fri Sep 23 08:20:16 2016 New Revision: 306235 URL: https://svnweb.freebsd.org/changeset/base/306235 Log: MFC r305869: mlx5en: Minor completion queue control path code refactor. Move setting of CQ moderation mode together with the other CQ moderation parameters. Pass completion event vector as a separate argument to mlx5e_open_cq(), because its value is different for each call. Pass mlx5e_priv pointer instead of mlx5e_channel pointer so that code can be used by rate limiting sendqueues. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:19:22 2016 (r306234) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:20:16 2016 (r306235) @@ -47,7 +47,6 @@ struct mlx5e_sq_param { struct mlx5e_cq_param { u32 cqc [MLX5_ST_SZ_DW(cqc)]; struct mlx5_wq_param wq; - u16 eq_ix; }; struct mlx5e_channel_param { @@ -1248,12 +1247,12 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) } static int -mlx5e_create_cq(struct mlx5e_channel *c, +mlx5e_create_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, - mlx5e_cq_comp_t *comp) + mlx5e_cq_comp_t *comp, + int eq_ix) { - struct mlx5e_priv *priv = c->priv; struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; int eqn_not_used; @@ -1263,21 +1262,20 @@ mlx5e_create_cq(struct mlx5e_channel *c, param->wq.buf_numa_node = 0; param->wq.db_numa_node = 0; - param->eq_ix = c->ix; err = mlx5_cqwq_create(mdev, ¶m->wq, param->cqc, &cq->wq, &cq->wq_ctrl); if (err) return (err); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn_not_used, &irqn); + mlx5_vector2eqn(mdev, eq_ix, &eqn_not_used, &irqn); mcq->cqe_sz = 64; mcq->set_ci_db = cq->wq_ctrl.db.db; mcq->arm_db = cq->wq_ctrl.db.db + 1; *mcq->set_ci_db = 0; *mcq->arm_db = 0; - mcq->vector = param->eq_ix; + mcq->vector = eq_ix; mcq->comp = comp; mcq->event = mlx5e_cq_error_event; mcq->irqn = irqn; @@ -1301,8 +1299,7 @@ mlx5e_destroy_cq(struct mlx5e_cq *cq) } static int -mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, - u8 moderation_mode) +mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix) { struct mlx5_core_cq *mcq = &cq->mcq; void *in; @@ -1325,9 +1322,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, eq_ix, &eqn, &irqn_not_used); - MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET(cqc, cqc, uar_page, mcq->uar->index); MLX5_SET(cqc, cqc, log_page_size, cq->wq_ctrl.buf.page_shift - @@ -1354,19 +1350,19 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) } static int -mlx5e_open_cq(struct mlx5e_channel *c, +mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, mlx5e_cq_comp_t *comp, - u8 moderation_mode) + int eq_ix) { int err; - err = mlx5e_create_cq(c, param, cq, comp); + err = mlx5e_create_cq(priv, param, cq, comp, eq_ix); if (err) return (err); - err = mlx5e_enable_cq(cq, param, moderation_mode); + err = mlx5e_enable_cq(cq, param, eq_ix); if (err) goto err_destroy_cq; @@ -1389,25 +1385,13 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { - u8 tx_moderation_mode; int err; int tc; - switch (c->priv->params.tx_cq_moderation_mode) { - case 0: - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ - err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, tx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->tx_cq, &c->sq[tc].cq, + &mlx5e_tx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; } @@ -1503,7 +1487,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr struct mlx5e_channel *volatile *cp) { struct mlx5e_channel *c; - u8 rx_moderation_mode; int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); @@ -1526,21 +1509,9 @@ mlx5e_open_channel(struct mlx5e_priv *pr if (err) goto err_free; - switch (priv->params.rx_cq_moderation_mode) { - case 0: - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } - /* open receive completion queue */ - err = mlx5e_open_cq(c, &cparam->rx_cq, &c->rq.cq, - &mlx5e_rx_cq_comp, rx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->rx_cq, &c->rq.cq, + &mlx5e_rx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; @@ -1670,6 +1641,18 @@ mlx5e_build_rx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); + switch (priv->params.rx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } @@ -1683,6 +1666,18 @@ mlx5e_build_tx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.tx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.tx_cq_moderation_pkts); + switch (priv->params.tx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:21:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5EF0BE6154; Fri, 23 Sep 2016 08:21:46 +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 AA6C4906; Fri, 23 Sep 2016 08:21:46 +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 u8N8LjvE048970; Fri, 23 Sep 2016 08:21:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8LjGP048968; Fri, 23 Sep 2016 08:21:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230821.u8N8LjGP048968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306236 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:21:47 -0000 Author: hselasky Date: Fri Sep 23 08:21:45 2016 New Revision: 306236 URL: https://svnweb.freebsd.org/changeset/base/306236 Log: MFC r305870: mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global. Make some functions and structures global to allow for code reuse when creating rate limiting sendqueues. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:20:16 2016 (r306235) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:21:45 2016 (r306236) @@ -352,6 +352,21 @@ struct mlx5e_stats { struct mlx5e_port_stats_debug port_stats_debug; }; +struct mlx5e_rq_param { + u32 rqc [MLX5_ST_SZ_DW(rqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_sq_param { + u32 sqc [MLX5_ST_SZ_DW(sqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_cq_param { + u32 cqc [MLX5_ST_SZ_DW(cqc)]; + struct mlx5_wq_param wq; +}; + struct mlx5e_params { u8 log_sq_size; u8 log_rq_size; @@ -794,5 +809,8 @@ void mlx5e_create_stats(struct sysctl_ct void mlx5e_send_nop(struct mlx5e_sq *, u32); void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); +int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, + struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); +void mlx5e_close_cq(struct mlx5e_cq *); #endif /* _MLX5_EN_H_ */ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:20:16 2016 (r306235) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:21:45 2016 (r306236) @@ -34,21 +34,6 @@ char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; -struct mlx5e_rq_param { - u32 rqc [MLX5_ST_SZ_DW(rqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_sq_param { - u32 sqc [MLX5_ST_SZ_DW(sqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_cq_param { - u32 cqc [MLX5_ST_SZ_DW(cqc)]; - struct mlx5_wq_param wq; -}; - struct mlx5e_channel_param { struct mlx5e_rq_param rq; struct mlx5e_sq_param sq; @@ -1349,7 +1334,7 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } -static int +int mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, @@ -1374,7 +1359,7 @@ err_destroy_cq: return (err); } -static void +void mlx5e_close_cq(struct mlx5e_cq *cq) { mlx5e_disable_cq(cq); From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:22:31 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81289BE62A9; Fri, 23 Sep 2016 08:22:31 +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 37C8FBB4; Fri, 23 Sep 2016 08:22:31 +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 u8N8MUpd049844; Fri, 23 Sep 2016 08:22:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8MUmf049842; Fri, 23 Sep 2016 08:22:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230822.u8N8MUmf049842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306237 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:22:31 -0000 Author: hselasky Date: Fri Sep 23 08:22:30 2016 New Revision: 306237 URL: https://svnweb.freebsd.org/changeset/base/306237 Log: MFC r305871: mlx5en: Optimise away duplicate UAR pointers. This change also reduces the size of the mlx5e_sq structure so that the last queue_state element will fit into the previous cacheline and then the mlx5e_sq structure becomes one cacheline less for amd64. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:21:45 2016 (r306236) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:22:30 2016 (r306237) @@ -528,8 +528,7 @@ struct mlx5e_sq { /* read only */ struct mlx5_wq_cyc wq; - void __iomem *uar_map; - void __iomem *uar_bf_map; + struct mlx5_uar uar; struct ifnet *ifp; u32 sqn; u32 bf_buf_size; @@ -538,7 +537,6 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; - struct mlx5_uar uar; struct mlx5e_priv *priv; int tc; unsigned int queue_state; @@ -780,13 +778,13 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); if (bf_sz) { - __iowrite64_copy(sq->uar_bf_map + ofst, wqe, bf_sz); + __iowrite64_copy(sq->uar.bf_map + ofst, wqe, bf_sz); /* flush the write-combining mapped buffer */ wmb(); } else { - mlx5_write64(wqe, sq->uar_map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, NULL); } sq->bf_offset ^= sq->bf_buf_size; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:21:45 2016 (r306236) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:22:30 2016 (r306237) @@ -956,8 +956,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, goto err_unmap_free_uar; sq->wq.db = &sq->wq.db[MLX5_SND_DBR]; - sq->uar_map = sq->uar.map; - sq->uar_bf_map = sq->uar.bf_map; sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2; err = mlx5e_alloc_sq_db(sq); From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:23:12 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA27BE6341; Fri, 23 Sep 2016 08:23:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9D4D2F; Fri, 23 Sep 2016 08:23:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8N8NBTj049932; Fri, 23 Sep 2016 08:23:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8NBfu049930; Fri, 23 Sep 2016 08:23:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230823.u8N8NBfu049930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306238 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:23:12 -0000 Author: hselasky Date: Fri Sep 23 08:23:11 2016 New Revision: 306238 URL: https://svnweb.freebsd.org/changeset/base/306238 Log: MFC r305872: mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:22:30 2016 (r306237) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:23:11 2016 (r306238) @@ -662,6 +662,7 @@ struct mlx5e_priv { struct work_struct update_stats_work; struct work_struct update_carrier_work; struct work_struct set_rx_mode_work; + MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) struct mlx5_core_dev *mdev; struct ifnet *ifp; @@ -784,7 +785,8 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); } else { - mlx5_write64(wqe, sq->uar.map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, + MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); } sq->bf_offset ^= sq->bf_buf_size; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:22:30 2016 (r306237) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:23:11 2016 (r306238) @@ -2753,6 +2753,7 @@ mlx5e_priv_mtx_init(struct mlx5e_priv *p mtx_init(&priv->async_events_mtx, "mlx5async", MTX_NETWORK_LOCK, MTX_DEF); sx_init(&priv->state_lock, "mlx5state"); callout_init_mtx(&priv->watchdog, &priv->async_events_mtx, 0); + MLX5_INIT_DOORBELL_LOCK(&priv->doorbell_lock); } static void From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:23:58 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B67BE6403; Fri, 23 Sep 2016 08:23:58 +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 9D2DBEE4; Fri, 23 Sep 2016 08:23:58 +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 u8N8NvgN050014; Fri, 23 Sep 2016 08:23:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8NvFK050012; Fri, 23 Sep 2016 08:23:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230823.u8N8NvFK050012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306239 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:23:58 -0000 Author: hselasky Date: Fri Sep 23 08:23:57 2016 New Revision: 306239 URL: https://svnweb.freebsd.org/changeset/base/306239 Log: MFC r305873: mlx5en: Factor out common sendqueue code for use with rate limiting SQs. Try to reuse code to setup sendqueues when possible by making some static functions global. Further split the mlx5e_close_sq_wait() function to separate out reusable parts. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:23:11 2016 (r306238) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:23:57 2016 (r306239) @@ -812,5 +812,11 @@ int mlx5e_refresh_channel_params(struct int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); void mlx5e_close_cq(struct mlx5e_cq *); +void mlx5e_free_sq_db(struct mlx5e_sq *); +int mlx5e_alloc_sq_db(struct mlx5e_sq *); +int mlx5e_enable_sq(struct mlx5e_sq *, struct mlx5e_sq_param *, int tis_num); +int mlx5e_modify_sq(struct mlx5e_sq *, int curr_state, int next_state); +void mlx5e_disable_sq(struct mlx5e_sq *); +void mlx5e_drain_sq(struct mlx5e_sq *); #endif /* _MLX5_EN_H_ */ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:23:11 2016 (r306238) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:23:57 2016 (r306239) @@ -873,7 +873,7 @@ mlx5e_close_rq_wait(struct mlx5e_rq *rq) mlx5e_destroy_rq(rq); } -static void +void mlx5e_free_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -884,7 +884,7 @@ mlx5e_free_sq_db(struct mlx5e_sq *sq) free(sq->mbuf, M_MLX5EN); } -static int +int mlx5e_alloc_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -1033,8 +1033,9 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) buf_ring_free(sq->br, M_MLX5EN); } -static int -mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) +int +mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param, + int tis_num) { void *in; void *sqc; @@ -1053,7 +1054,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, tis_num_0, tis_num); MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); @@ -1075,7 +1076,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str return (err); } -static int +int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { void *in; @@ -1101,7 +1102,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int return (err); } -static void +void mlx5e_disable_sq(struct mlx5e_sq *sq) { @@ -1120,7 +1121,7 @@ mlx5e_open_sq(struct mlx5e_channel *c, if (err) return (err); - err = mlx5e_enable_sq(sq, param); + err = mlx5e_enable_sq(sq, param, c->priv->tisn[tc]); if (err) goto err_destroy_sq; @@ -1196,8 +1197,8 @@ mlx5e_sq_cev_timeout(void *arg) callout_reset_curcpu(&sq->cev_callout, hz, mlx5e_sq_cev_timeout, sq); } -static void -mlx5e_close_sq_wait(struct mlx5e_sq *sq) +void +mlx5e_drain_sq(struct mlx5e_sq *sq) { mtx_lock(&sq->lock); @@ -1224,7 +1225,13 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) mtx_lock(&sq->lock); } mtx_unlock(&sq->lock); +} + +static void +mlx5e_close_sq_wait(struct mlx5e_sq *sq) +{ + mlx5e_drain_sq(sq); mlx5e_disable_sq(sq); mlx5e_destroy_sq(sq); } From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:24:42 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ABECBE64AF; Fri, 23 Sep 2016 08:24:42 +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 03025105E; Fri, 23 Sep 2016 08:24:41 +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 u8N8OfiP050101; Fri, 23 Sep 2016 08:24:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8OfEJ050100; Fri, 23 Sep 2016 08:24:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230824.u8N8OfEJ050100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306240 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:24:42 -0000 Author: hselasky Date: Fri Sep 23 08:24:41 2016 New Revision: 306240 URL: https://svnweb.freebsd.org/changeset/base/306240 Log: MFC r305874: mlx5en: Allow setting the software MTU size below 1500 bytes The hardware MTU size can't be set to a value less than 1500 bytes due to side-band management support. Allow setting the software MTU size below 1500 bytes, thus creating a mismatch between hardware and software MTU sizes. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:23:57 2016 (r306239) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:24:41 2016 (r306240) @@ -2173,7 +2173,6 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp int hw_mtu; int err; - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", @@ -2181,19 +2180,20 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp return (err); } err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); - if (!err) { - ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); - - if (ifp->if_mtu != sw_mtu) { - if_printf(ifp, "Port MTU %d is different than " - "ifp mtu %d\n", sw_mtu, (int)ifp->if_mtu); - } - } else { + if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); - ifp->if_mtu = sw_mtu; + } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { + err = -E2BIG, + if_printf(ifp, "Port MTU %d is smaller than " + "ifp mtu %d\n", hw_mtu, sw_mtu); + } else if (MLX5E_HW2SW_MTU(hw_mtu) > sw_mtu) { + err = -EINVAL; + if_printf(ifp, "Port MTU %d is bigger than " + "ifp mtu %d\n", hw_mtu, sw_mtu); } - return (0); + ifp->if_mtu = sw_mtu; + return (err); } int From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:25:24 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68AC7BE6525; Fri, 23 Sep 2016 08:25: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 384E011D3; Fri, 23 Sep 2016 08:25:24 +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 u8N8PNFs050193; Fri, 23 Sep 2016 08:25:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8PNU9050192; Fri, 23 Sep 2016 08:25:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230825.u8N8PNU9050192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306241 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:25:24 -0000 Author: hselasky Date: Fri Sep 23 08:25:23 2016 New Revision: 306241 URL: https://svnweb.freebsd.org/changeset/base/306241 Log: MFC r305875: mlx5en: Verify port type is ethernet before creating network device Else the mlx5en driver might attach to infiniband ports. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:24:41 2016 (r306240) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:25:23 2016 (r306241) @@ -2654,6 +2654,9 @@ mlx5e_check_required_hca_cap(struct mlx5 /* TODO: add more must-to-have features */ + if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH) + return (-ENODEV); + return (0); } From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:26:04 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ECBDBE6591; Fri, 23 Sep 2016 08:26:04 +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 CB239138C; Fri, 23 Sep 2016 08:26:03 +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 u8N8Q3PZ050282; Fri, 23 Sep 2016 08:26:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8Q2rn050280; Fri, 23 Sep 2016 08:26:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230826.u8N8Q2rn050280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306242 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:26:04 -0000 Author: hselasky Date: Fri Sep 23 08:26:02 2016 New Revision: 306242 URL: https://svnweb.freebsd.org/changeset/base/306242 Log: MFC r305876: mlx5en: Remove unused pdev pointer. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:25:23 2016 (r306241) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:26:02 2016 (r306242) @@ -467,7 +467,6 @@ struct mlx5e_rq { bus_dma_tag_t dma_tag; u32 wqe_sz; struct mlx5e_rq_mbuf *mbuf; - struct device *pdev; struct ifnet *ifp; struct mlx5e_rq_stats stats; struct mlx5e_cq cq; @@ -532,7 +531,6 @@ struct mlx5e_sq { struct ifnet *ifp; u32 sqn; u32 bf_buf_size; - struct device *pdev; u32 mkey_be; /* control path */ @@ -553,7 +551,6 @@ struct mlx5e_channel { /* data path */ struct mlx5e_rq rq; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; - struct device *pdev; struct ifnet *ifp; u32 mkey_be; u8 num_tc; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:25:23 2016 (r306241) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:26:02 2016 (r306242) @@ -674,7 +674,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, wqe->data.byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); } - rq->pdev = c->pdev; rq->ifp = c->ifp; rq->channel = c; rq->ix = c->ix; @@ -962,7 +961,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, if (err) goto err_sq_wq_destroy; - sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; sq->ifp = priv->ifp; sq->priv = priv; @@ -1486,7 +1484,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr c->priv = priv; c->ix = ix; c->cpu = 0; - c->pdev = &priv->mdev->pdev->dev; c->ifp = priv->ifp; c->mkey_be = cpu_to_be32(priv->mr.key); c->num_tc = priv->num_tc; From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:26:46 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80350BE6620; Fri, 23 Sep 2016 08:26:46 +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 507D71571; Fri, 23 Sep 2016 08:26:46 +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 u8N8QjQ0051793; Fri, 23 Sep 2016 08:26:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8QjSR051792; Fri, 23 Sep 2016 08:26:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230826.u8N8QjSR051792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306243 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:26:46 -0000 Author: hselasky Date: Fri Sep 23 08:26:45 2016 New Revision: 306243 URL: https://svnweb.freebsd.org/changeset/base/306243 Log: MFC r305877: mlx5en: Fix duplicate mbuf free-by-code. When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set, we should not free the mbuf, because the caller will keep the mbuf in the drbr. Make sure the mbuf pointer is correctly set upon function exit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:26:02 2016 (r306242) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:26:45 2016 (r306243) @@ -224,10 +224,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Send one multi NOP message instead of many */ mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS); pi = ((~sq->pc) & sq->wq.sz_m1); - if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) { - m_freem(mb); + if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) return (ENOMEM); - } } /* Setup local variables */ @@ -338,10 +336,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc mb, segs, &nsegs, BUS_DMA_NOWAIT); } /* Catch errors */ - if (err != 0) { + if (err != 0) goto tx_drop; - } - *mbp = mb; for (x = 0; x != nsegs; x++) { if (segs[x].ds_len == 0) @@ -374,6 +370,7 @@ skip_dma: bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, BUS_DMASYNC_PREWRITE); sq->stats.packets++; + *mbp = NULL; /* safety clear */ return (0); tx_drop: From owner-svn-src-stable-11@freebsd.org Fri Sep 23 08:41:19 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8022BE63A4; Fri, 23 Sep 2016 08:41:19 +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 96A78676; Fri, 23 Sep 2016 08:41:19 +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 u8N8fIA0060222; Fri, 23 Sep 2016 08:41:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8fIRv060220; Fri, 23 Sep 2016 08:41:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230841.u8N8fIRv060220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Sep 2016 08:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306255 - stable/11/sys/boot/kshim X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:41:19 -0000 Author: hselasky Date: Fri Sep 23 08:41:18 2016 New Revision: 306255 URL: https://svnweb.freebsd.org/changeset/base/306255 Log: MFC r305804: Make the callout structure in the boot loader's kernel shim more similar to the kernel one. Modified: stable/11/sys/boot/kshim/bsd_kernel.c stable/11/sys/boot/kshim/bsd_kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/kshim/bsd_kernel.c ============================================================================== --- stable/11/sys/boot/kshim/bsd_kernel.c Fri Sep 23 08:35:56 2016 (r306254) +++ stable/11/sys/boot/kshim/bsd_kernel.c Fri Sep 23 08:41:18 2016 (r306255) @@ -432,8 +432,8 @@ callout_callback(struct callout *c) } mtx_unlock(&mtx_callout); - if (c->func) - (c->func) (c->arg); + if (c->c_func != NULL) + (c->c_func) (c->c_arg); if (!(c->flags & CALLOUT_RETURNUNLOCKED)) mtx_unlock(c->mtx); @@ -487,8 +487,8 @@ callout_reset(struct callout *c, int to_ { callout_stop(c); - c->func = func; - c->arg = arg; + c->c_func = func; + c->c_arg = arg; c->timeout = ticks + to_ticks; mtx_lock(&mtx_callout); @@ -507,8 +507,8 @@ callout_stop(struct callout *c) } mtx_unlock(&mtx_callout); - c->func = NULL; - c->arg = NULL; + c->c_func = NULL; + c->c_arg = NULL; } void Modified: stable/11/sys/boot/kshim/bsd_kernel.h ============================================================================== --- stable/11/sys/boot/kshim/bsd_kernel.h Fri Sep 23 08:35:56 2016 (r306254) +++ stable/11/sys/boot/kshim/bsd_kernel.h Fri Sep 23 08:41:18 2016 (r306255) @@ -299,8 +299,8 @@ extern volatile int ticks; struct callout { LIST_ENTRY(callout) entry; - callout_fn_t *func; - void *arg; + callout_fn_t *c_func; + void *c_arg; struct mtx *mtx; int flags; int timeout; From owner-svn-src-stable-11@freebsd.org Sat Sep 24 10:32:28 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D103BE6D1A; Sat, 24 Sep 2016 10:32:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E100E699; Sat, 24 Sep 2016 10:32:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8OAWRgU027666; Sat, 24 Sep 2016 10:32:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8OAWR2T027665; Sat, 24 Sep 2016 10:32:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201609241032.u8OAWR2T027665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 24 Sep 2016 10:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306293 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 10:32:28 -0000 Author: dchagin Date: Sat Sep 24 10:32:26 2016 New Revision: 306293 URL: https://svnweb.freebsd.org/changeset/base/306293 Log: MFC r305896: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Modified: stable/11/sys/compat/linux/linux_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Sat Sep 24 08:13:15 2016 (r306292) +++ stable/11/sys/compat/linux/linux_ioctl.c Sat Sep 24 10:32:26 2016 (r306293) @@ -297,6 +297,15 @@ linux_ioctl_disk(struct thread *td, stru return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); From owner-svn-src-stable-11@freebsd.org Sat Sep 24 13:44:19 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD8DBDE54F; Sat, 24 Sep 2016 13:44:19 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A064C99; Sat, 24 Sep 2016 13:44:19 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8ODiItP000999; Sat, 24 Sep 2016 13:44:18 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ODiIB2000998; Sat, 24 Sep 2016 13:44:18 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609241344.u8ODiIB2000998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 24 Sep 2016 13:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306296 - stable/11/tools/tools/crypto X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 13:44:19 -0000 Author: gnn Date: Sat Sep 24 13:44:18 2016 New Revision: 306296 URL: https://svnweb.freebsd.org/changeset/base/306296 Log: MFC: 305066,305304,305312 Update cryptotest for modern algorithms Clean up the usage message and remove dead code. Add cpuset support to separate forked processes. Reviewed by: cem Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/tools/tools/crypto/cryptotest.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/crypto/cryptotest.c ============================================================================== --- stable/11/tools/tools/crypto/cryptotest.c Sat Sep 24 13:23:47 2016 (r306295) +++ stable/11/tools/tools/crypto/cryptotest.c Sat Sep 24 13:44:18 2016 (r306296) @@ -84,6 +84,7 @@ */ #include +#include #include #include #include @@ -96,6 +97,7 @@ #include #include #include +#include #include #include @@ -126,12 +128,10 @@ struct alg { { "blf", 0, 8, 5, 56, CRYPTO_BLF_CBC }, { "cast", 0, 8, 5, 16, CRYPTO_CAST_CBC }, { "skj", 0, 8, 10, 10, CRYPTO_SKIPJACK_CBC }, - { "aes", 0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, - { "aes192", 0, 16, 24, 24, CRYPTO_RIJNDAEL128_CBC}, - { "aes256", 0, 16, 32, 32, CRYPTO_RIJNDAEL128_CBC}, -#ifdef notdef - { "arc4", 0, 8, 1, 32, CRYPTO_ARC4 }, -#endif + { "rij", 0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, + { "aes", 0, 16, 16, 16, CRYPTO_AES_CBC}, + { "aes192", 0, 16, 24, 24, CRYPTO_AES_CBC}, + { "aes256", 0, 16, 32, 32, CRYPTO_AES_CBC}, { "md5", 1, 8, 16, 16, CRYPTO_MD5_HMAC }, { "sha1", 1, 8, 20, 20, CRYPTO_SHA1_HMAC }, { "sha256", 1, 8, 32, 32, CRYPTO_SHA2_256_HMAC }, @@ -139,27 +139,29 @@ struct alg { { "sha512", 1, 8, 64, 64, CRYPTO_SHA2_512_HMAC }, }; -static void +void usage(const char* cmd) { printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size ...]\n", cmd); printf("where algorithm is one of:\n"); - printf(" des 3des (default) blowfish cast skipjack\n"); - printf(" aes (aka rijndael) aes192 aes256 arc4\n"); + printf(" null des 3des (default) blowfish cast skipjack rij\n"); + printf(" aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n"); printf("count is the number of encrypt/decrypt ops to do\n"); printf("size is the number of bytes of text to encrypt+decrypt\n"); printf("\n"); printf("-c check the results (slows timing)\n"); - printf("-d use specific device\n"); + printf("-d use specific device, specify 'soft' for testing software implementations\n"); + printf("\tNOTE: to use software you must set:\n\t sysctl kern.cryptodevallowsoft=1\n"); printf("-z run all available algorithms on a variety of sizes\n"); printf("-v be verbose\n"); printf("-b mark operations for batching\n"); printf("-p profile kernel crypto operation (must be root)\n"); + printf("-t n for n threads and run tests concurrently\n"); exit(-1); } -static struct alg* +struct alg* getalgbycode(int cipher) { int i; @@ -170,7 +172,7 @@ getalgbycode(int cipher) return NULL; } -static struct alg* +struct alg* getalgbyname(const char* name) { int i; @@ -181,10 +183,10 @@ getalgbyname(const char* name) return NULL; } -static int +int devcrypto(void) { - static int fd = -1; + int fd = -1; if (fd < 0) { fd = open(_PATH_DEV "crypto", O_RDWR, 0); @@ -196,11 +198,14 @@ devcrypto(void) return fd; } -static int +int crlookup(const char *devname) { struct crypt_find_op find; + if (strncmp(devname, "soft", 4) == 0) + return CRYPTO_FLAG_SOFTWARE; + find.crid = -1; strlcpy(find.name, devname, sizeof(find.name)); if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1) @@ -208,10 +213,10 @@ crlookup(const char *devname) return find.crid; } -static const char * +const char * crfind(int crid) { - static struct crypt_find_op find; + struct crypt_find_op find; bzero(&find, sizeof(find)); find.crid = crid; @@ -220,7 +225,7 @@ crfind(int crid) return find.name; } -static int +int crget(void) { int fd; @@ -232,7 +237,7 @@ crget(void) return fd; } -static char +char rdigit(void) { const char a[] = { @@ -242,7 +247,7 @@ rdigit(void) return 0x20+a[random()%nitems(a)]; } -static void +void runtest(struct alg *alg, int count, int size, u_long cmd, struct timeval *tv) { int i, fd = crget(); @@ -386,7 +391,7 @@ runtest(struct alg *alg, int count, int } #ifdef __FreeBSD__ -static void +void resetstats() { struct cryptostats stats; @@ -409,7 +414,7 @@ resetstats() perror("kern.cryptostats"); } -static void +void printt(const char* tag, struct cryptotstat *ts) { uint64_t avg, min, max; @@ -424,7 +429,7 @@ printt(const char* tag, struct cryptotst } #endif -static void +void runtests(struct alg *alg, int count, int size, u_long cmd, int threads, int profile) { int i, status; @@ -464,6 +469,11 @@ runtests(struct alg *alg, int count, int if (threads > 1) { for (i = 0; i < threads; i++) if (fork() == 0) { + cpuset_t mask; + CPU_ZERO(&mask); + CPU_SET(i, &mask); + cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, + -1, sizeof(mask), &mask); runtest(alg, count, size, cmd, &tvp[i]); exit(0); } @@ -478,17 +488,10 @@ runtests(struct alg *alg, int count, int if (t) { int nops = alg->ishash ? count : 2*count; -#if 0 - t /= threads; - printf("%6.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", - t, nops, alg->name, size, (double)nops*size / t, - (double)nops*size / t * 8 / 1024 / 1024); -#else nops *= threads; printf("%8.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", t, nops, alg->name, size, (double)nops*size / t, (double)nops*size / t * 8 / 1024 / 1024); -#endif } #ifdef __FreeBSD__ if (profile) { @@ -576,6 +579,9 @@ main(int argc, char **argv) } argc--, argv++; } + if (maxthreads > CPU_SETSIZE) + errx(EX_USAGE, "Too many threads, %d, choose fewer.", maxthreads); + if (nsizes == 0) { if (alg) sizes[nsizes++] = alg->blocksize; From owner-svn-src-stable-11@freebsd.org Sat Sep 24 16:46:38 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACF19BE839B; Sat, 24 Sep 2016 16:46:38 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE4ABE4; Sat, 24 Sep 2016 16:46:38 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8OGkbRW069550; Sat, 24 Sep 2016 16:46:37 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8OGkbvj069548; Sat, 24 Sep 2016 16:46:37 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201609241646.u8OGkbvj069548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Sat, 24 Sep 2016 16:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306298 - in stable: 10/lib/libc/sys 11/lib/libc/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 16:46:38 -0000 Author: badger Date: Sat Sep 24 16:46:37 2016 New Revision: 306298 URL: https://svnweb.freebsd.org/changeset/base/306298 Log: MFC r305956: Add manpage for rctl_* system calls Approved by: kib (mentor) Sponsored by: Dell Technologies Added: stable/11/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/11/lib/libc/sys/Makefile.inc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/10/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/10/lib/libc/sys/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sys/Makefile.inc Sat Sep 24 15:11:27 2016 (r306297) +++ stable/11/lib/libc/sys/Makefile.inc Sat Sep 24 16:46:37 2016 (r306298) @@ -249,6 +249,7 @@ MAN+= abort2.2 \ pselect.2 \ ptrace.2 \ quotactl.2 \ + rctl_add_rule.2 \ read.2 \ readlink.2 \ reboot.2 \ @@ -412,6 +413,10 @@ MLINKS+=pdfork.2 pdgetpid.2\ pdfork.2 pdwait4.2 MLINKS+=pipe.2 pipe2.2 MLINKS+=poll.2 ppoll.2 +MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \ + rctl_add_rule.2 rctl_get_racct.2 \ + rctl_add_rule.2 rctl_get_rules.2 \ + rctl_add_rule.2 rctl_remove_rule.2 MLINKS+=read.2 pread.2 \ read.2 preadv.2 \ read.2 readv.2 Copied: stable/11/lib/libc/sys/rctl_add_rule.2 (from r305956, head/lib/libc/sys/rctl_add_rule.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/sys/rctl_add_rule.2 Sat Sep 24 16:46:37 2016 (r306298, copy of r305956, head/lib/libc/sys/rctl_add_rule.2) @@ -0,0 +1,220 @@ +.\" Copyright (c) 2016 Eric Badger +.\" 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$ +.\" +.Dd September 14, 2016 +.Dt RCTL_ADD_RULE 2 +.Os +.Sh NAME +.Nm rctl_add_rule, +.Nm rctl_get_limits +.Nm rctl_get_racct, +.Nm rctl_get_rules, +.Nm rctl_remove_rule +.Nd manipulate and query the resource limits database +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/rctl.h +.Ft int +.Fo rctl_add_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_limits +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_racct +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_rules +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_remove_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Sh DESCRIPTION +These system calls are used to manipulate and query the resource limits +database. +For all functions, +.Fa inbuflen +refers to the length of the buffer pointed to by +.Fa inbufp +and +.Fa outbuflen +refers to the length of the buffer pointed to by +.Fa outbufp . +.Pp +The +.Fn rctl_add_rule +function adds the rule pointed to by +.Fa inbufp +to the resource limits database. +The +.Fa outbufp +and +.Fa outbuflen +arguments are unused. +Rule format is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +.Pp +The +.Fn rctl_get_limits +function returns in +.Fa outbufp +a comma-separated list of rules that apply to the process that +matches the filter specified in +.Fa inbufp . +This includes rules with a subject of the process itself as well as rules +with a different subject (such as user or loginclass) that apply to the +process. +.Pp +The +.Fn rctl_get_racct +function returns resource usage information for a given subject. +The subject is specified by passing a filter in +.Fa inbufp . +Filter syntax is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +A comma-separated list of resources and the amount used of each by the +specified subject is returned in +.Fa outbufp . +The resource and amount is formatted as +.Qq resource=amount . +.Pp +The +.Fn rctl_get_rules +function returns in +.Fa outbufp +a comma-separated list of rules from the resource limits database that +match the filter passed in +.Fa inbufp . +Filter syntax is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +A filter of +.Va :: +may be passed to return all rules. +.Pp +The +.Fn rctl_remove_rule +function removes all rules matching the filter passed in +.Fa inbufp +from the resource limits database. +Filter syntax is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +.Fa outbufp +and +.Fa outbuflen +are unused. +.Sh RULES AND FILTERS +This section explains how the rule and filter format described in +.Xr rctl 8 +differs from the format passed to the system calls themselves. +The rctl tool provides several conveniences that the system calls do not. +When using the system call: +.Bl -dash -offset indent +.It +The subject must be fully specified. +For example, abbreviating +.Ql user +to +.Ql u +is not acceptable. +.It +User and group IDs must be numeric. +For example, +.Ql root +must be expressed as +.Ql 0 . +.It +Units are not permitted on resource amounts. +For example, a quantity of 1024 bytes must be expressed as +.Ql 1024 +and not +.Ql 1k . +.El +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The rctl system calls may fail if: +.Bl -tag -width Er +.It Bq Er ENOSYS +RACCT/RCTL support is not present in the kernel or the +.Va kern.racct.enable +sysctl is 0. +.It Bq Er EINVAL +The rule or filter passed in +.Fa inbufp +is invalid. +.It Bq Er EPERM +User has insufficient privileges to carry out the requested operation. +.It Bq Er E2BIG +.Fa inbufp +or +.Fa outbufp +are too large. +.It Bq Er ESRCH +No process matched the provided rule or filter. +.It Bq Er ENAMETOOLONG +The loginclass or jail name specified is too long. +.It Bq Er ERANGE +The rule amount is outside of the allowable range or +.Fa outbufp +is too small. +.It Bq Er EOPNOTSUPP +The requested operation is not supported for the given rule or filter. +.It Bq Er EFAULT +.Fa inbufp +or +.Fa outbufp +refer to invalid addresses. +.El +.Sh SEE ALSO +.Xr rctl 8 +.Sh HISTORY +The rctl family of system calls appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The rctl system calls were developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. +This manual page was written by +.An Eric Badger Aq Mt badger@FreeBSD.org .