From owner-svn-src-stable-10@freebsd.org Sun Sep 18 02:51:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 497C5BD64C0; Sun, 18 Sep 2016 02:51:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27443EC3; Sun, 18 Sep 2016 02:51:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8I2pI9D087080; Sun, 18 Sep 2016 02:51:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I2pIfQ087078; Sun, 18 Sep 2016 02:51:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180251.u8I2pIfQ087078@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:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305911 - in stable/10/lib/atf: libatf-c libatf-c++ X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 02:51:19 -0000 Author: ngie Date: Sun Sep 18 02:51:18 2016 New Revision: 305911 URL: https://svnweb.freebsd.org/changeset/base/305911 Log: MFstable/11 r305910: 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/10/lib/atf/libatf-c++/Makefile stable/10/lib/atf/libatf-c/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/atf/libatf-c++/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/Makefile Sun Sep 18 02:45:35 2016 (r305910) +++ stable/10/lib/atf/libatf-c++/Makefile Sun Sep 18 02:51:18 2016 (r305911) @@ -35,15 +35,15 @@ SHLIB_MAJOR= 2 DPADD= ${LIBATF_C} LDADD= -latf-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/10/lib/atf/libatf-c/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/Makefile Sun Sep 18 02:45:35 2016 (r305910) +++ stable/10/lib/atf/libatf-c/Makefile Sun Sep 18 02:51:18 2016 (r305911) @@ -27,25 +27,37 @@ .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-10@freebsd.org Sun Sep 18 03:00:47 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4552DBD6831; Sun, 18 Sep 2016 03:00:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 158288CD; Sun, 18 Sep 2016 03:00:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8I30k5F093542; Sun, 18 Sep 2016 03:00:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I30kkE093541; Sun, 18 Sep 2016 03:00:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180300.u8I30kkE093541@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 03:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305913 - stable/10/tests/sys/acl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 03:00:47 -0000 Author: ngie Date: Sun Sep 18 03:00:46 2016 New Revision: 305913 URL: https://svnweb.freebsd.org/changeset/base/305913 Log: MFstable/11 r305912: 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/10/tests/sys/acl/04.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/acl/04.sh ============================================================================== --- stable/10/tests/sys/acl/04.sh Sun Sep 18 02:56:16 2016 (r305912) +++ stable/10/tests/sys/acl/04.sh Sun Sep 18 03:00:46 2016 (r305913) @@ -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-10@freebsd.org Sun Sep 18 04:34:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54323BDF746; Sun, 18 Sep 2016 04:34:34 +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 0810518B5; Sun, 18 Sep 2016 04:34:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8I4YXPZ028794; Sun, 18 Sep 2016 04:34:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8I4YXfh028793; Sun, 18 Sep 2016 04:34:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609180434.u8I4YXfh028793@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:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305915 - stable/10/tests/sys/mac/bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 04:34:34 -0000 Author: ngie Date: Sun Sep 18 04:34:32 2016 New Revision: 305915 URL: https://svnweb.freebsd.org/changeset/base/305915 Log: MFstable/11 r305914: MFC r305357: Skip testcases 9/10 if jail(8) isn't installed These testcases require jail support Modified: stable/10/tests/sys/mac/bsdextended/matches_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/mac/bsdextended/matches_test.sh ============================================================================== --- stable/10/tests/sys/mac/bsdextended/matches_test.sh Sun Sep 18 04:19:43 2016 (r305914) +++ stable/10/tests/sys/mac/bsdextended/matches_test.sh Sun Sep 18 04:34:32 2016 (r305915) @@ -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-10@freebsd.org Wed Sep 21 08:14:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948B8BE3E27; Wed, 21 Sep 2016 08:14:56 +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 66D6A127; Wed, 21 Sep 2016 08:14:56 +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 u8L8EtBp047582; Wed, 21 Sep 2016 08:14:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L8EtH0047581; Wed, 21 Sep 2016 08:14:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609210814.u8L8EtH0047581@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:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306080 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 08:14:56 -0000 Author: kib Date: Wed Sep 21 08:14:55 2016 New Revision: 306080 URL: https://svnweb.freebsd.org/changeset/base/306080 Log: MFC r305939: Remove trailing space. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Wed Sep 21 08:12:39 2016 (r306079) +++ stable/10/sys/amd64/amd64/machdep.c Wed Sep 21 08:14:55 2016 (r306080) @@ -1457,7 +1457,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-10@freebsd.org Wed Sep 21 16:06:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5511ABE4609; Wed, 21 Sep 2016 16:06: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 182F7A78; Wed, 21 Sep 2016 16:06:01 +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 u8LG6014029465; Wed, 21 Sep 2016 16:06:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LG60NB029464; Wed, 21 Sep 2016 16:06:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211606.u8LG60NB029464@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:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306111 - stable/10/sys/dev/amdsbwd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:06:01 -0000 Author: avg Date: Wed Sep 21 16:06:00 2016 New Revision: 306111 URL: https://svnweb.freebsd.org/changeset/base/306111 Log: MFC r305535: amdsbwd: add support for FCH in family 16h models 30h-3Fh processors Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Wed Sep 21 16:05:47 2016 (r306110) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Wed Sep 21 16:06:00 2016 (r306111) @@ -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-10@freebsd.org Wed Sep 21 16:12:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84D2BBE4831; Wed, 21 Sep 2016 16:12:35 +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 54622194; Wed, 21 Sep 2016 16:12:35 +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 u8LGCYNB033278; Wed, 21 Sep 2016 16:12:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGCYrS033277; Wed, 21 Sep 2016 16:12:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211612.u8LGCYrS033277@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:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306113 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:12:35 -0000 Author: avg Date: Wed Sep 21 16:12:34 2016 New Revision: 306113 URL: https://svnweb.freebsd.org/changeset/base/306113 Log: MFC r303111: Document list of supported chipsets. Modified: stable/10/share/man/man4/intpm.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/intpm.4 ============================================================================== --- stable/10/share/man/man4/intpm.4 Wed Sep 21 16:12:26 2016 (r306112) +++ stable/10/share/man/man4/intpm.4 Wed Sep 21 16:12:34 2016 (r306113) @@ -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-10@freebsd.org Wed Sep 21 16:14:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20361BE4902; Wed, 21 Sep 2016 16:14:04 +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 D464B3C6; Wed, 21 Sep 2016 16:14:03 +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 u8LGE369033448; Wed, 21 Sep 2016 16:14:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGE2vg033443; Wed, 21 Sep 2016 16:14:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211614.u8LGE2vg033443@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:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306115 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:14:04 -0000 Author: avg Date: Wed Sep 21 16:14:02 2016 New Revision: 306115 URL: https://svnweb.freebsd.org/changeset/base/306115 Log: MFC r303113: Cross-link some SMBus controller drivers man pages. Modified: stable/10/share/man/man4/amdpm.4 stable/10/share/man/man4/amdsmb.4 stable/10/share/man/man4/ichsmb.4 stable/10/share/man/man4/intpm.4 stable/10/share/man/man4/ismt.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdpm.4 ============================================================================== --- stable/10/share/man/man4/amdpm.4 Wed Sep 21 16:13:58 2016 (r306114) +++ stable/10/share/man/man4/amdpm.4 Wed Sep 21 16:14:02 2016 (r306115) @@ -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/10/share/man/man4/amdsmb.4 ============================================================================== --- stable/10/share/man/man4/amdsmb.4 Wed Sep 21 16:13:58 2016 (r306114) +++ stable/10/share/man/man4/amdsmb.4 Wed Sep 21 16:14:02 2016 (r306115) @@ -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/10/share/man/man4/ichsmb.4 ============================================================================== --- stable/10/share/man/man4/ichsmb.4 Wed Sep 21 16:13:58 2016 (r306114) +++ stable/10/share/man/man4/ichsmb.4 Wed Sep 21 16:14:02 2016 (r306115) @@ -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/10/share/man/man4/intpm.4 ============================================================================== --- stable/10/share/man/man4/intpm.4 Wed Sep 21 16:13:58 2016 (r306114) +++ stable/10/share/man/man4/intpm.4 Wed Sep 21 16:14:02 2016 (r306115) @@ -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/10/share/man/man4/ismt.4 ============================================================================== --- stable/10/share/man/man4/ismt.4 Wed Sep 21 16:13:58 2016 (r306114) +++ stable/10/share/man/man4/ismt.4 Wed Sep 21 16:14:02 2016 (r306115) @@ -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-10@freebsd.org Wed Sep 21 16:15:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 821A3BE49CD; Wed, 21 Sep 2016 16:15:36 +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 513F494D; Wed, 21 Sep 2016 16:15:36 +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 u8LGFZrf033612; Wed, 21 Sep 2016 16:15:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGFZot033611; Wed, 21 Sep 2016 16:15:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211615.u8LGFZot033611@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:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306117 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:15:36 -0000 Author: avg Date: Wed Sep 21 16:15:35 2016 New Revision: 306117 URL: https://svnweb.freebsd.org/changeset/base/306117 Log: MFC r305596: intpm.4 update supported hardware list Modified: stable/10/share/man/man4/intpm.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/intpm.4 ============================================================================== --- stable/10/share/man/man4/intpm.4 Wed Sep 21 16:15:30 2016 (r306116) +++ stable/10/share/man/man4/intpm.4 Wed Sep 21 16:15:35 2016 (r306117) @@ -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-10@freebsd.org Wed Sep 21 16:17:24 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52EEFBE4A91; Wed, 21 Sep 2016 16:17:24 +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 D297FC92; Wed, 21 Sep 2016 16:17:23 +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 u8LGHNCP033781; Wed, 21 Sep 2016 16:17:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGHN3Z033780; Wed, 21 Sep 2016 16:17:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211617.u8LGHN3Z033780@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:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306119 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:17:24 -0000 Author: avg Date: Wed Sep 21 16:17:22 2016 New Revision: 306119 URL: https://svnweb.freebsd.org/changeset/base/306119 Log: MFC r305600: amdsbwd.4: update supported hardware list Modified: stable/10/share/man/man4/amdsbwd.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdsbwd.4 ============================================================================== --- stable/10/share/man/man4/amdsbwd.4 Wed Sep 21 16:17:17 2016 (r306118) +++ stable/10/share/man/man4/amdsbwd.4 Wed Sep 21 16:17:22 2016 (r306119) @@ -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-10@freebsd.org Wed Sep 21 16:23:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18ABBE4CEB; Wed, 21 Sep 2016 16:23:32 +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 7444813DF; Wed, 21 Sep 2016 16:23:32 +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 u8LGNVFd037775; Wed, 21 Sep 2016 16:23:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGNV4N037774; Wed, 21 Sep 2016 16:23:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211623.u8LGNV4N037774@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:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306121 - stable/10/sys/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:23:32 -0000 Author: avg Date: Wed Sep 21 16:23:31 2016 New Revision: 306121 URL: https://svnweb.freebsd.org/changeset/base/306121 Log: MFC r305603: intpm: do not try attaching to unsupported controller revisions Modified: stable/10/sys/pci/intpm.c Directory Properties: stable/10/ (props changed) stable/10/sys/gnu/dts/ (props changed) Modified: stable/10/sys/pci/intpm.c ============================================================================== --- stable/10/sys/pci/intpm.c Wed Sep 21 16:19:27 2016 (r306120) +++ stable/10/sys/pci/intpm.c Wed Sep 21 16:23:31 2016 (r306121) @@ -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-10@freebsd.org Wed Sep 21 16:27:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E67BE4E83; Wed, 21 Sep 2016 16:27:11 +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 B23DB1734; Wed, 21 Sep 2016 16:27:10 +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 u8LGR9AY038178; Wed, 21 Sep 2016 16:27:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGR9Q2038177; Wed, 21 Sep 2016 16:27:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211627.u8LGR9Q2038177@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:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306123 - stable/10/sys/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:27:11 -0000 Author: avg Date: Wed Sep 21 16:27:09 2016 New Revision: 306123 URL: https://svnweb.freebsd.org/changeset/base/306123 Log: MFC r305604: intpm: better clean up resources after a failed attachment Modified: stable/10/sys/pci/intpm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pci/intpm.c ============================================================================== --- stable/10/sys/pci/intpm.c Wed Sep 21 16:26:59 2016 (r306122) +++ stable/10/sys/pci/intpm.c Wed Sep 21 16:27:09 2016 (r306123) @@ -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-10@freebsd.org Wed Sep 21 16:29:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A56BE4FE3; Wed, 21 Sep 2016 16:29:16 +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 73D0D1AB7; Wed, 21 Sep 2016 16:29:16 +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 u8LGTFZa038460; Wed, 21 Sep 2016 16:29:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LGTF9D038459; Wed, 21 Sep 2016 16:29:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211629.u8LGTF9D038459@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:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306125 - stable/10/sys/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 16:29:16 -0000 Author: avg Date: Wed Sep 21 16:29:15 2016 New Revision: 306125 URL: https://svnweb.freebsd.org/changeset/base/306125 Log: MFC r305606: intpm: make sure to register smbus driver before intpm driver Modified: stable/10/sys/pci/intpm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pci/intpm.c ============================================================================== --- stable/10/sys/pci/intpm.c Wed Sep 21 16:29:04 2016 (r306124) +++ stable/10/sys/pci/intpm.c Wed Sep 21 16:29:15 2016 (r306125) @@ -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-10@freebsd.org Wed Sep 21 19:11:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2071ABE4F0A; Wed, 21 Sep 2016 19:11:39 +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 CA0E0F0C; Wed, 21 Sep 2016 19:11:38 +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 u8LJBc3t001019; Wed, 21 Sep 2016 19:11:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LJBcKM001018; Wed, 21 Sep 2016 19:11:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609211911.u8LJBcKM001018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Sep 2016 19:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306136 - stable/10/contrib/binutils/ld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 19:11:39 -0000 Author: emaste Date: Wed Sep 21 19:11:37 2016 New Revision: 306136 URL: https://svnweb.freebsd.org/changeset/base/306136 Log: MFC r275240 (bapt): Implement --no-fatal-warnings Implement --no-fatal-warning for compatibility with newer ld what ever order the options are passed to ld(1) the --no-fatal-warning always disable --fatal-warning Modified: stable/10/contrib/binutils/ld/lexsup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/ld/lexsup.c ============================================================================== --- stable/10/contrib/binutils/ld/lexsup.c Wed Sep 21 18:52:49 2016 (r306135) +++ stable/10/contrib/binutils/ld/lexsup.c Wed Sep 21 19:11:37 2016 (r306136) @@ -84,6 +84,7 @@ enum option_values OPTION_NO_KEEP_MEMORY, OPTION_NO_WARN_MISMATCH, OPTION_NO_WARN_SEARCH_MISMATCH, + OPTION_NO_WARN_FATAL, OPTION_NOINHIBIT_EXEC, OPTION_NON_SHARED, OPTION_NO_WHOLE_ARCHIVE, @@ -375,6 +376,9 @@ static const struct ld_option ld_options { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}, '\0', NULL, N_("Treat warnings as errors"), TWO_DASHES }, + { {"no-fatal-warnings", no_argument, NULL, OPTION_NO_WARN_FATAL}, + '\0', NULL, N_("Don't treat warnings as errors"), + TWO_DASHES }, { {"fini", required_argument, NULL, OPTION_FINI}, '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH }, { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX}, @@ -568,6 +572,7 @@ parse_args (unsigned argc, char **argv) struct option *really_longopts; int last_optind; enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR; + int no_fatal_warnings = FALSE; shortopts = xmalloc (OPTION_COUNT * 3 + 2); longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1)); @@ -1317,6 +1322,9 @@ parse_args (unsigned argc, char **argv) case OPTION_WARN_FATAL: config.fatal_warnings = TRUE; break; + case OPTION_NO_WARN_FATAL: + no_fatal_warnings = TRUE; + break; case OPTION_WARN_MULTIPLE_GP: config.warn_multiple_gp = TRUE; break; @@ -1438,6 +1446,8 @@ parse_args (unsigned argc, char **argv) break; } } + if (no_fatal_warnings) + config.fatal_warnings = FALSE; if (ingroup) lang_leave_group (); From owner-svn-src-stable-10@freebsd.org Wed Sep 21 19:53:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CD8EBE4985; Wed, 21 Sep 2016 19:53:53 +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 E0CEF287; Wed, 21 Sep 2016 19:53:52 +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 u8LJrqTE018776; Wed, 21 Sep 2016 19:53:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LJrqeY018775; Wed, 21 Sep 2016 19:53:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609211953.u8LJrqeY018775@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:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306141 - stable/10/sys/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 19:53:53 -0000 Author: avg Date: Wed Sep 21 19:53:51 2016 New Revision: 306141 URL: https://svnweb.freebsd.org/changeset/base/306141 Log: MFC r305602: intpm: fix attachment to supported AMD FCHs Modified: stable/10/sys/pci/intpm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pci/intpm.c ============================================================================== --- stable/10/sys/pci/intpm.c Wed Sep 21 19:51:59 2016 (r306140) +++ stable/10/sys/pci/intpm.c Wed Sep 21 19:53:51 2016 (r306141) @@ -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-10@freebsd.org Thu Sep 22 03:33:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FEABE2FB9; Thu, 22 Sep 2016 03:33:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDA091BF; Thu, 22 Sep 2016 03:33:47 +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 u8M3XkLQ092166; Thu, 22 Sep 2016 03:33:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3XkOL092165; Thu, 22 Sep 2016 03:33:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220333.u8M3XkOL092165@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:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306154 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:33:48 -0000 Author: mav Date: Thu Sep 22 03:33:46 2016 New Revision: 306154 URL: https://svnweb.freebsd.org/changeset/base/306154 Log: MFC r305608: "ATA pass through information available" is not an error. Modified: stable/10/sys/cam/scsi/scsi_all.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Thu Sep 22 03:31:14 2016 (r306153) +++ stable/10/sys/cam/scsi/scsi_all.c Thu Sep 22 03:33:46 2016 (r306154) @@ -1055,7 +1055,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-10@freebsd.org Thu Sep 22 03:34:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3048EBE3099; Thu, 22 Sep 2016 03:34:27 +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 031A7362; Thu, 22 Sep 2016 03:34:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8M3YQhU092247; Thu, 22 Sep 2016 03:34:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3YQJN092246; Thu, 22 Sep 2016 03:34:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220334.u8M3YQJN092246@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:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306155 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:34:27 -0000 Author: mav Date: Thu Sep 22 03:34:26 2016 New Revision: 306155 URL: https://svnweb.freebsd.org/changeset/base/306155 Log: MFC r305609: "Extended copy information available" is not an error either. Modified: stable/10/sys/cam/scsi/scsi_all.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Thu Sep 22 03:33:46 2016 (r306154) +++ stable/10/sys/cam/scsi/scsi_all.c Thu Sep 22 03:34:26 2016 (r306155) @@ -1064,7 +1064,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-10@freebsd.org Thu Sep 22 03:35:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE5CBE318B; Thu, 22 Sep 2016 03:35:03 +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 7A21574F; Thu, 22 Sep 2016 03:35:03 +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 u8M3Z29c092334; Thu, 22 Sep 2016 03:35:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8M3Z2s8092333; Thu, 22 Sep 2016 03:35:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609220335.u8M3Z2s8092333@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:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306156 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 03:35:03 -0000 Author: mav Date: Thu Sep 22 03:35:02 2016 New Revision: 306156 URL: https://svnweb.freebsd.org/changeset/base/306156 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/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Thu Sep 22 03:34:26 2016 (r306155) +++ stable/10/sys/cam/cam_periph.c Thu Sep 22 03:35:02 2016 (r306156) @@ -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-10@freebsd.org Thu Sep 22 10:42:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5F7BE4752; Thu, 22 Sep 2016 10:42:41 +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 4D0221C28; Thu, 22 Sep 2016 10:42:41 +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 u8MAgeZ0054033; Thu, 22 Sep 2016 10:42:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAge6p054030; Thu, 22 Sep 2016 10:42:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221042.u8MAge6p054030@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 10:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306175 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:42:41 -0000 Author: kib Date: Thu Sep 22 10:42:40 2016 New Revision: 306175 URL: https://svnweb.freebsd.org/changeset/base/306175 Log: MFC r305592: Partially lift suspension when ffs_reload() finished with cgs and going to re-read inodes. Modified: stable/10/sys/ufs/ffs/ffs_extern.h stable/10/sys/ufs/ffs/ffs_suspend.c stable/10/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/10/sys/ufs/ffs/ffs_extern.h Thu Sep 22 09:58:46 2016 (r306174) +++ stable/10/sys/ufs/ffs/ffs_extern.h Thu Sep 22 10:42:40 2016 (r306175) @@ -107,6 +107,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/10/sys/ufs/ffs/ffs_suspend.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_suspend.c Thu Sep 22 09:58:46 2016 (r306174) +++ stable/10/sys/ufs/ffs/ffs_suspend.c Thu Sep 22 10:42:40 2016 (r306175) @@ -234,7 +234,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/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Thu Sep 22 09:58:46 2016 (r306174) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Thu Sep 22 10:42:40 2016 (r306175) @@ -583,11 +583,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; @@ -602,7 +604,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); } @@ -692,6 +694,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-10@freebsd.org Thu Sep 22 10:44:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7518BE49DB; Thu, 22 Sep 2016 10:44:57 +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 6E20A1E47; Thu, 22 Sep 2016 10:44:57 +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 u8MAiuLg054172; Thu, 22 Sep 2016 10:44:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAiuAq054171; Thu, 22 Sep 2016 10:44:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221044.u8MAiuAq054171@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 10:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306176 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:44:57 -0000 Author: kib Date: Thu Sep 22 10:44:56 2016 New Revision: 306176 URL: https://svnweb.freebsd.org/changeset/base/306176 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/10/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:42:40 2016 (r306175) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:44:56 2016 (r306176) @@ -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-10@freebsd.org Thu Sep 22 10:46:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67895BE4B85; Thu, 22 Sep 2016 10:46:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3742E119; Thu, 22 Sep 2016 10:46:09 +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 u8MAk8Pc054274; Thu, 22 Sep 2016 10:46:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAk8Go054273; Thu, 22 Sep 2016 10:46:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221046.u8MAk8Go054273@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 10:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306177 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:46:09 -0000 Author: kib Date: Thu Sep 22 10:46:08 2016 New Revision: 306177 URL: https://svnweb.freebsd.org/changeset/base/306177 Log: MFC r305594: In softdep_prealloc(), return early not only for snapshots, but for the quota files as well. Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 10:44:56 2016 (r306176) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 10:46:08 2016 (r306177) @@ -2996,10 +2996,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-10@freebsd.org Thu Sep 22 10:47:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CBFBE4DA0; Thu, 22 Sep 2016 10:47:57 +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 8A9B0379; Thu, 22 Sep 2016 10:47:57 +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 u8MAluvt054381; Thu, 22 Sep 2016 10:47:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAluFv054380; Thu, 22 Sep 2016 10:47:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221047.u8MAluFv054380@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 10:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306178 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:47:57 -0000 Author: kib Date: Thu Sep 22 10:47:56 2016 New Revision: 306178 URL: https://svnweb.freebsd.org/changeset/base/306178 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/10/sys/ufs/ufs/ufs_quota.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_quota.c Thu Sep 22 10:46:08 2016 (r306177) +++ stable/10/sys/ufs/ufs/ufs_quota.c Thu Sep 22 10:47:56 2016 (r306178) @@ -1542,8 +1542,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-10@freebsd.org Thu Sep 22 10:49:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B50BE4FDD; Thu, 22 Sep 2016 10:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5098D7F5; Thu, 22 Sep 2016 10:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8MAngI2054498; Thu, 22 Sep 2016 10:49:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAnga2054497; Thu, 22 Sep 2016 10:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221049.u8MAnga2054497@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 10:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306179 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:49:43 -0000 Author: kib Date: Thu Sep 22 10:49:42 2016 New Revision: 306179 URL: https://svnweb.freebsd.org/changeset/base/306179 Log: MFC r305597: When extending directory inode in ufs_direnter(), adjust i_endoff. Modified: stable/10/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:47:56 2016 (r306178) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:49:42 2016 (r306179) @@ -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-10@freebsd.org Thu Sep 22 10:51:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F09B8BE523D; Thu, 22 Sep 2016 10:51:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF72CA2; Thu, 22 Sep 2016 10:51:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8MAplql056058; Thu, 22 Sep 2016 10:51:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MApldD056057; Thu, 22 Sep 2016 10:51:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221051.u8MApldD056057@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 10:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306180 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:51:49 -0000 Author: kib Date: Thu Sep 22 10:51:47 2016 New Revision: 306180 URL: https://svnweb.freebsd.org/changeset/base/306180 Log: MFC r305598: When logging unlikely UFS_TRUNCATE() failure in ufs_direnter(), include error code. Modified: stable/10/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:49:42 2016 (r306179) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Thu Sep 22 10:51:47 2016 (r306180) @@ -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) - vprint("ufs_direnter: failed to truncate", dvp); + 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-10@freebsd.org Thu Sep 22 10:53:15 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB3CBE549A; Thu, 22 Sep 2016 10:53:15 +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 E398AEE8; Thu, 22 Sep 2016 10:53:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8MArE7n058174; Thu, 22 Sep 2016 10:53:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MArExb058173; Thu, 22 Sep 2016 10:53:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221053.u8MArExb058173@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 10:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306181 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:53:15 -0000 Author: kib Date: Thu Sep 22 10:53:13 2016 New Revision: 306181 URL: https://svnweb.freebsd.org/changeset/base/306181 Log: MFC r305599: Do not leak transient ENOLCK error from flush_newblk_dep() loop. Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 10:51:47 2016 (r306180) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Thu Sep 22 10:53:13 2016 (r306181) @@ -12843,6 +12843,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-10@freebsd.org Thu Sep 22 10:54:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D66BE555A; Thu, 22 Sep 2016 10:54: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 C6C2E105C; Thu, 22 Sep 2016 10:54: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 u8MAsVde058268; Thu, 22 Sep 2016 10:54:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MAsVxA058267; Thu, 22 Sep 2016 10:54:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609221054.u8MAsVxA058267@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 10:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306182 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:54:32 -0000 Author: kib Date: Thu Sep 22 10:54:30 2016 New Revision: 306182 URL: https://svnweb.freebsd.org/changeset/base/306182 Log: MFC r305601: On rename, do not perform truncation of dirhash if the vnode truncation failed. Modified: stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Thu Sep 22 10:53:13 2016 (r306181) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Thu Sep 22 10:54:30 2016 (r306182) @@ -1530,11 +1530,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-10@freebsd.org Thu Sep 22 15:05:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D58BE591B; Thu, 22 Sep 2016 15:05:42 +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 5CCFD2FF; Thu, 22 Sep 2016 15:05:42 +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 u8MF5fRJ056751; Thu, 22 Sep 2016 15:05:41 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MF5c5i056719; Thu, 22 Sep 2016 15:05:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201609221505.u8MF5c5i056719@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 15:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306196 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/cms ... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 15:05:42 -0000 Author: jkim Date: Thu Sep 22 15:05:38 2016 New Revision: 306196 URL: https://svnweb.freebsd.org/changeset/base/306196 Log: Merge OpenSSL 1.0.1u. Added: stable/10/crypto/openssl/doc/crypto/d2i_PrivateKey.pod - copied unchanged from r306191, vendor-crypto/openssl/dist-1.0.1/doc/crypto/d2i_PrivateKey.pod stable/10/secure/lib/libcrypto/man/d2i_PrivateKey.3 (contents, props changed) Modified: stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/CONTRIBUTING stable/10/crypto/openssl/Configure stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/apps.c stable/10/crypto/openssl/apps/enc.c stable/10/crypto/openssl/apps/passwd.c stable/10/crypto/openssl/apps/s_server.c stable/10/crypto/openssl/apps/x509.c stable/10/crypto/openssl/crypto/asn1/a_bytes.c stable/10/crypto/openssl/crypto/asn1/a_object.c stable/10/crypto/openssl/crypto/asn1/a_set.c stable/10/crypto/openssl/crypto/asn1/asn1_lib.c stable/10/crypto/openssl/crypto/asn1/asn_mime.c stable/10/crypto/openssl/crypto/asn1/d2i_pr.c stable/10/crypto/openssl/crypto/asn1/f_enum.c stable/10/crypto/openssl/crypto/asn1/f_int.c stable/10/crypto/openssl/crypto/asn1/f_string.c stable/10/crypto/openssl/crypto/asn1/p5_pbe.c stable/10/crypto/openssl/crypto/asn1/p5_pbev2.c stable/10/crypto/openssl/crypto/asn1/tasn_enc.c stable/10/crypto/openssl/crypto/asn1/tasn_prn.c stable/10/crypto/openssl/crypto/asn1/x_name.c stable/10/crypto/openssl/crypto/bio/bf_nbio.c stable/10/crypto/openssl/crypto/bn/bn_lib.c stable/10/crypto/openssl/crypto/bn/bn_print.c stable/10/crypto/openssl/crypto/bn/bn_rand.c stable/10/crypto/openssl/crypto/cms/cms_enc.c stable/10/crypto/openssl/crypto/cms/cms_ess.c stable/10/crypto/openssl/crypto/cms/cms_pwri.c stable/10/crypto/openssl/crypto/des/des.c stable/10/crypto/openssl/crypto/des/enc_writ.c stable/10/crypto/openssl/crypto/dsa/dsa_gen.c stable/10/crypto/openssl/crypto/dsa/dsa_ossl.c stable/10/crypto/openssl/crypto/evp/bio_ok.c stable/10/crypto/openssl/crypto/evp/digest.c stable/10/crypto/openssl/crypto/evp/e_seed.c stable/10/crypto/openssl/crypto/md2/md2_dgst.c stable/10/crypto/openssl/crypto/md32_common.h stable/10/crypto/openssl/crypto/mdc2/mdc2dgst.c stable/10/crypto/openssl/crypto/ocsp/ocsp_ext.c stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/pem/pem.h stable/10/crypto/openssl/crypto/pem/pem_err.c stable/10/crypto/openssl/crypto/pem/pem_lib.c stable/10/crypto/openssl/crypto/pem/pvkfmt.c stable/10/crypto/openssl/crypto/pkcs12/p12_mutl.c stable/10/crypto/openssl/crypto/pkcs12/p12_npas.c stable/10/crypto/openssl/crypto/pkcs12/p12_utl.c stable/10/crypto/openssl/crypto/pkcs12/pkcs12.h stable/10/crypto/openssl/crypto/pkcs7/pk7_doit.c stable/10/crypto/openssl/crypto/rand/rand_unix.c stable/10/crypto/openssl/crypto/srp/srp_lib.c stable/10/crypto/openssl/crypto/srp/srp_vfy.c stable/10/crypto/openssl/crypto/ts/ts_lib.c stable/10/crypto/openssl/crypto/whrlpool/wp_dgst.c stable/10/crypto/openssl/crypto/x509/x509.h stable/10/crypto/openssl/crypto/x509/x509_err.c stable/10/crypto/openssl/crypto/x509/x509_txt.c stable/10/crypto/openssl/crypto/x509/x509_vfy.c stable/10/crypto/openssl/crypto/x509/x509_vfy.h stable/10/crypto/openssl/crypto/x509v3/v3_addr.c stable/10/crypto/openssl/doc/apps/cms.pod stable/10/crypto/openssl/doc/apps/smime.pod stable/10/crypto/openssl/doc/apps/verify.pod stable/10/crypto/openssl/doc/crypto/X509_verify_cert.pod stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/d1_clnt.c stable/10/crypto/openssl/ssl/d1_lib.c stable/10/crypto/openssl/ssl/d1_pkt.c stable/10/crypto/openssl/ssl/d1_srvr.c stable/10/crypto/openssl/ssl/s23_clnt.c stable/10/crypto/openssl/ssl/s2_clnt.c stable/10/crypto/openssl/ssl/s2_srvr.c stable/10/crypto/openssl/ssl/s3_both.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl_err.c stable/10/crypto/openssl/ssl/ssl_lib.c stable/10/crypto/openssl/ssl/ssl_locl.h stable/10/crypto/openssl/ssl/ssl_sess.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/Makefile.man stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/c_rehash.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/CHANGES Thu Sep 22 15:05:38 2016 (r306196) @@ -2,6 +2,166 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1t and 1.0.1u [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.1s and 1.0.1t [3 May 2016] *) Prevent padding oracle in AES-NI CBC MAC check Modified: stable/10/crypto/openssl/CONTRIBUTING ============================================================================== --- stable/10/crypto/openssl/CONTRIBUTING Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/CONTRIBUTING Thu Sep 22 15:05:38 2016 (r306196) @@ -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/10/crypto/openssl/Configure ============================================================================== --- stable/10/crypto/openssl/Configure Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/Configure Thu Sep 22 15:05:38 2016 (r306196) @@ -741,7 +741,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_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -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_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -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). Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/Makefile Thu Sep 22 15:05:38 2016 (r306196) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1t +VERSION=1.0.1u MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/NEWS Thu Sep 22 15:05:38 2016 (r306196) @@ -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.1t and OpenSSL 1.0.1u [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.1s and OpenSSL 1.0.1t [3 May 2016] o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/README Thu Sep 22 15:05:38 2016 (r306196) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1t 3 May 2016 + OpenSSL 1.0.1u 22 Sep 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/apps.c ============================================================================== --- stable/10/crypto/openssl/apps/apps.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/apps/apps.c Thu Sep 22 15:05:38 2016 (r306196) @@ -2241,6 +2241,8 @@ int args_verify(char ***pargs, int *parg flags |= X509_V_FLAG_CHECK_SS_SIGNATURE; 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; Modified: stable/10/crypto/openssl/apps/enc.c ============================================================================== --- stable/10/crypto/openssl/apps/enc.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/apps/enc.c Thu Sep 22 15:05:38 2016 (r306196) @@ -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/10/crypto/openssl/apps/passwd.c ============================================================================== --- stable/10/crypto/openssl/apps/passwd.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/apps/passwd.c Thu Sep 22 15:05:38 2016 (r306196) @@ -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/10/crypto/openssl/apps/s_server.c ============================================================================== --- stable/10/crypto/openssl/apps/s_server.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/apps/s_server.c Thu Sep 22 15:05:38 2016 (r306196) @@ -2968,7 +2968,7 @@ static int generate_session_id(const SSL { unsigned int count = 0; do { - if (RAND_pseudo_bytes(id, *id_len) < 0) + if (RAND_bytes(id, *id_len) <= 0) return 0; /* * Prefix the session_id with the required prefix. NB: If our prefix Modified: stable/10/crypto/openssl/apps/x509.c ============================================================================== --- stable/10/crypto/openssl/apps/x509.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/apps/x509.c Thu Sep 22 15:05:38 2016 (r306196) @@ -1053,6 +1053,10 @@ static int x509_certify(X509_STORE *ctx, EVP_PKEY *upkey; upkey = X509_get_pubkey(xca); + if (upkey == NULL) { + BIO_printf(bio_err, "Error obtaining CA X509 public key\n"); + goto end; + } EVP_PKEY_copy_parameters(upkey, pkey); EVP_PKEY_free(upkey); @@ -1161,6 +1165,8 @@ static int sign(X509 *x, EVP_PKEY *pkey, EVP_PKEY *pktmp; pktmp = X509_get_pubkey(x); + if (pktmp == NULL) + goto err; EVP_PKEY_copy_parameters(pktmp, pkey); EVP_PKEY_save_parameters(pktmp, 1); EVP_PKEY_free(pktmp); Modified: stable/10/crypto/openssl/crypto/asn1/a_bytes.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_bytes.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/a_bytes.c Thu Sep 22 15:05:38 2016 (r306196) @@ -60,7 +60,12 @@ #include "cryptlib.h" #include -static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c); +static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c, + int depth); +static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a, + const unsigned char **pp, long length, + int Ptag, int Pclass, int depth, + int *perr); /* * type is a 'bitmap' of acceptable string types. */ @@ -99,7 +104,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_ST ret = (*a); if (len != 0) { - s = (unsigned char *)OPENSSL_malloc((int)len + 1); + s = OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; @@ -154,15 +159,38 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsig return (r); } +/* + * Maximum recursion depth of d2i_ASN1_bytes(): much more than should be + * encountered in pratice. + */ + +#define ASN1_BYTES_MAXDEPTH 20 + ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, long length, int Ptag, int Pclass) { + int err = 0; + ASN1_STRING *s = int_d2i_ASN1_bytes(a, pp, length, Ptag, Pclass, 0, &err); + if (err != 0) + ASN1err(ASN1_F_D2I_ASN1_BYTES, err); + return s; +} + +static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a, + const unsigned char **pp, long length, + int Ptag, int Pclass, + int depth, int *perr) +{ ASN1_STRING *ret = NULL; const unsigned char *p; unsigned char *s; long len; int inf, tag, xclass; - int i = 0; + + if (depth > ASN1_BYTES_MAXDEPTH) { + *perr = ASN1_R_NESTED_ASN1_STRING; + return NULL; + } if ((a == NULL) || ((*a) == NULL)) { if ((ret = ASN1_STRING_new()) == NULL) @@ -173,18 +201,19 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING p = *pp; inf = ASN1_get_object(&p, &len, &tag, &xclass, length); if (inf & 0x80) { - i = ASN1_R_BAD_OBJECT_HEADER; + *perr = ASN1_R_BAD_OBJECT_HEADER; goto err; } if (tag != Ptag) { - i = ASN1_R_WRONG_TAG; + *perr = ASN1_R_WRONG_TAG; goto err; } if (inf & V_ASN1_CONSTRUCTED) { ASN1_const_CTX c; + c.error = 0; c.pp = pp; c.p = p; c.inf = inf; @@ -192,17 +221,18 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING c.tag = Ptag; c.xclass = Pclass; c.max = (length == 0) ? 0 : (p + length); - if (!asn1_collate_primitive(ret, &c)) + if (!asn1_collate_primitive(ret, &c, depth)) { + *perr = c.error; goto err; - else { + } else { p = c.p; } } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - s = (unsigned char *)OPENSSL_malloc((int)len + 1); + s = OPENSSL_malloc((int)len + 1); if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; + *perr = ERR_R_MALLOC_FAILURE; goto err; } if (ret->data != NULL) @@ -230,7 +260,6 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING err: if ((ret != NULL) && ((a == NULL) || (*a != ret))) ASN1_STRING_free(ret); - ASN1err(ASN1_F_D2I_ASN1_BYTES, i); return (NULL); } @@ -242,7 +271,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING * There have been a few bug fixes for this function from Paul Keogh * , many thanks to him */ -static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) +static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c, + int depth) { ASN1_STRING *os = NULL; BUF_MEM b; @@ -270,9 +300,8 @@ static int asn1_collate_primitive(ASN1_S } c->q = c->p; - if (d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass) - == NULL) { - c->error = ERR_R_ASN1_LIB; + if (int_d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass, + depth + 1, &c->error) == NULL) { goto err; } @@ -297,7 +326,6 @@ static int asn1_collate_primitive(ASN1_S ASN1_STRING_free(os); return (1); err: - ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE, c->error); if (os != NULL) ASN1_STRING_free(os); if (b.data != NULL) Modified: stable/10/crypto/openssl/crypto/asn1/a_object.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_object.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/a_object.c Thu Sep 22 15:05:38 2016 (r306196) @@ -73,7 +73,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsi return (0); objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT); - if (pp == NULL) + if (pp == NULL || objsize == -1) return objsize; p = *pp; @@ -174,8 +174,12 @@ int a2d_ASN1_OBJECT(unsigned char *out, if (!tmp) goto err; } - while (blsize--) - tmp[i++] = (unsigned char)BN_div_word(bl, 0x80L); + while (blsize--) { + BN_ULONG t = BN_div_word(bl, 0x80L); + if (t == (BN_ULONG)-1) + goto err; + tmp[i++] = (unsigned char)t; + } } else { for (;;) { Modified: stable/10/crypto/openssl/crypto/asn1/a_set.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_set.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/a_set.c Thu Sep 22 15:05:38 2016 (r306196) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -98,10 +99,14 @@ int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) if (a == NULL) return (0); - for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) + for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) { + int tmplen = i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + if (tmplen > INT_MAX - ret) + return -1; ret += i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + } r = ASN1_object_size(1, ret, ex_tag); - if (pp == NULL) + if (pp == NULL || r == -1) return (r); p = *pp; Modified: stable/10/crypto/openssl/crypto/asn1/asn1_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Thu Sep 22 15:05:38 2016 (r306196) @@ -256,26 +256,30 @@ static void asn1_put_length(unsigned cha int ASN1_object_size(int constructed, int length, int tag) { - int ret; - - ret = length; - ret++; + int ret = 1; + if (length < 0) + return -1; if (tag >= 31) { while (tag > 0) { tag >>= 7; ret++; } } - if (constructed == 2) - return ret + 3; - ret++; - if (length > 127) { - while (length > 0) { - length >>= 8; - ret++; + if (constructed == 2) { + ret += 3; + } else { + ret++; + if (length > 127) { + int tmplen = length; + while (tmplen > 0) { + tmplen >>= 8; + ret++; + } } } - return (ret); + if (ret >= INT_MAX - length) + return -1; + return ret + length; } static int _asn1_Finish(ASN1_const_CTX *c) @@ -324,7 +328,7 @@ int asn1_GetSequence(ASN1_const_CTX *c, return (0); } if (c->inf == (1 | V_ASN1_CONSTRUCTED)) - c->slen = *length + *(c->pp) - c->p; + c->slen = *length; c->eos = 0; return (1); } @@ -366,7 +370,7 @@ int ASN1_STRING_set(ASN1_STRING *str, co else len = strlen(data); } - if ((str->length < len) || (str->data == NULL)) { + if ((str->length <= len) || (str->data == NULL)) { c = str->data; if (c == NULL) str->data = OPENSSL_malloc(len + 1); Modified: stable/10/crypto/openssl/crypto/asn1/asn_mime.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn_mime.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/asn_mime.c Thu Sep 22 15:05:38 2016 (r306196) @@ -289,7 +289,7 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALU if ((flags & SMIME_DETACHED) && data) { /* We want multipart/signed */ /* Generate a random boundary */ - if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0) + if (RAND_bytes((unsigned char *)bound, 32) <= 0) return 0; for (i = 0; i < 32; i++) { c = bound[i] & 0xf; Modified: stable/10/crypto/openssl/crypto/asn1/d2i_pr.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/d2i_pr.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/d2i_pr.c Thu Sep 22 15:05:38 2016 (r306196) @@ -97,15 +97,17 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_P if (!ret->ameth->old_priv_decode || !ret->ameth->old_priv_decode(ret, &p, length)) { if (ret->ameth->priv_decode) { + EVP_PKEY *tmp; PKCS8_PRIV_KEY_INFO *p8 = NULL; p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length); if (!p8) goto err; - EVP_PKEY_free(ret); - ret = EVP_PKCS82PKEY(p8); + tmp = EVP_PKCS82PKEY(p8); PKCS8_PRIV_KEY_INFO_free(p8); - if (ret == NULL) + if (tmp == NULL) goto err; + EVP_PKEY_free(ret); + ret = tmp; } else { ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB); goto err; Modified: stable/10/crypto/openssl/crypto/asn1/f_enum.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/f_enum.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/f_enum.c Thu Sep 22 15:05:38 2016 (r306196) @@ -160,8 +160,6 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_EN i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -199,5 +197,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_EN err_sl: ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } Modified: stable/10/crypto/openssl/crypto/asn1/f_int.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/f_int.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/f_int.c Thu Sep 22 15:05:38 2016 (r306196) @@ -172,8 +172,6 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEG sp = OPENSSL_realloc_clean(s, slen, num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -211,5 +209,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEG err_sl: ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } Modified: stable/10/crypto/openssl/crypto/asn1/f_string.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/f_string.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/f_string.c Thu Sep 22 15:05:38 2016 (r306196) @@ -166,8 +166,6 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -205,5 +203,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING err_sl: ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } Modified: stable/10/crypto/openssl/crypto/asn1/p5_pbe.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/p5_pbe.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/p5_pbe.c Thu Sep 22 15:05:38 2016 (r306196) @@ -101,7 +101,7 @@ int PKCS5_pbe_set0_algor(X509_ALGOR *alg sstr = ASN1_STRING_data(pbe->salt); if (salt) memcpy(sstr, salt, saltlen); - else if (RAND_pseudo_bytes(sstr, saltlen) < 0) + else if (RAND_bytes(sstr, saltlen) <= 0) goto err; if (!ASN1_item_pack(pbe, ASN1_ITEM_rptr(PBEPARAM), &pbe_str)) { Modified: stable/10/crypto/openssl/crypto/asn1/p5_pbev2.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/p5_pbev2.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/p5_pbev2.c Thu Sep 22 15:05:38 2016 (r306196) @@ -120,7 +120,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_ if (EVP_CIPHER_iv_length(cipher)) { if (aiv) memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); - else if (RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) + else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0) goto err; } @@ -225,7 +225,7 @@ X509_ALGOR *PKCS5_pbkdf2_set(int iter, u if (salt) memcpy(osalt->data, salt, saltlen); - else if (RAND_pseudo_bytes(osalt->data, saltlen) < 0) + else if (RAND_bytes(osalt->data, saltlen) <= 0) goto merr; if (iter <= 0) Modified: stable/10/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Thu Sep 22 15:05:38 2016 (r306196) @@ -59,6 +59,7 @@ #include #include +#include #include "cryptlib.h" #include #include @@ -216,17 +217,19 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { const ASN1_TEMPLATE *seqtt; ASN1_VALUE **pseqval; + int tmplen; seqtt = asn1_do_adb(pval, tt, 1); if (!seqtt) return 0; pseqval = asn1_get_field_ptr(pval, seqtt); - /* FIXME: check for errors in enhanced version */ - seqcontlen += asn1_template_ex_i2d(pseqval, NULL, seqtt, - -1, aclass); + tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass); + if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen)) + return -1; + seqcontlen += tmplen; } seqlen = ASN1_object_size(ndef, seqcontlen, tag); - if (!out) + if (!out || seqlen == -1) return seqlen; /* Output SEQUENCE header */ ASN1_put_object(out, ndef, seqcontlen, tag, aclass); @@ -339,19 +342,24 @@ static int asn1_template_ex_i2d(ASN1_VAL /* Determine total length of items */ skcontlen = 0; for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + int tmplen; skitem = sk_ASN1_VALUE_value(sk, i); - skcontlen += ASN1_item_ex_i2d(&skitem, NULL, - ASN1_ITEM_ptr(tt->item), - -1, iclass); + tmplen = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), + -1, iclass); + if (tmplen == -1 || (skcontlen > INT_MAX - tmplen)) + return -1; + skcontlen += tmplen; } sklen = ASN1_object_size(ndef, skcontlen, sktag); + if (sklen == -1) + return -1; /* If EXPLICIT need length of surrounding tag */ if (flags & ASN1_TFLG_EXPTAG) ret = ASN1_object_size(ndef, sklen, ttag); else ret = sklen; - if (!out) + if (!out || ret == -1) return ret; /* Now encode this lot... */ @@ -380,7 +388,7 @@ static int asn1_template_ex_i2d(ASN1_VAL return 0; /* Find length of EXPLICIT tag */ ret = ASN1_object_size(ndef, i, ttag); - if (out) { + if (out && ret != -1) { /* Output tag and item */ ASN1_put_object(out, ndef, i, ttag, tclass); ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass); Modified: stable/10/crypto/openssl/crypto/asn1/tasn_prn.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_prn.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/tasn_prn.c Thu Sep 22 15:05:38 2016 (r306196) @@ -446,6 +446,8 @@ static int asn1_print_integer_ctx(BIO *o char *s; int ret = 1; s = i2s_ASN1_INTEGER(NULL, str); + if (s == NULL) + return 0; if (BIO_puts(out, s) <= 0) ret = 0; OPENSSL_free(s); Modified: stable/10/crypto/openssl/crypto/asn1/x_name.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/x_name.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/asn1/x_name.c Thu Sep 22 15:05:38 2016 (r306196) @@ -199,10 +199,8 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; - if (len > X509_NAME_MAX) { - ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); - return 0; - } + if (len > X509_NAME_MAX) + len = X509_NAME_MAX; q = p; /* Get internal representation of Name */ Modified: stable/10/crypto/openssl/crypto/bio/bf_nbio.c ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bf_nbio.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/bio/bf_nbio.c Thu Sep 22 15:05:38 2016 (r306196) @@ -139,7 +139,7 @@ static int nbiof_read(BIO *b, char *out, BIO_clear_retry_flags(b); #if 1 - if (RAND_pseudo_bytes(&n, 1) < 0) + if (RAND_bytes(&n, 1) <= 0) return -1; num = (n & 0x07); @@ -179,7 +179,7 @@ static int nbiof_write(BIO *b, const cha num = nt->lwn; nt->lwn = 0; } else { - if (RAND_pseudo_bytes(&n, 1) < 0) + if (RAND_bytes(&n, 1) <= 0) return -1; num = (n & 7); } Modified: stable/10/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_lib.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/bn/bn_lib.c Thu Sep 22 15:05:38 2016 (r306196) @@ -569,7 +569,7 @@ void BN_clear(BIGNUM *a) { bn_check_top(a); if (a->d != NULL) - memset(a->d, 0, a->dmax * sizeof(a->d[0])); + OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); a->top = 0; a->neg = 0; } Modified: stable/10/crypto/openssl/crypto/bn/bn_print.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_print.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/bn/bn_print.c Thu Sep 22 15:05:38 2016 (r306196) @@ -111,6 +111,7 @@ char *BN_bn2dec(const BIGNUM *a) char *p; BIGNUM *t = NULL; BN_ULONG *bn_data = NULL, *lp; + int bn_data_num; /*- * get an upper bound for the length of the decimal integer @@ -120,9 +121,9 @@ char *BN_bn2dec(const BIGNUM *a) */ i = BN_num_bits(a) * 3; num = (i / 10 + i / 1000 + 1) + 1; - bn_data = - (BN_ULONG *)OPENSSL_malloc((num / BN_DEC_NUM + 1) * sizeof(BN_ULONG)); - buf = (char *)OPENSSL_malloc(num + 3); + bn_data_num = num / BN_DEC_NUM + 1; + bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG)); + buf = OPENSSL_malloc(num + 3); if ((buf == NULL) || (bn_data == NULL)) { BNerr(BN_F_BN_BN2DEC, ERR_R_MALLOC_FAILURE); goto err; @@ -140,9 +141,12 @@ char *BN_bn2dec(const BIGNUM *a) if (BN_is_negative(t)) *p++ = '-'; - i = 0; while (!BN_is_zero(t)) { + if (lp - bn_data >= bn_data_num) + goto err; *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; lp++; } lp--; Modified: stable/10/crypto/openssl/crypto/bn/bn_rand.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_rand.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/bn/bn_rand.c Thu Sep 22 15:05:38 2016 (r306196) @@ -145,13 +145,9 @@ static int bnrand(int pseudorand, BIGNUM time(&tim); RAND_add(&tim, sizeof(tim), 0.0); - if (pseudorand) { - if (RAND_pseudo_bytes(buf, bytes) == -1) - goto err; - } else { - if (RAND_bytes(buf, bytes) <= 0) - goto err; - } + /* We ignore the value of pseudorand and always call RAND_bytes */ + if (RAND_bytes(buf, bytes) <= 0) + goto err; #if 1 if (pseudorand == 2) { Modified: stable/10/crypto/openssl/crypto/cms/cms_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/cms/cms_enc.c Thu Sep 22 14:57:48 2016 (r306195) +++ stable/10/crypto/openssl/crypto/cms/cms_enc.c Thu Sep 22 15:05:38 2016 (r306196) @@ -119,7 +119,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_E /* Generate a random IV if we need one */ ivlen = EVP_CIPHER_CTX_iv_length(ctx); if (ivlen > 0) { - if (RAND_pseudo_bytes(iv, ivlen) <= 0) + if (RAND_bytes(iv, ivlen) <= 0) goto err; piv = iv; } @@ -179,10 +179,9 @@ BIO *cms_EncryptedContent_init_bio(CMS_E CMS_R_CIPHER_INITIALISATION_ERROR); goto err; } - - if (piv) { + if (enc) { calg->parameter = ASN1_TYPE_new(); - if (!calg->parameter) { + if (calg->parameter == NULL) { CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, ERR_R_MALLOC_FAILURE); goto err; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Sep 22 16:47:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1847FBE62DF; Thu, 22 Sep 2016 16:47:01 +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 C4FD0D85; Thu, 22 Sep 2016 16:47:00 +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 u8MGl0qT095776; Thu, 22 Sep 2016 16:47:00 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MGl0bN095772; Thu, 22 Sep 2016 16:47:00 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609221647.u8MGl0bN095772@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:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306200 - stable/10/bin/cat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 16:47:01 -0000 Author: ache Date: Thu Sep 22 16:46:59 2016 New Revision: 306200 URL: https://svnweb.freebsd.org/changeset/base/306200 Log: MFC r305841 Implement multibyte encoding support for -v with fallback Modified: stable/10/bin/cat/cat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/cat/cat.c ============================================================================== --- stable/10/bin/cat/cat.c Thu Sep 22 16:05:19 2016 (r306199) +++ stable/10/bin/cat/cat.c Thu Sep 22 16:46:59 2016 (r306200) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int bflag, eflag, lflag, nflag, sflag, tflag, vflag; static int rval; @@ -205,6 +207,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)) @@ -237,18 +240,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-10@freebsd.org Thu Sep 22 21:14:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B74BE4C75; Thu, 22 Sep 2016 21:14:01 +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 5A1933B5; Thu, 22 Sep 2016 21:14:01 +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 u8MLE0Xn097872; Thu, 22 Sep 2016 21:14:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MLE0e5097870; Thu, 22 Sep 2016 21:14:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609222114.u8MLE0e5097870@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:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306214 - in stable/10/usr.bin/bsdiff: bsdiff bspatch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 21:14:01 -0000 Author: emaste Date: Thu Sep 22 21:14:00 2016 New Revision: 306214 URL: https://svnweb.freebsd.org/changeset/base/306214 Log: MFC r264823 (ed): Make usage printing more consistent with other tools. - Introduce a separate usage() function. - Don't use argv[0]. Directly name the application, as we do elsewhere. - Don't prepend the application name. - Don't print two newlines. Also apply the unnecessary semicolon cleanup from r298089 Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c stable/10/usr.bin/bsdiff/bspatch/bspatch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Thu Sep 22 21:05:21 2016 (r306213) +++ stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Thu Sep 22 21:14:00 2016 (r306214) @@ -199,6 +199,14 @@ static void offtout(off_t x,u_char *buf) if(x<0) buf[7]|=0x80; } +static void +usage(void) +{ + + fprintf(stderr, "usage: bsdiff oldfile newfile patchfile\n"); + exit(1); +} + int main(int argc,char *argv[]) { int fd; @@ -219,7 +227,8 @@ int main(int argc,char *argv[]) BZFILE * pfbz2; int bz2err; - if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); + if (argc != 4) + usage(); /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ Modified: stable/10/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/10/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 21:05:21 2016 (r306213) +++ stable/10/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 21:14:00 2016 (r306214) @@ -57,6 +57,14 @@ static off_t offtin(u_char *buf) return y; } +static void +usage(void) +{ + + fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n"); + exit(1); +} + int main(int argc,char * argv[]) { FILE * f, * cpf, * dpf, * epf; @@ -72,7 +80,8 @@ int main(int argc,char * argv[]) off_t lenread; off_t i; - if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); + if (argc != 4) + usage(); /* Open patch file */ if ((f = fopen(argv[3], "rb")) == NULL) @@ -152,7 +161,7 @@ int main(int argc,char * argv[]) (cbz2err != BZ_STREAM_END))) errx(1, "Corrupt patch\n"); ctrl[i]=offtin(buf); - }; + } /* Sanity-check */ if ((ctrl[0] < 0) || (ctrl[1] < 0)) @@ -190,7 +199,7 @@ int main(int argc,char * argv[]) /* Adjust pointers */ newpos+=ctrl[1]; oldpos+=ctrl[2]; - }; + } /* Clean up the bzip2 reads */ BZ2_bzReadClose(&cbz2err, cpfbz2); From owner-svn-src-stable-10@freebsd.org Thu Sep 22 21:16:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24604BE4D89; Thu, 22 Sep 2016 21:16:56 +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 DA2CF7FD; Thu, 22 Sep 2016 21:16:55 +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 u8MLGtxW098066; Thu, 22 Sep 2016 21:16:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MLGtFC098065; Thu, 22 Sep 2016 21:16:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609222116.u8MLGtFC098065@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:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306215 - stable/10/usr.bin/bsdiff/bspatch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 21:16:56 -0000 Author: emaste Date: Thu Sep 22 21:16:54 2016 New Revision: 306215 URL: https://svnweb.freebsd.org/changeset/base/306215 Log: MFC bspatch Capsicumization and 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/10/usr.bin/bsdiff/bspatch/bspatch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/10/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 21:14:00 2016 (r306214) +++ stable/10/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 22 21:16:54 2016 (r306215) @@ -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-10@freebsd.org Fri Sep 23 04:53:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB685BE5B91; Fri, 23 Sep 2016 04:53:48 +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 9BED738C; Fri, 23 Sep 2016 04:53:48 +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 u8N4rlkQ070376; Fri, 23 Sep 2016 04:53:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N4rlTM070375; Fri, 23 Sep 2016 04:53:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609230453.u8N4rlTM070375@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 04:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306225 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 04:53:48 -0000 Author: sephe Date: Fri Sep 23 04:53:47 2016 New Revision: 306225 URL: https://svnweb.freebsd.org/changeset/base/306225 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/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Sep 23 04:45:11 2016 (r306224) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Sep 23 04:53:47 2016 (r306225) @@ -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-10@freebsd.org Fri Sep 23 08:28:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2BEBE67CE; Fri, 23 Sep 2016 08:28: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 38A5819CB; Fri, 23 Sep 2016 08:28: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 u8N8Sjxk052225; Fri, 23 Sep 2016 08:28:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8SiOk052212; Fri, 23 Sep 2016 08:28:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230828.u8N8SiOk052212@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:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306244 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:28:46 -0000 Author: hselasky Date: Fri Sep 23 08:28:44 2016 New Revision: 306244 URL: https://svnweb.freebsd.org/changeset/base/306244 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/10/sys/dev/mlx5/cq.h stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/flow_table.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_mr.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_qp.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_srq.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_transobj.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_uar.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/10/sys/dev/mlx5/mlx5_core/transobj.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_ifc.h stable/10/sys/dev/mlx5/qp.h stable/10/sys/dev/mlx5/vport.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/cq.h ============================================================================== --- stable/10/sys/dev/mlx5/cq.h Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/cq.h Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/device.h Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/driver.h Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/flow_table.h ============================================================================== --- stable/10/sys/dev/mlx5/flow_table.h Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/flow_table.h Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 23 08:28:44 2016 (r306244) @@ -157,6 +157,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"; } @@ -183,6 +185,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); @@ -261,6 +278,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", @@ -478,6 +515,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]); @@ -575,6 +616,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"; @@ -607,19 +650,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/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 23 08:28:44 2016 (r306244) @@ -97,10 +97,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) { @@ -256,8 +256,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, @@ -550,7 +550,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] @@ -565,7 +565,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); @@ -628,10 +628,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); @@ -641,9 +641,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/10/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 23 08:28:44 2016 (r306244) @@ -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/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 23 08:26:45 2016 (r306243) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 23 08:28:44 2016 (r306244) @@ -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-10@freebsd.org Fri Sep 23 08:29:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A758BE68F1; Fri, 23 Sep 2016 08:29:29 +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 393881B5D; Fri, 23 Sep 2016 08:29:29 +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 u8N8TS1q052314; Fri, 23 Sep 2016 08:29:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8TSD4052310; Fri, 23 Sep 2016 08:29:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230829.u8N8TSD4052310@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:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306245 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:29:29 -0000 Author: hselasky Date: Fri Sep 23 08:29:27 2016 New Revision: 306245 URL: https://svnweb.freebsd.org/changeset/base/306245 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/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:28:44 2016 (r306244) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:29:27 2016 (r306245) @@ -439,9 +439,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); @@ -525,6 +525,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; @@ -533,7 +534,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:28:44 2016 (r306244) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:29:27 2016 (r306245) @@ -988,7 +988,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, @@ -1045,15 +1046,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); @@ -1062,10 +1060,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; @@ -1083,8 +1077,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); @@ -1098,7 +1092,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); @@ -1108,10 +1102,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; @@ -1128,7 +1118,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); @@ -1138,11 +1128,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 @@ -1308,7 +1295,7 @@ mlx5e_create_cq(struct mlx5e_channel *c, cqe->op_own = 0xf1; } - cq->channel = c; + cq->priv = priv; return (0); } @@ -1323,9 +1310,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; @@ -1347,7 +1331,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); @@ -1356,7 +1340,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); @@ -1371,11 +1355,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:28:44 2016 (r306244) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:29:27 2016 (r306245) @@ -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/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 23 08:28:44 2016 (r306244) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 23 08:29:27 2016 (r306245) @@ -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-10@freebsd.org Fri Sep 23 08:30:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7F4BE69A5; Fri, 23 Sep 2016 08:30:10 +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 75EC61CE1; Fri, 23 Sep 2016 08:30:10 +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 u8N8U9vb052427; Fri, 23 Sep 2016 08:30:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8U9h2052425; Fri, 23 Sep 2016 08:30:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230830.u8N8U9h2052425@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:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306246 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:30:10 -0000 Author: hselasky Date: Fri Sep 23 08:30:09 2016 New Revision: 306246 URL: https://svnweb.freebsd.org/changeset/base/306246 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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:29:27 2016 (r306245) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:30:09 2016 (r306246) @@ -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 { @@ -1254,12 +1253,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; @@ -1269,21 +1268,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; @@ -1307,8 +1305,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; @@ -1331,9 +1328,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 - @@ -1360,19 +1356,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; @@ -1395,25 +1391,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; } @@ -1509,7 +1493,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); @@ -1532,21 +1515,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; @@ -1676,6 +1647,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); } @@ -1689,6 +1672,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-10@freebsd.org Fri Sep 23 08:30:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C66B7BE6A52; Fri, 23 Sep 2016 08:30:54 +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 885831F45; Fri, 23 Sep 2016 08:30:54 +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 u8N8UrvD053211; Fri, 23 Sep 2016 08:30:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8UrHe053209; Fri, 23 Sep 2016 08:30:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230830.u8N8UrHe053209@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:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306247 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:30:54 -0000 Author: hselasky Date: Fri Sep 23 08:30:53 2016 New Revision: 306247 URL: https://svnweb.freebsd.org/changeset/base/306247 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/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:30:09 2016 (r306246) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:30:53 2016 (r306247) @@ -358,6 +358,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; @@ -804,5 +819,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:30:09 2016 (r306246) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:30:53 2016 (r306247) @@ -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; @@ -1355,7 +1340,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, @@ -1380,7 +1365,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-10@freebsd.org Fri Sep 23 08:31:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02B5BE6B0A; Fri, 23 Sep 2016 08:31:39 +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 A4BCA6A0; Fri, 23 Sep 2016 08:31:39 +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 u8N8VcTl053964; Fri, 23 Sep 2016 08:31:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8VcBp053962; Fri, 23 Sep 2016 08:31:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230831.u8N8VcBp053962@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:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306248 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:31:40 -0000 Author: hselasky Date: Fri Sep 23 08:31:38 2016 New Revision: 306248 URL: https://svnweb.freebsd.org/changeset/base/306248 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/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:30:53 2016 (r306247) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:31:38 2016 (r306248) @@ -538,8 +538,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; @@ -548,7 +547,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; @@ -790,13 +788,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:30:53 2016 (r306247) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:31:38 2016 (r306248) @@ -962,8 +962,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-10@freebsd.org Fri Sep 23 08:32:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E06ABE6C83; Fri, 23 Sep 2016 08:32: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 4F71E98B; Fri, 23 Sep 2016 08:32: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 u8N8WIP9056241; Fri, 23 Sep 2016 08:32:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8WIns056239; Fri, 23 Sep 2016 08:32:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230832.u8N8WIns056239@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:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306249 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:32:19 -0000 Author: hselasky Date: Fri Sep 23 08:32:18 2016 New Revision: 306249 URL: https://svnweb.freebsd.org/changeset/base/306249 Log: MFC r305872: mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:31:38 2016 (r306248) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:32:18 2016 (r306249) @@ -672,6 +672,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; @@ -794,7 +795,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:31:38 2016 (r306248) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:32:18 2016 (r306249) @@ -2759,6 +2759,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-10@freebsd.org Fri Sep 23 08:33:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0560BBE6D24; Fri, 23 Sep 2016 08:33:05 +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 D4D54B25; Fri, 23 Sep 2016 08:33:04 +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 u8N8X4U5056345; Fri, 23 Sep 2016 08:33:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8X3hL056343; Fri, 23 Sep 2016 08:33:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230833.u8N8X3hL056343@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:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306250 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:33:05 -0000 Author: hselasky Date: Fri Sep 23 08:33:03 2016 New Revision: 306250 URL: https://svnweb.freebsd.org/changeset/base/306250 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/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:32:18 2016 (r306249) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:33:03 2016 (r306250) @@ -822,5 +822,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:32:18 2016 (r306249) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:33:03 2016 (r306250) @@ -879,7 +879,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); @@ -890,7 +890,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); @@ -1039,8 +1039,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; @@ -1059,7 +1060,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); @@ -1081,7 +1082,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; @@ -1107,7 +1108,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int return (err); } -static void +void mlx5e_disable_sq(struct mlx5e_sq *sq) { @@ -1126,7 +1127,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; @@ -1202,8 +1203,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); @@ -1230,7 +1231,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-10@freebsd.org Fri Sep 23 08:33:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02196BE6E37; Fri, 23 Sep 2016 08:33:49 +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 ACC3CCAE; Fri, 23 Sep 2016 08:33:48 +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 u8N8XlLG056425; Fri, 23 Sep 2016 08:33:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8Xldw056424; Fri, 23 Sep 2016 08:33:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230833.u8N8Xldw056424@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:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306251 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:33:49 -0000 Author: hselasky Date: Fri Sep 23 08:33:47 2016 New Revision: 306251 URL: https://svnweb.freebsd.org/changeset/base/306251 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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:33:03 2016 (r306250) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:33:47 2016 (r306251) @@ -2179,7 +2179,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", @@ -2187,19 +2186,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-10@freebsd.org Fri Sep 23 08:34:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B5DEBE6E9A; Fri, 23 Sep 2016 08:34:30 +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 E1A23E36; Fri, 23 Sep 2016 08:34:29 +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 u8N8YTGk056510; Fri, 23 Sep 2016 08:34:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8YT1U056509; Fri, 23 Sep 2016 08:34:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230834.u8N8YT1U056509@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:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306252 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:34:30 -0000 Author: hselasky Date: Fri Sep 23 08:34:28 2016 New Revision: 306252 URL: https://svnweb.freebsd.org/changeset/base/306252 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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:33:47 2016 (r306251) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:34:28 2016 (r306252) @@ -2660,6 +2660,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-10@freebsd.org Fri Sep 23 08:35:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E231BE6F45; Fri, 23 Sep 2016 08:35: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 45735FAB; Fri, 23 Sep 2016 08:35: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 u8N8ZBLE056604; Fri, 23 Sep 2016 08:35:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8ZBu0056602; Fri, 23 Sep 2016 08:35:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230835.u8N8ZBu0056602@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:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306253 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:35:12 -0000 Author: hselasky Date: Fri Sep 23 08:35:11 2016 New Revision: 306253 URL: https://svnweb.freebsd.org/changeset/base/306253 Log: MFC r305876: mlx5en: Remove unused pdev pointer. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:34:28 2016 (r306252) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Fri Sep 23 08:35:11 2016 (r306253) @@ -473,7 +473,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; @@ -542,7 +541,6 @@ struct mlx5e_sq { struct ifnet *ifp; u32 sqn; u32 bf_buf_size; - struct device *pdev; u32 mkey_be; /* control path */ @@ -563,7 +561,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/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:34:28 2016 (r306252) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 23 08:35:11 2016 (r306253) @@ -669,7 +669,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; @@ -968,7 +967,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; @@ -1492,7 +1490,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-10@freebsd.org Fri Sep 23 08:35:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAACDBE6037; Fri, 23 Sep 2016 08:35:57 +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 8A6E91A4; Fri, 23 Sep 2016 08:35:57 +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 u8N8Zu6J056686; Fri, 23 Sep 2016 08:35:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8N8ZuSg056685; Fri, 23 Sep 2016 08:35:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609230835.u8N8ZuSg056685@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:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306254 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 08:35:57 -0000 Author: hselasky Date: Fri Sep 23 08:35:56 2016 New Revision: 306254 URL: https://svnweb.freebsd.org/changeset/base/306254 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/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:35:11 2016 (r306253) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 23 08:35:56 2016 (r306254) @@ -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-10@freebsd.org Sat Sep 24 10:34:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9865ABE6EEE; Sat, 24 Sep 2016 10:34:36 +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 686128F4; Sat, 24 Sep 2016 10:34:36 +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 u8OAYZ31027817; Sat, 24 Sep 2016 10:34:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8OAYZQ6027816; Sat, 24 Sep 2016 10:34:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201609241034.u8OAYZQ6027816@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:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306294 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 10:34:36 -0000 Author: dchagin Date: Sat Sep 24 10:34:35 2016 New Revision: 306294 URL: https://svnweb.freebsd.org/changeset/base/306294 Log: MFC r305896: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Sep 24 10:32:26 2016 (r306293) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Sep 24 10:34:35 2016 (r306294) @@ -296,6 +296,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-10@freebsd.org Sat Sep 24 11:09:47 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EE9DBE8C9C for ; Sat, 24 Sep 2016 11:09:47 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 201559C2 for ; Sat, 24 Sep 2016 11:09:43 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id y6so110043133lff.1 for ; Sat, 24 Sep 2016 04:09:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2jcqV26sK/dD9XEn+lpaEkxWnPcigyU/tA2Pa96Ti/Y=; b=cXJmNSJYUvRpfcN/G74DSbVmG1hiVhsO2j3PAKQxR9tfW3ykEKVM9DXh9tGrXkEah4 CXgYPwzmn/rvzRBju/iqclsUTi191hQwzfzPeEjm9CSD4/pLa0MnnZgSY6/hT1Ltp23k PTT/5kBVPwHDeNeGIHy6ELzP7nNcxQ/7oJu9giyssv9lVDQaSrzs1WHZWOD2yXDXErGo xx1a+csuAe2tWCzNIuYbcjhhPuk0YkNH+Tzmrcm4kcaUdGnYh0x7C+YqdYZBQPDoxQPt eGYt9Xg7thwEvtiKHEaLQd6ev8g7P1X6jt/bm2X4XWGC66aQu+jiiQnV+0p5t3IEGCdt +mZA== X-Gm-Message-State: AE9vXwPYyCdOb5U39O355lI3YM7ZPGEDFxjaCWrknBMWdeF1eK6NeZJCgaCYtcCEHpRzVQ== X-Received: by 10.46.71.69 with SMTP id u66mr4408994lja.14.1474715376038; Sat, 24 Sep 2016 04:09:36 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h41sm1969858lji.28.2016.09.24.04.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2016 04:09:35 -0700 (PDT) Subject: Re: svn commit: r306294 - stable/10/sys/compat/linux To: Dmitry Chagin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201609241034.u8OAYZQ6027816@repo.freebsd.org> From: Andrey Chernov Message-ID: <6b4986dc-4b47-56cf-12cb-37f9756f4204@freebsd.org> Date: Sat, 24 Sep 2016 14:09:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <201609241034.u8OAYZQ6027816@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 11:09:47 -0000 On 24.09.2016 13:34, Dmitry Chagin wrote: > Author: dchagin > Date: Sat Sep 24 10:34:35 2016 > New Revision: 306294 > URL: https://svnweb.freebsd.org/changeset/base/306294 > > Log: > MFC r305896: > > Implement BLKSSZGET ioctl for the Linuxulator. Off topic: is there any chance to get linux ALSA working, at least its PulseAudio plugin? Currently linux PulseAudio itself works nice (transfering all sounds from remote machine to local), but linux ALSA PulseAudio plugin exits with thread assert error. The same things compiled natively (i.e. ALSA + PulseAudio plugin for FreeBSD) works nice. I mean this ALSA setup: pcm.!default { type pulse hint.description "PulseAudio" } ctl.!default { type pulse } From owner-svn-src-stable-10@freebsd.org Sat Sep 24 16:46:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0DBBE83A1; 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 A392CBE5; 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 u8OGkbWK069557; 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 u8OGkbwm069555; Sat, 24 Sep 2016 16:46:37 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201609241646.u8OGkbwm069555@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-10@freebsd.org Subject: svn commit: r306298 - in stable: 10/lib/libc/sys 11/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 16:46:39 -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/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) Changes in other areas also in this revision: 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) Modified: stable/10/lib/libc/sys/Makefile.inc ============================================================================== --- stable/10/lib/libc/sys/Makefile.inc Sat Sep 24 15:11:27 2016 (r306297) +++ stable/10/lib/libc/sys/Makefile.inc Sat Sep 24 16:46:37 2016 (r306298) @@ -259,6 +259,7 @@ MAN+= abort2.2 \ pselect.2 \ ptrace.2 \ quotactl.2 \ + rctl_add_rule.2 \ read.2 \ readlink.2 \ reboot.2 \ @@ -414,6 +415,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/10/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/10/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 .