From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 05:54:49 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41A8A347; Sun, 22 Mar 2015 05:54:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBB582; Sun, 22 Mar 2015 05:54:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M5sn7V085564; Sun, 22 Mar 2015 05:54:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M5snDM085563; Sun, 22 Mar 2015 05:54:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503220554.t2M5snDM085563@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 Mar 2015 05:54:49 +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: r280338 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 22 Mar 2015 05:54:49 -0000 Author: ngie Date: Sun Mar 22 05:54:48 2015 New Revision: 280338 URL: https://svnweb.freebsd.org/changeset/base/280338 Log: MFC r278888: Some minor style(9) fixes (whitespace + comment) Modified: stable/10/sys/vm/memguard.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/memguard.c ============================================================================== --- stable/10/sys/vm/memguard.c Sun Mar 22 02:15:09 2015 (r280337) +++ stable/10/sys/vm/memguard.c Sun Mar 22 05:54:48 2015 (r280338) @@ -89,9 +89,7 @@ memguard_sysctl_desc(SYSCTL_HANDLER_ARGS return (error); mtx_lock(&malloc_mtx); - /* - * If mtp is NULL, it will be initialized in memguard_cmp(). - */ + /* If mtp is NULL, it will be initialized in memguard_cmp() */ vm_memguard_mtype = malloc_desc2type(desc); strlcpy(vm_memguard_desc, desc, sizeof(vm_memguard_desc)); mtx_unlock(&malloc_mtx); @@ -504,7 +502,7 @@ int memguard_cmp_zone(uma_zone_t zone) { - if ((memguard_options & MG_GUARD_NOFREE) == 0 && + if ((memguard_options & MG_GUARD_NOFREE) == 0 && zone->uz_flags & UMA_ZONE_NOFREE) return (0); From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 08:42:45 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A43F614; Sun, 22 Mar 2015 08:42:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 743F11FB; Sun, 22 Mar 2015 08:42:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M8gjE5063474; Sun, 22 Mar 2015 08:42:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M8gj0g063473; Sun, 22 Mar 2015 08:42:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503220842.t2M8gj0g063473@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 Mar 2015 08:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280340 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 22 Mar 2015 08:42:45 -0000 Author: ngie Date: Sun Mar 22 08:42:44 2015 New Revision: 280340 URL: https://svnweb.freebsd.org/changeset/base/280340 Log: MFC r279197,r279198: r279197: Parallelize building bootstrap-tools Differential Revision: https://reviews.freebsd.org/D1901 Reviewed by: ian No serious objections from: imp r279198: Fill in missing dependencies for dtrace related tools so the bootstrap-tools compiles properly on older hosts Pointyhat to: me Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun Mar 22 06:17:26 2015 (r280339) +++ stable/10/Makefile.inc1 Sun Mar 22 08:42:44 2015 (r280340) @@ -1218,6 +1218,8 @@ legacy: # # bootstrap-tools: Build tools needed for compatibility # +_bt= _bootstrap-tools + .if ${MK_GAMES} != "no" _strfile= games/fortune/strfile .endif @@ -1248,11 +1250,15 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 1000002 _m4= usr.bin/m4 + +${_bt}-usr.bin/m4: ${_bt}-lib/libohash .endif .if ${BOOTSTRAPPING} < 1000013 _yacc= lib/liby \ usr.bin/yacc + +${_bt}-usr.bin/yacc: ${_bt}-lib/liby .endif .if ${BOOTSTRAPPING} < 1000014 @@ -1262,6 +1268,8 @@ _crunch= usr.sbin/crunch .if ${BOOTSTRAPPING} < 1000026 _nmtree= lib/libnetbsd \ usr.sbin/nmtree + +${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd .endif .if ${BOOTSTRAPPING} < 1000027 @@ -1286,6 +1294,9 @@ _clang_tblgen= \ lib/clang/libllvmtablegen \ usr.bin/clang/tblgen \ usr.bin/clang/clang-tblgen + +${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport +${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport .endif # dtrace tools are required for older bootstrap env and cross-build @@ -1295,6 +1306,9 @@ _clang_tblgen= \ || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge + +${_bt}-cddl/usr.bin/ctfconvert: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf +${_bt}-cddl/usr.bin/ctfmerge: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf .endif # Default to building the GPL DTC, but build the BSDL one if users explicitly @@ -1312,6 +1326,9 @@ _kerberos5_bootstrap_tools= \ kerberos5/tools/asn1_compile \ kerberos5/tools/slc \ usr.bin/compile_et + +${_bt}-kerberos5/tools/slc: ${_bt}-kerberos5/lib/libroken +${_bt}-kerberos5/tools/asn1_compile: ${_bt}-kerberos5/lib/libroken .endif .if ${_BOOTSTRAP_MAKEINFO} != "no" @@ -1319,10 +1336,11 @@ _texinfo= gnu/usr.bin/texinfo/libtxi \ gnu/usr.bin/texinfo/makeinfo \ gnu/usr.bin/texinfo/install-info .endif +bootstrap-tools: .PHONY + # Please document (add comment) why something is in 'bootstrap-tools'. # Try to bound the building of the bootstrap-tool to just the # FreeBSD versions that need the tool built at this stage of the build. -bootstrap-tools: .MAKE .for _tool in \ ${_clang_tblgen} \ ${_kerberos5_bootstrap_tools} \ @@ -1350,12 +1368,15 @@ bootstrap-tools: .MAKE ${_nmtree} \ ${_texinfo} \ ${_vtfontcvt} +${_bt}-${_tool}: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ ${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install + +bootstrap-tools: ${_bt}-${_tool} .endfor # From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 08:47:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD53877B; Sun, 22 Mar 2015 08:47:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DE3229; Sun, 22 Mar 2015 08:47:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M8laoZ064134; Sun, 22 Mar 2015 08:47:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M8la59064133; Sun, 22 Mar 2015 08:47:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503220847.t2M8la59064133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 Mar 2015 08:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280341 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 22 Mar 2015 08:47:36 -0000 Author: ngie Date: Sun Mar 22 08:47:35 2015 New Revision: 280341 URL: https://svnweb.freebsd.org/changeset/base/280341 Log: Remove dependency between usr.bin/m4 and lib/libohash libohash doesn't exist on stable/10 (only head) Not sure why my make buildworld didn't catch any issues This is a direct commit to stable/10 as a followup to r280340 Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun Mar 22 08:42:44 2015 (r280340) +++ stable/10/Makefile.inc1 Sun Mar 22 08:47:35 2015 (r280341) @@ -1250,8 +1250,6 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 1000002 _m4= usr.bin/m4 - -${_bt}-usr.bin/m4: ${_bt}-lib/libohash .endif .if ${BOOTSTRAPPING} < 1000013 From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 09:12:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3FA8DA8; Sun, 22 Mar 2015 09:12:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDCA66B6; Sun, 22 Mar 2015 09:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M9Cjb0077546; Sun, 22 Mar 2015 09:12:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M9Cj7c077545; Sun, 22 Mar 2015 09:12:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503220912.t2M9Cj7c077545@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Mar 2015 09:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280343 - stable/10/sys/x86/iommu 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.18-1 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, 22 Mar 2015 09:12:46 -0000 Author: kib Date: Sun Mar 22 09:12:44 2015 New Revision: 280343 URL: https://svnweb.freebsd.org/changeset/base/280343 Log: MFC r280253: Fix syntax error. Modified: stable/10/sys/x86/iommu/intel_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_reg.h ============================================================================== --- stable/10/sys/x86/iommu/intel_reg.h Sun Mar 22 09:09:26 2015 (r280342) +++ stable/10/sys/x86/iommu/intel_reg.h Sun Mar 22 09:12:44 2015 (r280343) @@ -103,7 +103,7 @@ typedef struct dmar_irte { #define DMAR_IRTE1_IM_POSTED (1ULL << 15) /* Posted */ /* Delivery Mode */ #define DMAR_IRTE1_DLM_FM (0ULL << 5) -#define DMAR_IRTE1_DLM_LP (1ULL << 5 +#define DMAR_IRTE1_DLM_LP (1ULL << 5) #define DMAR_IRTE1_DLM_SMI (2ULL << 5) #define DMAR_IRTE1_DLM_NMI (4ULL << 5) #define DMAR_IRTE1_DLM_INIT (5ULL << 5) From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 12:50:00 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B9A5422; Sun, 22 Mar 2015 12:50:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 730ADC34; Sun, 22 Mar 2015 12:50:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MCo0je076312; Sun, 22 Mar 2015 12:50:00 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MCnwqI076260; Sun, 22 Mar 2015 12:49:58 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201503221249.t2MCnwqI076260@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 22 Mar 2015 12:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280344 - stable/10/usr.bin/procstat 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.18-1 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, 22 Mar 2015 12:50:00 -0000 Author: scottl Date: Sun Mar 22 12:49:57 2015 New Revision: 280344 URL: https://svnweb.freebsd.org/changeset/base/280344 Log: MFC r279842, r279875 Implement basic reporting of cpuset info via the -S option Obtained from: Netflix, Inc. Added: stable/10/usr.bin/procstat/procstat_cs.c - copied unchanged from r279842, head/usr.bin/procstat/procstat_cs.c Modified: stable/10/usr.bin/procstat/Makefile stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat.c stable/10/usr.bin/procstat/procstat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/procstat/Makefile ============================================================================== --- stable/10/usr.bin/procstat/Makefile Sun Mar 22 09:12:44 2015 (r280343) +++ stable/10/usr.bin/procstat/Makefile Sun Mar 22 12:49:57 2015 (r280344) @@ -8,6 +8,7 @@ SRCS= procstat.c \ procstat_basic.c \ procstat_bin.c \ procstat_cred.c \ + procstat_cs.c \ procstat_files.c \ procstat_kstack.c \ procstat_rlimit.c \ Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Sun Mar 22 09:12:44 2015 (r280343) +++ stable/10/usr.bin/procstat/procstat.1 Sun Mar 22 12:49:57 2015 (r280344) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2014 +.Dd March 10, 2015 .Dt PROCSTAT 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nm .Op Fl CHhn .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | r | s | t | v | x +.Op Fl b | c | e | f | i | j | k | l | r | s | S | t | v | x .Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The @@ -75,6 +75,8 @@ Display resource limits for the process. Display resource usage information for the process. .It Fl s Display security credential information for the process. +.It Fl S +Display the cpuset information for the thread. .It Fl t Display thread information for the process. .It Fl v @@ -108,9 +110,16 @@ flag may be used to request per-thread s statistics for some options. For those options, the second field in the table will list the thread ID to which the row of information corresponds. +The +.Fl H +flag is implied for the +.Fl S +mode. .Pp -Some information, such as VM and file descriptor information, is available +Information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. +A cpuset value displayed as -1 means that the information is either invalid +or not available. .Ss Binary Information Display the process ID, command, and path to the process binary: .Pp Modified: stable/10/usr.bin/procstat/procstat.c ============================================================================== --- stable/10/usr.bin/procstat/procstat.c Sun Mar 22 09:12:44 2015 (r280343) +++ stable/10/usr.bin/procstat/procstat.c Sun Mar 22 12:49:57 2015 (r280344) @@ -40,7 +40,7 @@ #include "procstat.h" static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; -static int sflag, tflag, vflag, xflag; +static int sflag, tflag, vflag, xflag, Sflag; int hflag, nflag, Cflag, Hflag; static void @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-CHhn] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -r | -s | -t | -v | -x]\n"); + "-l | -r | -s | -S | -t | -v | -x]\n"); fprintf(stderr, " [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -85,6 +85,8 @@ procstat(struct procstat *prstat, struct procstat_vm(prstat, kipp); else if (xflag) procstat_auxv(prstat, kipp); + else if (Sflag) + procstat_cs(prstat, kipp); else procstat_basic(kipp); } @@ -128,7 +130,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrsStvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -144,6 +146,9 @@ main(int argc, char *argv[]) case 'N': nlistf = optarg; break; + case 'S': + Sflag++; + break; case 'a': aflag++; break; @@ -228,7 +233,7 @@ main(int argc, char *argv[]) /* We require that either 0 or 1 mode flags be set. */ tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + rflag + sflag + tflag + vflag + xflag; + lflag + rflag + sflag + tflag + vflag + xflag + Sflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: stable/10/usr.bin/procstat/procstat.h ============================================================================== --- stable/10/usr.bin/procstat/procstat.h Sun Mar 22 09:12:44 2015 (r280343) +++ stable/10/usr.bin/procstat/procstat.h Sun Mar 22 12:49:57 2015 (r280344) @@ -39,6 +39,7 @@ void procstat_auxv(struct procstat *prst void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, Copied: stable/10/usr.bin/procstat/procstat_cs.c (from r279842, head/usr.bin/procstat/procstat_cs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/procstat/procstat_cs.c Sun Mar 22 12:49:57 2015 (r280344, copy of r279842, head/usr.bin/procstat/procstat_cs.c) @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 2007 Robert N. M. Watson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +void +procstat_cs(struct procstat *procstat, struct kinfo_proc *kipp) +{ + cpusetid_t cs; + cpuset_t mask; + struct kinfo_proc *kip; + unsigned int count, i; + int once, twice, lastcpu, cpu; + + if (!hflag) + printf("%5s %6s %-16s %-16s %2s %4s %-7s\n", "PID", + "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); + + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); + if (kip == NULL) + return; + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { + kipp = &kip[i]; + printf("%5d ", kipp->ki_pid); + printf("%6d ", kipp->ki_tid); + printf("%-16s ", strlen(kipp->ki_comm) ? + kipp->ki_comm : "-"); + printf("%-16s ", (strlen(kipp->ki_tdname) && + (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? + kipp->ki_tdname : "-"); + if (kipp->ki_oncpu != 255) + printf("%3d ", kipp->ki_oncpu); + else if (kipp->ki_lastcpu != 255) + printf("%3d ", kipp->ki_lastcpu); + else + printf("%3s ", "-"); + if (cpuset_getid(CPU_LEVEL_CPUSET, CPU_WHICH_TID, + kipp->ki_tid, &cs) != 0) { + cs = CPUSET_INVALID; + } + printf("%4d ", cs); + if ((cs != CPUSET_INVALID) && + (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, + kipp->ki_tid, sizeof(mask), &mask) == 0)) { + lastcpu = -1; + once = 0; + twice = 0; + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, &mask)) { + if (once == 0) { + printf("%d", cpu); + once = 1; + } else if (cpu == lastcpu + 1) { + twice = 1; + } else if (twice == 1) { + printf("-%d,%d", lastcpu, cpu); + twice = 0; + } else + printf(",%d", cpu); + lastcpu = cpu; + } + } + if (once && twice) + printf("-%d", lastcpu); + } + printf("\n"); + } + procstat_freeprocs(procstat, kip); +} From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 18:32:39 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2C06CBD; Sun, 22 Mar 2015 18:32:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6461F6; Sun, 22 Mar 2015 18:32:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MIWcfh043040; Sun, 22 Mar 2015 18:32:38 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MIWc4P043039; Sun, 22 Mar 2015 18:32:38 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201503221832.t2MIWc4P043039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 22 Mar 2015 18:32: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: r280353 - stable/10/sys/dev/drm2 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.18-1 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, 22 Mar 2015 18:32:39 -0000 Author: jah Date: Sun Mar 22 18:32:37 2015 New Revision: 280353 URL: https://svnweb.freebsd.org/changeset/base/280353 Log: MFC r279919: Using parent DMA tag in drm_pci_alloc(). This can allow drm2 devices to work with Intel DMAR enabled for the system, as long as DMAR is disabled for the drm2 device. Reviewed by: kib (mentor) Modified: stable/10/sys/dev/drm2/drm_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_pci.c ============================================================================== --- stable/10/sys/dev/drm2/drm_pci.c Sun Mar 22 18:31:28 2015 (r280352) +++ stable/10/sys/dev/drm2/drm_pci.c Sun Mar 22 18:32:37 2015 (r280353) @@ -76,7 +76,9 @@ drm_pci_alloc(struct drm_device *dev, si if (mtx_owned(&dev->dma_lock)) DRM_ERROR("called while holding dma_lock\n"); - ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */ + ret = bus_dma_tag_create( + bus_get_dma_tag(dev->device), /* parent */ + align, 0, /* align, boundary */ maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ size, 1, size, /* maxsize, nsegs, maxsegsize */ From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 22 22:00:30 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB840CC4; Sun, 22 Mar 2015 22:00:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C578FCE7; Sun, 22 Mar 2015 22:00:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MM0UtN041349; Sun, 22 Mar 2015 22:00:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MM0UAJ041348; Sun, 22 Mar 2015 22:00:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503222200.t2MM0UAJ041348@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 Mar 2015 22:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280356 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 22 Mar 2015 22:00:31 -0000 Author: ngie Date: Sun Mar 22 22:00:29 2015 New Revision: 280356 URL: https://svnweb.freebsd.org/changeset/base/280356 Log: Defeat race with texinfo tools built with make bootstrap-tools This is a direct commit to stable/10 because texinfo has been removed from head Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun Mar 22 21:18:44 2015 (r280355) +++ stable/10/Makefile.inc1 Sun Mar 22 22:00:29 2015 (r280356) @@ -1333,6 +1333,9 @@ ${_bt}-kerberos5/tools/asn1_compile: ${_ _texinfo= gnu/usr.bin/texinfo/libtxi \ gnu/usr.bin/texinfo/makeinfo \ gnu/usr.bin/texinfo/install-info + +${_bt}-gnu/usr.bin/texinfo/install-info: ${_bt}-gnu/usr.bin/texinfo/libtxi +${_bt}-gnu/usr.bin/texinfo/makeinfo: ${_bt}-gnu/usr.bin/texinfo/libtxi .endif bootstrap-tools: .PHONY From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 11:48:26 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C41E292F; Mon, 23 Mar 2015 11:48:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADEBCC93; Mon, 23 Mar 2015 11:48:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NBmQCn024957; Mon, 23 Mar 2015 11:48:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NBmQ7o024956; Mon, 23 Mar 2015 11:48:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503231148.t2NBmQ7o024956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 23 Mar 2015 11:48: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: r280363 - stable/10/usr.sbin/bhyve 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.18-1 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: Mon, 23 Mar 2015 11:48:26 -0000 Author: mav Date: Mon Mar 23 11:48:25 2015 New Revision: 280363 URL: https://svnweb.freebsd.org/changeset/base/280363 Log: MFC r280293: Add missing variable initialization. Reported by: Coverity CID: 1288938 Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:47:01 2015 (r280362) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:48:25 2015 (r280363) @@ -1509,7 +1509,7 @@ ata_ioreq_cb(struct blockif_req *br, int DPRINTF("%s %d\n", __func__, err); - ncq = 0; + ncq = dsm = 0; aior = br->br_param; p = aior->io_pr; cfis = aior->cfis; From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 13:38:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29BB3142; Mon, 23 Mar 2015 13:38:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12459C37; Mon, 23 Mar 2015 13:38:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NDca0h077574; Mon, 23 Mar 2015 13:38:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NDcYS9077563; Mon, 23 Mar 2015 13:38:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503231338.t2NDcYS9077563@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 23 Mar 2015 13:38: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: r280369 - in stable/10/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon modules/drm2/i915kms 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.18-1 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: Mon, 23 Mar 2015 13:38:36 -0000 Author: kib Date: Mon Mar 23 13:38:33 2015 New Revision: 280369 URL: https://svnweb.freebsd.org/changeset/base/280369 Log: MFC r277487: An update for the i915 GPU driver, which brings the code up to Linux commit 4d93914ae3db4a897ead4b. MFC r277959 (by adrian): Fix backlight for ivybridge based laptops (and whatever else comes through this codepath.) MFC r278146: Do not attach to the unsupported chipsets, unless magic tunable is frobbed. MFC r278147, r278148: Fix sign for the error code returned from the driver-specific code. MFC r278152: Do not access gmbus_ports array past its end. MFC r278159 (by emaste): Remove duplicate intel_fbc_enabled prototype. Added: stable/10/sys/dev/drm2/i915/i915_gem_stolen.c - copied unchanged from r277487, head/sys/dev/drm2/i915/i915_gem_stolen.c stable/10/sys/dev/drm2/i915/intel_ddi.c - copied unchanged from r277487, head/sys/dev/drm2/i915/intel_ddi.c stable/10/sys/dev/drm2/i915/intel_pm.c - copied unchanged from r277487, head/sys/dev/drm2/i915/intel_pm.c Modified: stable/10/sys/dev/drm2/drm.h stable/10/sys/dev/drm2/drmP.h stable/10/sys/dev/drm2/drm_crtc.c stable/10/sys/dev/drm2/drm_crtc.h stable/10/sys/dev/drm2/drm_crtc_helper.c stable/10/sys/dev/drm2/drm_crtc_helper.h stable/10/sys/dev/drm2/drm_drv.c stable/10/sys/dev/drm2/drm_edid.c stable/10/sys/dev/drm2/drm_edid.h stable/10/sys/dev/drm2/drm_edid_modes.h stable/10/sys/dev/drm2/drm_fb_helper.c stable/10/sys/dev/drm2/drm_ioctl.c stable/10/sys/dev/drm2/drm_irq.c stable/10/sys/dev/drm2/drm_memory.c stable/10/sys/dev/drm2/drm_mode.h stable/10/sys/dev/drm2/drm_pciids.h stable/10/sys/dev/drm2/drm_stub.c stable/10/sys/dev/drm2/i915/i915_debug.c stable/10/sys/dev/drm2/i915/i915_dma.c stable/10/sys/dev/drm2/i915/i915_drm.h stable/10/sys/dev/drm2/i915/i915_drv.c stable/10/sys/dev/drm2/i915/i915_drv.h stable/10/sys/dev/drm2/i915/i915_gem.c stable/10/sys/dev/drm2/i915/i915_gem_context.c stable/10/sys/dev/drm2/i915/i915_gem_evict.c stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c stable/10/sys/dev/drm2/i915/i915_gem_gtt.c stable/10/sys/dev/drm2/i915/i915_gem_tiling.c stable/10/sys/dev/drm2/i915/i915_irq.c stable/10/sys/dev/drm2/i915/i915_reg.h stable/10/sys/dev/drm2/i915/i915_suspend.c stable/10/sys/dev/drm2/i915/intel_bios.c stable/10/sys/dev/drm2/i915/intel_crt.c stable/10/sys/dev/drm2/i915/intel_display.c stable/10/sys/dev/drm2/i915/intel_dp.c stable/10/sys/dev/drm2/i915/intel_drv.h stable/10/sys/dev/drm2/i915/intel_fb.c stable/10/sys/dev/drm2/i915/intel_hdmi.c stable/10/sys/dev/drm2/i915/intel_iic.c stable/10/sys/dev/drm2/i915/intel_lvds.c stable/10/sys/dev/drm2/i915/intel_modes.c stable/10/sys/dev/drm2/i915/intel_overlay.c stable/10/sys/dev/drm2/i915/intel_panel.c stable/10/sys/dev/drm2/i915/intel_ringbuffer.c stable/10/sys/dev/drm2/i915/intel_ringbuffer.h stable/10/sys/dev/drm2/i915/intel_sdvo.c stable/10/sys/dev/drm2/i915/intel_sprite.c stable/10/sys/dev/drm2/i915/intel_tv.c stable/10/sys/dev/drm2/radeon/atombios_encoders.c stable/10/sys/dev/drm2/radeon/radeon_legacy_encoders.c stable/10/sys/modules/drm2/i915kms/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm.h ============================================================================== --- stable/10/sys/dev/drm2/drm.h Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drm.h Mon Mar 23 13:38:33 2015 (r280369) @@ -1018,6 +1018,9 @@ struct drm_event_vblank { #define DRM_CAP_PRIME 0x5 #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 +#define DRM_PRIME_CAP_IMPORT 0x1 +#define DRM_PRIME_CAP_EXPORT 0x2 + #include "drm_mode.h" /** @@ -1126,6 +1129,8 @@ struct drm_event_vblank { #define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) #define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) #define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) +#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) +#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) #define DRM_IOCTL_MM_INIT DRM_IOWR(0xc0, struct drm_mm_init_arg) #define DRM_IOCTL_MM_TAKEDOWN DRM_IOWR(0xc1, struct drm_mm_type_arg) Modified: stable/10/sys/dev/drm2/drmP.h ============================================================================== --- stable/10/sys/dev/drm2/drmP.h Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drmP.h Mon Mar 23 13:38:33 2015 (r280369) @@ -1246,6 +1246,7 @@ int drm_ati_pcigart_cleanup(struct drm_d /* Cache management (drm_memory.c) */ void drm_clflush_pages(vm_page_t *pages, unsigned long num_pages); +void drm_clflush_virt_range(char *addr, unsigned long length); /* Locking IOCTL support (drm_drv.c) */ int drm_lock(struct drm_device *dev, void *data, Modified: stable/10/sys/dev/drm2/drm_crtc.c ============================================================================== --- stable/10/sys/dev/drm2/drm_crtc.c Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drm_crtc.c Mon Mar 23 13:38:33 2015 (r280369) @@ -352,7 +352,7 @@ void drm_framebuffer_cleanup(struct drm_ * @funcs: callbacks for the new CRTC * * LOCKING: - * Caller must hold mode config lock. + * Takes mode_config lock. * * Inits a new object created as base part of an driver crtc object. * @@ -372,8 +372,11 @@ int drm_crtc_init(struct drm_device *dev if (ret) goto out; + crtc->base.properties = &crtc->properties; + list_add_tail(&crtc->head, &dev->mode_config.crtc_list); dev->mode_config.num_crtc++; + out: sx_xunlock(&dev->mode_config.mutex); @@ -474,6 +477,7 @@ int drm_connector_init(struct drm_device if (ret) goto out; + connector->base.properties = &connector->properties; connector->dev = dev; connector->funcs = funcs; connector->connector_type = connector_type; @@ -582,6 +586,7 @@ int drm_plane_init(struct drm_device *de if (ret) goto out; + plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; plane->format_types = malloc(sizeof(uint32_t) * format_count, @@ -1399,11 +1404,7 @@ int drm_mode_getconnector(struct drm_dev } connector = obj_to_connector(obj); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] != 0) { - props_count++; - } - } + props_count = connector->properties.count; for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) { if (connector->encoder_ids[i] != 0) { @@ -1456,21 +1457,19 @@ int drm_mode_getconnector(struct drm_dev copied = 0; prop_ptr = (uint32_t *)(uintptr_t)(out_resp->props_ptr); prop_values = (uint64_t *)(uintptr_t)(out_resp->prop_values_ptr); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] != 0) { - if (copyout(&connector->property_ids[i], - prop_ptr + copied, sizeof(uint32_t))) { - ret = EFAULT; - goto out; - } + for (i = 0; i < connector->properties.count; i++) { + if (copyout(&connector->properties.ids[i], + prop_ptr + copied, sizeof(uint32_t))) { + ret = EFAULT; + goto out; + } - if (copyout(&connector->property_values[i], - prop_values + copied, sizeof(uint64_t))) { - ret = EFAULT; - goto out; - } - copied++; + if (copyout(&connector->properties.values[i], + prop_values + copied, sizeof(uint64_t))) { + ret = EFAULT; + goto out; } + copied++; } } out_resp->count_props = props_count; @@ -1808,7 +1807,7 @@ int drm_mode_setcrtc(struct drm_device * struct drm_display_mode *mode = NULL; struct drm_mode_set set; uint32_t *set_connectors_ptr; - int ret = 0; + int ret; int i; if (!drm_core_check_feature(dev, DRIVER_MODESET)) @@ -2070,7 +2069,7 @@ int drm_mode_addfb(struct drm_device *de ret = -dev->mode_config.funcs->fb_create(dev, file_priv, &r, &fb); if (ret != 0) { - DRM_ERROR("could not create framebuffer, error %d\n", ret); + DRM_DEBUG_KMS("could not create framebuffer, error %d\n", ret); goto out; } @@ -2152,6 +2151,47 @@ static int format_check(struct drm_mode_ } } +static int framebuffer_check(struct drm_mode_fb_cmd2 *r) +{ + int ret, hsub, vsub, num_planes, i; + + ret = format_check(r); + if (ret) { + DRM_DEBUG_KMS("bad framebuffer format 0x%08x\n", r->pixel_format); + return ret; + } + + hsub = drm_format_horz_chroma_subsampling(r->pixel_format); + vsub = drm_format_vert_chroma_subsampling(r->pixel_format); + num_planes = drm_format_num_planes(r->pixel_format); + + if (r->width == 0 || r->width % hsub) { + DRM_DEBUG_KMS("bad framebuffer width %u\n", r->height); + return -EINVAL; + } + + if (r->height == 0 || r->height % vsub) { + DRM_DEBUG_KMS("bad framebuffer height %u\n", r->height); + return -EINVAL; + } + + for (i = 0; i < num_planes; i++) { + unsigned int width = r->width / (i != 0 ? hsub : 1); + + if (!r->handles[i]) { + DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); + return -EINVAL; + } + + if (r->pitches[i] < drm_format_plane_cpp(r->pixel_format, i) * width) { + DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); + return -EINVAL; + } + } + + return 0; +} + /** * drm_mode_addfb2 - add an FB to the graphics configuration * @inode: inode from the ioctl @@ -2181,21 +2221,19 @@ int drm_mode_addfb2(struct drm_device *d return (EINVAL); if ((config->min_width > r->width) || (r->width > config->max_width)) { - DRM_ERROR("bad framebuffer width %d, should be >= %d && <= %d\n", + DRM_DEBUG_KMS("bad framebuffer width %d, should be >= %d && <= %d\n", r->width, config->min_width, config->max_width); return (EINVAL); } if ((config->min_height > r->height) || (r->height > config->max_height)) { - DRM_ERROR("bad framebuffer height %d, should be >= %d && <= %d\n", + DRM_DEBUG_KMS("bad framebuffer height %d, should be >= %d && <= %d\n", r->height, config->min_height, config->max_height); return (EINVAL); } - ret = format_check(r); - if (ret) { - DRM_ERROR("bad framebuffer format 0x%08x\n", r->pixel_format); - return ret; - } + ret = framebuffer_check(r); + if (ret) + return -ret; sx_xlock(&dev->mode_config.mutex); @@ -2204,7 +2242,7 @@ int drm_mode_addfb2(struct drm_device *d ret = -dev->mode_config.funcs->fb_create(dev, file_priv, r, &fb); if (ret != 0) { - DRM_ERROR("could not create framebuffer, error %d\n", ret); + DRM_DEBUG_KMS("could not create framebuffer, error %d\n", ret); goto out; } @@ -2335,7 +2373,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de struct drm_framebuffer *fb; unsigned flags; int num_clips; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return (EINVAL); @@ -2530,7 +2568,7 @@ int drm_mode_attachmode_ioctl(struct drm struct drm_display_mode *mode; struct drm_mode_object *obj; struct drm_mode_modeinfo *umode = &mode_cmd->mode; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; @@ -2584,7 +2622,7 @@ int drm_mode_detachmode_ioctl(struct drm struct drm_connector *connector; struct drm_display_mode mode; struct drm_mode_modeinfo *umode = &mode_cmd->mode; - int ret = 0; + int ret; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; @@ -2672,6 +2710,33 @@ struct drm_property *drm_property_create return property; } +struct drm_property *drm_property_create_bitmask(struct drm_device *dev, + int flags, const char *name, + const struct drm_prop_enum_list *props, + int num_values) +{ + struct drm_property *property; + int i, ret; + + flags |= DRM_MODE_PROP_BITMASK; + + property = drm_property_create(dev, flags, name, num_values); + if (!property) + return NULL; + + for (i = 0; i < num_values; i++) { + ret = drm_property_add_enum(property, i, + props[i].type, + props[i].name); + if (ret) { + drm_property_destroy(dev, property); + return NULL; + } + } + + return property; +} + struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, const char *name, uint64_t min, uint64_t max) @@ -2695,7 +2760,14 @@ int drm_property_add_enum(struct drm_pro { struct drm_property_enum *prop_enum; - if (!(property->flags & DRM_MODE_PROP_ENUM)) + if (!(property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK))) + return -EINVAL; + + /* + * Bitmask enum properties have the additional constraint of values + * from 0 to 63 + */ + if ((property->flags & DRM_MODE_PROP_BITMASK) && (value > 63)) return -EINVAL; if (!list_empty(&property->enum_blob_list)) { @@ -2736,56 +2808,71 @@ void drm_property_destroy(struct drm_dev free(property, DRM_MEM_KMS); } -int drm_connector_attach_property(struct drm_connector *connector, +void drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val) { - int i; - - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == 0) { - connector->property_ids[i] = property->base.id; - connector->property_values[i] = init_val; - break; - } - } - - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + drm_object_attach_property(&connector->base, property, init_val); } int drm_connector_property_set_value(struct drm_connector *connector, struct drm_property *property, uint64_t value) { + return drm_object_property_set_value(&connector->base, property, value); +} + +int drm_connector_property_get_value(struct drm_connector *connector, + struct drm_property *property, uint64_t *val) +{ + return drm_object_property_get_value(&connector->base, property, val); +} + +void drm_object_attach_property(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t init_val) +{ + int count = obj->properties->count; + + if (count == DRM_OBJECT_MAX_PROPERTY) { + printf("Failed to attach object property (type: 0x%x). Please " + "increase DRM_OBJECT_MAX_PROPERTY by 1 for each time " + "you see this message on the same object type.\n", + obj->type); + return; + } + + obj->properties->ids[count] = property->base.id; + obj->properties->values[count] = init_val; + obj->properties->count++; +} + +int drm_object_property_set_value(struct drm_mode_object *obj, + struct drm_property *property, uint64_t val) +{ int i; - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == property->base.id) { - connector->property_values[i] = value; - break; + for (i = 0; i < obj->properties->count; i++) { + if (obj->properties->ids[i] == property->base.id) { + obj->properties->values[i] = val; + return 0; } } - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + return -EINVAL; } -int drm_connector_property_get_value(struct drm_connector *connector, +int drm_object_property_get_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val) { int i; - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == property->base.id) { - *val = connector->property_values[i]; - break; + for (i = 0; i < obj->properties->count; i++) { + if (obj->properties->ids[i] == property->base.id) { + *val = obj->properties->values[i]; + return 0; } } - if (i == DRM_CONNECTOR_MAX_PROPERTY) - return -EINVAL; - return 0; + return -EINVAL; } int drm_mode_getproperty_ioctl(struct drm_device *dev, @@ -2817,7 +2904,7 @@ int drm_mode_getproperty_ioctl(struct dr } property = obj_to_property(obj); - if (property->flags & DRM_MODE_PROP_ENUM) { + if (property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) { list_for_each_entry(prop_enum, &property->enum_blob_list, head) enum_count++; } else if (property->flags & DRM_MODE_PROP_BLOB) { @@ -2842,7 +2929,7 @@ int drm_mode_getproperty_ioctl(struct dr } out_resp->count_values = value_count; - if (property->flags & DRM_MODE_PROP_ENUM) { + if (property->flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) { if ((out_resp->count_enum_blobs >= enum_count) && enum_count) { copied = 0; enum_ptr = (struct drm_mode_property_enum *)(uintptr_t)out_resp->enum_blob_ptr; @@ -2965,7 +3052,7 @@ int drm_mode_connector_update_edid_prope struct edid *edid) { struct drm_device *dev = connector->dev; - int ret = 0, size; + int ret, size; if (connector->edid_blob_ptr) drm_property_destroy_blob(dev, connector->edid_blob_ptr); @@ -2988,75 +3075,202 @@ int drm_mode_connector_update_edid_prope return ret; } +static bool drm_property_change_is_valid(struct drm_property *property, + u64 value) +{ + if (property->flags & DRM_MODE_PROP_IMMUTABLE) + return false; + if (property->flags & DRM_MODE_PROP_RANGE) { + if (value < property->values[0] || value > property->values[1]) + return false; + return true; + } else if (property->flags & DRM_MODE_PROP_BITMASK) { + int i; + u64 valid_mask = 0; + for (i = 0; i < property->num_values; i++) + valid_mask |= (1ULL << property->values[i]); + return !(value & ~valid_mask); + } else { + int i; + for (i = 0; i < property->num_values; i++) + if (property->values[i] == value) + return true; + return false; + } +} + int drm_mode_connector_property_set_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_mode_connector_set_property *out_resp = data; - struct drm_mode_object *obj; - struct drm_property *property; - struct drm_connector *connector; + struct drm_mode_connector_set_property *conn_set_prop = data; + struct drm_mode_obj_set_property obj_set_prop = { + .value = conn_set_prop->value, + .prop_id = conn_set_prop->prop_id, + .obj_id = conn_set_prop->connector_id, + .obj_type = DRM_MODE_OBJECT_CONNECTOR + }; + + /* It does all the locking and checking we need */ + return drm_mode_obj_set_property_ioctl(dev, &obj_set_prop, file_priv); +} + +static int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_connector *connector = obj_to_connector(obj); + + /* Do DPMS ourselves */ + if (property == connector->dev->mode_config.dpms_property) { + if (connector->funcs->dpms) + (*connector->funcs->dpms)(connector, (int)value); + ret = 0; + } else if (connector->funcs->set_property) + ret = connector->funcs->set_property(connector, property, value); + + /* store the property value if successful */ + if (!ret) + drm_connector_property_set_value(connector, property, value); + return ret; +} + +static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ int ret = -EINVAL; + struct drm_crtc *crtc = obj_to_crtc(obj); + + if (crtc->funcs->set_property) + ret = crtc->funcs->set_property(crtc, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + +static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_plane *plane = obj_to_plane(obj); + + if (plane->funcs->set_property) + ret = plane->funcs->set_property(plane, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + +int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_mode_obj_get_properties *arg = data; + struct drm_mode_object *obj; + int ret = 0; int i; + int copied = 0; + int props_count = 0; + uint32_t __user *props_ptr; + uint64_t __user *prop_values_ptr; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; sx_xlock(&dev->mode_config.mutex); - obj = drm_mode_object_find(dev, out_resp->connector_id, DRM_MODE_OBJECT_CONNECTOR); + obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); if (!obj) { + ret = -EINVAL; + goto out; + } + if (!obj->properties) { + ret = -EINVAL; goto out; } - connector = obj_to_connector(obj); - for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) { - if (connector->property_ids[i] == out_resp->prop_id) - break; + props_count = obj->properties->count; + + /* This ioctl is called twice, once to determine how much space is + * needed, and the 2nd time to fill it. */ + if ((arg->count_props >= props_count) && props_count) { + copied = 0; + props_ptr = (uint32_t __user *)(unsigned long)(arg->props_ptr); + prop_values_ptr = (uint64_t __user *)(unsigned long) + (arg->prop_values_ptr); + for (i = 0; i < props_count; i++) { + if (copyout(props_ptr + copied, + &obj->properties->ids[i], sizeof(uint32_t))) { + ret = -EFAULT; + goto out; + } + if (copyout(prop_values_ptr + copied, + &obj->properties->values[i], sizeof(uint64_t))) { + ret = -EFAULT; + goto out; + } + copied++; + } } + arg->count_props = props_count; +out: + sx_xunlock(&dev->mode_config.mutex); + return ret; +} - if (i == DRM_CONNECTOR_MAX_PROPERTY) { +int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_mode_obj_set_property *arg = data; + struct drm_mode_object *arg_obj; + struct drm_mode_object *prop_obj; + struct drm_property *property; + int ret = -EINVAL; + int i; + + if (!drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + + sx_xlock(&dev->mode_config.mutex); + + arg_obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type); + if (!arg_obj) + goto out; + if (!arg_obj->properties) goto out; - } - obj = drm_mode_object_find(dev, out_resp->prop_id, DRM_MODE_OBJECT_PROPERTY); - if (!obj) { + for (i = 0; i < arg_obj->properties->count; i++) + if (arg_obj->properties->ids[i] == arg->prop_id) + break; + + if (i == arg_obj->properties->count) goto out; - } - property = obj_to_property(obj); - if (property->flags & DRM_MODE_PROP_IMMUTABLE) + prop_obj = drm_mode_object_find(dev, arg->prop_id, + DRM_MODE_OBJECT_PROPERTY); + if (!prop_obj) goto out; + property = obj_to_property(prop_obj); - if (property->flags & DRM_MODE_PROP_RANGE) { - if (out_resp->value < property->values[0]) - goto out; + if (!drm_property_change_is_valid(property, arg->value)) + goto out; - if (out_resp->value > property->values[1]) - goto out; - } else { - int found = 0; - for (i = 0; i < property->num_values; i++) { - if (property->values[i] == out_resp->value) { - found = 1; - break; - } - } - if (!found) { - goto out; - } + switch (arg_obj->type) { + case DRM_MODE_OBJECT_CONNECTOR: + ret = drm_mode_connector_set_obj_prop(arg_obj, property, + arg->value); + break; + case DRM_MODE_OBJECT_CRTC: + ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value); + break; + case DRM_MODE_OBJECT_PLANE: + ret = drm_mode_plane_set_obj_prop(arg_obj, property, arg->value); + break; } - /* Do DPMS ourselves */ - if (property == connector->dev->mode_config.dpms_property) { - if (connector->funcs->dpms) - (*connector->funcs->dpms)(connector, (int) out_resp->value); - ret = 0; - } else if (connector->funcs->set_property) - ret = connector->funcs->set_property(connector, property, out_resp->value); - - /* store the property value if successful */ - if (!ret) - drm_connector_property_set_value(connector, property, out_resp->value); out: sx_xunlock(&dev->mode_config.mutex); return ret; @@ -3176,6 +3390,11 @@ int drm_mode_gamma_get_ioctl(struct drm_ } crtc = obj_to_crtc(obj); + if (crtc->funcs->gamma_set == NULL) { + ret = -ENOSYS; + goto out; + } + /* memcpy into gamma store */ if (crtc_lut->gamma_size != crtc->gamma_size) { ret = -EINVAL; @@ -3417,3 +3636,136 @@ void drm_fb_get_bpp_depth(uint32_t forma break; } } + +/** + * drm_format_num_planes - get the number of planes for format + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The number of planes used by the specified pixel format. + */ +int drm_format_num_planes(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: + return 3; + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + return 2; + default: + return 1; + } +} + +/** + * drm_format_plane_cpp - determine the bytes per pixel value + * @format: pixel format (DRM_FORMAT_*) + * @plane: plane index + * + * RETURNS: + * The bytes per pixel value for the specified plane. + */ +int drm_format_plane_cpp(uint32_t format, int plane) +{ + unsigned int depth; + int bpp; + + if (plane >= drm_format_num_planes(format)) + return 0; + + switch (format) { + case DRM_FORMAT_YUYV: + case DRM_FORMAT_YVYU: + case DRM_FORMAT_UYVY: + case DRM_FORMAT_VYUY: + return 2; + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + return plane ? 2 : 1; + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: + return 1; + default: + drm_fb_get_bpp_depth(format, &depth, &bpp); + return bpp >> 3; + } +} + +/** + * drm_format_horz_chroma_subsampling - get the horizontal chroma subsampling factor + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The horizontal chroma subsampling factor for the + * specified pixel format. + */ +int drm_format_horz_chroma_subsampling(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV411: + case DRM_FORMAT_YVU411: + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + return 4; + case DRM_FORMAT_YUYV: + case DRM_FORMAT_YVYU: + case DRM_FORMAT_UYVY: + case DRM_FORMAT_VYUY: + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + return 2; + default: + return 1; + } +} + +/** + * drm_format_vert_chroma_subsampling - get the vertical chroma subsampling factor + * @format: pixel format (DRM_FORMAT_*) + * + * RETURNS: + * The vertical chroma subsampling factor for the + * specified pixel format. + */ +int drm_format_vert_chroma_subsampling(uint32_t format) +{ + switch (format) { + case DRM_FORMAT_YUV410: + case DRM_FORMAT_YVU410: + return 4; + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + return 2; + default: + return 1; + } +} Modified: stable/10/sys/dev/drm2/drm_crtc.h ============================================================================== --- stable/10/sys/dev/drm2/drm_crtc.h Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drm_crtc.h Mon Mar 23 13:38:33 2015 (r280369) @@ -47,6 +47,14 @@ struct i2c_adapter; struct drm_mode_object { uint32_t id; uint32_t type; + struct drm_object_properties *properties; +}; + +#define DRM_OBJECT_MAX_PROPERTY 16 +struct drm_object_properties { + int count; + uint32_t ids[DRM_OBJECT_MAX_PROPERTY]; + uint64_t values[DRM_OBJECT_MAX_PROPERTY]; }; /* @@ -295,7 +303,8 @@ struct drm_plane; * @mode_fixup: fixup proposed mode * @mode_set: set the desired mode on the CRTC * @gamma_set: specify color ramp for CRTC - * @destroy: deinit and free object. + * @destroy: deinit and free object + * @set_property: called when a property is changed * * The drm_crtc_funcs structure is the central CRTC management structure * in the DRM. Each CRTC controls one or more connectors (note that the name @@ -339,6 +348,8 @@ struct drm_crtc_funcs { int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event); + int (*set_property)(struct drm_crtc *crtc, + struct drm_property *property, uint64_t val); }; /** @@ -347,6 +358,7 @@ struct drm_crtc_funcs { * @x: x position on screen * @y: y position on screen * @funcs: CRTC control functions + * @properties: property tracking for this CRTC * * Each CRTC may have one or more connectors associated with it. This structure * allows the CRTC to be controlled. @@ -382,6 +394,8 @@ struct drm_crtc { /* if you are using the helper */ void *helper_private; + + struct drm_object_properties properties; }; @@ -431,7 +445,6 @@ struct drm_encoder_funcs { }; #define DRM_CONNECTOR_MAX_UMODES 16 -#define DRM_CONNECTOR_MAX_PROPERTY 16 #define DRM_CONNECTOR_LEN 32 #define DRM_CONNECTOR_MAX_ENCODER 2 @@ -511,8 +524,7 @@ struct drm_connector { struct list_head user_modes; struct drm_property_blob *edid_blob_ptr; - u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; - uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; + struct drm_object_properties properties; uint8_t polled; /* DRM_CONNECTOR_POLL_* */ @@ -543,6 +555,7 @@ struct drm_connector { * @update_plane: update the plane configuration * @disable_plane: shut down the plane * @destroy: clean up plane resources + * @set_property: called when a property is changed */ struct drm_plane_funcs { int (*update_plane)(struct drm_plane *plane, @@ -553,6 +566,8 @@ struct drm_plane_funcs { uint32_t src_w, uint32_t src_h); int (*disable_plane)(struct drm_plane *plane); void (*destroy)(struct drm_plane *plane); + int (*set_property)(struct drm_plane *plane, + struct drm_property *property, uint64_t val); }; /** @@ -570,6 +585,7 @@ struct drm_plane_funcs { * @enabled: enabled flag * @funcs: helper functions * @helper_private: storage for drver layer + @properties: property tracking for this plane */ struct drm_plane { struct drm_device *dev; @@ -592,6 +608,8 @@ struct drm_plane { const struct drm_plane_funcs *funcs; void *helper_private; + + struct drm_object_properties properties; }; /** @@ -806,6 +824,15 @@ extern int drm_connector_property_set_va extern int drm_connector_property_get_value(struct drm_connector *connector, struct drm_property *property, uint64_t *value); +void drm_object_attach_property(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t init_val); +extern int drm_object_property_set_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t val); +extern int drm_object_property_get_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t *value); extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); extern void drm_framebuffer_set_object(struct drm_device *dev, unsigned long handle); @@ -818,7 +845,7 @@ extern int drmfb_remove(struct drm_devic extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); extern bool drm_crtc_in_use(struct drm_crtc *crtc); -extern int drm_connector_attach_property(struct drm_connector *connector, +extern void drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val); extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, const char *name, int num_values); @@ -826,6 +853,10 @@ extern struct drm_property *drm_property const char *name, const struct drm_prop_enum_list *props, int num_values); +struct drm_property *drm_property_create_bitmask(struct drm_device *dev, + int flags, const char *name, + const struct drm_prop_enum_list *props, + int num_values); struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, const char *name, uint64_t min, uint64_t max); @@ -921,7 +952,8 @@ extern int drm_add_modes_noedid(struct d extern int drm_edid_header_is_valid(const u8 *raw_edid); extern bool drm_edid_is_valid(struct edid *edid); struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, - int hsize, int vsize, int fresh); + int hsize, int vsize, int fresh, + bool rb); extern int drm_mode_create_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); @@ -929,7 +961,16 @@ extern int drm_mode_mmap_dumb_ioctl(stru void *data, struct drm_file *file_priv); extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); +extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, int *bpp); +extern int drm_format_num_planes(uint32_t format); +extern int drm_format_plane_cpp(uint32_t format, int plane); +extern int drm_format_horz_chroma_subsampling(uint32_t format); +extern int drm_format_vert_chroma_subsampling(uint32_t format); + #endif /* __DRM_CRTC_H__ */ Modified: stable/10/sys/dev/drm2/drm_crtc_helper.c ============================================================================== --- stable/10/sys/dev/drm2/drm_crtc_helper.c Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drm_crtc_helper.c Mon Mar 23 13:38:33 2015 (r280369) @@ -549,7 +549,7 @@ int drm_crtc_helper_set_config(struct dr int count = 0, ro, fail = 0; struct drm_crtc_helper_funcs *crtc_funcs; struct drm_mode_set save_set; - int ret = 0; + int ret; int i; DRM_DEBUG_KMS("\n"); Modified: stable/10/sys/dev/drm2/drm_crtc_helper.h ============================================================================== --- stable/10/sys/dev/drm2/drm_crtc_helper.h Mon Mar 23 13:05:02 2015 (r280368) +++ stable/10/sys/dev/drm2/drm_crtc_helper.h Mon Mar 23 13:38:33 2015 (r280369) @@ -78,7 +78,7 @@ struct drm_encoder_helper_funcs { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 14:36:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 366F416D; Mon, 23 Mar 2015 14:36:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20C6F68F; Mon, 23 Mar 2015 14:36:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NEaseG007988; Mon, 23 Mar 2015 14:36:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NEas9w007985; Mon, 23 Mar 2015 14:36:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503231436.t2NEas9w007985@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 23 Mar 2015 14:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280370 - stable/10/usr.sbin/bhyve 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.18-1 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: Mon, 23 Mar 2015 14:36:55 -0000 Author: mav Date: Mon Mar 23 14:36:53 2015 New Revision: 280370 URL: https://svnweb.freebsd.org/changeset/base/280370 Log: MFC r279957, r280017: Add DSM TRIM command support for virtual AHCI disks. It works only for virtual disks backed by ZVOLs and raw devices supporting BIO_DELETE. Virtual disks backed by files won't report this capability. Relnotes: yes Modified: stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/block_if.h stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Mon Mar 23 13:38:33 2015 (r280369) +++ stable/10/usr.sbin/bhyve/block_if.c Mon Mar 23 14:36:53 2015 (r280370) @@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$"); enum blockop { BOP_READ, BOP_WRITE, - BOP_FLUSH + BOP_FLUSH, + BOP_DELETE }; enum blockstat { @@ -81,6 +82,7 @@ struct blockif_ctxt { int bc_magic; int bc_fd; int bc_ischr; + int bc_candelete; int bc_rdonly; off_t bc_size; int bc_sectsz; @@ -172,6 +174,7 @@ static void blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be) { struct blockif_req *br; + off_t arg[2]; int err; br = be->be_req; @@ -197,6 +200,19 @@ blockif_proc(struct blockif_ctxt *bc, st } else if (fsync(bc->bc_fd)) err = errno; break; + case BOP_DELETE: + if (!bc->bc_candelete) + err = EOPNOTSUPP; + else if (bc->bc_rdonly) + err = EROFS; + else if (bc->bc_ischr) { + arg[0] = br->br_offset; + arg[1] = br->br_iov[0].iov_len; + if (ioctl(bc->bc_fd, DIOCGDELETE, arg)) + err = errno; + } else + err = EOPNOTSUPP; + break; default: err = EINVAL; break; @@ -276,9 +292,10 @@ blockif_open(const char *optstr, const c char *nopt, *xopts; struct blockif_ctxt *bc; struct stat sbuf; + struct diocgattr_arg arg; off_t size, psectsz, psectoff; int extra, fd, i, sectsz; - int nocache, sync, ro; + int nocache, sync, ro, candelete; pthread_once(&blockif_once, blockif_init); @@ -332,6 +349,7 @@ blockif_open(const char *optstr, const c size = sbuf.st_size; sectsz = DEV_BSIZE; psectsz = psectoff = 0; + candelete = 0; if (S_ISCHR(sbuf.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || ioctl(fd, DIOCGSECTORSIZE, §sz)) { @@ -343,6 +361,10 @@ blockif_open(const char *optstr, const c assert(sectsz != 0); if (ioctl(fd, DIOCGSTRIPESIZE, &psectsz) == 0 && psectsz > 0) ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); + strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); + arg.len = sizeof(arg.value.i); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + candelete = arg.value.i; } else psectsz = sbuf.st_blksize; @@ -355,6 +377,7 @@ blockif_open(const char *optstr, const c bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; bc->bc_ischr = S_ISCHR(sbuf.st_mode); + bc->bc_candelete = candelete; bc->bc_rdonly = ro; bc->bc_size = size; bc->bc_sectsz = sectsz; @@ -434,6 +457,14 @@ blockif_flush(struct blockif_ctxt *bc, s } int +blockif_delete(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_DELETE)); +} + +int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq) { struct blockif_elem *be; @@ -634,3 +665,11 @@ blockif_is_ro(struct blockif_ctxt *bc) assert(bc->bc_magic == BLOCKIF_SIG); return (bc->bc_rdonly); } + +int +blockif_candelete(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (bc->bc_candelete); +} Modified: stable/10/usr.sbin/bhyve/block_if.h ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.h Mon Mar 23 13:38:33 2015 (r280369) +++ stable/10/usr.sbin/bhyve/block_if.h Mon Mar 23 14:36:53 2015 (r280370) @@ -58,9 +58,11 @@ int blockif_sectsz(struct blockif_ctxt * void blockif_psectsz(struct blockif_ctxt *bc, int *size, int *off); int blockif_queuesz(struct blockif_ctxt *bc); int blockif_is_ro(struct blockif_ctxt *bc); +int blockif_candelete(struct blockif_ctxt *bc); int blockif_read(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_write(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_flush(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_delete(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_close(struct blockif_ctxt *bc); Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 13:38:33 2015 (r280369) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 14:36:53 2015 (r280370) @@ -644,6 +644,100 @@ ahci_handle_flush(struct ahci_port *p, i } static inline void +read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, + void *buf, int size) +{ + struct ahci_cmd_hdr *hdr; + struct ahci_prdt_entry *prdt; + void *to; + int i, len; + + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); + len = size; + to = buf; + prdt = (struct ahci_prdt_entry *)(cfis + 0x80); + for (i = 0; i < hdr->prdtl && len; i++) { + uint8_t *ptr; + uint32_t dbcsz; + int sublen; + + dbcsz = (prdt->dbc & DBCMASK) + 1; + ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); + sublen = len < dbcsz ? len : dbcsz; + memcpy(to, ptr, sublen); + len -= sublen; + to += sublen; + prdt++; + } +} + +static void +ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done) +{ + struct ahci_ioreq *aior; + struct blockif_req *breq; + uint8_t *entry; + uint64_t elba; + uint32_t len, elen; + int err; + uint8_t buf[512]; + + len = (uint16_t)cfis[13] << 8 | cfis[12]; + len *= 512; + read_prdt(p, slot, cfis, buf, sizeof(buf)); + +next: + entry = &buf[done]; + elba = ((uint64_t)entry[5] << 40) | + ((uint64_t)entry[4] << 32) | + ((uint64_t)entry[3] << 24) | + ((uint64_t)entry[2] << 16) | + ((uint64_t)entry[1] << 8) | + entry[0]; + elen = (uint16_t)entry[7] << 8 | entry[6]; + done += 8; + if (elen == 0) { + if (done >= len) { + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + p->pending &= ~(1 << slot); + ahci_check_stopped(p); + return; + } + goto next; + } + + /* + * Pull request off free list + */ + aior = STAILQ_FIRST(&p->iofhd); + assert(aior != NULL); + STAILQ_REMOVE_HEAD(&p->iofhd, io_flist); + aior->cfis = cfis; + aior->slot = slot; + aior->len = len; + aior->done = done; + aior->prdtl = 0; + + breq = &aior->io_req; + breq->br_offset = elba * blockif_sectsz(p->bctx); + breq->br_iovcnt = 1; + breq->br_iov[0].iov_len = elen * blockif_sectsz(p->bctx); + + /* + * Mark this command in-flight. + */ + p->pending |= 1 << slot; + + /* + * Stuff request onto busy list + */ + TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + + err = blockif_delete(p->bctx, breq); + assert(err == 0); +} + +static inline void write_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, int size) { @@ -684,10 +778,12 @@ handle_identify(struct ahci_port *p, int } else { uint16_t buf[256]; uint64_t sectors; - int sectsz, psectsz, psectoff; + int sectsz, psectsz, psectoff, candelete, ro; uint16_t cyl; uint8_t sech, heads; + ro = blockif_is_ro(p->bctx); + candelete = blockif_candelete(p->bctx); sectsz = blockif_sectsz(p->bctx); sectors = blockif_size(p->bctx) / sectsz; blockif_chs(p->bctx, &cyl, &heads, &sech); @@ -718,6 +814,7 @@ handle_identify(struct ahci_port *p, int buf[66] = 100; buf[67] = 100; buf[68] = 100; + buf[69] = 0; buf[75] = 31; buf[76] = (1 << 8 | 1 << 2); buf[80] = 0x1f0; @@ -736,6 +833,11 @@ handle_identify(struct ahci_port *p, int buf[101] = (sectors >> 16); buf[102] = (sectors >> 32); buf[103] = (sectors >> 48); + if (candelete && !ro) { + buf[69] |= ATA_SUPPORT_RZAT | ATA_SUPPORT_DRAT; + buf[105] = 1; + buf[169] = ATA_SUPPORT_DSM_TRIM; + } buf[106] = 0x4000; buf[209] = 0x4000; if (psectsz > sectsz) { @@ -1394,6 +1496,15 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_FLUSHCACHE48: ahci_handle_flush(p, slot, cfis); break; + case ATA_DATA_SET_MANAGEMENT: + if (cfis[11] == 0 && cfis[3] == ATA_DSM_TRIM && + cfis[13] == 0 && cfis[12] == 1) { + ahci_handle_dsm_trim(p, slot, cfis, 0); + break; + } + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; case ATA_STANDBY_CMD: break; case ATA_NOP: @@ -1505,7 +1616,7 @@ ata_ioreq_cb(struct blockif_req *br, int struct pci_ahci_softc *sc; uint32_t tfd; uint8_t *cfis; - int pending, slot, ncq; + int pending, slot, ncq, dsm; DPRINTF("%s %d\n", __func__, err); @@ -1521,6 +1632,8 @@ ata_ioreq_cb(struct blockif_req *br, int if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || cfis[2] == ATA_READ_FPDMA_QUEUED) ncq = 1; + if (cfis[2] == ATA_DATA_SET_MANAGEMENT) + dsm = 1; pthread_mutex_lock(&sc->mtx); @@ -1534,10 +1647,17 @@ ata_ioreq_cb(struct blockif_req *br, int */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); - if (pending && !err) { - ahci_handle_dma(p, slot, cfis, aior->done, - hdr->prdtl - pending); - goto out; + if (dsm) { + if (aior->done != aior->len && !err) { + ahci_handle_dsm_trim(p, slot, cfis, aior->done); + goto out; + } + } else { + if (pending && !err) { + ahci_handle_dma(p, slot, cfis, aior->done, + hdr->prdtl - pending); + goto out; + } } if (!err && aior->done == aior->len) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 14:42:13 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2CD2511; Mon, 23 Mar 2015 14:42:13 +0000 (UTC) Received: from borg.macktronics.com (borg.macktronics.com [209.181.253.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8597D4; Mon, 23 Mar 2015 14:42:12 +0000 (UTC) Received: from olive.macktronics.com (olive.macktronics.com [209.181.253.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by borg.macktronics.com (Postfix) with ESMTPS id 59DE9546; Mon, 23 Mar 2015 09:35:55 -0500 (CDT) Date: Mon, 23 Mar 2015 09:35:54 -0500 (CDT) From: Dan Mack To: Alexander Motin Subject: Re: svn commit: r280363 - stable/10/usr.sbin/bhyve In-Reply-To: <201503231148.t2NBmQ7o024956@svn.freebsd.org> Message-ID: References: <201503231148.t2NBmQ7o024956@svn.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 14:42:13 -0000 I just tried to build 280369 and got this: --- all_subdir_bhyve --- /usr/src/usr.sbin/bhyve/pci_ahci.c:1512:8: error: use of undeclared identifier 'dsm' ncq = dsm = 0; ^ 1 error generated. *** [pci_ahci.o] Error code 1 This is on 10.1-Stable Dan On Mon, 23 Mar 2015, Alexander Motin wrote: > Author: mav > Date: Mon Mar 23 11:48:25 2015 > New Revision: 280363 > URL: https://svnweb.freebsd.org/changeset/base/280363 > > Log: > MFC r280293: Add missing variable initialization. > > Reported by: Coverity > CID: 1288938 > > Modified: > stable/10/usr.sbin/bhyve/pci_ahci.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/usr.sbin/bhyve/pci_ahci.c > ============================================================================== > --- stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:47:01 2015 (r280362) > +++ stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:48:25 2015 (r280363) > @@ -1509,7 +1509,7 @@ ata_ioreq_cb(struct blockif_req *br, int > > DPRINTF("%s %d\n", __func__, err); > > - ncq = 0; > + ncq = dsm = 0; > aior = br->br_param; > p = aior->io_pr; > cfis = aior->cfis; > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > dan -- Dan Mack From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 14:43:40 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 784E0757; Mon, 23 Mar 2015 14:43:40 +0000 (UTC) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E93C7FC; Mon, 23 Mar 2015 14:43:40 +0000 (UTC) Received: by labto5 with SMTP id to5so28179112lab.0; Mon, 23 Mar 2015 07:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=FasvwP8lI+lsnVI3l7dTDgZiE4AFADmnlAnkL0QaZoM=; b=oojzq/HJD+94170K4v7Nj18RLNkAccqJ0kHQy9SSsZngkqkD1AMVoRaSZSZfg8hDXe ksj1JXlN86PfqtTTzyiuh8d+9BfLWniz8z+lJoVX5wP9xcgBO88Gn3JR7KhEosEHRalX fLhpGLSlDX6DpJWzmJDJk9zBmYz+YnLyfnUo5TOEqUwIkOV96dWZPrRTEMmfytpkaJ0/ s2o1Uvd1yDnf8KoVCgvLFRfp6zMLy3PMvp+2la5VCFYWMUOLtlXR0lwgz+D9C/WJow3w 9U6ZbreBLmerLBcnM/W3oIBFpWOKoZcC+BpxqTi2IzaDoD6HulM7tyG5vW4/IBoX2Afr ngmg== X-Received: by 10.152.37.228 with SMTP id b4mr55793471lak.111.1427121818121; Mon, 23 Mar 2015 07:43:38 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id p2sm222560laj.29.2015.03.23.07.43.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 07:43:37 -0700 (PDT) Sender: Alexander Motin Message-ID: <55102697.8030903@FreeBSD.org> Date: Mon, 23 Mar 2015 16:43:35 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dan Mack Subject: Re: svn commit: r280363 - stable/10/usr.sbin/bhyve References: <201503231148.t2NBmQ7o024956@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 14:43:40 -0000 On 23.03.2015 16:35, Dan Mack wrote: > I just tried to build 280369 and got this: > > --- all_subdir_bhyve --- > /usr/src/usr.sbin/bhyve/pci_ahci.c:1512:8: error: use of undeclared > identifier 'dsm' > ncq = dsm = 0; > ^ > 1 error generated. > *** [pci_ahci.o] Error code 1 > > This is on 10.1-Stable Yes, it was my fault. Should be fixed by r280370. Sorry. > On Mon, 23 Mar 2015, Alexander Motin wrote: > >> Author: mav >> Date: Mon Mar 23 11:48:25 2015 >> New Revision: 280363 >> URL: https://svnweb.freebsd.org/changeset/base/280363 >> >> Log: >> MFC r280293: Add missing variable initialization. >> >> Reported by: Coverity >> CID: 1288938 >> >> Modified: >> stable/10/usr.sbin/bhyve/pci_ahci.c >> Directory Properties: >> stable/10/ (props changed) >> >> Modified: stable/10/usr.sbin/bhyve/pci_ahci.c >> ============================================================================== >> >> --- stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:47:01 2015 >> (r280362) >> +++ stable/10/usr.sbin/bhyve/pci_ahci.c Mon Mar 23 11:48:25 2015 >> (r280363) >> @@ -1509,7 +1509,7 @@ ata_ioreq_cb(struct blockif_req *br, int >> >> DPRINTF("%s %d\n", __func__, err); >> >> - ncq = 0; >> + ncq = dsm = 0; >> aior = br->br_param; >> p = aior->io_pr; >> cfis = aior->cfis; >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >> > > > dan > -- > Dan Mack > -- Alexander Motin From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 14:44:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FE788A2; Mon, 23 Mar 2015 14:44:46 +0000 (UTC) Received: from borg.macktronics.com (borg.macktronics.com [209.181.253.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 002E880E; Mon, 23 Mar 2015 14:44:46 +0000 (UTC) Received: from olive.macktronics.com (olive.macktronics.com [209.181.253.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by borg.macktronics.com (Postfix) with ESMTPS id 2DA4B551; Mon, 23 Mar 2015 09:44:45 -0500 (CDT) Date: Mon, 23 Mar 2015 09:44:45 -0500 (CDT) From: Dan Mack To: Alexander Motin Subject: Re: svn commit: r280363 - stable/10/usr.sbin/bhyve In-Reply-To: <55102697.8030903@FreeBSD.org> Message-ID: References: <201503231148.t2NBmQ7o024956@svn.freebsd.org> <55102697.8030903@FreeBSD.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 14:44:46 -0000 On Mon, 23 Mar 2015, Alexander Motin wrote: > On 23.03.2015 16:35, Dan Mack wrote: >> I just tried to build 280369 and got this: >> >> --- all_subdir_bhyve --- >> /usr/src/usr.sbin/bhyve/pci_ahci.c:1512:8: error: use of undeclared >> identifier 'dsm' >> ncq = dsm = 0; >> ^ >> 1 error generated. >> *** [pci_ahci.o] Error code 1 >> >> This is on 10.1-Stable > > Yes, it was my fault. Should be fixed by r280370. Sorry. Okies, thanks. Usually not in a hurry but tyring to build with the openssl fixes now :-) Take care, dan -- Dan Mack From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 19:12:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F067F179; Mon, 23 Mar 2015 19:12:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D26E0B; Mon, 23 Mar 2015 19:12:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJCuIG047371; Mon, 23 Mar 2015 19:12:56 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NJCuuF047369; Mon, 23 Mar 2015 19:12:56 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503231912.t2NJCuuF047369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 23 Mar 2015 19:12: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: r280390 - stable/10/usr.sbin/sysrc 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.18-1 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: Mon, 23 Mar 2015 19:12:57 -0000 Author: dteske Date: Mon Mar 23 19:12:55 2015 New Revision: 280390 URL: https://svnweb.freebsd.org/changeset/base/280390 Log: MFC revisions 274068, 274119, 279624: r274068: Add key+=append syntax to sysrc(8) r279624: Add key-=remove syntax r274119: Add EXAMPLES-section entries for new syntax Reviewed by: shurd (r274068) Thanks to: seanc Relnotes: sysrc(8) now supports key+=append and key-=remove Modified: stable/10/usr.sbin/sysrc/sysrc stable/10/usr.sbin/sysrc/sysrc.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/sysrc/sysrc ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc Mon Mar 23 18:54:37 2015 (r280389) +++ stable/10/usr.sbin/sysrc/sysrc Mon Mar 23 19:12:55 2015 (r280390) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2014 Devin Teske +# Copyright (c) 2010-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.1 Jul-18,2014" +SYSRC_VERSION="6.3 Mar-4,2015" # # Options @@ -80,7 +80,7 @@ die() # usage() { - f_err "Usage: %s [OPTIONS] name[=value] ...\n" "$pgm" + f_err "Usage: %s [OPTIONS] name[[+]=value] ...\n" "$pgm" f_err "Try \`%s --help' for more information.\n" "$pgm" die } @@ -94,7 +94,7 @@ help() local optfmt="\t%-11s%s\n" local envfmt="\t%-17s%s\n" - f_err "Usage: %s [OPTIONS] name[=value] ...\n" "$pgm" + f_err "Usage: %s [OPTIONS] name[[+|-]=value] ...\n" "$pgm" f_err "OPTIONS:\n" f_err "$optfmt" "-a" \ @@ -529,6 +529,12 @@ status=$SUCCESS while [ $# -gt 0 ]; do NAME="${1%%=*}" + case "$NAME" in + *+) mode=APPEND NAME="${NAME%+}" ;; + *-) mode=REMOVE NAME="${NAME%-}" ;; + *) mode=ASSIGN + esac + [ "$DESCRIBE" ] && \ echo "$NAME: $( f_sysrc_desc "$NAME" )" @@ -589,18 +595,70 @@ while [ $# -gt 0 ]; do fi # - # If `-N' is passed, simplify the output + # Determine both `before' value and appropriate `new' value # - if [ ! "$SHOW_VALUE" ]; then - echo "$NAME" - f_sysrc_set "$NAME" "${1#*}" - else + case "$mode" in + APPEND) + before=$( f_sysrc_get "$NAME" ) + add="${1#*=}" + delim="${add%"${add#?}"}" # first character + oldIFS="$IFS" + case "$delim" in + ""|[$IFS]|[a-zA-Z0-9]) delim=" " ;; + *) IFS="$delim" + esac + new="$before" + for a in $add; do + [ "$a" ] || continue + skip= + for b in $before; do + [ "$b" = "$a" ] && skip=1 break + done + [ "$skip" ] || new="$new$delim$a" + done + new="${new#"$delim"}" IFS="$oldIFS" + unset add delim oldIFS a skip b + [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) + ;; + REMOVE) + before=$( f_sysrc_get "$NAME" ) + remove="${1#*=}" + delim="${remove%"${remove#?}"}" # first character + oldIFS="$IFS" + case "$delim" in + ""|[$IFS]|[a-zA-Z0-9]) delim=" " ;; + *) IFS="$delim" + esac + new= + for b in $before; do + [ "$b" ] || continue + add=1 + for r in $remove; do + [ "$r" = "$b" ] && add= break + done + [ "$add" ] && new="$new$delim$b" + done + new="${new#"$delim"}" IFS="$oldIFS" + unset remove delim oldIFS b add r + [ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" ) + ;; + *) if [ "$SHOW_FILE" ]; then before=$( f_sysrc_find "$NAME" ) else before=$( f_sysrc_get "$NAME" ) fi - if f_sysrc_set "$NAME" "${1#*=}"; then + new="${1#*=}" + esac + + # + # If `-N' is passed, simplify the output + # + if [ ! "$SHOW_VALUE" ]; then + echo "$NAME" + f_sysrc_set "$NAME" "$new" + else + if f_sysrc_set "$NAME" "$new"; then if [ "$SHOW_FILE" ]; then after=$( f_sysrc_find "$NAME" ) else Modified: stable/10/usr.sbin/sysrc/sysrc.8 ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc.8 Mon Mar 23 18:54:37 2015 (r280389) +++ stable/10/usr.sbin/sysrc/sysrc.8 Mon Mar 23 19:12:55 2015 (r280390) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2014 Devin Teske +.\" Copyright (c) 2011-2015 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jul 18, 2014 +.Dd March 4, 2015 .Dt SYSRC 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Op Fl cdDeFhinNqvx .Op Fl f Ar file .Op Fl j Ar jail | Fl R Ar dir -.Ar name Ns Op = Ns Ar value +.Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value .Ar ... .Nm .Op Fl cdDeFhinNqvx @@ -135,6 +135,15 @@ It shares the `-e' and `-n' options and also has the same .Ql name[=value] syntax for making queries/assignments. +In addition +.Pq but unlike Xr sysctl 8 , +.Ql name+=value +is supported for adding items to values +.Pq see APPENDING VALUES +and +.Ql name-=value +is supported for removing items from values +.Pq see SUBTRACTING VALUES . .Pp However, while .Xr sysctl 8 @@ -183,6 +192,115 @@ modifying these integral files (yet taki grow unwieldy should .Nm be called repeatedly). +.Sh APPENDING VALUES +When using the +.Ql key+=value +syntax to add items to existing values, +the first character of the value is taken as the delimiter separating items +.Pq usually Qo \ Qc or Qo , Qc . +For example, in the following statement: +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces+=" gif0" +.El +.Pp +the first character is a space, informing +.Nm +that existing values are to be considered separated by whitespace. +If +.Ql gif0 +is not found in the existing value for +.Va cloned_interfaces , +it is added +.Pq with delimiter only if existing value is non-NULL . +.Pp +For convenience, if the first character is alpha-numeric +.Pq letters A-Z, a-z, or numbers 0-9 , +.Nm +uses the default setting of whitespace as separator. +For example, the above and below statements are equivalent since +.Dq gif0 +starts with an alpha-numeric character +.Pq the letter Li g : +.Pp +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces+=gif0 +.El +.Pp +Take the following sequence for example: +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces= # start with NULL +.It \ +.Nm +cloned_interfaces+=gif0 +.Dl # NULL -> `gif0' Pq NB: no preceding delimiter +.It \ +.Nm +cloned_interfaces+=gif0 # no change +.It \ +.Nm +cloned_interfaces+="tun0 gif0" +.Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication +.El +.Pp +.Nm +prevents the same value from being added if already there. +.Sh SUBTRACTING VALUES +When using the +.Ql key-=value +syntax to remove items from existing values, +the first character of the value is taken as the delimiter separating items +.Pq usually Qo \ Qc or Qo , Qc . +For example, in the following statement: +.Pp +.Dl Nm cloned_interfaces-=" gif0" +.Pp +the first character is a space, informing +.Nm +that existing values are to be considered separated by whitespace. +If +.Ql gif0 +is found in the existing value for +.Va cloned_interfaces , +it is removed +.Pq extra delimiters removed . +.Pp +For convenience, if the first character is alpha-numeric +.Pq letters A-Z, a-z, or numbers 0-9 , +.Nm +uses the default setting of whitespace as separator. +For example, the above and below statements are equivalent since +.Dq gif0 +starts with an alpha-numeric character +.Pq the letter Li g : +.Pp +.Bl -tag -width indent+ +.It \ +.Nm +cloned_interfaces-=gif0 +.El +.Pp +Take the following sequence for example: +.Bl -tag -width indent+ +.It \ +.Nm +foo="bar baz" # start +.It \ +.Nm +foo-=bar # `bar baz' -> `baz' +.It \ +.Nm +foo-=baz # `baz' -> NULL +.El +.Pp +.Nm +removes all occurrences of all items provided +and collapses extra delimiters between items. .Sh ENVIRONMENT The following environment variables are referenced by .Nm : @@ -243,6 +361,16 @@ Working on other files, such as -f /etc/crontab MAILTO .Dl returns the value of the MAILTO setting Pq if configured . .Pp +Appending to existing values: +.Pp +.Nm +\&cloned_interfaces+=gif0 +.Dl appends Qo gif0 Qc to $cloned_interfaces Pq see APPENDING VALUES . +.Pp +.Nm +\&cloned_interfaces-=gif0 +.Dl removes Qo gif0 Qc from $cloned_interfaces Pq see SUBTRACTING VALUES . +.Pp In addition to the above syntax, .Nm also supports inline From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 19:44:20 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45FB86BA; Mon, 23 Mar 2015 19:44:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 307291FF; Mon, 23 Mar 2015 19:44:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJiK1f063116; Mon, 23 Mar 2015 19:44:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NJiJpK063111; Mon, 23 Mar 2015 19:44:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503231944.t2NJiJpK063111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 23 Mar 2015 19:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280392 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 19:44:20 -0000 Author: pfg Date: Mon Mar 23 19:44:18 2015 New Revision: 280392 URL: https://svnweb.freebsd.org/changeset/base/280392 Log: MFC r279186: setmode(3): Make sure that setmode sets errno on failure. Our man page already documented this partially but now we provide more consistent behavior. PR: 136669 Obtained from: NetBSD (CVS rev. 1.31, 1.33) Relnotes: yes Modified: stable/10/lib/libc/gen/setmode.3 stable/10/lib/libc/gen/setmode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/setmode.3 ============================================================================== --- stable/10/lib/libc/gen/setmode.3 Mon Mar 23 19:25:34 2015 (r280391) +++ stable/10/lib/libc/gen/setmode.3 Mon Mar 23 19:44:18 2015 (r280392) @@ -28,7 +28,7 @@ .\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd February 22, 2015 .Dt SETMODE 3 .Os .Sh NAME @@ -99,7 +99,20 @@ The function may fail and set errno for any of the errors specified for the library routine -.Xr malloc 3 . +.Xr malloc 3 +or +.Xr strtol 3 . +In addition, +.Fn setmode +will fail and set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa mode +argument does not represent a valid mode. +.El .Sh SEE ALSO .Xr chmod 1 , .Xr stat 2 , Modified: stable/10/lib/libc/gen/setmode.c ============================================================================== --- stable/10/lib/libc/gen/setmode.c Mon Mar 23 19:25:34 2015 (r280391) +++ stable/10/lib/libc/gen/setmode.c Mon Mar 23 19:44:18 2015 (r280392) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -66,7 +68,7 @@ typedef struct bitcmd { #define CMD2_OBITS 0x08 #define CMD2_UBITS 0x10 -static BITCMD *addcmd(BITCMD *, int, int, int, u_int); +static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t); static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG static void dumpmode(BITCMD *); @@ -151,33 +153,32 @@ common: if (set->cmd2 & CMD2_CLR) { BITCMD *newset; \ setlen += SET_LEN_INCR; \ newset = realloc(saveset, sizeof(BITCMD) * setlen); \ - if (!newset) { \ - if (saveset) \ - free(saveset); \ - saveset = NULL; \ - return (NULL); \ - } \ + if (newset == NULL) \ + goto out; \ set = newset + (set - saveset); \ saveset = newset; \ endset = newset + (setlen - 2); \ } \ - set = addcmd(set, (a), (b), (c), (d)) + set = addcmd(set, (mode_t)(a), (mode_t)(b), (mode_t)(c), (d)) #define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) void * setmode(const char *p) { - int perm, who; + int serrno; char op, *ep; BITCMD *set, *saveset, *endset; sigset_t sigset, sigoset; - mode_t mask; - int equalopdone=0, permXbits, setlen; + mode_t mask, perm, permXbits, who; long perml; + int equalopdone; + int setlen; - if (!*p) + if (!*p) { + errno = EINVAL; return (NULL); + } /* * Get a copy of the mask for the permissions that are mask relative. @@ -203,10 +204,17 @@ setmode(const char *p) * or illegal bits. */ if (isdigit((unsigned char)*p)) { + errno = 0; perml = strtol(p, &ep, 8); - if (*ep || perml < 0 || perml & ~(STANDARD_BITS|S_ISTXT)) { - free(saveset); - return (NULL); + if (*ep) { + errno = EINVAL; + goto out; + } + if (errno == ERANGE && (perml == LONG_MAX || perml == LONG_MIN)) + goto out; + if (perml & ~(STANDARD_BITS|S_ISTXT)) { + errno = EINVAL; + goto out; } perm = (mode_t)perml; ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask); @@ -218,6 +226,7 @@ setmode(const char *p) * Build list of structures to set/clear/copy bits as described by * each clause of the symbolic mode. */ + equalopdone = 0; for (;;) { /* First, find out which bits might be modified. */ for (who = 0;; ++p) { @@ -240,8 +249,8 @@ setmode(const char *p) } getop: if ((op = *p++) != '+' && op != '-' && op != '=') { - free(saveset); - return (NULL); + errno = EINVAL; + goto out; } if (op == '=') equalopdone = 0; @@ -330,10 +339,15 @@ apply: if (!*p) dumpmode(saveset); #endif return (saveset); +out: + serrno = errno; + free(saveset); + errno = serrno; + return NULL; } static BITCMD * -addcmd(BITCMD *set, int op, int who, int oparg, u_int mask) +addcmd(BITCMD *set, mode_t op, mode_t who, mode_t oparg, mode_t mask) { switch (op) { case '=': From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 19:50:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70D1FB24; Mon, 23 Mar 2015 19:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BABF315; Mon, 23 Mar 2015 19:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJoMKu064109; Mon, 23 Mar 2015 19:50:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NJoMpa064108; Mon, 23 Mar 2015 19:50:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503231950.t2NJoMpa064108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 23 Mar 2015 19:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280394 - stable/10/lib/libc/db/man 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.18-1 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: Mon, 23 Mar 2015 19:50:22 -0000 Author: pfg Date: Mon Mar 23 19:50:21 2015 New Revision: 280394 URL: https://svnweb.freebsd.org/changeset/base/280394 Log: MFC r279037: dbm_delete(3): correct man page to match current behaviour. "The dbm_store() and dbm_delete() functions shall return 0 when they succeed and a negative value when they fail." Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html PR: 42422 Suggested by: delphij Modified: stable/10/lib/libc/db/man/dbm.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/db/man/dbm.3 ============================================================================== --- stable/10/lib/libc/db/man/dbm.3 Mon Mar 23 19:47:52 2015 (r280393) +++ stable/10/lib/libc/db/man/dbm.3 Mon Mar 23 19:50:21 2015 (r280394) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 16, 2006 +.Dd February 19, 2015 .Dt DBM 3 .Os .Sh NAME @@ -174,9 +174,7 @@ deletes the entry for The .Fn dbm_delete function -normally returns zero but returns 1 if there was no entry with -.Fa key -in the database or returns -1 and sets +normally returns zero or returns -1 and sets .Va errno if there were any errors. .Pp From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 20:00:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ADEB2BF; Mon, 23 Mar 2015 20:00:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25FB33D7; Mon, 23 Mar 2015 20:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NK0aw3071392; Mon, 23 Mar 2015 20:00:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NK0ave071391; Mon, 23 Mar 2015 20:00:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503232000.t2NK0ave071391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 23 Mar 2015 20:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280396 - stable/10/lib/msun/src 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.18-1 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: Mon, 23 Mar 2015 20:00:36 -0000 Author: pfg Date: Mon Mar 23 20:00:35 2015 New Revision: 280396 URL: https://svnweb.freebsd.org/changeset/base/280396 Log: MFC r277948: msun: use previously ignored "in" value. This fixes evaluation of exceptional values in scalblnl(). While here, simplify the code as suggested by Bruce Evans. Reported by: clang static analyzer Modified: stable/10/lib/msun/src/s_scalbln.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/src/s_scalbln.c ============================================================================== --- stable/10/lib/msun/src/s_scalbln.c Mon Mar 23 19:53:37 2015 (r280395) +++ stable/10/lib/msun/src/s_scalbln.c Mon Mar 23 20:00:35 2015 (r280396) @@ -35,13 +35,7 @@ scalbln (double x, long n) { int in; - in = (int)n; - if (in != n) { - if (n > 0) - in = INT_MAX; - else - in = INT_MIN; - } + in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n; return (scalbn(x, in)); } @@ -50,13 +44,7 @@ scalblnf (float x, long n) { int in; - in = (int)n; - if (in != n) { - if (n > 0) - in = INT_MAX; - else - in = INT_MIN; - } + in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n; return (scalbnf(x, in)); } @@ -65,12 +53,6 @@ scalblnl (long double x, long n) { int in; - in = (int)n; - if (in != n) { - if (n > 0) - in = INT_MAX; - else - in = INT_MIN; - } - return (scalbnl(x, (int)n)); + in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n; + return (scalbnl(x, in)); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 20:50:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6DD64CE; Mon, 23 Mar 2015 20:50:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7EE4B97; Mon, 23 Mar 2015 20:50:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NKoTOR093353; Mon, 23 Mar 2015 20:50:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NKoTQg093352; Mon, 23 Mar 2015 20:50:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503232050.t2NKoTQg093352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 23 Mar 2015 20:50: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: r280398 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 20:50:30 -0000 Author: emaste Date: Mon Mar 23 20:50:28 2015 New Revision: 280398 URL: https://svnweb.freebsd.org/changeset/base/280398 Log: MFC r275060: Fix b64_pton output buffer overrun test for exact-sized buffer b64_pton would sometimes erroneously fail to decode a base64 string into a precisely sized buffer. The overflow check was a little too greedy. Modified: stable/10/lib/libc/net/base64.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/base64.c ============================================================================== --- stable/10/lib/libc/net/base64.c Mon Mar 23 20:02:16 2015 (r280397) +++ stable/10/lib/libc/net/base64.c Mon Mar 23 20:50:28 2015 (r280398) @@ -199,6 +199,7 @@ b64_pton(src, target, targsize) size_t targsize; { int tarindex, state, ch; + u_char nextbyte; char *pos; state = 0; @@ -226,22 +227,28 @@ b64_pton(src, target, targsize) break; case 1: if (target) { - if ((size_t)tarindex + 1 >= targsize) + if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 4; - target[tarindex+1] = ((pos - Base64) & 0x0f) - << 4 ; + nextbyte = ((pos - Base64) & 0x0f) << 4; + if ((size_t)tarindex + 1 < targsize) + target[tarindex + 1] = nextbyte; + else if (nextbyte) + return (-1); } tarindex++; state = 2; break; case 2: if (target) { - if ((size_t)tarindex + 1 >= targsize) + if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 2; - target[tarindex+1] = ((pos - Base64) & 0x03) - << 6; + nextbyte = ((pos - Base64) & 0x03) << 6; + if ((size_t)tarindex + 1 < targsize) + target[tarindex + 1] = nextbyte; + else if (nextbyte) + return (-1); } tarindex++; state = 3; @@ -299,7 +306,8 @@ b64_pton(src, target, targsize) * zeros. If we don't check them, they become a * subliminal channel. */ - if (target && target[tarindex] != 0) + if (target && (size_t)tarindex < targsize && + target[tarindex] != 0) return (-1); } } else { From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 23 20:51:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1242627; Mon, 23 Mar 2015 20:51:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C41EBB1; Mon, 23 Mar 2015 20:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NKpal4095063; Mon, 23 Mar 2015 20:51:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NKpasC095062; Mon, 23 Mar 2015 20:51:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503232051.t2NKpasC095062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 23 Mar 2015 20:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280399 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 23 Mar 2015 20:51:36 -0000 Author: emaste Date: Mon Mar 23 20:51:35 2015 New Revision: 280399 URL: https://svnweb.freebsd.org/changeset/base/280399 Log: MFC r275163: ANSIfy b64_pton Modified: stable/10/lib/libc/net/base64.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/base64.c ============================================================================== --- stable/10/lib/libc/net/base64.c Mon Mar 23 20:50:28 2015 (r280398) +++ stable/10/lib/libc/net/base64.c Mon Mar 23 20:51:35 2015 (r280399) @@ -193,10 +193,7 @@ b64_ntop(u_char const *src, size_t srcle */ int -b64_pton(src, target, targsize) - char const *src; - u_char *target; - size_t targsize; +b64_pton(const char *src, u_char *target, size_t targsize) { int tarindex, state, ch; u_char nextbyte; From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 01:31:03 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0BE4D6B; Tue, 24 Mar 2015 01:31:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8B8DA3; Tue, 24 Mar 2015 01:31:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O1V31W028012; Tue, 24 Mar 2015 01:31:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O1V3ne028011; Tue, 24 Mar 2015 01:31:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503240131.t2O1V3ne028011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 24 Mar 2015 01:31: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: r280408 - stable/10/usr.bin/grep 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.18-1 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: Tue, 24 Mar 2015 01:31:03 -0000 Author: pfg Date: Tue Mar 24 01:31:02 2015 New Revision: 280408 URL: https://svnweb.freebsd.org/changeset/base/280408 Log: MFC r280307: bsdgrep: fix regression in the -f option since r268799 Caused by an incomplete merge from NetBSD. PR: 198725 Modified: stable/10/usr.bin/grep/grep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/grep/grep.c ============================================================================== --- stable/10/usr.bin/grep/grep.c Tue Mar 24 00:10:11 2015 (r280407) +++ stable/10/usr.bin/grep/grep.c Tue Mar 24 01:31:02 2015 (r280408) @@ -316,7 +316,7 @@ read_patterns(const char *fn) len = 0; line = NULL; while ((rlen = getline(&line, &len, f)) != -1) - add_pattern(line, line[0] == '\n' ? 0 : len); + add_pattern(line, line[0] == '\n' ? 0 : (size_t)rlen); free(line); if (ferror(f)) err(2, "%s", fn); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 06:05:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 701811E6; Tue, 24 Mar 2015 06:05:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50CFCE10; Tue, 24 Mar 2015 06:05:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O65sk1060327; Tue, 24 Mar 2015 06:05:54 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O65r9k060321; Tue, 24 Mar 2015 06:05:53 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503240605.t2O65r9k060321@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Tue, 24 Mar 2015 06:05: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: r280414 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 24 Mar 2015 06:05:55 -0000 Author: edwin Date: Tue Mar 24 06:05:52 2015 New Revision: 280414 URL: https://svnweb.freebsd.org/changeset/base/280414 Log: MFC of 280413,tzdata10: Release 2015b - 2015-03-19 23:28:11 -0700 Changes affecting future time stamps Mongolia will start observing DST again this year, from the last Saturday in March at 02:00 to the last Saturday in September at 00:00. (Thanks to Ganbold Tsagaankhuu.) Palestine will start DST on March 28, not March 27. Also, correct the fall 2014 transition from September 26 to October 24. Adjust future predictions accordingly. (Thanks to Steffen Thorsen.) Changes affecting past time stamps The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a regression. (Thanks to Stuart Bishop for reporting the problem.) Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: America/Antigua, America/Cayman, Pacific/Midway, and Pacific/Saipan. Changes affecting time zone abbreviations Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD". (Thanks to Hank W.) Modified: stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/leap-seconds.list stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/asia Tue Mar 24 06:05:52 2015 (r280414) @@ -1904,6 +1904,13 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # was at the start of 2008-03-31 (the day of Steffen Thorsen's report); # this is almost surely wrong. +# From Ganbold Tsagaankhuu (2015-03-10): +# It seems like yesterday Mongolian Government meeting has concluded to use +# daylight saving time in Mongolia.... Starting at 2:00AM of last Saturday of +# March 2015, daylight saving time starts. And 00:00AM of last Saturday of +# September daylight saving time ends. Source: +# http://zasag.mn/news/view/8969 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mongol 1983 1984 - Apr 1 0:00 1:00 S Rule Mongol 1983 only - Oct 1 0:00 0 - @@ -1924,6 +1931,8 @@ Rule Mongol 1984 1998 - Sep lastSun 0:00 Rule Mongol 2001 only - Apr lastSat 2:00 1:00 S Rule Mongol 2001 2006 - Sep lastSat 2:00 0 - Rule Mongol 2002 2006 - Mar lastSat 2:00 1:00 S +Rule Mongol 2015 max - Mar lastSat 2:00 1:00 S +Rule Mongol 2015 max - Sep lastSat 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta @@ -2342,13 +2351,19 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # official source...: # http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252 -# From Paul Eggert (2013-09-24): -# For future dates, guess the last Thursday in March at 24:00 through -# the first Friday on or after September 21 at 00:00. This is consistent with -# the predictions in today's editions of the following URLs, -# which are for Gaza and Hebron respectively: -# http://www.timeanddate.com/worldclock/timezone.html?n=702 -# http://www.timeanddate.com/worldclock/timezone.html?n=2364 +# From Steffen Thorsen (2015-03-03): +# Sources such as http://www.alquds.com/news/article/view/id/548257 +# and http://www.raya.ps/ar/news/890705.html say Palestine areas will +# start DST on 2015-03-28 00:00 which is one day later than expected. +# +# From Paul Eggert (2015-03-03): +# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014 +# says that the fall 2014 transition was Oct 23 at 24:00. +# For future dates, guess the last Friday in March at 24:00 through +# the first Friday on or after October 21 at 00:00. This is consistent with +# the predictions in today's editions of the following URLs: +# http://www.timeanddate.com/time/change/gaza-strip/gaza +# http://www.timeanddate.com/time/change/west-bank/hebron # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2374,9 +2389,11 @@ Rule Palestine 2011 only - Apr 1 0:01 1 Rule Palestine 2011 only - Aug 1 0:00 0 - Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - -Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 max - Sep Fri>=21 0:00 0 - +Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - +Rule Palestine 2014 max - Oct Fri>=21 0:00 0 - +Rule Palestine 2015 max - Mar lastFri 24:00 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/australasia Tue Mar 24 06:05:52 2015 (r280414) @@ -373,6 +373,7 @@ Zone Pacific/Guam -14:21:00 - LMT 1844 D 9:39:00 - LMT 1901 # Agana 10:00 - GST 2000 Dec 23 # Guam 10:00 - ChST # Chamorro Standard Time +Link Pacific/Guam Pacific/Saipan # N Mariana Is # Kiribati # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -388,12 +389,7 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 14:00 - LINT # N Mariana Is -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Saipan -14:17:00 - LMT 1844 Dec 31 - 9:43:00 - LMT 1901 - 9:00 - MPT 1969 Oct # N Mariana Is Time - 10:00 - MPT 2000 Dec 23 - 10:00 - ChST # Chamorro Standard Time +# See Pacific/Guam. # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -563,6 +559,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 -11:00 - NST 1967 Apr # N=Nome -11:00 - BST 1983 Nov 30 # B=Bering -11:00 - SST # S=Samoa +Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands # Samoa (formerly and also known as Western Samoa) @@ -744,23 +741,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 190 # uninhabited # Midway -# -# From Mark Brader (2005-01-23): -# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies, -# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3] -# reproduced a Pan American Airways timetable from 1936, for their weekly -# "Orient Express" flights between San Francisco and Manila, and connecting -# flights to Chicago and the US East Coast. As it uses some time zone -# designations that I've never seen before:.... -# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I. H.L.T. Ar. 5:30P Sun. -# " 3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A " -# -Zone Pacific/Midway -11:49:28 - LMT 1901 - -11:00 - NST 1956 Jun 3 - -11:00 1:00 NDT 1956 Sep 2 - -11:00 - NST 1967 Apr # N=Nome - -11:00 - BST 1983 Nov 30 # B=Bering - -11:00 - SST # S=Samoa +# See Pacific/Pago_Pago. # Palmyra # uninhabited since World War II; was probably like Pacific/Kiritimati Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/europe Tue Mar 24 06:05:52 2015 (r280414) @@ -2400,7 +2400,7 @@ Zone Europe/Volgograd 2:57:40 - LMT 192 4:00 Russia VOL%sT 1989 Mar 26 2:00s # Volgograd T 3:00 Russia VOL%sT 1991 Mar 31 2:00s 4:00 - VOLT 1992 Mar 29 2:00s - 3:00 Russia MSK 2011 Mar 27 2:00s + 3:00 Russia MSK/MSD 2011 Mar 27 2:00s 4:00 - MSK 2014 Oct 26 2:00s 3:00 - MSK Modified: stable/10/contrib/tzdata/leap-seconds.list ============================================================================== --- stable/10/contrib/tzdata/leap-seconds.list Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/leap-seconds.list Tue Mar 24 06:05:52 2015 (r280414) @@ -131,10 +131,10 @@ # over the last few minutes of the day. The frequency of the local # clock is decreased (or increased) to realize the positive (or # negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# defintion of UTC. +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. # # Questions or comments to: # Judah Levine Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/northamerica Tue Mar 24 06:05:52 2015 (r280414) @@ -2312,8 +2312,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # "...the new time zone will come into effect at two o'clock on the first Sunday # of February, when we will have to advance the clock one hour from its current # time..." -# # Also, the new zone will not use DST. +# +# From Carlos Raúl Perasso (2015-02-02): +# The decree that modifies the Mexican Hour System Law has finally +# been published at the Diario Oficial de la Federación +# http://www.dof.gob.mx/nota_detalle.php?codigo=5380123&fecha=31/01/2015 +# It establishes 5 zones for Mexico: +# 1- Zona Centro (Central Zone): Corresponds to longitude 90 W, +# includes most of Mexico, excluding what's mentioned below. +# 2- Zona Pacífico (Pacific Zone): Longitude 105 W, includes the +# states of Baja California Sur; Chihuahua; Nayarit (excluding Bahía +# de Banderas which lies in Central Zone); Sinaloa and Sonora. +# 3- Zona Noroeste (Northwest Zone): Longitude 120 W, includes the +# state of Baja California. +# 4- Zona Sureste (Southeast Zone): Longitude 75 W, includes the state +# of Quintana Roo. +# 5- The islands, reefs and keys shall take their timezone from the +# longitude they are located at. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D @@ -2508,13 +2524,8 @@ Zone America/Santa_Isabel -7:39:28 - LMT ############################################################################### # Anguilla -# See America/Port_of_Spain. - # Antigua and Barbuda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Antigua -4:07:12 - LMT 1912 Mar 2 - -5:00 - EST 1951 - -4:00 - AST +# See America/Port_of_Spain. # Bahamas # @@ -2581,10 +2592,7 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 193 -4:00 US A%sT # Cayman Is -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST +# See America/Panama. # Costa Rica @@ -3107,6 +3115,7 @@ Zone America/Managua -5:45:08 - LMT 1890 Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'. Modified: stable/10/contrib/tzdata/southamerica ============================================================================== --- stable/10/contrib/tzdata/southamerica Tue Mar 24 05:52:28 2015 (r280413) +++ stable/10/contrib/tzdata/southamerica Tue Mar 24 06:05:52 2015 (r280414) @@ -1206,10 +1206,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf -# From Juan Correa (2015-01-28): -# ... today the Ministry of Energy announced that Chile will drop DST, will keep -# "summer time" (UTC -3 / UTC -5) all year round.... -# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html +# From Eduardo Romero Urra (2015-03-03): +# Today has been published officially that Chile will use the DST time +# permanently until March 25 of 2017 +# http://www.diariooficial.interior.gob.cl/media/2015/03/03/1-large.jpg +# +# From Paul Eggert (2015-03-03): +# For now, assume that the extension will persist indefinitely. # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1268,7 +1271,7 @@ Zone America/Santiago -4:42:46 - LMT 189 -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time -6:00 Chile EAS%sT 2015 Apr 26 3:00u -5:00 - EAST # @@ -1603,6 +1606,7 @@ Zone America/Port_of_Spain -4:06:04 - LM # These all agree with Trinidad and Tobago since 1970. Link America/Port_of_Spain America/Anguilla +Link America/Port_of_Spain America/Antigua Link America/Port_of_Spain America/Dominica Link America/Port_of_Spain America/Grenada Link America/Port_of_Spain America/Guadeloupe From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 06:55:12 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF8E1CF; Tue, 24 Mar 2015 06:55:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4863C5F6; Tue, 24 Mar 2015 06:55:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O6tCTv083878; Tue, 24 Mar 2015 06:55:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O6t95Y083871; Tue, 24 Mar 2015 06:55:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503240655.t2O6t95Y083871@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 06:55: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: r280419 - in stable/10: etc include share/examples share/man/man4 share/man/man9 share/misc tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 24 Mar 2015 06:55:12 -0000 Author: ngie Date: Tue Mar 24 06:55:08 2015 New Revision: 280419 URL: https://svnweb.freebsd.org/changeset/base/280419 Log: MFC r278135,r278202: r278135 (by amdmi3): - Remove more files when MK_USB == no Reviewed by: ngie Approved by: ngie Differential Revision: D1600 r278202: Clean up more usb related files when MK_USB == no when dealing with manpages, libraries, and binaries Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/Makefile stable/10/include/Makefile stable/10/share/examples/Makefile stable/10/share/man/man4/Makefile stable/10/share/man/man9/Makefile stable/10/share/misc/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/etc/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -44,7 +44,6 @@ BIN1= crontab \ rc.bsdextended \ rc.firewall \ rc.initdiskless \ - rc.sendmail \ rc.shutdown \ rc.subr \ remote \ @@ -144,6 +143,10 @@ BIN1+= portsnap.conf BIN1+= pf.os .endif +.if ${MK_SENDMAIL} != "no" +BIN1+= rc.sendmail +.endif + .if ${MK_TCSH} != "no" BIN1+= csh.cshrc csh.login csh.logout .endif @@ -248,7 +251,9 @@ distribution: ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install +.if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt @@ -310,8 +315,10 @@ distribution: .endif ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ ${DESTDIR}/etc/dumpdates +.if ${MK_LOCATE} != "no" ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ ${DESTDIR}/var/db/locate.database +.endif ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \ ${DESTDIR}/var/crash cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ @@ -379,6 +386,7 @@ distrib-dirs: ${MTREES:N/*} done; true .endif ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys +.if ${MK_MAN} != "no" cd ${DESTDIR}/usr/share/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ @@ -386,23 +394,30 @@ distrib-dirs: ${MTREES:N/*} ${INSTALL_SYMLINK} ../$$mandir \ ${DESTDIR}/usr/share/man/en.UTF-8/; \ done +.if ${MK_OPENSSL} != "no" cd ${DESTDIR}/usr/share/openssl/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ done +.endif set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; do \ ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \ - ${INSTALL_SYMLINK} "$$2" \ - "${DESTDIR}/usr/share/openssl/man/$$1"; \ + if [ "${MK_OPENSSL}" != "no" ]; then \ + ${INSTALL_SYMLINK} "$$2" \ + "${DESTDIR}/usr/share/openssl/man/$$1"; \ + fi; \ shift; shift; \ done +.endif +.if ${MK_NLS} != "no" set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ shift; shift; \ done +.endif etc-examples: cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/include/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -46,7 +46,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ - dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ + dev/speaker dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ @@ -58,6 +58,10 @@ LSUBDIRS= cam/ata cam/scsi \ security/mac_mls security/mac_partition \ ufs/ffs ufs/ufs +.if ${MK_USB} != "no" +LSUBDIRS+= dev/usb +.endif + LSUBSUBDIRS= dev/mpt/mpilib .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" Modified: stable/10/share/examples/Makefile ============================================================================== --- stable/10/share/examples/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/share/examples/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -18,7 +18,6 @@ LDIRS= BSD_daemon \ ipfw \ jails \ kld \ - libusb20 \ libvgl \ mdoc \ netgraph \ @@ -92,12 +91,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/syscall/module/syscall.c \ kld/syscall/test/Makefile \ kld/syscall/test/call.c \ - libusb20/Makefile \ - libusb20/README \ - libusb20/util.c \ - libusb20/util.h \ - libusb20/bulk.c \ - libusb20/control.c \ libvgl/Makefile \ libvgl/demo.c \ mdoc/POSIX-copyright \ @@ -203,6 +196,16 @@ XFILES+= hast/ucarp.sh \ hast/vip-up.sh .endif +.if ${MK_USB} != "no" +LDIRS+= libusb20 +XFILES+= libusb20/Makefile \ + libusb20/README \ + libusb20/util.c \ + libusb20/util.h \ + libusb20/bulk.c \ + libusb20/control.c +.endif + .if ${MACHINE_CPUARCH} == "amd64" .if ${MK_BHYVE} != "no" LDIRS+= bhyve Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/share/man/man4/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -504,54 +504,6 @@ MAN= aac.4 \ tws.4 \ tx.4 \ txp.4 \ - u3g.4 \ - uark.4 \ - uart.4 \ - uath.4 \ - ubsa.4 \ - ubsec.4 \ - ubser.4 \ - ubtbcmfw.4 \ - uchcom.4 \ - ucom.4 \ - ucycom.4 \ - udav.4 \ - udbp.4 \ - udp.4 \ - udplite.4 \ - uep.4 \ - ufm.4 \ - ufoma.4 \ - uftdi.4 \ - ugen.4 \ - uhci.4 \ - uhid.4 \ - uhso.4 \ - uipaq.4 \ - ukbd.4 \ - uled.4 \ - ulpt.4 \ - umass.4 \ - umcs.4 \ - umct.4 \ - umodem.4 \ - ums.4 \ - unix.4 \ - upgt.4 \ - uplcom.4 \ - ural.4 \ - urio.4 \ - urndis.4 \ - ${_urtw.4} \ - urtwn.4 \ - urtwnfw.4 \ - usb.4 \ - usb_template.4 \ - usb_quirk.4 \ - uslcom.4 \ - utopia.4 \ - uvisor.4 \ - uvscom.4 \ vale.4 \ vga.4 \ vge.4 \ @@ -733,13 +685,6 @@ MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 -MLINKS+=u3g.4 u3gstub.4 -MLINKS+=uath.4 if_uath.4 -MLINKS+=udav.4 if_udav.4 -MLINKS+=upgt.4 if_upgt.4 -MLINKS+=ural.4 if_ural.4 -MLINKS+=urndis.4 if_urndis.4 -MLINKS+=${_urtw.4} ${_if_urtw.4} MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=${_vmx.4} ${_if_vmx.4} @@ -884,4 +829,63 @@ _pflog.4= pflog.4 _pfsync.4= pfsync.4 .endif +.if ${MK_USB} != "no" +MAN+= u3g.4 \ + uark.4 \ + uart.4 \ + uath.4 \ + ubsa.4 \ + ubsec.4 \ + ubser.4 \ + ubtbcmfw.4 \ + uchcom.4 \ + ucom.4 \ + ucycom.4 \ + udav.4 \ + udbp.4 \ + udp.4 \ + udplite.4 \ + uep.4 \ + ufm.4 \ + ufoma.4 \ + uftdi.4 \ + ugen.4 \ + uhci.4 \ + uhid.4 \ + uhso.4 \ + uipaq.4 \ + ukbd.4 \ + uled.4 \ + ulpt.4 \ + umass.4 \ + umcs.4 \ + umct.4 \ + umodem.4 \ + ums.4 \ + unix.4 \ + upgt.4 \ + uplcom.4 \ + ural.4 \ + urio.4 \ + urndis.4 \ + ${_urtw.4} \ + urtwn.4 \ + urtwnfw.4 \ + usb.4 \ + usb_template.4 \ + usb_quirk.4 \ + uslcom.4 \ + utopia.4 \ + uvisor.4 \ + uvscom.4 \ + +MLINKS+=u3g.4 u3gstub.4 +MLINKS+=uath.4 if_uath.4 +MLINKS+=udav.4 if_udav.4 +MLINKS+=upgt.4 if_upgt.4 +MLINKS+=ural.4 if_ural.4 +MLINKS+=urndis.4 if_urndis.4 +MLINKS+=${_urtw.4} ${_if_urtw.4} +.endif + .include Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/share/man/man9/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + MAN= accept_filter.9 \ accf_data.9 \ accf_dns.9 \ @@ -270,7 +272,6 @@ MAN= accept_filter.9 \ uidinfo.9 \ uio.9 \ unr.9 \ - usbdi.9 \ utopia.9 \ vaccess.9 \ vaccess_acl_nfs4.9 \ @@ -1408,6 +1409,9 @@ MLINKS+=uidinfo.9 uifind.9 \ uidinfo.9 uihold.9 MLINKS+=uio.9 uiomove.9 \ uio.9 uiomove_nofault.9 + +.if ${MK_USB} != "no" +MAN+= usbdi.9 MLINKS+=usbdi.9 usbd_do_request.9 \ usbdi.9 usbd_do_request_flags.9 \ usbdi.9 usbd_errstr.9 \ @@ -1459,6 +1463,7 @@ MLINKS+=usbdi.9 usbd_do_request.9 \ usbdi.9 usb_fifo_reset.9 \ usbdi.9 usb_fifo_softc.9 \ usbdi.9 usb_fifo_wakeup.9 +.endif MLINKS+=vcount.9 count_dev.9 MLINKS+=vfsconf.9 vfs_modevent.9 \ vfsconf.9 vfs_register.9 \ Modified: stable/10/share/misc/Makefile ============================================================================== --- stable/10/share/misc/Makefile Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/share/misc/Makefile Tue Mar 24 06:55:08 2015 (r280419) @@ -1,15 +1,22 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/8/93 # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../sys/dev/usb FILES= ascii birthtoken bsd-family-tree committers-doc.dot committers-ports.dot \ committers-src.dot eqnchar flowers init.ee \ iso3166 iso639 latin1 man.template mdoc.template operator pci_vendors \ - scsi_modes usb_hid_usages usbdevs \ + scsi_modes \ organization.dot NO_OBJ= FILESDIR= ${BINDIR}/misc +.if ${MK_USB} != "no" +FILES+= usb_hid_usages +FILES+= usbdevs +.endif + .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 24 06:14:27 2015 (r280418) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 24 06:55:08 2015 (r280419) @@ -4861,8 +4861,357 @@ OLD_FILES+=usr/sbin/unbound-control-setu .endif .if ${MK_USB} == no +OLD_FILES+=etc/devd/uath.conf OLD_FILES+=etc/devd/uauth.conf +OLD_FILES+=etc/devd/ulpt.conf OLD_FILES+=etc/devd/usb.conf +OLD_FILES+=usr/bin/usbhidaction +OLD_FILES+=usr/bin/usbhidctl +OLD_FILES+=usr/include/libusb.h +OLD_FILES+=usr/include/libusb20.h +OLD_FILES+=usr/include/libusb20_desc.h +OLD_FILES+=usr/include/usb.h +OLD_FILES+=usr/include/usbhid.h +OLD_FILES+=usr/lib/libusb.a +OLD_FILES+=usr/lib/libusb.so +OLD_LIBS+=usr/lib/libusb.so.3 +OLD_FILES+=usr/lib/libusb_p.a +OLD_FILES+=usr/lib/libusbhid.a +OLD_FILES+=usr/lib/libusbhid.so +OLD_LIBS+=usr/lib/libusbhid.so.4 +OLD_FILES+=usr/lib/libusbhid_p.a +OLD_FILES+=usr/lib32/libusb.a +OLD_FILES+=usr/lib32/libusb.so +OLD_LIBS+=usr/lib32/libusb.so.3 +OLD_FILES+=usr/lib32/libusb_p.a +OLD_FILES+=usr/lib32/libusbhid.a +OLD_FILES+=usr/lib32/libusbhid.so +OLD_LIBS+=usr/lib32/libusbhid.so.4 +OLD_FILES+=usr/lib32/libusbhid_p.a +OLD_FILES+=usr/libdata/pkgconfig/libusb-0.1.pc +OLD_FILES+=usr/libdata/pkgconfig/libusb-1.0.pc +OLD_FILES+=usr/libdata/pkgconfig/libusb-2.0.pc +OLD_FILES+=usr/sbin/uathload +OLD_FILES+=usr/sbin/uhsoctl +OLD_FILES+=usr/sbin/usbconfig +OLD_FILES+=usr/sbin/usbdump +OLD_FILES+=usr/share/examples/libusb20/Makefile +OLD_FILES+=usr/share/examples/libusb20/README +OLD_FILES+=usr/share/examples/libusb20/bulk.c +OLD_FILES+=usr/share/examples/libusb20/control.c +OLD_FILES+=usr/share/examples/libusb20/util.c +OLD_FILES+=usr/share/examples/libusb20/util.h +OLD_DIRS+=usr/share/examples/libusb20 +OLD_FILES+=usr/share/man/man1/uhsoctl.1.gz +OLD_FILES+=usr/share/man/man1/usbhidaction.1.gz +OLD_FILES+=usr/share/man/man1/usbhidctl.1.gz +OLD_FILES+=usr/share/man/man3/hid_dispose_report_desc.3.gz +OLD_FILES+=usr/share/man/man3/hid_end_parse.3.gz +OLD_FILES+=usr/share/man/man3/hid_get_data.3.gz +OLD_FILES+=usr/share/man/man3/hid_get_item.3.gz +OLD_FILES+=usr/share/man/man3/hid_get_report_desc.3.gz +OLD_FILES+=usr/share/man/man3/hid_init.3.gz +OLD_FILES+=usr/share/man/man3/hid_locate.3.gz +OLD_FILES+=usr/share/man/man3/hid_report_size.3.gz +OLD_FILES+=usr/share/man/man3/hid_set_data.3.gz +OLD_FILES+=usr/share/man/man3/hid_start_parse.3.gz +OLD_FILES+=usr/share/man/man3/hid_usage_in_page.3.gz +OLD_FILES+=usr/share/man/man3/hid_usage_page.3.gz +OLD_FILES+=usr/share/man/man3/libusb.3.gz +OLD_FILES+=usr/share/man/man3/libusb20.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_add_dev_quirk.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_alloc_default.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_dequeue_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_device_foreach.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_enqueue_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_free.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_get_dev_quirk.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_get_quirk_name.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_get_template.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_remove_dev_quirk.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_be_set_template.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_desc_foreach.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_alloc.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_alloc_config.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_check_connected.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_close.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_detach_kernel_driver.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_free.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_address.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_backend_name.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_bus_number.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_config_index.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_debug.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_desc.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_device_desc.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_fd.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_iface_desc.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_info.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_mode.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_parent_address.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_parent_port.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_port_path.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_power_mode.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_power_usage.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_get_speed.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_kernel_driver_active.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_open.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_process.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_req_string_simple_sync.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_req_string_sync.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_request_sync.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_reset.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_set_alt_index.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_set_config_index.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_set_debug.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_set_power_mode.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_dev_wait_process.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_error_name.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_me_decode.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_me_encode.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_me_get_1.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_me_get_2.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_strerror.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_bulk_intr_sync.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_callback_wrapper.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_clear_stall_sync.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_close.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_drain.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_actual_frames.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_actual_length.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_length.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_max_frames.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_max_packet_length.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_max_total_length.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_pointer.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_priv_sc0.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_priv_sc1.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_status.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_get_time_complete.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_open.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_pending.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_buffer.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_callback.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_flags.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_length.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_priv_sc0.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_priv_sc1.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_timeout.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_set_total_frames.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_setup_bulk.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_setup_control.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_setup_intr.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_setup_isoc.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_start.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_stop.3.gz +OLD_FILES+=usr/share/man/man3/libusb20_tr_submit.3.gz +OLD_FILES+=usr/share/man/man3/libusb_alloc_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_attach_kernel_driver.3.gz +OLD_FILES+=usr/share/man/man3/libusb_bulk_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_cancel_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_check_connected.3.gz +OLD_FILES+=usr/share/man/man3/libusb_claim_interface.3.gz +OLD_FILES+=usr/share/man/man3/libusb_clear_halt.3.gz +OLD_FILES+=usr/share/man/man3/libusb_close.3.gz +OLD_FILES+=usr/share/man/man3/libusb_control_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_detach_kernel_driver.3.gz +OLD_FILES+=usr/share/man/man3/libusb_detach_kernel_driver_np.3.gz +OLD_FILES+=usr/share/man/man3/libusb_error_name.3.gz +OLD_FILES+=usr/share/man/man3/libusb_event_handler_active.3.gz +OLD_FILES+=usr/share/man/man3/libusb_event_handling_ok.3.gz +OLD_FILES+=usr/share/man/man3/libusb_exit.3.gz +OLD_FILES+=usr/share/man/man3/libusb_free_bos_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_free_config_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_free_device_list.3.gz +OLD_FILES+=usr/share/man/man3/libusb_free_ss_endpoint_comp.3.gz +OLD_FILES+=usr/share/man/man3/libusb_free_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_active_config_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_bus_number.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_config_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_config_descriptor_by_value.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_configuration.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_device_address.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_device_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_device_list.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_device_speed.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_driver.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_driver_np.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_max_iso_packet_size.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_max_packet_size.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_next_timeout.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_pollfds.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_string_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_get_string_descriptor_ascii.3.gz +OLD_FILES+=usr/share/man/man3/libusb_handle_events.3.gz +OLD_FILES+=usr/share/man/man3/libusb_handle_events_completed.3.gz +OLD_FILES+=usr/share/man/man3/libusb_handle_events_locked.3.gz +OLD_FILES+=usr/share/man/man3/libusb_handle_events_timeout.3.gz +OLD_FILES+=usr/share/man/man3/libusb_handle_events_timeout_completed.3.gz +OLD_FILES+=usr/share/man/man3/libusb_init.3.gz +OLD_FILES+=usr/share/man/man3/libusb_interrupt_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_kernel_driver_active.3.gz +OLD_FILES+=usr/share/man/man3/libusb_lock_event_waiters.3.gz +OLD_FILES+=usr/share/man/man3/libusb_lock_events.3.gz +OLD_FILES+=usr/share/man/man3/libusb_open.3.gz +OLD_FILES+=usr/share/man/man3/libusb_open_device_with_vid_pid.3.gz +OLD_FILES+=usr/share/man/man3/libusb_parse_bos_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/libusb_parse_ss_endpoint_comp.3.gz +OLD_FILES+=usr/share/man/man3/libusb_ref_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb_release_interface.3.gz +OLD_FILES+=usr/share/man/man3/libusb_reset_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb_set_configuration.3.gz +OLD_FILES+=usr/share/man/man3/libusb_set_debug.3.gz +OLD_FILES+=usr/share/man/man3/libusb_set_interface_alt_setting.3.gz +OLD_FILES+=usr/share/man/man3/libusb_set_pollfd_notifiers.3.gz +OLD_FILES+=usr/share/man/man3/libusb_strerror.3.gz +OLD_FILES+=usr/share/man/man3/libusb_submit_transfer.3.gz +OLD_FILES+=usr/share/man/man3/libusb_try_lock_events.3.gz +OLD_FILES+=usr/share/man/man3/libusb_unlock_event_waiters.3.gz +OLD_FILES+=usr/share/man/man3/libusb_unlock_events.3.gz +OLD_FILES+=usr/share/man/man3/libusb_unref_device.3.gz +OLD_FILES+=usr/share/man/man3/libusb_wait_for_event.3.gz +OLD_FILES+=usr/share/man/man3/libusbhid.3.gz +OLD_FILES+=usr/share/man/man3/usb.3.gz +OLD_FILES+=usr/share/man/man3/usb_bulk_read.3.gz +OLD_FILES+=usr/share/man/man3/usb_bulk_write.3.gz +OLD_FILES+=usr/share/man/man3/usb_check_connected.3.gz +OLD_FILES+=usr/share/man/man3/usb_claim_interface.3.gz +OLD_FILES+=usr/share/man/man3/usb_clear_halt.3.gz +OLD_FILES+=usr/share/man/man3/usb_close.3.gz +OLD_FILES+=usr/share/man/man3/usb_control_msg.3.gz +OLD_FILES+=usr/share/man/man3/usb_destroy_configuration.3.gz +OLD_FILES+=usr/share/man/man3/usb_device.3.gz +OLD_FILES+=usr/share/man/man3/usb_fetch_and_parse_descriptors.3.gz +OLD_FILES+=usr/share/man/man3/usb_find_busses.3.gz +OLD_FILES+=usr/share/man/man3/usb_find_devices.3.gz +OLD_FILES+=usr/share/man/man3/usb_get_busses.3.gz +OLD_FILES+=usr/share/man/man3/usb_get_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/usb_get_descriptor_by_endpoint.3.gz +OLD_FILES+=usr/share/man/man3/usb_get_string.3.gz +OLD_FILES+=usr/share/man/man3/usb_get_string_simple.3.gz +OLD_FILES+=usr/share/man/man3/usb_init.3.gz +OLD_FILES+=usr/share/man/man3/usb_interrupt_read.3.gz +OLD_FILES+=usr/share/man/man3/usb_interrupt_write.3.gz +OLD_FILES+=usr/share/man/man3/usb_open.3.gz +OLD_FILES+=usr/share/man/man3/usb_parse_configuration.3.gz +OLD_FILES+=usr/share/man/man3/usb_parse_descriptor.3.gz +OLD_FILES+=usr/share/man/man3/usb_release_interface.3.gz +OLD_FILES+=usr/share/man/man3/usb_reset.3.gz +OLD_FILES+=usr/share/man/man3/usb_resetep.3.gz +OLD_FILES+=usr/share/man/man3/usb_set_altinterface.3.gz +OLD_FILES+=usr/share/man/man3/usb_set_configuration.3.gz +OLD_FILES+=usr/share/man/man3/usb_set_debug.3.gz +OLD_FILES+=usr/share/man/man3/usb_strerror.3.gz +OLD_FILES+=usr/share/man/man3/usbhid.3.gz +OLD_FILES+=usr/share/man/man4/u3g.4.gz +OLD_FILES+=usr/share/man/man4/u3gstub.4.gz +OLD_FILES+=usr/share/man/man4/uark.4.gz +OLD_FILES+=usr/share/man/man4/uart.4.gz +OLD_FILES+=usr/share/man/man4/uath.4.gz +OLD_FILES+=usr/share/man/man4/ubsa.4.gz +OLD_FILES+=usr/share/man/man4/ubsec.4.gz +OLD_FILES+=usr/share/man/man4/ubser.4.gz +OLD_FILES+=usr/share/man/man4/ubtbcmfw.4.gz +OLD_FILES+=usr/share/man/man4/uchcom.4.gz +OLD_FILES+=usr/share/man/man4/ucom.4.gz +OLD_FILES+=usr/share/man/man4/ucycom.4.gz +OLD_FILES+=usr/share/man/man4/udav.4.gz +OLD_FILES+=usr/share/man/man4/udbp.4.gz +OLD_FILES+=usr/share/man/man4/udp.4.gz +OLD_FILES+=usr/share/man/man4/udplite.4.gz +OLD_FILES+=usr/share/man/man4/uep.4.gz +OLD_FILES+=usr/share/man/man4/ufm.4.gz +OLD_FILES+=usr/share/man/man4/ufoma.4.gz +OLD_FILES+=usr/share/man/man4/uftdi.4.gz +OLD_FILES+=usr/share/man/man4/ugen.4.gz +OLD_FILES+=usr/share/man/man4/uhci.4.gz +OLD_FILES+=usr/share/man/man4/uhid.4.gz +OLD_FILES+=usr/share/man/man4/uhso.4.gz +OLD_FILES+=usr/share/man/man4/uipaq.4.gz +OLD_FILES+=usr/share/man/man4/ukbd.4.gz +OLD_FILES+=usr/share/man/man4/uled.4.gz +OLD_FILES+=usr/share/man/man4/ulpt.4.gz +OLD_FILES+=usr/share/man/man4/umass.4.gz +OLD_FILES+=usr/share/man/man4/umcs.4.gz +OLD_FILES+=usr/share/man/man4/umct.4.gz +OLD_FILES+=usr/share/man/man4/umodem.4.gz +OLD_FILES+=usr/share/man/man4/umoscom.4.gz +OLD_FILES+=usr/share/man/man4/ums.4.gz +OLD_FILES+=usr/share/man/man4/unix.4.gz +OLD_FILES+=usr/share/man/man4/upgt.4.gz +OLD_FILES+=usr/share/man/man4/uplcom.4.gz +OLD_FILES+=usr/share/man/man4/ural.4.gz +OLD_FILES+=usr/share/man/man4/urio.4.gz +OLD_FILES+=usr/share/man/man4/urndis.4.gz +OLD_FILES+=usr/share/man/man4/urtw.4.gz +OLD_FILES+=usr/share/man/man4/urtwn.4.gz +OLD_FILES+=usr/share/man/man4/urtwnfw.4.gz +OLD_FILES+=usr/share/man/man4/usb.4.gz +OLD_FILES+=usr/share/man/man4/usb_quirk.4.gz +OLD_FILES+=usr/share/man/man4/usb_template.4.gz +OLD_FILES+=usr/share/man/man4/usfs.4.gz +OLD_FILES+=usr/share/man/man4/uslcom.4.gz +OLD_FILES+=usr/share/man/man4/utopia.4.gz +OLD_FILES+=usr/share/man/man4/uvisor.4.gz +OLD_FILES+=usr/share/man/man4/uvscom.4.gz +OLD_FILES+=usr/share/man/man8/uathload.8.gz +OLD_FILES+=usr/share/man/man8/usbconfig.8.gz +OLD_FILES+=usr/share/man/man8/usbdump.8.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_alloc_buffer.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_attach.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_detach.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_free_buffer.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_get_data.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_get_data_buffer.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_get_data_error.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_get_data_linear.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_put_bytes_max.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_put_data.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_put_data_buffer.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_put_data_error.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_put_data_linear.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_reset.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_softc.9.gz +OLD_FILES+=usr/share/man/man9/usb_fifo_wakeup.9.gz +OLD_FILES+=usr/share/man/man9/usbd_do_request.9.gz +OLD_FILES+=usr/share/man/man9/usbd_do_request_flags.9.gz +OLD_FILES+=usr/share/man/man9/usbd_errstr.9.gz +OLD_FILES+=usr/share/man/man9/usbd_lookup_id_by_info.9.gz +OLD_FILES+=usr/share/man/man9/usbd_lookup_id_by_uaa.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_clear_stall.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_drain.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_pending.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_poll.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_setup.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_start.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_stop.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_submit.9.gz +OLD_FILES+=usr/share/man/man9/usbd_transfer_unsetup.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_clr_flag.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_frame_data.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_frame_len.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_get_frame.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_get_priv.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_is_stalled.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_max_framelen.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_max_frames.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_max_len.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_flag.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_frame_data.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_frame_len.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_frame_offset.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_frames.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_interval.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_priv.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_stall.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_set_timeout.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_softc.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_state.9.gz +OLD_FILES+=usr/share/man/man9/usbd_xfer_status.9.gz +OLD_FILES+=usr/share/man/man9/usbdi.9.gz +OLD_FILES+=usr/share/misc/usb_hid_usages +OLD_FILES+=usr/share/misc/usbdevs .endif .if ${MK_UTMPX} == no From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 06:59:42 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BF7C3B0; Tue, 24 Mar 2015 06:59:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76CD7648; Tue, 24 Mar 2015 06:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O6xgSg084417; Tue, 24 Mar 2015 06:59:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O6xg2f084416; Tue, 24 Mar 2015 06:59:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503240659.t2O6xg2f084416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 06:59: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: r280420 - stable/10/etc 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.18-1 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: Tue, 24 Mar 2015 06:59:42 -0000 Author: ngie Date: Tue Mar 24 06:59:41 2015 New Revision: 280420 URL: https://svnweb.freebsd.org/changeset/base/280420 Log: Forced commit to note that the previous commit to this file included the following MFC as well: MFC 278251: Honor the following flags for items that can be conditionalized out of the build/install without disrupting other dependent services (see r278249, et al): - MK_LOCATE - MK_MAN - MK_NLS - MK_OPENSSL - MK_PKGBOOTSTRAP - MK_SENDMAIL Additional flags need to be handled in etc/Makefile, but it requires refactoring the relevant scripts in etc/rc.d/* MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/Makefile Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Tue Mar 24 06:55:08 2015 (r280419) +++ stable/10/etc/Makefile Tue Mar 24 06:59:41 2015 (r280420) @@ -52,7 +52,7 @@ BIN1= crontab \ shells \ sysctl.conf \ syslog.conf \ - termcap.small + termcap.small \ .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" BIN1+= libmap32.conf From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 07:44:00 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9790FBA8; Tue, 24 Mar 2015 07:44:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77E96B8C; Tue, 24 Mar 2015 07:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O7i0R9007329; Tue, 24 Mar 2015 07:44:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O7hxtg007300; Tue, 24 Mar 2015 07:43:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503240743.t2O7hxtg007300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 07:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280422 - in stable/10: etc/rc.d tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 24 Mar 2015 07:44:00 -0000 Author: ngie Date: Tue Mar 24 07:43:58 2015 New Revision: 280422 URL: https://svnweb.freebsd.org/changeset/base/280422 Log: MFC r271893,r271895,r272043,r278249,r278282,r278466: r271893: Don't install /etc/rc.d/rwho unless MK_RCMDS == yes Sponsored by: EMC / Isilon Storage Division r271895: Don't install /etc/rc.d/ftp-proxy unless MK_PF == yes Sponsored by: EMC / Isilon Storage Division r272043: Don't install /etc/rc.d/keyserv unless MK_OPENSSL == yes Sponsored by: EMC / Isilon Storage Division r278249: Honor the following flags with the following rc.d scripts for services that can be easily decoupled from the boot process without disrupting other services - MK_APM && MK_ACPI: powerd - MK_BOOTPARAMD: bootparams - MK_FTP: ftpd - MK_INETD: inetd - MK_LEGACY_CONSOLE: moused, syscons - MK_MAIL: othermta - MK_NS_CACHING: nscd - MK_NTP: ntpd (ntpdate is required by other services and can't be easily conditionalized -- yet..) - MK_ROUTED: routed - MK_SENDMAIL: sendmail - MK_TIMED: timed - MK_VI: virecover Sponsored by: EMC / Isilon Storage Division r278282: Use FILES+= idiom instead of _inetd when referencing inetd rc.d script This was a discrepancy between ^/projects/building-blocks and ^/head that I didn't resolve before committing the change to ^/head Pointyhat to: me Reported by: jhb Sponsored by: EMC / Isilon Storage Division r278466: Remove explicit routing/sendmail rc.d inclusion in FILES Reported by: Guy Yur Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/rc.d/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/Makefile ============================================================================== --- stable/10/etc/rc.d/Makefile Tue Mar 24 07:11:54 2015 (r280421) +++ stable/10/etc/rc.d/Makefile Tue Mar 24 07:43:58 2015 (r280422) @@ -18,7 +18,6 @@ FILES= DAEMON \ auditdistd \ bgfsck \ ${_bluetooth} \ - bootparams \ bridge \ ${_bthidd} \ cleanvar \ @@ -34,8 +33,6 @@ FILES= DAEMON \ dumpon \ faith \ fsck \ - ftp-proxy \ - ftpd \ gbde \ geli \ geli2 \ @@ -45,7 +42,6 @@ FILES= DAEMON \ hostid \ hostid_save \ hostname \ - inetd \ initrandom \ ip6addrctl \ ipfilter \ @@ -57,7 +53,6 @@ FILES= DAEMON \ ${_ipxrouted} \ ${_kadmind} \ ${_kdc} \ - keyserv \ ${_kfd} \ kld \ kldxref \ @@ -74,7 +69,6 @@ FILES= DAEMON \ mdconfig \ mdconfig2 \ mountd \ - moused \ mroute6d \ mrouted \ msgs \ @@ -90,15 +84,12 @@ FILES= DAEMON \ nisdomain \ ${_nscd} \ nsswitch \ - ntpd \ ntpdate \ ${_opensm} \ - othermta \ pf \ pflog \ pfsync \ postrandom \ - powerd \ ppp \ pppoed \ pwcheck \ @@ -110,16 +101,13 @@ FILES= DAEMON \ rfcomm_pppd_server \ root \ route6d \ - routed \ routing \ rpcbind \ rtadvd \ rtsold \ - rwho \ savecore \ sdpd \ securelevel \ - sendmail \ serial \ sppp \ ${_sshd} \ @@ -129,10 +117,8 @@ FILES= DAEMON \ stf \ swap \ swaplate \ - syscons \ sysctl \ syslogd \ - timed \ tmp \ ${_ubthidhci} \ ugidfw \ @@ -158,6 +144,10 @@ FILES+= accounting FILES+= power_profile .endif +.if ${MK_ACPI} != "no" || ${MK_APM} != "no" +FILES+= powerd +.endif + .if ${MK_AMD} != "no" FILES+= amd .endif @@ -180,6 +170,10 @@ _hcsecd= hcsecd _ubthidhci= ubthidhci .endif +.if ${MK_BOOTPARAMD} != "no" +FILES+= bootparams +.endif + .if ${MK_BSNMP} != "no" FILES+= bsnmpd .endif @@ -188,6 +182,10 @@ FILES+= bsnmpd FILES+= ccd .endif +.if ${MK_FTP} != "no" +FILES+= ftpd +.endif + .if ${MK_HAST} != "no" FILES+= hastd .endif @@ -196,6 +194,10 @@ FILES+= hastd _ipxrouted= ipxrouted .endif +.if ${MK_INETD} != "no" +FILES+= inetd +.endif + .if ${MK_ISCSI} != "no" FILES+= iscsictl FILES+= iscsid @@ -214,22 +216,59 @@ _kfd= kfd _kpasswdd= kpasswdd .endif +.if ${MK_LEGACY_CONSOLE} != "no" +FILES+= moused +FILES+= syscons +.endif + .if ${MK_LPR} != "no" FILES+= lpd .endif +.if ${MK_MAIL} != "no" +FILES+= othermta +.endif + .if ${MK_NS_CACHING} != "no" _nscd= nscd .endif +.if ${MK_NTP} != "no" +FILES+= ntpd +.endif + .if ${MK_OFED} != "no" _opensm= opensm .endif +.if ${MK_OPENSSL} != "no" +FILES+= keyserv +.endif + .if ${MK_OPENSSH} != "no" _sshd= sshd .endif +.if ${MK_PF} != "no" +FILES+= ftp-proxy +.endif + +.if ${MK_RCMDS} != "no" +FILES+= rwho +.endif + +.if ${MK_ROUTED} != "no" +FILES+= routed +.endif + +.if ${MK_SENDMAIL} != "no" +FILES+= sendmail +.endif + +.if ${MK_TIMED} != "no" +FILES+= timed +.endif + .if ${MK_UNBOUND} != "no" _unbound= local_unbound .endif Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 24 07:11:54 2015 (r280421) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 24 07:43:58 2015 (r280422) @@ -3692,9 +3692,9 @@ OLD_FILES+=usr/libexec/ssh-pkcs11-helper OLD_FILES+=usr/sbin/sshd .endif -#.if ${MK_OPENSSL} == no -# to be filled in -#.endif +.if ${MK_OPENSSL} == no +OLD_FILES+=etc/rc.d/keyserv +.endif .if ${MK_PC_SYSINSTALL} == no # backend-partmanager @@ -3788,6 +3788,7 @@ OLD_DIRS+=usr/share/examples/pc-sysinsta .if ${MK_PF} == no OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os +OLD_FILES+=etc/rc.d/ftp-proxy OLD_FILES+=sbin/pfctl OLD_FILES+=sbin/pflogd OLD_FILES+=usr/libexec/tftp-proxy @@ -3975,6 +3976,7 @@ OLD_FILES+=usr/lib/private/libssh_p.a .if ${MK_RCMDS} == no OLD_FILES+=bin/rcp +OLD_FILES+=etc/rc.d/rwho OLD_FILES+=etc/periodic/daily/140.clean-rwho OLD_FILES+=etc/periodic/daily/430.status-rwho OLD_FILES+=rescue/rcp From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 08:18:25 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EC39319; Tue, 24 Mar 2015 08:18:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 898E5E64; Tue, 24 Mar 2015 08:18:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O8IPYl022068; Tue, 24 Mar 2015 08:18:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O8IPlJ022067; Tue, 24 Mar 2015 08:18:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503240818.t2O8IPlJ022067@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Mar 2015 08:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280424 - stable/10/sys/x86/iommu 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.18-1 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: Tue, 24 Mar 2015 08:18:25 -0000 Author: kib Date: Tue Mar 24 08:18:24 2015 New Revision: 280424 URL: https://svnweb.freebsd.org/changeset/base/280424 Log: MFC r280195: When inserting new entry into the address map, ensure that not only next entry does not intersect with the tail of the new entry, but also that previous entry is also before new entry start. Modified: stable/10/sys/x86/iommu/intel_gas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_gas.c ============================================================================== --- stable/10/sys/x86/iommu/intel_gas.c Tue Mar 24 08:06:45 2015 (r280423) +++ stable/10/sys/x86/iommu/intel_gas.c Tue Mar 24 08:18:24 2015 (r280424) @@ -366,7 +366,8 @@ dmar_gas_match_insert(struct dmar_gas_ma next = RB_NEXT(dmar_gas_entries_tree, &a->ctx->rb_root, prev); KASSERT(next->start >= a->entry->end && - next->start - a->entry->start >= a->size, + next->start - a->entry->start >= a->size && + prev->end <= a->entry->end, ("dmar_gas_match_insert hole failed %p prev (%jx, %jx) " "free_after %jx next (%jx, %jx) entry (%jx, %jx)", a->ctx, (uintmax_t)prev->start, (uintmax_t)prev->end, From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 08:21:37 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F405468; Tue, 24 Mar 2015 08:21:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0D1F07; Tue, 24 Mar 2015 08:21:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O8LbkQ025620; Tue, 24 Mar 2015 08:21:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O8LbNI025600; Tue, 24 Mar 2015 08:21:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503240821.t2O8LbNI025600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Mar 2015 08:21: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: r280425 - stable/10/sys/x86/iommu 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.18-1 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: Tue, 24 Mar 2015 08:21:37 -0000 Author: kib Date: Tue Mar 24 08:21:36 2015 New Revision: 280425 URL: https://svnweb.freebsd.org/changeset/base/280425 Log: MFC r280196: Recheck that boundary is not crossed after the move to satisfy boundary restriction. Modified: stable/10/sys/x86/iommu/intel_gas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_gas.c ============================================================================== --- stable/10/sys/x86/iommu/intel_gas.c Tue Mar 24 08:18:24 2015 (r280424) +++ stable/10/sys/x86/iommu/intel_gas.c Tue Mar 24 08:21:36 2015 (r280425) @@ -327,13 +327,15 @@ dmar_gas_match_one(struct dmar_gas_match start = roundup2(bs, a->common->alignment); /* DMAR_PAGE_SIZE to create gap after new entry. */ if (start + a->size + DMAR_PAGE_SIZE <= prev->end + prev->free_after && - start + a->size <= end) { + start + a->size <= end && dmar_test_boundary(start, a->size, + a->common->boundary)) { a->entry->start = start; return (true); } /* - * Not enough space to align at boundary, but allowed to split. + * Not enough space to align at the requested boundary, or + * boundary is smaller than the size, but allowed to split. * We already checked that start + size does not overlap end. * * XXXKIB. It is possible that bs is exactly at the start of From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 08:24:56 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96D2D705; Tue, 24 Mar 2015 08:24:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 818E0F32; Tue, 24 Mar 2015 08:24:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O8OuPI026457; Tue, 24 Mar 2015 08:24:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O8Ouap026456; Tue, 24 Mar 2015 08:24:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503240824.t2O8Ouap026456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 08:24: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: r280427 - stable/10/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 24 Mar 2015 08:24:56 -0000 Author: ngie Date: Tue Mar 24 08:24:55 2015 New Revision: 280427 URL: https://svnweb.freebsd.org/changeset/base/280427 Log: MFC r278204: Sort the entries by build knob, then MACHINE_ARCH like other areas of the tree Sponsored by: EMC / Isilon Storage Division Modified: stable/10/include/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Tue Mar 24 08:22:48 2015 (r280426) +++ stable/10/include/Makefile Tue Mar 24 08:24:55 2015 (r280427) @@ -58,14 +58,10 @@ LSUBDIRS= cam/ata cam/scsi \ security/mac_mls security/mac_partition \ ufs/ffs ufs/ufs -.if ${MK_USB} != "no" -LSUBDIRS+= dev/usb -.endif - LSUBSUBDIRS= dev/mpt/mpilib -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" -_dev_powermac_nvram= dev/powermac_nvram +.if ${MK_BLUETOOTH} != "no" +LSUBSUBDIRS+= netgraph/bluetooth/include .endif .if ${MK_GPIB} != "no" @@ -81,10 +77,6 @@ INCS+= gssapi.h INCS+= hesiod.h .endif -.if ${MK_BLUETOOTH} != "no" -LSUBSUBDIRS+= netgraph/bluetooth/include -.endif - # XXX unconditionally needed by #.if ${MK_IPX} != "no" _netipx= netipx @@ -94,7 +86,14 @@ _netipx= netipx .if ${MK_ICONV} == "yes" INCS+= iconv.h .endif - + +.if ${MK_USB} != "no" +LSUBDIRS+= dev/usb +.endif + +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +_dev_powermac_nvram= dev/powermac_nvram +.endif # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 14:36:15 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A380CF6; Tue, 24 Mar 2015 14:36:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71673B7; Tue, 24 Mar 2015 14:36:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OEaFaO004000; Tue, 24 Mar 2015 14:36:15 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OEaBW4003982; Tue, 24 Mar 2015 14:36:11 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503241436.t2OEaBW4003982@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 24 Mar 2015 14:36: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: r280438 - in stable/10: contrib/groff/tmac lib lib/libmt rescue/rescue share/man/man4 share/mk sys/cam/scsi sys/sys usr.bin/mt 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.18-1 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: Tue, 24 Mar 2015 14:36:15 -0000 Author: ken Date: Tue Mar 24 14:36:10 2015 New Revision: 280438 URL: https://svnweb.freebsd.org/changeset/base/280438 Log: MFC sa(4) and mt(1) improvements. This includes these changes: 279219, 279229, 279261, 279534, 279570, 280230, 280231. In addition, bump __FreeBSD_version for the addition of the new mtio(4) / sa(4) ioctls. Thanks to Dan Langille, Harald Schmalzbauer and Rudolf Cejka for spending a significant amount of time and effort testing these changes. ------------------------------------------------------------------------ r279219 | ken | 2015-02-23 14:59:30 -0700 (Mon, 23 Feb 2015) | 282 lines Significant upgrades to sa(4) and mt(1). The primary focus of these changes is to modernize FreeBSD's tape infrastructure so that we can take advantage of some of the features of modern tape drives and allow support for LTFS. Significant changes and new features include: o sa(4) driver status and parameter information is now exported via an XML structure. This will allow for changes and improvements later on that will not break userland applications. The old MTIOCGET status ioctl remains, so applications using the existing interface will not break. o 'mt status' now reports drive-reported tape position information as well as the previously available calculated tape position information. These numbers will be different at times, because the drive-reported block numbers are relative to BOP (Beginning of Partition), but the block numbers calculated previously via sa(4) (and still provided) are relative to the last filemark. Both numbers are now provided. 'mt status' now also shows the drive INQUIRY information, serial number and any position flags (BOP, EOT, etc.) provided with the tape position information. 'mt status -v' adds information on the maximum possible I/O size, and the underlying values used to calculate it. o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed. The extra devices were originally added as place holders for density-specific device nodes. Some OSes (NetBSD, NetApp's OnTap and Solaris) have had device nodes that, when you write to them, will automatically select a given density for particular tape drives. This is a convenient way of switching densities, but it was never implemented in FreeBSD. Only the device nodes were there, and that sometimes confused users. For modern tape devices, the density is generally not selectable (e.g. with LTO) or defaults to the highest availble density when the tape is rewritten from BOT (e.g. TS11X0). So, for most users, density selection won't be necessary. If they do need to select the density, it is easy enough to use 'mt density' to change it. o Protection information is now supported. This is either a Reed-Solomon CRC or CRC32 that is included at the end of each block read and written. On write, the tape drive verifies the CRC, and on read, the tape drive provides a CRC for the userland application to verify. o New, extensible tape driver parameter get/set interface. o Density reporting information. For drives that support it, 'mt getdensity' will show detailed information on what formats the tape drive supports, and what formats the tape drive supports. o Some mt(1) functionality moved into a new mt(3) library so that external applications can reuse the code. o The new mt(3) library includes helper routines to aid in parsing the XML output of the sa(4) driver, and build a tree of driver metadata. o Support for the MTLOAD (load a tape in the drive) and MTWEOFI (write filemark immediate) ioctls needed by IBM's LTFS implementation. o Improve device departure behavior for the sa(4) driver. The previous implementation led to hangs when the device was open. o This has been tested on the following types of drives: IBM TS1150 IBM TS1140 IBM LTO-6 IBM LTO-5 HP LTO-2 Seagate DDS-4 Quantum DLT-4000 Exabyte 8505 Sony DDS-2 contrib/groff/tmac/doc-syms, share/mk/bsd.libnames.mk, lib/Makefile, Add libmt. lib/libmt/Makefile, lib/libmt/mt.3, lib/libmt/mtlib.c, lib/libmt/mtlib.h, New mt(3) library that contains functions moved from mt(1) and new functions needed to interact with the updated sa(4) driver. This includes XML parser helper functions that application writers can use when writing code to query tape parameters. rescue/rescue/Makefile: Add -lmt to CRUNCH_LIBS. src/share/man/man4/mtio.4 Clarify this man page a bit, and since it contains what is essentially the mtio.h header file, add new ioctls and structure definitions from mtio.h. src/share/man/man4/sa.4 Update BUGS and maintainer section. sys/cam/scsi/scsi_all.c, sys/cam/scsi/scsi_all.h: Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building functions. sys/cam/scsi/scsi_sa.c sys/cam/scsi/scsi_sa.h Many tape driver changes, largely outlined above. Increase the sa(4) driver read/write timeout from 4 to 32 minutes. This is based on the recommended values for IBM LTO 5/6 drives. This may also avoid timeouts for other tape hardware that can take a long time to do retries and error recovery. Longer term, a better way to handle this is to ask the drive for recommended timeout values using the REPORT SUPPORTED OPCODES command. Modern IBM and Oracle tape drives at least support that command, and it would allow for more accurate timeout values. Add XML status generation. This is done with a series of macros to eliminate as much duplicate code as possible. The new XML-based status values are reported through the new MTIOCEXTGET ioctl. Add XML driver parameter reporting, using the new MTIOCPARAMGET ioctl. Add a new driver parameter setting interface, using the new MTIOCPARAMSET and MTIOCSETLIST ioctls. Add a new MTIOCRBLIM ioctl to get block limits information. Add CCB/CDB building routines scsi_locate_16, scsi_locate_10, and scsi_read_position_10(). scsi_locate_10 implements the LOCATE command, as does the existing scsi_set_position() command. It just supports additional arguments and features. If/when we figure out a good way to provide backward compatibility for older applications using the old function API, we can just revamp scsi_set_position(). The same goes for scsi_read_position_10() and the existing scsi_read_position() function. Revamp sasetpos() to take the new mtlocate structure as an argument. It now will use either scsi_locate_10() or scsi_locate_16(), depending upon the arguments the user supplies. As before, once we change position we don't have a clear idea of what the current logical position of the tape drive is. For tape drives that support long form position data, we read the current position and store that for later reporting after changing the position. This should help applications like Bacula speed tape access under FreeBSD once they are modified to support the new ioctls. Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all drives that report SCSI-2 or older, as well as drives that report an Illegal Request type error for READ POSITION with the long format. So we should automatically detect drives that don't support the long form and stop asking for it after an initial try. Add a partition number to the sa(4) softc. Improve device departure handling. The previous implementation led to hangs when the device was open. If an application had the sa(4) driver open, and attempted to close it after it went away, the cam_periph_release() call in saclose() would cause the periph to get destroyed because that was the last reference to it. Because destroy_dev() was called from the sa(4) driver's cleanup routine (sacleanup()), and would block waiting for the close to happen, a deadlock would result. So instead of calling destroy_dev() from the cleanup routine, call destroy_dev_sched_cb() from saoninvalidate() and wait for the callback. Acquire a reference for devfs in saregister(), and release it in the new sadevgonecb() routine when all devfs devices for the particular sa(4) driver instance are gone. Add a new function, sasetupdev(), to centralize setting per-instance devfs device parameters instead of repeating the code in saregister(). Add an open count to the softc, so we know how many peripheral driver references are a result of open sessions. Add the D_TRACKCLOSE flag to the cdevsw flags so that we get a 1:1 mapping of open to close calls instead of a N:1 mapping. This should be a no-op for everything except the control device, since we don't allow more than one open on non-control devices. However, since we do allow multiple opens on the control device, the combination of the open count and the D_TRACKCLOSE flag should result in an accurate peripheral driver reference count, and an accurate open count. The accurate open count allows us to release all peripheral driver references that are the result of open contexts once we get the callback from devfs. sys/sys/mtio.h: Add a number of new mt(4) ioctls and the requisite data structures. None of the existing interfaces been removed or changed. This includes definitions for the following new ioctls: MTIOCRBLIM /* get block limits */ MTIOCEXTLOCATE /* seek to position */ MTIOCEXTGET /* get tape status */ MTIOCPARAMGET /* get tape params */ MTIOCPARAMSET /* set tape params */ MTIOCSETLIST /* set N params */ usr.bin/mt/Makefile: mt(1) now depends on libmt, libsbuf and libbsdxml. usr.bin/mt/mt.1: Document new mt(1) features and subcommands. usr.bin/mt/mt.c: Implement support for mt(1) subcommands that need to use getopt(3) for their arguments. Implement a new 'mt status' command to replace the old 'mt status' command. The old status command has been renamed 'ostatus'. The new status function uses the MTIOCEXTGET ioctl, and therefore parses the XML data to determine drive status. The -x argument to 'mt status' allows the user to dump out the raw XML reported by the kernel. The new status display is mostly the same as the old status display, except that it doesn't print the redundant density mode information, and it does print the current partition number and position flags. Add a new command, 'mt locate', that will supersede the old 'mt setspos' and 'mt sethpos' commands. 'mt locate' implements all of the functionality of the MTIOCEXTLOCATE ioctl, and allows the user to change the logical position of the tape drive in a number of ways. (Partition, block number, file number, set mark number, end of data.) The immediate bit and the explicit address bits are implemented, but not documented in the man page. Add a new 'mt weofi' command to use the new MTWEOFI ioctl. This allows the user to ask the drive to write a filemark without waiting around for the operation to complete. Add a new 'mt getdensity' command that gets the XML-based tape drive density report from the sa(4) driver and displays it. This uses the SCSI REPORT DENSITY SUPPORT command to get comprehensive information from the tape drive about what formats it is able to read and write. Add a new 'mt protect' command that allows getting and setting tape drive protection information. The protection information is a CRC tacked on to the end of every read/write from and to the tape drive. Sponsored by: Spectra Logic MFC after: 1 month ------------------------------------------------------------------------ ------------------------------------------------------------------------ r279229 | ken | 2015-02-23 22:43:16 -0700 (Mon, 23 Feb 2015) | 5 lines Fix printf format warnings on sparc64 and mips. Sponsored by: Spectra Logic MFC after: 1 month ------------------------------------------------------------------------ ------------------------------------------------------------------------ r279261 | ken | 2015-02-24 21:30:23 -0700 (Tue, 24 Feb 2015) | 23 lines Fix several problems found by Coverity. lib/libmt/mtlib.c: In mt_start_element(), make sure we don't overflow the cur_sb array. CID 1271325 usr.bin/mt/mt.c: In main(), bzero the mt_com structure so that we aren't using any uninitialized stack variables. CID 1271319 In mt_param(), only allow one -s and one -p argument. This will prevent a memory leak caused by overwriting the param_name and/or param_value variables. CID 1271320 and CID 1271322 To make things simpler in mt_param(), make sure there there is only one exit path for the function. Make sure the arguments are explicitly freed. Sponsored by: Spectra Logic Pointed out by: emaste MFC after: 1 month ------------------------------------------------------------------------ ------------------------------------------------------------------------ r279534 | ken | 2015-03-02 11:09:49 -0700 (Mon, 02 Mar 2015) | 18 lines Change the sa(4) driver to check for long position support on SCSI-2 devices. Some older tape devices claim to be SCSI-2, but actually do support long position information. (Long position information includes the current file mark.) For example, the COMPAQ SuperDLT1. So we now only disable the check on SCSI-1 and older devices. sys/cam/scsi/scsi_sa.c: In saregister(), only disable fetching long position information on SCSI-1 and older drives. Update the comment to explain why. Confirmed by: dvl Sponsored by: Spectra Logic MFC after: 3 weeks ------------------------------------------------------------------------ ------------------------------------------------------------------------ r279570 | ken | 2015-03-03 15:49:07 -0700 (Tue, 03 Mar 2015) | 21 lines Add density code for DAT-72, and notes on DAT-160. As it turns out, the density code for DAT-160 (0x48) is the same as for SDLT220. Since the SDLT values are already in the table, we will leave them in place. Thanks to Harald Schmalzbauer for confirming the DAT-72 density code. lib/libmt/mtlib.c: Add DAT-72 density code, and commented out DAT-160 density code. Explain why DAT-160 is commented out. Add notes explaining where the bpi values for these formats came from. usr.bin/mt/mt.1: Add DAT-72 density code, and add a note explaining that the SDLTTapeI(110) density code (0x48) is the same as DAT-160. Sponsored by: Spectra Logic MFC after: 3 weeks ------------------------------------------------------------------------ ------------------------------------------------------------------------ r280230 | ken | 2015-03-18 14:52:34 -0600 (Wed, 18 Mar 2015) | 25 lines Fix a couple of problems in the sa(4) media type reports. The only drives I have discovered so far that support medium type reports are newer HP LTO (LTO-5 and LTO-6) drives. IBM drives only support the density reports. sys/cam/scsi/scsi_sa.h: The number of possible density codes in the medium type report is 9, not 8. This caused problems parsing all of the medium type report after this point in the structure. usr.bin/mt/mt.c: Run the density codes returned in the medium type report through denstostring(), just like the primary and secondary density codes in the density report. This will print the density code in hex, and give a text description if it is available. Thanks to Rudolf Cejka for doing extensive testing with HP LTO drives and Bacula and discovering these problems. Tested by: Rudolf Cejka Sponsored by: Spectra Logic MFC after: 4 days ------------------------------------------------------------------------ ------------------------------------------------------------------------ r280231 | ken | 2015-03-18 14:54:54 -0600 (Wed, 18 Mar 2015) | 16 lines Improve the mt(1) rblim display. The granularity reported by READ BLOCK LIMITS is an exponent, not a byte value. So a granularity of 0 means 2^0, or 1 byte. A granularity of 1 means 2^1, or 2 bytes. Print out the individual block limits on separate lines to improve readability and avoid exceeding 80 columns. usr.bin/mt/mt.c: Fix and improve the 'mt rblim' output. Add a MT_PLURAL() macro so we can print "byte" or "bytes" as appropriate. Sponsored by: Spectra Logic MFC after: 4 days ------------------------------------------------------------------------ Sponsored by: Spectra Logic Added: stable/10/lib/libmt/ - copied from r279219, head/lib/libmt/ Modified: stable/10/contrib/groff/tmac/doc-syms stable/10/lib/Makefile stable/10/lib/libmt/mtlib.c stable/10/rescue/rescue/Makefile stable/10/share/man/man4/mtio.4 stable/10/share/man/man4/sa.4 stable/10/share/mk/bsd.libnames.mk stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cam/scsi/scsi_sa.c stable/10/sys/cam/scsi/scsi_sa.h stable/10/sys/sys/mtio.h stable/10/sys/sys/param.h stable/10/usr.bin/mt/Makefile stable/10/usr.bin/mt/mt.1 stable/10/usr.bin/mt/mt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/groff/tmac/doc-syms ============================================================================== --- stable/10/contrib/groff/tmac/doc-syms Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/contrib/groff/tmac/doc-syms Tue Mar 24 14:36:10 2015 (r280438) @@ -796,6 +796,7 @@ .ds doc-str-Lb-libmd Message Digest (MD4, MD5, etc.) Support Library (libmd, \-lmd) .ds doc-str-Lb-libmemstat Kernel Memory Allocator Statistics Library (libmemstat, \-lmemstat) .ds doc-str-Lb-libmenu Curses Menu Library (libmenu, \-lmenu) +.ds doc-str-Lb-libmt Magnetic Tape Library (libmt, \-lmt) .ds doc-str-Lb-libnetgraph Netgraph User Library (libnetgraph, \-lnetgraph) .ds doc-str-Lb-libnetpgp Netpgp signing, verification, encryption and decryption (libnetpgp, \-lnetpgp) .ds doc-str-Lb-libossaudio OSS Audio Emulation Library (libossaudio, \-lossaudio) Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/lib/Makefile Tue Mar 24 14:36:10 2015 (r280438) @@ -65,6 +65,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libmd \ ${_libmilter} \ ${_libmp} \ + libmt \ ${_libnandfs} \ libnetbsd \ ${_libnetgraph} \ Modified: stable/10/lib/libmt/mtlib.c ============================================================================== --- head/lib/libmt/mtlib.c Mon Feb 23 21:59:30 2015 (r279219) +++ stable/10/lib/libmt/mtlib.c Tue Mar 24 14:36:10 2015 (r280438) @@ -68,7 +68,7 @@ mt_start_element(void *user_data, const return; mtinfo->level++; - if ((u_int)mtinfo->level > (sizeof(mtinfo->cur_sb) / + if ((u_int)mtinfo->level >= (sizeof(mtinfo->cur_sb) / sizeof(mtinfo->cur_sb[0]))) { mtinfo->error = 1; snprintf(mtinfo->error_str, sizeof(mtinfo->error_str), @@ -568,6 +568,15 @@ static struct densities { * * IBM 3592 definitions obtained from second edition of the IBM * System Storage Tape Drive 3592 SCSI Reference (May 25, 2012). + * + * DAT-72 and DAT-160 bpi values taken from "HP StorageWorks DAT160 + * tape drive white paper", dated June 2007. + * + * DAT-160 / SDLT220 density code (0x48) conflict information + * found here: + * + * http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c01065117&sp4ts.oid=429311 + * (Document ID c01065117) */ /*Num. bpmm bpi Reference */ { 0x1, 32, 800, "X3.22-1983" }, @@ -613,6 +622,14 @@ static struct densities { { 0x42, 7398, 187909, "LTO-2" }, { 0x44, 9638, 244805, "LTO-3" }, { 0x46, 12725, 323215, "LTO-4" }, + { 0x47, 6417, 163000, "DAT-72" }, + /* + * XXX KDM note that 0x48 is also the density code for DAT-160. + * For some reason they used overlapping density codes. + */ +#if 0 + { 0x48, 6870, 174500, "DAT-160" }, +#endif { 0x48, 5236, 133000, "SDLTapeI(110)" }, { 0x49, 7598, 193000, "SDLTapeI(160)" }, { 0x4a, 0, 0, "T10000A" }, Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/rescue/rescue/Makefile Tue Mar 24 14:36:10 2015 (r280438) @@ -131,7 +131,7 @@ CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv .if ${MK_OPENSSL} == "no" CRUNCH_LIBS+= -lmd .endif -CRUNCH_LIBS+= -lsbuf -lufs -lz +CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk Modified: stable/10/share/man/man4/mtio.4 ============================================================================== --- stable/10/share/man/man4/mtio.4 Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/share/man/man4/mtio.4 Tue Mar 24 14:36:10 2015 (r280438) @@ -35,7 +35,7 @@ .\" @(#)mtio.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 11, 2011 +.Dd February 12, 2015 .Dt MTIO 4 .Os .Sh NAME @@ -44,10 +44,10 @@ .Sh DESCRIPTION The special files named -.Pa /dev/[n]sa* +.Pa /dev/[en]sa* refer to SCSI tape drives, which may be attached to the system. -.Pa /dev/[n]sa*.ctl +.Pa /dev/sa*.ctl are control devices that can be used to issue ioctls to the SCSI tape driver to set parameters that are required to last beyond the unmounting of a tape. @@ -57,16 +57,19 @@ when the last requested read, write or s has been reached. The letter .Ql n -is usually prepended to +is prepended to the name of the no-rewind devices. +The letter +.Ql e +is prepended to the name of the eject devices. .Pp Tapes can be written with either fixed length records or variable length records. See .Xr sa 4 for more information. -Two end-of-file markers mark the end of a tape, and -one end-of-file marker marks the end of a tape file. +Two filemarks mark the end of a tape, and +one filemark marks the end of a tape file. If the tape is not to be rewound it is positioned with the head in between the two tape marks, where the next write will over write the second end-of-file marker. @@ -132,6 +135,8 @@ struct mtop { #define MTWSS 16 /* write setmark(s) */ #define MTFSS 17 /* forward space setmark */ #define MTBSS 18 /* backward space setmark */ +#define MTLOAD 19 /* load tape in drive */ +#define MTWEOFI 20 /* write an end-of-file record without waiting*/ #define MT_COMP_ENABLE 0xffffffff #define MT_COMP_DISABLED 0xfffffffe @@ -228,6 +233,112 @@ union mterrstat { char _reserved_padding[256]; }; +struct mtrblim { + uint32_t granularity; + uint32_t min_block_length; + uint32_t max_block_length; +}; + +typedef enum { + MT_LOCATE_DEST_OBJECT = 0x00, + MT_LOCATE_DEST_FILE = 0x01, + MT_LOCATE_DEST_SET = 0x02, + MT_LOCATE_DEST_EOD = 0x03 +} mt_locate_dest_type; + +typedef enum { + MT_LOCATE_BAM_IMPLICIT = 0x00, + MT_LOCATE_BAM_EXPLICIT = 0x01 +} mt_locate_bam; + +typedef enum { + MT_LOCATE_FLAG_IMMED = 0x01, + MT_LOCATE_FLAG_CHANGE_PART = 0x02 +} mt_locate_flags; + +struct mtlocate { + mt_locate_flags flags; + mt_locate_dest_type dest_type; + mt_locate_bam block_address_mode; + int64_t partition; + uint64_t logical_id; + uint8_t reserved[64]; +}; + +typedef enum { + MT_EXT_GET_NONE, + MT_EXT_GET_OK, + MT_EXT_GET_NEED_MORE_SPACE, + MT_EXT_GET_ERROR +} mt_ext_get_status; + +struct mtextget { + uint32_t alloc_len; + char *status_xml; + uint32_t fill_len; + mt_ext_get_status status; + char error_str[128]; + uint8_t reserved[64]; +}; + +#define MT_EXT_GET_ROOT_NAME "mtextget" +#define MT_DENSITY_ROOT_NAME "mtdensity" +#define MT_MEDIA_DENSITY_NAME "media_density" +#define MT_DENSITY_REPORT_NAME "density_report" +#define MT_MEDIUM_TYPE_REPORT_NAME "medium_type_report" +#define MT_MEDIA_REPORT_NAME "media_report" +#define MT_DENSITY_ENTRY_NAME "density_entry" + +#define MT_DENS_WRITE_OK 0x80 +#define MT_DENS_DUP 0x40 +#define MT_DENS_DEFLT 0x20 + + +#define MT_PARAM_FIXED_STR_LEN 32 +union mt_param_value { + int64_t value_signed; + uint64_t value_unsigned; + char *value_var_str; + char value_fixed_str[MT_PARAM_FIXED_STR_LEN]; + uint8_t reserved[64]; +}; + +typedef enum { + MT_PARAM_SET_NONE, + MT_PARAM_SET_SIGNED, + MT_PARAM_SET_UNSIGNED, + MT_PARAM_SET_VAR_STR, + MT_PARAM_SET_FIXED_STR +} mt_param_set_type; + +typedef enum { + MT_PARAM_STATUS_NONE, + MT_PARAM_STATUS_OK, + MT_PARAM_STATUS_ERROR +} mt_param_set_status; + +#define MT_PARAM_VALUE_NAME_LEN 64 +struct mtparamset { + char value_name[MT_PARAM_VALUE_NAME_LEN]; + mt_param_set_type value_type; + int value_len; + union mt_param_value value; + mt_param_set_status status; + char error_str[128]; +}; + +#define MT_PARAM_ROOT_NAME "mtparamget" +#define MT_PROTECTION_NAME "protection" + +/* + * Set a list of parameters. + */ +struct mtsetlist { + int num_params; + int param_len; + struct mtparamset *params; +}; + /* * Constants for mt_type byte. These are the same * for controllers compatible with the types listed. @@ -277,6 +388,12 @@ union mterrstat { #define MTIOCSETEOTMODEL _IOW('m', 8, uint32_t) /* Get current EOT model */ #define MTIOCGETEOTMODEL _IOR('m', 8, uint32_t) +#define MTIOCRBLIM _IOR('m', 9, struct mtrblim) /* get block limits */ +#define MTIOCEXTLOCATE _IOW('m', 10, struct mtlocate) /* seek to position */ +#define MTIOCEXTGET _IOWR('m', 11, struct mtextget) /* get tape status */ +#define MTIOCPARAMGET _IOWR('m', 12, struct mtextget) /* get tape params */ +#define MTIOCPARAMSET _IOWR('m', 13, struct mtparamset) /* set tape params */ +#define MTIOCSETLIST _IOWR('m', 14, struct mtsetlist) /* set N params */ #ifndef _KERNEL #define DEFTAPE "/dev/nsa0" @@ -285,13 +402,12 @@ union mterrstat { #endif /* !_SYS_MTIO_H_ */ .Ed .Sh FILES -.Bl -tag -width /dev/[n]sa* -compact -.It Pa /dev/[n]sa* +.Bl -tag -width /dev/[en]sa* -compact +.It Pa /dev/[en]sa* .El .Sh SEE ALSO .Xr mt 1 , .Xr tar 1 , -.Xr ast 4 , .Xr sa 4 .Sh HISTORY The @@ -300,8 +416,3 @@ manual appeared in .Bx 4.2 . An i386 version first appeared in .Fx 2.2 . -.Sh BUGS -The status should be returned in a device independent format. -.Pp -The special file naming should be redone in a more consistent and -understandable manner. Modified: stable/10/share/man/man4/sa.4 ============================================================================== --- stable/10/share/man/man4/sa.4 Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/share/man/man4/sa.4 Tue Mar 24 14:36:10 2015 (r280438) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2013 +.Dd February 12, 2015 .Dt SA 4 .Os .Sh NAME @@ -285,10 +285,10 @@ device driver written and ported from by .An Julian Elischer . .Pp -The current owner of record is -.An Matthew Jacob -who has suffered too many -years of breaking tape drivers. +The owner of record for many years was +.An Matthew Jacob . +The current maintainer is +.An Kenneth Merry .Sh BUGS This driver lacks many of the hacks required to deal with older devices. Many older @@ -305,7 +305,5 @@ for your device in order to read tapes w .Fx 2.X. .Pp -Fine grained density and compression mode support that is bound to specific -device names needs to be added. -.Pp -Support for fast indexing by use of partitions is missing. +Partitions are only supported for status information and location. +It would be nice to add support for creating and editing tape partitions. Modified: stable/10/share/mk/bsd.libnames.mk ============================================================================== --- stable/10/share/mk/bsd.libnames.mk Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/share/mk/bsd.libnames.mk Tue Mar 24 14:36:10 2015 (r280438) @@ -95,6 +95,7 @@ LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a .endif LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a +LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/sys/cam/scsi/scsi_all.c Tue Mar 24 14:36:10 2015 (r280438) @@ -7443,6 +7443,71 @@ scsi_persistent_reserve_out(struct ccb_s scsi_cmd->opcode = PERSISTENT_RES_OUT; scsi_cmd->action = service_action; scsi_cmd->scope_type = scope | res_type; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/data_ptr, + /*dxfer_len*/dxfer_len, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_security_protocol_in(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint32_t security_protocol, + uint32_t security_protocol_specific, int byte4, + uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, + int timeout) +{ + struct scsi_security_protocol_in *scsi_cmd; + + scsi_cmd = (struct scsi_security_protocol_in *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + + scsi_cmd->opcode = SECURITY_PROTOCOL_IN; + + scsi_cmd->security_protocol = security_protocol; + scsi_ulto2b(security_protocol_specific, + scsi_cmd->security_protocol_specific); + scsi_cmd->byte4 = byte4; + scsi_ulto4b(dxfer_len, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + dxfer_len, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_security_protocol_out(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint32_t security_protocol, + uint32_t security_protocol_specific, int byte4, + uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, + int timeout) +{ + struct scsi_security_protocol_out *scsi_cmd; + + scsi_cmd = (struct scsi_security_protocol_out *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + + scsi_cmd->opcode = SECURITY_PROTOCOL_OUT; + + scsi_cmd->security_protocol = security_protocol; + scsi_ulto2b(security_protocol_specific, + scsi_cmd->security_protocol_specific); + scsi_cmd->byte4 = byte4; scsi_ulto4b(dxfer_len, scsi_cmd->length); cam_fill_csio(csio, Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/sys/cam/scsi/scsi_all.h Tue Mar 24 14:36:10 2015 (r280438) @@ -1758,6 +1758,7 @@ struct ata_pass_16 { #define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 #define ATA_PASS_12 0xA1 +#define SECURITY_PROTOCOL_IN 0xA2 #define MAINTENANCE_IN 0xA3 #define MAINTENANCE_OUT 0xA4 #define MOVE_MEDIUM 0xA5 @@ -1765,6 +1766,7 @@ struct ata_pass_16 { #define WRITE_12 0xAA #define WRITE_VERIFY_12 0xAE #define VERIFY_12 0xAF +#define SECURITY_PROTOCOL_OUT 0xB5 #define READ_ELEMENT_STATUS 0xB8 #define READ_CD 0xBE @@ -2702,6 +2704,41 @@ struct scsi_target_group_data_extended { struct scsi_target_port_group_descriptor groups[]; }; +struct scsi_security_protocol_in +{ + uint8_t opcode; + uint8_t security_protocol; +#define SPI_PROT_INFORMATION 0x00 +#define SPI_PROT_CBCS 0x07 +#define SPI_PROT_TAPE_DATA_ENC 0x20 +#define SPI_PROT_DATA_ENC_CONFIG 0x21 +#define SPI_PROT_SA_CREATE_CAP 0x40 +#define SPI_PROT_IKEV2_SCSI 0x41 +#define SPI_PROT_JEDEC_UFS 0xEC +#define SPI_PROT_SDCARD_TFSSS 0xED +#define SPI_PROT_AUTH_HOST_TRANSIENT 0xEE +#define SPI_PROT_ATA_DEVICE_PASSWORD 0xEF + uint8_t security_protocol_specific[2]; + uint8_t byte4; +#define SPI_INC_512 0x80 + uint8_t reserved1; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_security_protocol_out +{ + uint8_t opcode; + uint8_t security_protocol; + uint8_t security_protocol_specific[2]; + uint8_t byte4; +#define SPO_INC_512 0x80 + uint8_t reserved1; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; typedef enum { SSD_TYPE_NONE, @@ -3623,6 +3660,20 @@ void scsi_start_stop(struct ccb_scsiio * u_int8_t tag_action, int start, int load_eject, int immediate, u_int8_t sense_len, u_int32_t timeout); +void scsi_security_protocol_in(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint32_t security_protocol, + uint32_t security_protocol_specific, int byte4, + uint8_t *data_ptr, uint32_t dxfer_len, + int sense_len, int timeout); + +void scsi_security_protocol_out(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *,union ccb *), + uint8_t tag_action, uint32_t security_protocol, + uint32_t security_protocol_specific, int byte4, + uint8_t *data_ptr, uint32_t dxfer_len, + int sense_len, int timeout); + void scsi_persistent_reserve_in(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *,union ccb *), uint8_t tag_action, int service_action, Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Tue Mar 24 14:22:58 2015 (r280437) +++ stable/10/sys/cam/scsi/scsi_sa.c Tue Mar 24 14:36:10 2015 (r280438) @@ -2,6 +2,7 @@ * Implementation of SCSI Sequential Access Peripheral driver for CAM. * * Copyright (c) 1999, 2000 Matthew Jacob + * Copyright (c) 2013, 2014, 2015 Spectra Logic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef _KERNEL #include +#include #include #include #endif @@ -69,7 +71,7 @@ __FBSDID("$FreeBSD$"); #include #ifndef SA_IO_TIMEOUT -#define SA_IO_TIMEOUT 4 +#define SA_IO_TIMEOUT 32 #endif #ifndef SA_SPACE_TIMEOUT #define SA_SPACE_TIMEOUT 1 * 60 @@ -80,6 +82,9 @@ __FBSDID("$FreeBSD$"); #ifndef SA_ERASE_TIMEOUT #define SA_ERASE_TIMEOUT 4 * 60 #endif +#ifndef SA_REP_DENSITY_TIMEOUT +#define SA_REP_DENSITY_TIMEOUT 90 +#endif #define SCSIOP_TIMEOUT (60 * 1000) /* not an option */ @@ -87,6 +92,7 @@ __FBSDID("$FreeBSD$"); #define REWIND_TIMEOUT (SA_REWIND_TIMEOUT * 60 * 1000) #define ERASE_TIMEOUT (SA_ERASE_TIMEOUT * 60 * 1000) #define SPACE_TIMEOUT (SA_SPACE_TIMEOUT * 60 * 1000) +#define REP_DENSITY_TIMEOUT (SA_REP_DENSITY_TIMEOUT * 60 * 1000) /* * Additional options that can be set for config: SA_1FM_AT_EOT @@ -133,7 +139,12 @@ typedef enum { SA_FLAG_COMP_ENABLED = 0x0400, SA_FLAG_COMP_SUPP = 0x0800, SA_FLAG_COMP_UNSUPP = 0x1000, - SA_FLAG_TAPE_FROZEN = 0x2000 + SA_FLAG_TAPE_FROZEN = 0x2000, + SA_FLAG_PROTECT_SUPP = 0x4000, + + SA_FLAG_COMPRESSION = (SA_FLAG_COMP_SUPP|SA_FLAG_COMP_ENABLED| + SA_FLAG_COMP_UNSUPP), + SA_FLAG_SCTX_INIT = 0x8000 } sa_flags; typedef enum { @@ -143,27 +154,30 @@ typedef enum { } sa_mode; typedef enum { - SA_PARAM_NONE = 0x00, - SA_PARAM_BLOCKSIZE = 0x01, - SA_PARAM_DENSITY = 0x02, - SA_PARAM_COMPRESSION = 0x04, - SA_PARAM_BUFF_MODE = 0x08, - SA_PARAM_NUMBLOCKS = 0x10, - SA_PARAM_WP = 0x20, - SA_PARAM_SPEED = 0x40, - SA_PARAM_ALL = 0x7f + SA_PARAM_NONE = 0x000, + SA_PARAM_BLOCKSIZE = 0x001, + SA_PARAM_DENSITY = 0x002, + SA_PARAM_COMPRESSION = 0x004, + SA_PARAM_BUFF_MODE = 0x008, + SA_PARAM_NUMBLOCKS = 0x010, + SA_PARAM_WP = 0x020, + SA_PARAM_SPEED = 0x040, + SA_PARAM_DENSITY_EXT = 0x080, + SA_PARAM_LBP = 0x100, + SA_PARAM_ALL = 0x1ff } sa_params; typedef enum { - SA_QUIRK_NONE = 0x00, - SA_QUIRK_NOCOMP = 0x01, /* Can't deal with compression at all */ - SA_QUIRK_FIXED = 0x02, /* Force fixed mode */ - SA_QUIRK_VARIABLE = 0x04, /* Force variable mode */ - SA_QUIRK_2FM = 0x08, /* Needs Two File Marks at EOD */ - SA_QUIRK_1FM = 0x10, /* No more than 1 File Mark at EOD */ - SA_QUIRK_NODREAD = 0x20, /* Don't try and dummy read density */ - SA_QUIRK_NO_MODESEL = 0x40, /* Don't do mode select at all */ - SA_QUIRK_NO_CPAGE = 0x80 /* Don't use DEVICE COMPRESSION page */ + SA_QUIRK_NONE = 0x000, + SA_QUIRK_NOCOMP = 0x001, /* Can't deal with compression at all*/ + SA_QUIRK_FIXED = 0x002, /* Force fixed mode */ + SA_QUIRK_VARIABLE = 0x004, /* Force variable mode */ + SA_QUIRK_2FM = 0x008, /* Needs Two File Marks at EOD */ + SA_QUIRK_1FM = 0x010, /* No more than 1 File Mark at EOD */ + SA_QUIRK_NODREAD = 0x020, /* Don't try and dummy read density */ + SA_QUIRK_NO_MODESEL = 0x040, /* Don't do mode select at all */ + SA_QUIRK_NO_CPAGE = 0x080, /* Don't use DEVICE COMPRESSION page */ + SA_QUIRK_NO_LONG_POS = 0x100 /* No long position information */ } sa_quirks; #define SA_QUIRK_BIT_STRING \ @@ -175,10 +189,10 @@ typedef enum { "\0051FM" \ "\006NODREAD" \ "\007NO_MODESEL" \ - "\010NO_CPAGE" + "\010NO_CPAGE" \ + "\011NO_LONG_POS" #define SAMODE(z) (dev2unit(z) & 0x3) -#define SADENSITY(z) ((dev2unit(z) >> 2) & 0x3) #define SA_IS_CTRL(z) (dev2unit(z) & (1 << 4)) #define SA_NOT_CTLDEV 0 @@ -187,29 +201,134 @@ typedef enum { #define SA_ATYPE_R 0 #define SA_ATYPE_NR 1 #define SA_ATYPE_ER 2 +#define SA_NUM_ATYPES 3 -#define SAMINOR(ctl, mode, access) \ - ((ctl << 4) | (mode << 2) | (access & 0x3)) +#define SAMINOR(ctl, access) \ + ((ctl << 4) | (access & 0x3)) -#define SA_NUM_MODES 4 struct sa_devs { struct cdev *ctl_dev; - struct sa_mode_devs { - struct cdev *r_dev; - struct cdev *nr_dev; - struct cdev *er_dev; - } mode_devs[SA_NUM_MODES]; + struct cdev *r_dev; + struct cdev *nr_dev; + struct cdev *er_dev; +}; + +#define SASBADDBASE(sb, indent, data, xfmt, name, type, xsize, desc) \ + sbuf_printf(sb, "%*s<%s type=\"%s\" size=\"%zd\" " \ + "fmt=\"%s\" desc=\"%s\">" #xfmt "\n", indent, "", \ + #name, #type, xsize, #xfmt, desc ? desc : "", data, #name); + +#define SASBADDINT(sb, indent, data, fmt, name) \ + SASBADDBASE(sb, indent, data, fmt, name, int, sizeof(data), \ + NULL) + +#define SASBADDINTDESC(sb, indent, data, fmt, name, desc) \ + SASBADDBASE(sb, indent, data, fmt, name, int, sizeof(data), \ + desc) + +#define SASBADDUINT(sb, indent, data, fmt, name) \ + SASBADDBASE(sb, indent, data, fmt, name, uint, sizeof(data), \ + NULL) + +#define SASBADDUINTDESC(sb, indent, data, fmt, name, desc) \ + SASBADDBASE(sb, indent, data, fmt, name, uint, sizeof(data), \ + desc) + +#define SASBADDFIXEDSTR(sb, indent, data, fmt, name) \ + SASBADDBASE(sb, indent, data, fmt, name, str, sizeof(data), \ + NULL) + +#define SASBADDFIXEDSTRDESC(sb, indent, data, fmt, name, desc) \ + SASBADDBASE(sb, indent, data, fmt, name, str, sizeof(data), \ + desc) + +#define SASBADDVARSTR(sb, indent, data, fmt, name, maxlen) \ + SASBADDBASE(sb, indent, data, fmt, name, str, maxlen, NULL) + +#define SASBADDVARSTRDESC(sb, indent, data, fmt, name, maxlen, desc) \ + SASBADDBASE(sb, indent, data, fmt, name, str, maxlen, desc) + +#define SASBADDNODE(sb, indent, name) { \ + sbuf_printf(sb, "%*s<%s type=\"%s\">\n", indent, "", #name, \ + "node"); \ + indent += 2; \ +} + +#define SASBADDNODENUM(sb, indent, name, num) { \ + sbuf_printf(sb, "%*s<%s type=\"%s\" num=\"%d\">\n", indent, "", \ + #name, "node", num); \ + indent += 2; \ +} + +#define SASBENDNODE(sb, indent, name) { \ + indent -= 2; \ + sbuf_printf(sb, "%*s\n", indent, "", #name); \ +} + +#define SA_DENSITY_TYPES 4 + +struct sa_prot_state { + int initialized; + uint32_t prot_method; + uint32_t pi_length; + uint32_t lbp_w; + uint32_t lbp_r; + uint32_t rbdp; +}; + +struct sa_prot_info { + struct sa_prot_state cur_prot_state; + struct sa_prot_state pending_prot_state; +}; + +/* + * A table mapping protection parameters to their types and values. + */ +struct sa_prot_map { + char *name; + mt_param_set_type param_type; + off_t offset; + uint32_t min_val; + uint32_t max_val; + uint32_t *value; +} sa_prot_table[] = { + { "prot_method", MT_PARAM_SET_UNSIGNED, + __offsetof(struct sa_prot_state, prot_method), + /*min_val*/ 0, /*max_val*/ 255, NULL }, + { "pi_length", MT_PARAM_SET_UNSIGNED, + __offsetof(struct sa_prot_state, pi_length), + /*min_val*/ 0, /*max_val*/ SA_CTRL_DP_PI_LENGTH_MASK, NULL }, + { "lbp_w", MT_PARAM_SET_UNSIGNED, + __offsetof(struct sa_prot_state, lbp_w), + /*min_val*/ 0, /*max_val*/ 1, NULL }, + { "lbp_r", MT_PARAM_SET_UNSIGNED, + __offsetof(struct sa_prot_state, lbp_r), + /*min_val*/ 0, /*max_val*/ 1, NULL }, + { "rbdp", MT_PARAM_SET_UNSIGNED, + __offsetof(struct sa_prot_state, rbdp), + /*min_val*/ 0, /*max_val*/ 1, NULL } }; +#define SA_NUM_PROT_ENTS sizeof(sa_prot_table)/sizeof(sa_prot_table[0]) + +#define SA_PROT_ENABLED(softc) ((softc->flags & SA_FLAG_PROTECT_SUPP) \ + && (softc->prot_info.cur_prot_state.initialized != 0) \ + && (softc->prot_info.cur_prot_state.prot_method != 0)) + +#define SA_PROT_LEN(softc) softc->prot_info.cur_prot_state.pi_length + struct sa_softc { sa_state state; sa_flags flags; sa_quirks quirks; u_int si_flags; + struct cam_periph *periph; struct bio_queue_head bio_queue; int queue_count; struct devstat *device_stats; struct sa_devs devs; + int open_count; + int num_devs_to_destroy; int blk_gran; int blk_mask; int blk_shift; @@ -231,12 +350,37 @@ struct sa_softc { int filemarks; union ccb saved_ccb; int last_resid_was_io; - - /* - * Relative to BOT Location. - */ - daddr_t fileno; - daddr_t blkno; + uint8_t density_type_bits[SA_DENSITY_TYPES]; + int density_info_valid[SA_DENSITY_TYPES]; + uint8_t density_info[SA_DENSITY_TYPES][SRDS_MAX_LENGTH]; + + struct sa_prot_info prot_info; + + int sili; + int eot_warn; + + /* + * Current position information. -1 means that the given value is + * unknown. fileno and blkno are always calculated. blkno is + * relative to the previous file mark. rep_fileno and rep_blkno + * are as reported by the drive, if it supports the long form + * report for the READ POSITION command. rep_blkno is relative to + * the beginning of the partition. + * + * bop means that the drive is at the beginning of the partition. + * eop means that the drive is between early warning and end of + * partition, inside the current partition. + * bpew means that the position is in a PEWZ (Programmable Early + * Warning Zone) + */ + daddr_t partition; /* Absolute from BOT */ + daddr_t fileno; /* Relative to beginning of partition */ + daddr_t blkno; /* Relative to last file mark */ + daddr_t rep_blkno; /* Relative to beginning of partition */ + daddr_t rep_fileno; /* Relative to beginning of partition */ + int bop; /* Beginning of Partition */ + int eop; /* End of Partition */ + int bpew; /* Beyond Programmable Early Warning */ /* * Latched Error Info @@ -403,16 +547,42 @@ static int sagetparams(struct cam_perip u_int8_t *write_protect, u_int8_t *speed, int *comp_supported, int *comp_enabled, u_int32_t *comp_algorithm, - sa_comp_t *comp_page); + sa_comp_t *comp_page, + struct scsi_control_data_prot_subpage + *prot_page, int dp_size, + int prot_changeable); +static int sasetprot(struct cam_periph *periph, + struct sa_prot_state *new_prot); static int sasetparams(struct cam_periph *periph, sa_params params_to_set, u_int32_t blocksize, u_int8_t density, u_int32_t comp_algorithm, u_int32_t sense_flags); +static int sasetsili(struct cam_periph *periph, + struct mtparamset *ps, int num_params); +static int saseteotwarn(struct cam_periph *periph, + struct mtparamset *ps, int num_params); +static void safillprot(struct sa_softc *softc, int *indent, + struct sbuf *sb); +static void sapopulateprots(struct sa_prot_state *cur_state, + struct sa_prot_map *new_table, + int table_ents); +static struct sa_prot_map *safindprotent(char *name, struct sa_prot_map *table, + int table_ents); +static int sasetprotents(struct cam_periph *periph, + struct mtparamset *ps, int num_params); +static struct sa_param_ent *safindparament(struct mtparamset *ps); +static int saparamsetlist(struct cam_periph *periph, + struct mtsetlist *list, int need_copy); +static int saextget(struct cdev *dev, struct cam_periph *periph, + struct sbuf *sb, struct mtextget *g); +static int saparamget(struct sa_softc *softc, struct sbuf *sb); static void saprevent(struct cam_periph *periph, int action); static int sarewind(struct cam_periph *periph); static int saspace(struct cam_periph *periph, int count, scsi_space_code code); +static void sadevgonecb(void *arg); +static void sasetupdev(struct sa_softc *softc, struct cdev *dev); static int samount(struct cam_periph *, int, struct cdev *); static int saretension(struct cam_periph *periph); static int sareservereleaseunit(struct cam_periph *periph, @@ -420,9 +590,16 @@ static int sareservereleaseunit(struct static int saloadunload(struct cam_periph *periph, int load); static int saerase(struct cam_periph *periph, int longerase); static int sawritefilemarks(struct cam_periph *periph, - int nmarks, int setmarks); + int nmarks, int setmarks, int immed); +static int sagetpos(struct cam_periph *periph); static int sardpos(struct cam_periph *periph, int, u_int32_t *); -static int sasetpos(struct cam_periph *periph, int, u_int32_t *); +static int sasetpos(struct cam_periph *periph, int, + struct mtlocate *); +static void safilldenstypesb(struct sbuf *sb, int *indent, + uint8_t *buf, int buf_len, + int is_density); +static void safilldensitysb(struct sa_softc *softc, int *indent, + struct sbuf *sb); #ifndef SA_DEFAULT_IO_SPLIT @@ -464,7 +641,7 @@ static struct cdevsw sa_cdevsw = { .d_ioctl = saioctl, .d_strategy = sastrategy, .d_name = "sa", - .d_flags = D_TAPE, + .d_flags = D_TAPE | D_TRACKCLOSE, }; static int @@ -488,6 +665,7 @@ saopen(struct cdev *dev, int flags, int if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 1; + softc->open_count++; cam_periph_unlock(periph); return (0); } @@ -519,6 +697,7 @@ saopen(struct cdev *dev, int flags, int if (error && (flags & O_NONBLOCK)) { softc->flags |= SA_FLAG_OPEN; softc->open_pending_mount = 1; + softc->open_count++; cam_periph_unhold(periph); cam_periph_unlock(periph); return (0); @@ -534,6 +713,7 @@ saopen(struct cdev *dev, int flags, int saprevent(periph, PR_PREVENT); softc->flags |= SA_FLAG_OPEN; + softc->open_count++; cam_periph_unhold(periph); cam_periph_unlock(periph); @@ -545,7 +725,7 @@ saclose(struct cdev *dev, int flag, int { struct cam_periph *periph; struct sa_softc *softc; - int mode, error, writing, tmp; + int mode, error, writing, tmp, i; int closedbits = SA_FLAG_OPEN; mode = SAMODE(dev); @@ -564,6 +744,7 @@ saclose(struct cdev *dev, int flag, int softc->open_rdonly = 0; if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 0; + softc->open_count--; cam_periph_unlock(periph); cam_periph_release(periph); return (0); @@ -572,6 +753,7 @@ saclose(struct cdev *dev, int flag, int if (softc->open_pending_mount) { softc->flags &= ~SA_FLAG_OPEN; softc->open_pending_mount = 0; + softc->open_count--; cam_periph_unlock(periph); cam_periph_release(periph); return (0); @@ -676,6 +858,16 @@ saclose(struct cdev *dev, int flag, int * And we are no longer open for business. */ softc->flags &= ~closedbits; + softc->open_count--; + + /* + * Invalidate any density information that depends on having tape + * media in the drive. + */ + for (i = 0; i < SA_DENSITY_TYPES; i++) { + if (softc->density_type_bits[i] & SRDS_MEDIA) + softc->density_info_valid[i] = 0; + } /* * Inform users if tape state if frozen.... @@ -824,6 +1016,480 @@ sastrategy(struct bio *bp) return; } +static int +sasetsili(struct cam_periph *periph, struct mtparamset *ps, int num_params) +{ + uint32_t sili_blocksize; + struct sa_softc *softc; + int error; + + error = 0; + softc = (struct sa_softc *)periph->softc; + + if (ps->value_type != MT_PARAM_SET_SIGNED) { + snprintf(ps->error_str, sizeof(ps->error_str), + "sili is a signed parameter"); + goto bailout; + } + if ((ps->value.value_signed < 0) + || (ps->value.value_signed > 1)) { + snprintf(ps->error_str, sizeof(ps->error_str), + "invalid sili value %jd", (intmax_t)ps->value.value_signed); + goto bailout_error; + } + /* + * We only set the SILI flag in variable block + * mode. You'll get a check condition in fixed + * block mode if things don't line up in any case. + */ + if (softc->flags & SA_FLAG_FIXED) { + snprintf(ps->error_str, sizeof(ps->error_str), + "can't set sili bit in fixed block mode"); + goto bailout_error; + } + if (softc->sili == ps->value.value_signed) + goto bailout; + + if (ps->value.value_signed == 1) + sili_blocksize = 4; + else + sili_blocksize = 0; + + error = sasetparams(periph, SA_PARAM_BLOCKSIZE, + sili_blocksize, 0, 0, SF_QUIET_IR); + if (error != 0) { + snprintf(ps->error_str, sizeof(ps->error_str), + "sasetparams() returned error %d", error); + goto bailout_error; + } + + softc->sili = ps->value.value_signed; + +bailout: + ps->status = MT_PARAM_STATUS_OK; + return (error); + +bailout_error: + ps->status = MT_PARAM_STATUS_ERROR; + if (error == 0) + error = EINVAL; + + return (error); +} + +static int +saseteotwarn(struct cam_periph *periph, struct mtparamset *ps, int num_params) +{ + struct sa_softc *softc; + int error; + + error = 0; + softc = (struct sa_softc *)periph->softc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 16:53:18 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53819425; Tue, 24 Mar 2015 16:53:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA44384; Tue, 24 Mar 2015 16:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OGrHqV071404; Tue, 24 Mar 2015 16:53:17 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OGrHvi071403; Tue, 24 Mar 2015 16:53:17 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503241653.t2OGrHvi071403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 24 Mar 2015 16:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280446 - 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.18-1 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: Tue, 24 Mar 2015 16:53:18 -0000 Author: ken Date: Tue Mar 24 16:53:16 2015 New Revision: 280446 URL: https://svnweb.freebsd.org/changeset/base/280446 Log: MFC, r279375 ------------------------------------------------------------------------ r279375 | ken | 2015-02-27 14:35:36 -0700 (Fri, 27 Feb 2015) | 26 lines Fix I/O size calculation for pass(4) driver requests and add latency tracking. It is important to subtract the residual from the requested transfer size to see how much data was actually transferred. With tape drives in particular, it is common to request more data than is returned. Also, add I/O latency tracking for CAM requests issued by cam_periph_runccb(). If the caller supplies a struct devstat, and the I/O is a SCSI or ATA I/O, we will track the elapsed time to provide I/O latency statistics for the request. sys/cam/scsi/cam_periph.c: In cam_periph_runccb(), subtract the residual when reporting I/O totals to devstat(9) for SCSI and ATA passthrough requests. In cam_periph_runccb(), grab the I/O start time and supply the start time to devstat_end_transaction() so that it can calculate the elapsed I/O time. Sponsored by: Spectra Logic MFC after: 1 week ------------------------------------------------------------------------ Sponsored by: Spectra Logic 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 Tue Mar 24 16:46:40 2015 (r280445) +++ stable/10/sys/cam/cam_periph.c Tue Mar 24 16:53:16 2015 (r280446) @@ -1048,8 +1048,11 @@ cam_periph_runccb(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, struct devstat *ds) { + struct bintime *starttime; + struct bintime ltime; int error; + starttime = NULL; xpt_path_assert(ccb->ccb_h.path, MA_OWNED); /* @@ -1057,8 +1060,11 @@ cam_periph_runccb(union ccb *ccb, * this particular type of ccb, record the transaction start. */ if ((ds != NULL) && (ccb->ccb_h.func_code == XPT_SCSI_IO || - ccb->ccb_h.func_code == XPT_ATA_IO)) - devstat_start_transaction(ds, NULL); + ccb->ccb_h.func_code == XPT_ATA_IO)) { + starttime = <ime; + binuptime(starttime); + devstat_start_transaction(ds, starttime); + } ccb->ccb_h.cbfcnp = cam_periph_done; xpt_action(ccb); @@ -1086,22 +1092,22 @@ cam_periph_runccb(union ccb *ccb, if (ds != NULL) { if (ccb->ccb_h.func_code == XPT_SCSI_IO) { devstat_end_transaction(ds, - ccb->csio.dxfer_len, + ccb->csio.dxfer_len - ccb->csio.resid, ccb->csio.tag_action & 0x3, ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) ? DEVSTAT_NO_DATA : (ccb->ccb_h.flags & CAM_DIR_OUT) ? DEVSTAT_WRITE : - DEVSTAT_READ, NULL, NULL); + DEVSTAT_READ, NULL, starttime); } else if (ccb->ccb_h.func_code == XPT_ATA_IO) { devstat_end_transaction(ds, - ccb->ataio.dxfer_len, + ccb->ataio.dxfer_len - ccb->ataio.resid, ccb->ataio.tag_action & 0x3, ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) ? DEVSTAT_NO_DATA : (ccb->ccb_h.flags & CAM_DIR_OUT) ? DEVSTAT_WRITE : - DEVSTAT_READ, NULL, NULL); + DEVSTAT_READ, NULL, starttime); } } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 17:20:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD2D1000; Tue, 24 Mar 2015 17:20:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D38B28BE; Tue, 24 Mar 2015 17:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OHKLn8082858; Tue, 24 Mar 2015 17:20:21 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OHKLI7082856; Tue, 24 Mar 2015 17:20:21 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503241720.t2OHKLI7082856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 24 Mar 2015 17:20:21 +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: r280448 - in stable/10/sys/dev: mpr mps 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.18-1 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: Tue, 24 Mar 2015 17:20:22 -0000 Author: ken Date: Tue Mar 24 17:20:20 2015 New Revision: 280448 URL: https://svnweb.freebsd.org/changeset/base/280448 Log: MFC, r279336: ------------------------------------------------------------------------ r279336 | ken | 2015-02-26 15:22:06 -0700 (Thu, 26 Feb 2015) | 12 lines Add FreeBSD stable/10 version checks for the availability of the CDAI_FLAG_NONE advanced information CCB flag. Support for the flag was merged to stable/10 in r279329, and the __FreeBSD_version in stable/10 was bumped to 1001510. Check for that version in the mps(4) and mpr(4) drivers when determining whether to use the flag. Sponsored by: Spectra Logic MFC after: 3 days ------------------------------------------------------------------------ Modified: stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mps/mps_sas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas.c Tue Mar 24 17:12:36 2015 (r280447) +++ stable/10/sys/dev/mpr/mpr_sas.c Tue Mar 24 17:20:20 2015 (r280448) @@ -3084,7 +3084,8 @@ mprsas_async(void *callback_arg, uint32_ cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; cdai.buftype = CDAI_TYPE_RCAPLONG; -#if __FreeBSD_version >= 1100061 +#if (__FreeBSD_version >= 1100061) || \ + ((__FreeBSD_version >= 1001510) && (__FreeBSD_version < 1100000)) cdai.flags = CDAI_FLAG_NONE; #else cdai.flags = 0; Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Tue Mar 24 17:12:36 2015 (r280447) +++ stable/10/sys/dev/mps/mps_sas.c Tue Mar 24 17:20:20 2015 (r280448) @@ -3237,7 +3237,8 @@ mpssas_async(void *callback_arg, uint32_ cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; cdai.buftype = CDAI_TYPE_RCAPLONG; -#if __FreeBSD_version >= 1100061 +#if (__FreeBSD_version >= 1100061) || \ + ((__FreeBSD_version >= 1001510) && (__FreeBSD_version < 1100000)) cdai.flags = CDAI_FLAG_NONE; #else cdai.flags = 0; From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 17:37:32 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED6D0493; Tue, 24 Mar 2015 17:37:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D749CAD8; Tue, 24 Mar 2015 17:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OHbWBe092497; Tue, 24 Mar 2015 17:37:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OHbWKR092496; Tue, 24 Mar 2015 17:37:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503241737.t2OHbWKR092496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 24 Mar 2015 17:37:32 +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: r280449 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 24 Mar 2015 17:37:33 -0000 Author: pfg Date: Tue Mar 24 17:37:31 2015 New Revision: 280449 URL: https://svnweb.freebsd.org/changeset/base/280449 Log: MFC r280273; Permit multiple arguments for the nonnull attribute. This is very useful for non-trivial functions and doesn't affect existing uses. Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h ============================================================================== --- stable/10/sys/sys/cdefs.h Tue Mar 24 17:20:20 2015 (r280448) +++ stable/10/sys/sys/cdefs.h Tue Mar 24 17:37:31 2015 (r280449) @@ -347,9 +347,9 @@ #endif #if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) +#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) #else -#define __nonnull(x) +#define __nonnull(...) #endif #if __GNUC_PREREQ__(3, 4) From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 24 20:00:13 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49CE7110; Tue, 24 Mar 2015 20:00:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 333C1DFF; Tue, 24 Mar 2015 20:00:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OK0D8Z065578; Tue, 24 Mar 2015 20:00:13 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OK0Cbg065573; Tue, 24 Mar 2015 20:00:12 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503242000.t2OK0Cbg065573@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 24 Mar 2015 20:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280455 - in stable/10: lib/libpmc sys/amd64/conf sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmcstudy 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.18-1 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: Tue, 24 Mar 2015 20:00:13 -0000 Author: rrs Date: Tue Mar 24 20:00:11 2015 New Revision: 280455 URL: https://svnweb.freebsd.org/changeset/base/280455 Log: MFC of r277177 and r279894 with the fixes for the PMC for Haswell. Sponsored by: Netflix Inc. Added: stable/10/usr.sbin/pmcstudy/ - copied from r277177, head/usr.sbin/pmcstudy/ Modified: stable/10/lib/libpmc/libpmc.c stable/10/sys/amd64/conf/GENERIC stable/10/sys/dev/hwpmc/hwpmc_core.c stable/10/sys/dev/hwpmc/hwpmc_intel.c stable/10/sys/dev/hwpmc/hwpmc_logging.c stable/10/sys/dev/hwpmc/hwpmc_mod.c stable/10/sys/dev/hwpmc/hwpmc_piv.c stable/10/sys/dev/hwpmc/hwpmc_uncore.c stable/10/sys/dev/hwpmc/hwpmc_x86.c stable/10/sys/dev/hwpmc/pmc_events.h stable/10/sys/sys/pmc.h stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/libpmc.c ============================================================================== --- stable/10/lib/libpmc/libpmc.c Tue Mar 24 19:25:36 2015 (r280454) +++ stable/10/lib/libpmc/libpmc.c Tue Mar 24 20:00:11 2015 (r280455) @@ -200,6 +200,12 @@ static const struct pmc_event_descr hasw __PMC_EV_ALIAS_HASWELL() }; +static const struct pmc_event_descr haswell_xeon_event_table[] = +{ + __PMC_EV_ALIAS_HASWELL_XEON() +}; + + static const struct pmc_event_descr ivybridge_event_table[] = { __PMC_EV_ALIAS_IVYBRIDGE() @@ -267,6 +273,7 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOF PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(nehalem_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(haswell_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -312,6 +319,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap); PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); +PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); @@ -626,6 +634,8 @@ static struct pmc_event_alias core2_alia #define nehalem_ex_aliases_without_iaf core2_aliases_without_iaf #define haswell_aliases core2_aliases #define haswell_aliases_without_iaf core2_aliases_without_iaf +#define haswell_xeon_aliases core2_aliases +#define haswell_xeon_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_xeon_aliases core2_aliases @@ -896,7 +906,8 @@ iap_allocate_pmc(enum pmc_event pe, char n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); - } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL) { + } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL || + cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL_XEON) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp); } else @@ -2788,6 +2799,10 @@ pmc_event_names_of_class(enum pmc_class ev = haswell_event_table; count = PMC_EVENT_TABLE_SIZE(haswell); break; + case PMC_CPU_INTEL_HASWELL_XEON: + ev = haswell_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(haswell_xeon); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); @@ -3115,6 +3130,9 @@ pmc_init(void) pmc_class_table[n++] = &haswelluc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(haswell); break; + case PMC_CPU_INTEL_HASWELL_XEON: + PMC_MDEP_INIT_INTEL_V2(haswell_xeon); + break; case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; @@ -3280,6 +3298,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = haswell_event_table; evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell); break; + case PMC_CPU_INTEL_HASWELL_XEON: + ev = haswell_xeon_event_table; + evfence = haswell_xeon_event_table + PMC_EVENT_TABLE_SIZE(haswell_xeon); + break; + case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Tue Mar 24 19:25:36 2015 (r280454) +++ stable/10/sys/amd64/conf/GENERIC Tue Mar 24 20:00:11 2015 (r280455) @@ -84,6 +84,7 @@ options SMP # Symmetric MultiProcesso device cpufreq # Bus support. +device hwpmc device acpi options ACPI_DMAR device pci Modified: stable/10/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_core.c Tue Mar 24 19:25:36 2015 (r280454) +++ stable/10/sys/dev/hwpmc/hwpmc_core.c Tue Mar 24 20:00:11 2015 (r280455) @@ -38,7 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if (__FreeBSD_version >= 1100000) +#include +#else #include +#endif #include #include #include @@ -569,7 +573,8 @@ struct iap_event_descr { #define IAP_F_IBX (1 << 9) /* CPU: Ivy Bridge Xeon */ #define IAP_F_HW (1 << 10) /* CPU: Haswell */ #define IAP_F_CAS (1 << 11) /* CPU: Atom Silvermont */ -#define IAP_F_FM (1 << 12) /* Fixed mask */ +#define IAP_F_HWX (1 << 12) /* CPU: Haswell Xeon */ +#define IAP_F_FM (1 << 13) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ (IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA) @@ -613,11 +618,11 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS), + IAP_F_CAS | IAP_F_HWX), IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | IAP_F_CAS), IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | - IAP_F_SBX | IAP_F_CAS), + IAP_F_SBX | IAP_F_CAS | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), @@ -638,9 +643,9 @@ static struct iap_event_descr iap_events IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O | IAP_F_CAS), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | @@ -654,7 +659,7 @@ static struct iap_event_descr iap_events IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_HWX), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA), @@ -662,26 +667,27 @@ static struct iap_event_descr iap_events IAP_F_SBX), IAPDESCR(08H_01H, 0x08, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_02H, 0x08, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_04H, 0x08, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_05H, 0x08, 0x05, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_06H, 0x08, 0x06, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_07H, 0x08, 0x07, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), - IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW), + IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX | IAP_F_HW), - IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW), - IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW), - IAPDESCR(08H_60H, 0x08, 0x60, IAP_F_FM | IAP_F_HW), - IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_HW), + IAP_F_SBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), + IAPDESCR(08H_60H, 0x08, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_81H, 0x08, 0x81, IAP_F_FM | IAP_F_IB | IAP_F_IBX), IAPDESCR(08H_82H, 0x08, 0x82, IAP_F_FM | IAP_F_IB | IAP_F_IBX), IAPDESCR(08H_84H, 0x08, 0x84, IAP_F_FM | IAP_F_IB | IAP_F_IBX), + IAPDESCR(08H_88H, 0x08, 0x88, IAP_F_IB | IAP_F_IBX), IAPDESCR(09H_01H, 0x09, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), IAPDESCR(09H_02H, 0x09, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), @@ -697,15 +703,16 @@ static struct iap_event_descr iap_events IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), - IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW), + IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | + IAP_F_IB | IAP_F_IBX | IAP_F_HWX), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(0FH_01H, 0x0F, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(0FH_02H, 0x0F, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -716,24 +723,24 @@ static struct iap_event_descr iap_events IAPDESCR(10H_00H, 0x10, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(10H_01H, 0x10, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_SBX), + IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | IAP_F_IBX ), IAPDESCR(10H_02H, 0x10, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_04H, 0x10, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_08H, 0x10, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_10H, 0x10, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_IB | IAP_F_IBX), IAPDESCR(10H_20H, 0x10, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_IB | IAP_F_IBX), IAPDESCR(10H_40H, 0x10, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_IB | IAP_F_IBX), IAPDESCR(10H_80H, 0x10, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_IB | IAP_F_IBX), IAPDESCR(10H_81H, 0x10, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(11H_00H, 0x11, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(11H_01H, 0x11, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_SB | - IAP_F_SBX), - IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX), + IAP_F_SBX | IAP_F_IB | IAP_F_IBX), + IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | IAP_F_IBX), IAPDESCR(11H_81H, 0x11, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(12H_00H, 0x12, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -796,30 +803,30 @@ static struct iap_event_descr iap_events IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW), + IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW), + IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW), + IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW), + IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | IAP_F_HWX), IAPDESCR(25H, 0x25, IAP_M_CORE, IAP_F_ALLCPUSCORE2), @@ -850,7 +857,7 @@ static struct iap_event_descr iap_events IAPDESCR(27H_10H, 0x27, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_20H, 0x27, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_40H, 0x27, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(27H_50H, 0x27, 0x50, IAP_F_FM | IAP_F_HW), + IAPDESCR(27H_50H, 0x27, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(27H_80H, 0x27, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_E0H, 0x27, 0xE0, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_F0H, 0x27, 0xF0, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -878,10 +885,10 @@ static struct iap_event_descr iap_events IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS), + IAP_F_CAS | IAP_F_HWX), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS), + IAP_F_CAS | IAP_F_HWX), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), @@ -897,10 +904,10 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_CAS), + IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_CAS), + IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -942,25 +949,25 @@ static struct iap_event_descr iap_events IAPDESCR(48H_00H, 0x48, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(48H_01H, 0x48, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O), IAPDESCR(49H_00H, 0x49, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(49H_01H, 0x49, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_02H, 0x49, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW), - IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW), - IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW), - IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), IAPDESCR(4BH_00H, 0x4B, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(4BH_01H, 0x4B, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7O), @@ -970,9 +977,9 @@ static struct iap_event_descr iap_events IAPDESCR(4CH_00H, 0x4C, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(4CH_01H, 0x4C, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(4CH_02H, 0x4C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(4DH_01H, 0x4D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -989,7 +996,7 @@ static struct iap_event_descr iap_events IAPDESCR(4FH_10H, 0x4F, 0x10, IAP_F_FM | IAP_F_WM), IAPDESCR(51H_01H, 0x51, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(51H_02H, 0x51, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(51H_04H, 0x51, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1001,10 +1008,10 @@ static struct iap_event_descr iap_events IAPDESCR(53H_01H, 0x53, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(58H_04H, 0x58, 0x04, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(58H_04H, 0x58, 0x04, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(59H_20H, 0x59, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(59H_40H, 0x59, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), @@ -1016,25 +1023,25 @@ static struct iap_event_descr iap_events IAPDESCR(5BH_4FH, 0x5B, 0x4F, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(5CH_01H, 0x5C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(5CH_02H, 0x5C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(5EH_01H, 0x5E, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB), - IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_IBX), + IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB ), /* IB not in manual */ + IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_IBX | IAP_F_IB), IAPDESCR(60H, 0x60, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(60H_01H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(60H_02H, 0x60, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(60H_04H, 0x60, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(60H_08H, 0x60, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(61H, 0x61, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), IAPDESCR(61H_00H, 0x61, 0x00, IAP_F_FM | IAP_F_CC), @@ -1046,9 +1053,9 @@ static struct iap_event_descr iap_events IAP_F_CA | IAP_F_CC2), IAPDESCR(63H, 0x63, IAP_M_CORE, IAP_F_CC), IAPDESCR(63H_01H, 0x63, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(63H_02H, 0x63, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(64H, 0x64, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(64H_40H, 0x64, 0x40, IAP_F_FM | IAP_F_CC), @@ -1090,20 +1097,25 @@ static struct iap_event_descr iap_events IAPDESCR(78H, 0x78, IAP_M_CORE | IAP_M_SNOOPTYPE, IAP_F_CA | IAP_F_CC2), IAPDESCR(79H_02H, 0x79, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(79H_04H, 0x79, 0x04, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(79H_08H, 0x79, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(79H_10H, 0x79, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + + IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(79H_20H, 0x79, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + + IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(79H_30H, 0x79, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + + IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(7AH, 0x7A, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1120,10 +1132,10 @@ static struct iap_event_descr iap_events IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_02H, 0x80, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS), + IAP_F_CAS | IAP_F_HWX), IAPDESCR(80H_03H, 0x80, 0x03, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), - IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_IBX), IAPDESCR(81H_00H, 0x81, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(81H_01H, 0x81, 0x01, IAP_F_FM | IAP_F_I7O), @@ -1141,74 +1153,74 @@ static struct iap_event_descr iap_events IAPDESCR(85H_00H, 0x85, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(85H_01H, 0x85, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_02H, 0x85, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_04H, 0x85, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_10H, 0x85, 0x10, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(85H_20H, 0x85, 0x20, IAP_F_FM | IAP_F_I7O | IAP_F_HW), - IAPDESCR(85H_40H, 0x85, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW), - IAPDESCR(85H_60H, 0x85, 0x60, IAP_F_FM | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(85H_20H, 0x85, 0x20, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), + IAPDESCR(85H_40H, 0x85, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), + IAPDESCR(85H_60H, 0x85, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_80H, 0x85, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7O), IAPDESCR(86H_00H, 0x86, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(87H_00H, 0x87, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(87H_01H, 0x87, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(87H_02H, 0x87, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(87H_04H, 0x87, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(87H_08H, 0x87, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(87H_0FH, 0x87, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_00H, 0x88, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(88H_01H, 0x88, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_02H, 0x88, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_04H, 0x88, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_07H, 0x88, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_08H, 0x88, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_10H, 0x88, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_20H, 0x88, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_30H, 0x88, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_40H, 0x88, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_7FH, 0x88, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_80H, 0x88, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_FFH, 0x88, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_00H, 0x89, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(89H_01H, 0x89, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_02H, 0x89, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_04H, 0x89, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_07H, 0x89, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_08H, 0x89, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_10H, 0x89, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_20H, 0x89, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_30H, 0x89, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_40H, 0x89, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_7FH, 0x89, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_80H, 0x89, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_FFH, 0x89, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(8AH_00H, 0x8A, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(8BH_00H, 0x8B, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -1223,45 +1235,45 @@ static struct iap_event_descr iap_events IAPDESCR(93H_00H, 0x93, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(94H_00H, 0x94, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(97H_00H, 0x97, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(98H_00H, 0x98, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + + IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A0H_00H, 0xA0, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(A1H_01H, 0xA1, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A1H_02H, 0xA1, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A1H_04H, 0xA1, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A1H_08H, 0xA1, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(A1H_10H, 0xA1, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A1H_20H, 0xA1, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A1H_04H, 0xA1, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A1H_08H, 0xA1, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_IB | IAP_F_IBX), + IAPDESCR(A1H_10H, 0xA1, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A1H_20H, 0xA1, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A1H_30H, 0xA1, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(A1H_40H, 0xA1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A1H_80H, 0xA1, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A2H_00H, 0xA2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(A2H_01H, 0xA2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A2H_02H, 0xA2, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(A2H_04H, 0xA2, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A2H_08H, 0xA2, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A2H_10H, 0xA2, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A2H_20H, 0xA2, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(A2H_40H, 0xA2, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1269,15 +1281,17 @@ static struct iap_event_descr iap_events IAPDESCR(A2H_80H, 0xA2, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW), - IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW), + IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB), + IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX), + IAPDESCR(A3H_0CH, 0xA3, 0x08, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(A8H_01H, 0xA8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(A8H_01H, 0xA8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IBX | + IAP_F_IB |IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(AAH_01H, 0xAA, 0x01, IAP_F_FM | IAP_F_CC2), IAPDESCR(AAH_02H, 0xAA, 0x02, IAP_F_FM | IAP_F_CA), @@ -1295,17 +1309,17 @@ static struct iap_event_descr iap_events IAPDESCR(ACH_0AH, 0xAC, 0x0A, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(AEH_01H, 0xAE, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B0H_00H, 0xB0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(B0H_01H, 0xB0, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B0H_02H, 0xB0, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B0H_04H, 0xB0, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B0H_08H, 0xB0, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O), IAPDESCR(B0H_20H, 0xB0, 0x20, IAP_F_FM | IAP_F_I7O), IAPDESCR(B0H_40H, 0xB0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1315,7 +1329,7 @@ static struct iap_event_descr iap_events IAPDESCR(B1H_01H, 0xB1, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(B1H_02H, 0xB1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1353,7 +1367,7 @@ static struct iap_event_descr iap_events IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_CAS), IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_CAS), IAPDESCR(B7H_02H, 0xB7, 0x02, IAP_F_CAS), IAPDESCR(B8H_01H, 0xB8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1364,30 +1378,30 @@ static struct iap_event_descr iap_events IAPDESCR(BAH_02H, 0xBA, 0x02, IAP_F_FM | IAP_F_I7O), IAPDESCR(BBH_01H, 0xBB, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(BCH_11H, 0xBC, 0x11, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_12H, 0xBC, 0x12, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_14H, 0xBC, 0x14, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_18H, 0xBC, 0x18, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_21H, 0xBC, 0x21, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_22H, 0xBC, 0x22, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_24H, 0xBC, 0x24, IAP_F_FM | IAP_F_HW), - IAPDESCR(BCH_28H, 0xBC, 0x28, IAP_F_FM | IAP_F_HW), + IAPDESCR(BCH_11H, 0xBC, 0x11, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_12H, 0xBC, 0x12, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_14H, 0xBC, 0x14, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_18H, 0xBC, 0x18, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_21H, 0xBC, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_22H, 0xBC, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_24H, 0xBC, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(BCH_28H, 0xBC, 0x28, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(BDH_01H, 0xBD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(BDH_20H, 0xBD, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS), + IAP_F_CAS | IAP_F_HWX), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C0H_02H, 0xC0, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB), IAPDESCR(C0H_04H, 0xC0, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1398,21 +1412,22 @@ static struct iap_event_descr iap_events IAPDESCR(C1H_01H, 0xC1, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C1H_02H, 0xC1, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C1H_08H, 0xC1, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C1H_10H, 0xC1, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C1H_20H, 0xC1, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW), + IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW | IAP_F_HWX), + IAPDESCR(C1H_80H, 0xC1, 0x80, IAP_F_IB | IAP_F_IBX), IAPDESCR(C1H_FEH, 0xC1, 0xFE, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C2H_01H, 0xC2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(C2H_02H, 0xC2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C2H_04H, 0xC2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(C2H_07H, 0xC2, 0x07, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1424,37 +1439,39 @@ static struct iap_event_descr iap_events IAPDESCR(C3H_01H, 0xC3, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(C3H_02H, 0xC3, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS | IAP_F_HWX), IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_CAS), IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O), IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_00H, 0xC4, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(C4H_01H, 0xC4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_02H, 0xC4, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_04H, 0xC4, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_08H, 0xC4, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(C4H_0CH, 0xC4, 0x0C, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C4H_0FH, 0xC4, 0x0F, IAP_F_FM | IAP_F_CA), IAPDESCR(C4H_10H, 0xC4, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_20H, 0xC4, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_CAS), IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_CAS), IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_CAS), @@ -1466,17 +1483,17 @@ static struct iap_event_descr iap_events IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C5H_10H, 0xC5, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_CAS), IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_CAS), IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_CAS), @@ -1511,15 +1528,15 @@ static struct iap_event_descr iap_events IAPDESCR(CAH_00H, 0xCA, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), IAPDESCR(CAH_02H, 0xCA, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CAH_04H, 0xCA, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CAH_08H, 0xCA, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CAH_10H, 0xCA, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_CAS), IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_CAS), IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_CAS), @@ -1545,11 +1562,11 @@ static struct iap_event_descr iap_events IAP_F_I7 | IAP_F_WM), IAPDESCR(CCH_03H, 0xCC, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(CCH_20H, 0xCC, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(CDH_00H, 0xCD, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX), IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), @@ -1559,55 +1576,67 @@ static struct iap_event_descr iap_events /* Sandy Bridge / Sandy Bridge Xeon - 11, 12, 21, 41, 42, 81, 82 */ IAPDESCR(D0H_00H, 0xD0, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(D0H_01H, 0xD0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), - IAPDESCR(D0H_02H, 0xD0, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(D0H_10H, 0xD0, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D0H_02H, 0xD0, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(D0H_10H, 0xD0, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(D0H_11H, 0xD0, 0x11, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(D0H_12H, 0xD0, 0x12, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_20H, 0xD0, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAPDESCR(D0H_20H, 0xD0, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_40H, 0xD0, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_80H, 0xD0, 0x80, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - + IAPDESCR(D0H_40H, 0xD0, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX | + IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), /* Not in spec but in linux and Vtune guide */ + IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX | + IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), /* Not in spec but in linux and Vtune guide */ + IAPDESCR(D0H_80H, 0xD0, 0x80, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX | + IAP_F_IB | IAP_F_IBX), /* Not in spec but in linux and Vtune guide */ + IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX | + IAP_F_IB | IAP_F_IBX), /* Not in spec but in linux and Vtune guide */ IAPDESCR(D1H_01H, 0xD1, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D1H_02H, 0xD1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D1H_04H, 0xD1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(D1H_08H, 0xD1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(D1H_10H, 0xD1, 0x10, IAP_F_HW), - IAPDESCR(D1H_20H, 0xD1, 0x20, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D1H_08H, 0xD1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D1H_10H, 0xD1, 0x10, IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX), + IAPDESCR(D1H_20H, 0xD1, 0x20, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | + IAP_F_HW | IAP_F_HWX), IAPDESCR(D1H_40H, 0xD1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_01H, 0xD2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_02H, 0xD2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_04H, 0xD2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_08H, 0xD2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_0FH, 0xD2, 0x0F, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D2H_10H, 0xD2, 0x10, IAP_F_FM | IAP_F_CC2E), IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), - IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_IBX), - IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_IBX), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D3H_03H, 0xD0, 0x3, IAP_F_IBX ), + IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), /* Not defined for IBX */ + IAPDESCR(D3H_0CH, 0xD0, 0x0, IAP_F_IBX ), + IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_IBX ), + IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_IBX ), IAPDESCR(D4H_01H, 0xD4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 08:23:09 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED80739F; Wed, 25 Mar 2015 08:23:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE3F2853; Wed, 25 Mar 2015 08:23:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P8N9hk023518; Wed, 25 Mar 2015 08:23:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P8N9QP023517; Wed, 25 Mar 2015 08:23:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503250823.t2P8N9QP023517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 Mar 2015 08:23: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: r280494 - stable/10/tools/regression/sysvshm 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.18-1 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, 25 Mar 2015 08:23:10 -0000 Author: kib Date: Wed Mar 25 08:23:08 2015 New Revision: 280494 URL: https://svnweb.freebsd.org/changeset/base/280494 Log: MFC r280232: Cosmetics. Modified: stable/10/tools/regression/sysvshm/shmtest.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sysvshm/shmtest.c ============================================================================== --- stable/10/tools/regression/sysvshm/shmtest.c Wed Mar 25 06:41:08 2015 (r280493) +++ stable/10/tools/regression/sysvshm/shmtest.c Wed Mar 25 08:23:08 2015 (r280494) @@ -49,27 +49,22 @@ #include #include -int main __P((int, char *[])); -void print_shmid_ds __P((struct shmid_ds *, mode_t)); -void sigsys_handler __P((int)); -void sigchld_handler __P((int)); -void cleanup __P((void)); -void receiver __P((void)); -void usage __P((void)); - -const char *m_str = "The quick brown fox jumped over the lazy dog."; - -int sender_shmid = -1; -pid_t child_pid; - -key_t shmkey; - -size_t pgsize; +static void print_shmid_ds(struct shmid_ds *, mode_t); +static void sigsys_handler(int); +static void sigchld_handler(int); +static void cleanup(void); +static void receiver(void); +static void usage(void); + +static const char *m_str = "The quick brown fox jumped over the lazy dog."; + +static int sender_shmid = -1; +static pid_t child_pid; +static key_t shmkey; +static size_t pgsize; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct sigaction sa; struct shmid_ds s_ds; @@ -172,17 +167,15 @@ main(argc, argv) errx(1, "sender: received unexpected signal"); } -void -sigsys_handler(signo) - int signo; +static void +sigsys_handler(int signo __unused) { errx(1, "System V Shared Memory support is not present in the kernel"); } -void -sigchld_handler(signo) - int signo; +static void +sigchld_handler(int signo __unused) { struct shmid_ds s_ds; int cstatus; @@ -214,8 +207,8 @@ sigchld_handler(signo) exit(0); } -void -cleanup() +static void +cleanup(void) { /* @@ -227,10 +220,8 @@ cleanup() } } -void -print_shmid_ds(sp, mode) - struct shmid_ds *sp; - mode_t mode; +static void +print_shmid_ds(struct shmid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -262,16 +253,16 @@ print_shmid_ds(sp, mode) errx(1, "mode mismatch"); } -void -usage() +static void +usage(void) { fprintf(stderr, "usage: %s keypath\n", getprogname()); exit(1); } -void -receiver() +static void +receiver(void) { int shmid; void *shm_buf; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 09:40:49 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25A593B8; Wed, 25 Mar 2015 09:40:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF31F99; Wed, 25 Mar 2015 09:40:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P9emG7059804; Wed, 25 Mar 2015 09:40:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P9em1G059803; Wed, 25 Mar 2015 09:40:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503250940.t2P9em1G059803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 09:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280496 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 09:40:49 -0000 Author: arybchik Date: Wed Mar 25 09:40:48 2015 New Revision: 280496 URL: https://svnweb.freebsd.org/changeset/base/280496 Log: MFC: 263297 Return error when packet is dropped because of link down. Submitted by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 08:55:34 2015 (r280495) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:40:48 2015 (r280496) @@ -604,7 +604,7 @@ sfxge_if_transmit(struct ifnet *ifp, str if (!SFXGE_LINK_UP(sc)) { m_freem(m); - return (0); + return (ENETDOWN); } /* Pick the desired transmit queue. */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 09:45:09 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB1B612; Wed, 25 Mar 2015 09:45:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E011C4; Wed, 25 Mar 2015 09:45:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P9j9Gm062913; Wed, 25 Mar 2015 09:45:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P9j8wQ062908; Wed, 25 Mar 2015 09:45:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503250945.t2P9j8wQ062908@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 09:45: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: r280497 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 09:45:09 -0000 Author: arybchik Date: Wed Mar 25 09:45:07 2015 New Revision: 280497 URL: https://svnweb.freebsd.org/changeset/base/280497 Log: MFC: 263332 Add counter for Tx errors returned from if_transmit. Submitted by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:40:48 2015 (r280496) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:45:07 2015 (r280497) @@ -515,6 +515,11 @@ sfxge_tx_packet_add(struct sfxge_txq *tx int locked; int rc; + if (!SFXGE_LINK_UP(txq->sc)) { + rc = ENETDOWN; + goto fail; + } + /* * Try to grab the txq lock. If we are able to get the lock, * the packet will be appended to the "get list" of the deferred @@ -552,6 +557,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx fail: m_freem(m); + atomic_add_long(&txq->early_drops, 1); return (rc); } @@ -602,11 +608,6 @@ sfxge_if_transmit(struct ifnet *ifp, str KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); - if (!SFXGE_LINK_UP(sc)) { - m_freem(m); - return (ENETDOWN); - } - /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { int index = 0; @@ -1406,6 +1407,7 @@ static const struct { SFXGE_TX_STAT(tso_long_headers, tso_long_headers), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), + SFXGE_TX_STAT(tx_early_drops, early_drops), }; static int Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 09:40:48 2015 (r280496) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 09:45:07 2015 (r280497) @@ -159,6 +159,7 @@ struct sfxge_txq { unsigned long tso_long_headers; unsigned long collapses; unsigned long drops; + unsigned long early_drops; /* The following fields change more often, and are used mostly * on the completion path From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 09:54:08 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AFA486D; Wed, 25 Mar 2015 09:54:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2590C1C3; Wed, 25 Mar 2015 09:54:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P9s7gW067445; Wed, 25 Mar 2015 09:54:07 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P9s7fg067444; Wed, 25 Mar 2015 09:54:07 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201503250954.t2P9s7fg067444@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 25 Mar 2015 09:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280498 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 09:54:08 -0000 Author: dchagin Date: Wed Mar 25 09:54:07 2015 New Revision: 280498 URL: https://svnweb.freebsd.org/changeset/base/280498 Log: MFC r279776: Add a cred parameter to the VOP_VPTOCNP(9) manpage. While here fix igor warning about new line. Modified: stable/10/share/man/man9/VOP_VPTOCNP.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- stable/10/share/man/man9/VOP_VPTOCNP.9 Wed Mar 25 09:45:07 2015 (r280497) +++ stable/10/share/man/man9/VOP_VPTOCNP.9 Wed Mar 25 09:54:07 2015 (r280498) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2011 +.Dd March 8, 2015 .Dt VOP_VPTOCNP 9 .Os .Sh NAME @@ -36,9 +36,10 @@ .Nd translate a vnode to its component name .Sh SYNOPSIS .In sys/param.h +.In sys/ucred.h .In sys/vnode.h .Ft int -.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "char *buf" "int *buflen" +.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "struct ucred *cred" "char *buf" "int *buflen" .Sh DESCRIPTION This translates a vnode into its component name, and writes that name to the head of the buffer specified by @@ -49,6 +50,8 @@ The vnode to translate. .It Fa dvp The vnode of the parent directory of .Fa vp . +.It Fa cred +The caller credentials. .It Fa buf The buffer into which to prepend the component name. .It Fa buflen @@ -59,7 +62,8 @@ The default implementation of .Nm scans through .Fa vp Ns 's -parent directory looking for a dirent with a matching file number. If +parent directory looking for a dirent with a matching file number. +If .Fa vp is not a directory, then .Nm From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 09:56:50 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26AE7AA1; Wed, 25 Mar 2015 09:56:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4CE1DF; Wed, 25 Mar 2015 09:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P9un0r067866; Wed, 25 Mar 2015 09:56:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P9un7g067862; Wed, 25 Mar 2015 09:56:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503250956.t2P9un7g067862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 09:56:49 +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: r280499 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 09:56:50 -0000 Author: arybchik Date: Wed Mar 25 09:56:48 2015 New Revision: 280499 URL: https://svnweb.freebsd.org/changeset/base/280499 Log: MFC: 263649 sfxge: limit software Tx queue size. Previous implementation limits put queue size only (when Tx lock can't be acquired), but get queue may grow unboundedly which results in mbuf pools exhaustion and latency growth. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:54:07 2015 (r280498) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:56:48 2015 (r280499) @@ -476,6 +476,9 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); + if (stdp->std_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + return (ENOBUFS); + *(stdp->std_getp) = mbuf; stdp->std_getp = &mbuf->m_nextpkt; stdp->std_count++; @@ -495,8 +498,8 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, old_len = mp->m_pkthdr.csum_data; } else old_len = 0; - if (old_len >= SFXGE_TX_MAX_DEFERRED) - return ENOBUFS; + if (old_len >= SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT) + return (ENOBUFS); mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; } while (atomic_cmpset_ptr(putp, old, new) == 0); @@ -527,12 +530,9 @@ sfxge_tx_packet_add(struct sfxge_txq *tx */ locked = mtx_trylock(&txq->lock); - /* - * Can only fail if we weren't able to get the lock. - */ if (sfxge_tx_qdpl_put(txq, m, locked) != 0) { - KASSERT(!locked, - ("sfxge_tx_qdpl_put() failed locked")); + if (locked) + mtx_unlock(&txq->lock); rc = ENOBUFS; goto fail; } Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 09:54:07 2015 (r280498) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 09:56:48 2015 (r280499) @@ -75,7 +75,8 @@ struct sfxge_tx_mapping { enum sfxge_tx_buf_flags flags; }; -#define SFXGE_TX_MAX_DEFERRED 64 +#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 /* * Deferred packet list. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 09:59:42 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2273D52; Wed, 25 Mar 2015 09:59:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AE0D20F; Wed, 25 Mar 2015 09:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P9xgsu068528; Wed, 25 Mar 2015 09:59:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P9xcVT068508; Wed, 25 Mar 2015 09:59:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503250959.t2P9xcVT068508@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 09:59: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: r280501 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 09:59:42 -0000 Author: arybchik Date: Wed Mar 25 09:59:38 2015 New Revision: 280501 URL: https://svnweb.freebsd.org/changeset/base/280501 Log: MFC: 272325 cleanup: code style fixes Remove trailing whitespaces and tabs. Enclose value in return statements in parentheses. Use tabs after #define. Do not skip comparison with 0/NULL in boolean expressions. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efsys.h stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_dma.c stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_intr.c stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_rx.h stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 09:59:38 2015 (r280501) @@ -53,44 +53,44 @@ extern "C" { #define EFSYS_HAS_UINT64 1 #define EFSYS_USE_UINT64 0 #if _BYTE_ORDER == _BIG_ENDIAN -#define EFSYS_IS_BIG_ENDIAN 1 -#define EFSYS_IS_LITTLE_ENDIAN 0 +#define EFSYS_IS_BIG_ENDIAN 1 +#define EFSYS_IS_LITTLE_ENDIAN 0 #elif _BYTE_ORDER == _LITTLE_ENDIAN -#define EFSYS_IS_BIG_ENDIAN 0 -#define EFSYS_IS_LITTLE_ENDIAN 1 +#define EFSYS_IS_BIG_ENDIAN 0 +#define EFSYS_IS_LITTLE_ENDIAN 1 #endif #include "efx_types.h" /* Common code requires this */ #if __FreeBSD_version < 800068 -#define memmove(d, s, l) bcopy(s, d, l) +#define memmove(d, s, l) bcopy(s, d, l) #endif - + /* FreeBSD equivalents of Solaris things */ #ifndef _NOTE -#define _NOTE(s) +#define _NOTE(s) #endif #ifndef B_FALSE -#define B_FALSE FALSE +#define B_FALSE FALSE #endif #ifndef B_TRUE -#define B_TRUE TRUE +#define B_TRUE TRUE #endif #ifndef IS_P2ALIGNED -#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) +#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) #endif #ifndef P2ROUNDUP -#define P2ROUNDUP(x, align) (-(-(x) & -(align))) +#define P2ROUNDUP(x, align) (-(-(x) & -(align))) #endif #ifndef IS2P -#define ISP2(x) (((x) & ((x) - 1)) == 0) +#define ISP2(x) (((x) & ((x) - 1)) == 0) #endif -#define ENOTACTIVE EINVAL +#define ENOTACTIVE EINVAL /* Memory type to use on FreeBSD */ MALLOC_DECLARE(M_SFXGE); @@ -242,7 +242,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_PHY_PROPS 0 #define EFSYS_OPT_PHY_BIST 1 #define EFSYS_OPT_PHY_LED_CONTROL 1 -#define EFSYS_OPT_PHY_FLAGS 0 +#define EFSYS_OPT_PHY_FLAGS 0 #define EFSYS_OPT_VPD 1 #define EFSYS_OPT_NVRAM 1 @@ -256,8 +256,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_WOL 1 #define EFSYS_OPT_RX_SCALE 1 #define EFSYS_OPT_QSTATS 1 -#define EFSYS_OPT_FILTER 0 -#define EFSYS_OPT_RX_SCATTER 0 +#define EFSYS_OPT_FILTER 0 +#define EFSYS_OPT_RX_SCATTER 0 #define EFSYS_OPT_RX_HDR_SPLIT 0 #define EFSYS_OPT_EV_PREFETCH 0 @@ -272,7 +272,7 @@ typedef struct __efsys_identifier_s efsy #ifndef KDTRACE_HOOKS -#define EFSYS_PROBE(_name) +#define EFSYS_PROBE(_name) #define EFSYS_PROBE1(_name, _type1, _arg1) @@ -815,16 +815,16 @@ extern void sfxge_err(efsys_identifier_t panic(#_exp); \ } while (0) -#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \ +#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \ const _t __x = (_t)(_x); \ const _t __y = (_t)(_y); \ if (!(__x _op __y)) \ - panic("assertion failed at %s:%u", __FILE__, __LINE__); \ + panic("assertion failed at %s:%u", __FILE__, __LINE__); \ } while(0) -#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t) -#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t) -#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t) +#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t) +#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t) +#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t) #ifdef __cplusplus } Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 09:59:38 2015 (r280501) @@ -56,12 +56,12 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define SFXGE_CAP (IFCAP_VLAN_MTU | \ +#define SFXGE_CAP (IFCAP_VLAN_MTU | \ IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \ IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) -#define SFXGE_CAP_ENABLE SFXGE_CAP -#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ +#define SFXGE_CAP_ENABLE SFXGE_CAP +#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); @@ -77,7 +77,7 @@ sfxge_start(struct sfxge_softc *sc) sx_assert(&sc->softc_lock, LA_XLOCKED); if (sc->init_state == SFXGE_STARTED) - return 0; + return (0); if (sc->init_state != SFXGE_REGISTERED) { rc = EINVAL; @@ -222,7 +222,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign ifp->if_mtu = ifr->ifr_mtu; error = sfxge_start(sc); sx_xunlock(&sc->softc_lock); - if (error) { + if (error != 0) { ifp->if_flags &= ~IFF_UP; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if_down(ifp); @@ -286,7 +286,7 @@ sfxge_ifnet_fini(struct ifnet *ifp) if_free(ifp); } -static int +static int sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc) { const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp); @@ -323,11 +323,11 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - return 0; + return (0); fail: ether_ifdetach(sc->ifnet); - return rc; + return (rc); } void @@ -346,7 +346,7 @@ sfxge_bar_init(struct sfxge_softc *sc) { efsys_bar_t *esbp = &sc->bar; - esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR); + esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR); if ((esbp->esb_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &esbp->esb_rid, RF_ACTIVE)) == NULL) { device_printf(sc->dev, "Cannot allocate BAR region %d\n", @@ -385,7 +385,7 @@ sfxge_create(struct sfxge_softc *sc) device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics"); - if (!sc->stats_node) { + if (sc->stats_node == NULL) { error = ENOMEM; goto fail; } @@ -553,14 +553,14 @@ sfxge_vpd_handler(SYSCTL_HANDLER_ARGS) struct sfxge_softc *sc = arg1; efx_vpd_value_t value; int rc; - + value.evv_tag = arg2 >> 16; value.evv_keyword = arg2 & 0xffff; if ((rc = efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, value.evv_value, value.evv_length); + return (SYSCTL_OUT(req, value.evv_value, value.evv_length)); } static void @@ -622,12 +622,12 @@ sfxge_vpd_init(struct sfxge_softc *sc) for (keyword[1] = 'A'; keyword[1] <= 'Z'; keyword[1]++) sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, keyword); - return 0; - + return (0); + fail2: free(sc->vpd_data, M_SFXGE); fail: - return rc; + return (rc); } static void @@ -744,12 +744,12 @@ sfxge_probe(device_t dev) pci_device_id = pci_get_device(dev); rc = efx_family(pci_vendor_id, pci_device_id, &family); - if (rc) - return ENXIO; + if (rc != 0) + return (ENXIO); KASSERT(family == EFX_FAMILY_SIENA, ("impossible controller family")); device_set_desc(dev, "Solarflare SFC9000 family"); - return 0; + return (0); } static device_method_t sfxge_methods[] = { Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 09:59:38 2015 (r280501) @@ -30,7 +30,7 @@ */ #ifndef _SFXGE_H -#define _SFXGE_H +#define _SFXGE_H #include #include @@ -52,43 +52,43 @@ /* This should be right on most machines the driver will be used on, and * we needn't care too much about wasting a few KB per interface. */ -#define CACHE_LINE_SIZE 128 +#define CACHE_LINE_SIZE 128 #endif #ifndef IFCAP_LINKSTATE -#define IFCAP_LINKSTATE 0 +#define IFCAP_LINKSTATE 0 #endif #ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 +#define IFCAP_VLAN_HWTSO 0 #endif #ifndef IFM_10G_T -#define IFM_10G_T IFM_UNKNOWN +#define IFM_10G_T IFM_UNKNOWN #endif #ifndef IFM_10G_KX4 -#define IFM_10G_KX4 IFM_10G_CX4 +#define IFM_10G_KX4 IFM_10G_CX4 #endif #if __FreeBSD_version >= 800054 /* Networking core is multiqueue aware. We can manage our own TX * queues and use m_pkthdr.flowid. */ -#define SFXGE_HAVE_MQ +#define SFXGE_HAVE_MQ #endif #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 -#define SFXGE_HAVE_DESCRIBE_INTR +#define SFXGE_HAVE_DESCRIBE_INTR #endif #ifdef IFM_ETH_RXPAUSE -#define SFXGE_HAVE_PAUSE_MEDIAOPTS +#define SFXGE_HAVE_PAUSE_MEDIAOPTS #endif #ifndef CTLTYPE_U64 -#define CTLTYPE_U64 CTLTYPE_QUAD +#define CTLTYPE_U64 CTLTYPE_QUAD #endif #include "sfxge_rx.h" #include "sfxge_tx.h" -#define SFXGE_IP_ALIGN 2 +#define SFXGE_IP_ALIGN 2 -#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ +#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ enum sfxge_evq_state { SFXGE_EVQ_UNINITIALIZED = 0, @@ -132,9 +132,9 @@ enum sfxge_intr_state { }; struct sfxge_intr_hdl { - int eih_rid; - void *eih_tag; - struct resource *eih_res; + int eih_rid; + void *eih_tag; + struct resource *eih_res; }; struct sfxge_intr { @@ -196,7 +196,7 @@ struct sfxge_softc { device_t dev; struct sx softc_lock; enum sfxge_softc_state init_state; - struct ifnet *ifnet; + struct ifnet *ifnet; unsigned int if_flags; struct sysctl_oid *stats_node; @@ -208,7 +208,7 @@ struct sfxge_softc { efx_nic_t *enp; struct mtx enp_lock; - bus_dma_tag_t parent_dma_tag; + bus_dma_tag_t parent_dma_tag; efsys_bar_t bar; struct sfxge_intr intr; @@ -242,8 +242,8 @@ struct sfxge_softc { #endif }; -#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) -#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) +#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) +#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) /* * From sfxge.c. @@ -298,6 +298,6 @@ extern void sfxge_mac_link_update(struct extern int sfxge_mac_filter_set(struct sfxge_softc *sc); extern int sfxge_port_ifmedia_init(struct sfxge_softc *sc); -#define SFXGE_MAX_MTU (9 * 1024) +#define SFXGE_MAX_MTU (9 * 1024) #endif /* _SFXGE_H */ Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 09:59:38 2015 (r280501) @@ -46,7 +46,7 @@ sfxge_dma_cb(void *arg, bus_dma_segment_ addr = arg; - if (error) { + if (error != 0) { *addr = 0; return; } @@ -78,7 +78,7 @@ retry: return (0); } #if defined(__i386__) || defined(__amd64__) - while (m && seg_count < maxsegs) { + while (m != NULL && seg_count < maxsegs) { /* * firmware doesn't like empty segments */ @@ -193,7 +193,7 @@ sfxge_dma_init(struct sfxge_softc *sc) BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lock, lockarg */ - &sc->parent_dma_tag)) { + &sc->parent_dma_tag) != 0) { device_printf(sc->dev, "Cannot allocate parent DMA tag\n"); return (ENOMEM); } Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 09:59:38 2015 (r280501) @@ -221,7 +221,7 @@ sfxge_get_txq_by_label(struct sfxge_evq KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES); - return evq->sc->txq[index]; + return (evq->sc->txq[index]); } static boolean_t @@ -438,7 +438,7 @@ sfxge_ev_stat_handler(SYSCTL_HANDLER_ARG sfxge_ev_stat_update(sc); - return SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id])); + return (SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id]))); } static void @@ -488,7 +488,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG sx_xlock(&sc->softc_lock); - if (req->newptr) { + if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &moderation, sizeof(moderation))) != 0) goto out; @@ -515,14 +515,14 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG out: sx_xunlock(&sc->softc_lock); - return error; + return (error); } static boolean_t sfxge_ev_initialized(void *arg) { struct sfxge_evq *evq; - + evq = (struct sfxge_evq *)arg; KASSERT(evq->init_state == SFXGE_EVQ_STARTING, @@ -741,7 +741,7 @@ sfxge_ev_start(struct sfxge_softc *sc) /* Initialize the event module */ if ((rc = efx_ev_init(sc->enp)) != 0) - return rc; + return (rc); /* Start the event queues */ for (index = 0; index < intr->n_alloc; index++) { Modified: stable/10/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 09:59:38 2015 (r280501) @@ -66,19 +66,19 @@ sfxge_intr_line_filter(void *arg) ("intr->type != EFX_INTR_LINE")); if (intr->state != SFXGE_INTR_STARTED) - return FILTER_STRAY; + return (FILTER_STRAY); (void)efx_intr_status_line(enp, &fatal, &qmask); if (fatal) { (void) efx_intr_disable(enp); (void) efx_intr_fatal(enp); - return FILTER_HANDLED; + return (FILTER_HANDLED); } if (qmask != 0) { intr->zero_count = 0; - return FILTER_SCHEDULE_THREAD; + return (FILTER_SCHEDULE_THREAD); } /* SF bug 15783: If the function is not asserting its IRQ and @@ -93,13 +93,13 @@ sfxge_intr_line_filter(void *arg) if (intr->zero_count++ == 0) { if (evq->init_state == SFXGE_EVQ_STARTED) { if (efx_ev_qpending(evq->common, evq->read_ptr)) - return FILTER_SCHEDULE_THREAD; + return (FILTER_SCHEDULE_THREAD); efx_ev_qprime(evq->common, evq->read_ptr); - return FILTER_HANDLED; + return (FILTER_HANDLED); } } - return FILTER_STRAY; + return (FILTER_STRAY); } static void @@ -171,7 +171,7 @@ sfxge_intr_bus_enable(struct sfxge_softc default: KASSERT(0, ("Invalid interrupt type")); - return EINVAL; + return (EINVAL); } /* Try to add the handlers */ @@ -250,7 +250,7 @@ sfxge_intr_alloc(struct sfxge_softc *sc, table[i].eih_res = res; } - if (error) { + if (error != 0) { count = i - 1; for (i = 0; i < count; i++) bus_release_resource(dev, SYS_RES_IRQ, @@ -345,7 +345,7 @@ sfxge_intr_setup_msi(struct sfxge_softc if (count == 0) return (EINVAL); - if ((error = pci_alloc_msi(dev, &count)) != 0) + if ((error = pci_alloc_msi(dev, &count)) != 0) return (ENOMEM); /* Allocate interrupt handler. */ @@ -420,7 +420,7 @@ void sfxge_intr_stop(struct sfxge_softc *sc) { struct sfxge_intr *intr; - + intr = &sc->intr; KASSERT(intr->state == SFXGE_INTR_STARTED, Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 09:59:38 2015 (r280501) @@ -74,7 +74,7 @@ sfxge_mac_stat_update(struct sfxge_softc /* Try to update the cached counters */ if ((rc = efx_mac_stats_update(sc->enp, esmp, - port->mac_stats.decode_buf, NULL)) != EAGAIN) + port->mac_stats.decode_buf, NULL)) != EAGAIN) goto out; DELAY(100); @@ -83,7 +83,7 @@ sfxge_mac_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: mtx_unlock(&port->lock); - return rc; + return (rc); } static int @@ -94,11 +94,11 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_AR int rc; if ((rc = sfxge_mac_stat_update(sc)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, + return (SYSCTL_OUT(req, (uint64_t *)sc->port.mac_stats.decode_buf + id, - sizeof(uint64_t)); + sizeof(uint64_t))); } static void @@ -130,9 +130,9 @@ sfxge_port_wanted_fc(struct sfxge_softc struct ifmedia_entry *ifm = sc->media.ifm_cur; if (ifm->ifm_media == (IFM_ETHER | IFM_AUTO)) - return EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE; - return ((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) | - ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0); + return (EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE); + return (((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) | + ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0)); } static unsigned int @@ -150,13 +150,13 @@ sfxge_port_link_fc_ifm(struct sfxge_soft static unsigned int sfxge_port_wanted_fc(struct sfxge_softc *sc) { - return sc->port.wanted_fc; + return (sc->port.wanted_fc); } static unsigned int sfxge_port_link_fc_ifm(struct sfxge_softc *sc) { - return 0; + return (0); } static int @@ -172,7 +172,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND mtx_lock(&port->lock); - if (req->newptr) { + if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0) goto out; @@ -235,7 +235,7 @@ sfxge_mac_link_update(struct sfxge_softc { struct sfxge_port *port; int link_state; - + port = &sc->port; if (port->link_mode == mode) @@ -289,7 +289,7 @@ sfxge_mac_filter_set_locked(struct sfxge /* Set promisc-unicast and broadcast filter bits */ if ((rc = efx_mac_filter_set(enp, !!(ifp->if_flags & IFF_PROMISC), B_TRUE)) != 0) - return rc; + return (rc); /* Set multicast hash filter */ if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) { @@ -311,7 +311,7 @@ sfxge_mac_filter_set_locked(struct sfxge } if_maddr_runlock(ifp); } - return efx_mac_hash_set(enp, bucket); + return (efx_mac_hash_set(enp, bucket)); } int @@ -336,7 +336,7 @@ sfxge_mac_filter_set(struct sfxge_softc else rc = 0; mtx_unlock(&port->lock); - return rc; + return (rc); } void @@ -413,7 +413,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every second */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + 1000, B_FALSE)) != 0) goto fail2; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) @@ -435,7 +435,7 @@ fail4: (void)efx_mac_drain(enp, B_TRUE); fail3: (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 0, B_FALSE); + 0, B_FALSE); fail2: efx_port_fini(sc->enp); fail: @@ -488,7 +488,7 @@ sfxge_phy_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: mtx_unlock(&port->lock); - return rc; + return (rc); } static int @@ -499,11 +499,11 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_AR int rc; if ((rc = sfxge_phy_stat_update(sc)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, + return (SYSCTL_OUT(req, (uint32_t *)sc->port.phy_stats.decode_buf + id, - sizeof(uint32_t)); + sizeof(uint32_t))); } static void @@ -619,7 +619,7 @@ fail: free(port->phy_stats.decode_buf, M_SFXGE); (void)mtx_destroy(&port->lock); port->sc = NULL; - return rc; + return (rc); } static int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = { @@ -697,9 +697,9 @@ sfxge_media_change(struct ifnet *ifp) rc = efx_phy_adv_cap_set(sc->enp, ifm->ifm_data); out: - sx_xunlock(&sc->softc_lock); + sx_xunlock(&sc->softc_lock); - return rc; + return (rc); } int sfxge_port_ifmedia_init(struct sfxge_softc *sc) @@ -788,7 +788,7 @@ int sfxge_port_ifmedia_init(struct sfxge best_mode_ifm = mode_ifm; } - if (best_mode_ifm) + if (best_mode_ifm != 0) ifmedia_set(&sc->media, best_mode_ifm); /* Now discard port state until interface is started. */ @@ -796,5 +796,5 @@ int sfxge_port_ifmedia_init(struct sfxge out2: efx_nic_fini(sc->enp); out: - return rc; + return (rc); } Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 09:59:38 2015 (r280501) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) -#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) +#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) +#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) /* Size of the LRO hash table. Must be a power of 2. A larger table * means we can accelerate a larger number of streams. @@ -87,10 +87,10 @@ static int lro_slow_start_packets = 2000 static int lro_loss_packets = 20; /* Flags for sfxge_lro_conn::l2_id; must not collide with EVL_VLID_MASK */ -#define SFXGE_LRO_L2_ID_VLAN 0x4000 -#define SFXGE_LRO_L2_ID_IPV6 0x8000 -#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN) -#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) +#define SFXGE_LRO_L2_ID_VLAN 0x4000 +#define SFXGE_LRO_L2_ID_IPV6 0x8000 +#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN) +#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) /* Compare IPv6 addresses, avoiding conditional branches */ static __inline unsigned long ipv6_addr_cmp(const struct in6_addr *left, @@ -179,12 +179,12 @@ static inline struct mbuf *sfxge_rx_allo m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT); /* Allocate (and attach) packet buffer */ - if (m && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { + if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { uma_zfree(zone_mbuf, m); m = NULL; } - return m; + return (m); } #define SFXGE_REFILL_BATCH 64 @@ -370,7 +370,7 @@ static void sfxge_lro_drop(struct sfxge_ KASSERT(!c->mbuf, ("found orphaned mbuf")); - if (c->next_buf.mbuf) { + if (c->next_buf.mbuf != NULL) { sfxge_rx_deliver(rxq->sc, &c->next_buf); LIST_REMOVE(c, active_link); } @@ -510,7 +510,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx if (__predict_false(th_seq != c->next_seq)) { /* Out-of-order, so start counting again. */ - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); c->n_in_order_pkts -= lro_loss_packets; c->next_seq = th_seq + data_length; @@ -522,10 +522,10 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx now = ticks; if (now - c->last_pkt_ticks > lro_idle_ticks) { ++rxq->lro.n_drop_idle; - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); sfxge_lro_drop(rxq, c); - return 0; + return (0); } c->last_pkt_ticks = ticks; @@ -537,12 +537,12 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx } if (__predict_false(dont_merge)) { - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); if (th->th_flags & (TH_FIN | TH_RST)) { ++rxq->lro.n_drop_closed; sfxge_lro_drop(rxq, c); - return 0; + return (0); } goto deliver_buf_out; } @@ -563,11 +563,11 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx } rx_buf->mbuf = NULL; - return 1; + return (1); deliver_buf_out: sfxge_rx_deliver(rxq->sc, rx_buf); - return 1; + return (1); } static void sfxge_lro_new_conn(struct sfxge_lro_state *st, uint32_t conn_hash, @@ -621,7 +621,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct struct sfxge_lro_conn *c; uint16_t l2_id; uint16_t l3_proto; - void *nh; + void *nh; struct tcphdr *th; uint32_t conn_hash; unsigned bucket; @@ -671,7 +671,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct continue; if ((c->source - th->th_sport) | (c->dest - th->th_dport)) continue; - if (c->mbuf) { + if (c->mbuf != NULL) { if (SFXGE_LRO_CONN_IS_TCPIPV4(c)) { struct ip *c_iph, *iph = nh; c_iph = c->nh; @@ -691,7 +691,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct TAILQ_REMOVE(&rxq->lro.conns[bucket], c, link); TAILQ_INSERT_HEAD(&rxq->lro.conns[bucket], c, link); - if (c->next_buf.mbuf) { + if (c->next_buf.mbuf != NULL) { if (!sfxge_lro_try_merge(rxq, c)) goto deliver_now; } else { @@ -720,10 +720,10 @@ static void sfxge_lro_end_of_burst(struc while (!LIST_EMPTY(&st->active_conns)) { c = LIST_FIRST(&st->active_conns); - if (!c->delivered && c->mbuf) + if (!c->delivered && c->mbuf != NULL) sfxge_lro_deliver(st, c); if (sfxge_lro_try_merge(rxq, c)) { - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(st, c); LIST_REMOVE(c, active_link); } @@ -836,7 +836,7 @@ sfxge_rx_qstop(struct sfxge_softc *sc, u evq = sc->evq[index]; mtx_lock(&evq->lock); - + KASSERT(rxq->init_state == SFXGE_RXQ_STARTED, ("rxq not started")); @@ -881,7 +881,7 @@ again: rxq->loopback = 0; /* Destroy the common code receive queue. */ - efx_rx_qdestroy(rxq->common); + efx_rx_qdestroy(rxq->common); efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, EFX_RXQ_NBUFS(SFXGE_NDESCS)); @@ -1136,7 +1136,7 @@ static const struct { const char *name; size_t offset; } sfxge_rx_stats[] = { -#define SFXGE_RX_STAT(name, member) \ +#define SFXGE_RX_STAT(name, member) \ { #name, offsetof(struct sfxge_rxq, member) } SFXGE_RX_STAT(lro_merges, lro.n_merges), SFXGE_RX_STAT(lro_bursts, lro.n_bursts), @@ -1161,7 +1161,7 @@ sfxge_rx_stat_handler(SYSCTL_HANDLER_ARG sum += *(unsigned int *)((caddr_t)sc->rxq[index] + sfxge_rx_stats[id].offset); - return SYSCTL_OUT(req, &sum, sizeof(sum)); + return (SYSCTL_OUT(req, &sum, sizeof(sum))); } static void Modified: stable/10/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 09:59:38 2015 (r280501) @@ -30,25 +30,25 @@ */ #ifndef _SFXGE_RX_H -#define _SFXGE_RX_H +#define _SFXGE_RX_H -#define SFXGE_MAGIC_RESERVED 0x8000 +#define SFXGE_MAGIC_RESERVED 0x8000 -#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 -#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ - ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) +#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 +#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ + ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) -#define SFXGE_MAGIC_RX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ - (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ + (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_RX_QREFILL \ - (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QREFILL \ + (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_TX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_TX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) #define SFXGE_RX_SCALE_MAX EFX_MAXRSS Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:58:02 2015 (r280500) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:59:38 2015 (r280501) @@ -74,8 +74,8 @@ __FBSDID("$FreeBSD$"); * the output at a packet boundary. Allow for a reasonable * minimum MSS of 512. */ -#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) -#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) +#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) +#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -343,7 +343,7 @@ static int sfxge_tx_queue_mbuf(struct sf /* Post the fragment list. */ sfxge_tx_qlist_post(txq); - return 0; + return (0); reject_mapped: bus_dmamap_unload(txq->packet_dma_tag, *used_map); @@ -352,7 +352,7 @@ reject: m_freem(mbuf); ++txq->drops; - return rc; + return (rc); } #ifdef SFXGE_HAVE_MQ @@ -426,8 +426,8 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx ("queue unblocked but count is non-zero")); } -#define SFXGE_TX_QDPL_PENDING(_txq) \ - ((_txq)->dpl.std_put != 0) +#define SFXGE_TX_QDPL_PENDING(_txq) \ + ((_txq)->dpl.std_put != 0) /* * Service the deferred packet list. @@ -493,7 +493,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, do { old = *putp; - if (old) { + if (old != 0) { struct mbuf *mp = (struct mbuf *)old; old_len = mp->m_pkthdr.csum_data; } else @@ -559,7 +559,6 @@ fail: m_freem(m); atomic_add_long(&txq->early_drops, 1); return (rc); - } static void @@ -577,7 +576,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx } stdp->std_get = NULL; stdp->std_count = 0; - stdp->std_getp = &stdp->std_get; + stdp->std_getp = &stdp->std_get; mtx_unlock(&txq->lock); } @@ -599,7 +598,7 @@ sfxge_if_qflush(struct ifnet *ifp) */ int sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) -{ +{ struct sfxge_softc *sc; struct sfxge_txq *txq; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:01:10 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33776EBE; Wed, 25 Mar 2015 10:01:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2D022F; Wed, 25 Mar 2015 10:01:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA1AGa068956; Wed, 25 Mar 2015 10:01:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA17I6068947; Wed, 25 Mar 2015 10:01:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251001.t2PA17I6068947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280502 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:01:10 -0000 Author: arybchik Date: Wed Mar 25 10:01:07 2015 New Revision: 280502 URL: https://svnweb.freebsd.org/changeset/base/280502 Log: MFC: 272328 Make size of Tx and Rx rings configurable Required size of event queue is calculated now. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_rx.h stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:01:07 2015 (r280502) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -66,6 +67,25 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); + +SYSCTL_NODE(_hw, OID_AUTO, sfxge, CTLFLAG_RD, 0, + "SFXGE driver parameters"); + +#define SFXGE_PARAM_RX_RING SFXGE_PARAM(rx_ring) +static int sfxge_rx_ring_entries = SFXGE_NDESCS; +TUNABLE_INT(SFXGE_PARAM_RX_RING, &sfxge_rx_ring_entries); +SYSCTL_INT(_hw_sfxge, OID_AUTO, rx_ring, CTLFLAG_RDTUN, + &sfxge_rx_ring_entries, 0, + "Maximum number of descriptors in a receive ring"); + +#define SFXGE_PARAM_TX_RING SFXGE_PARAM(tx_ring) +static int sfxge_tx_ring_entries = SFXGE_NDESCS; +TUNABLE_INT(SFXGE_PARAM_TX_RING, &sfxge_tx_ring_entries); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, CTLFLAG_RDTUN, + &sfxge_tx_ring_entries, 0, + "Maximum number of descriptors in a transmit ring"); + + static void sfxge_reset(void *arg, int npending); @@ -313,8 +333,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_qflush = sfxge_if_qflush; #else ifp->if_start = sfxge_if_start; - IFQ_SET_MAXLEN(&ifp->if_snd, SFXGE_NDESCS - 1); - ifp->if_snd.ifq_drv_maxlen = SFXGE_NDESCS - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, sc->txq_entries - 1); + ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1; IFQ_SET_READY(&ifp->if_snd); mtx_init(&sc->tx_lock, "txq", NULL, MTX_DEF); @@ -413,6 +433,26 @@ sfxge_create(struct sfxge_softc *sc) goto fail3; sc->enp = enp; + if (!ISP2(sfxge_rx_ring_entries) || + !(sfxge_rx_ring_entries & EFX_RXQ_NDESCS_MASK)) { + log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", + SFXGE_PARAM_RX_RING, sfxge_rx_ring_entries, + EFX_RXQ_MINNDESCS, EFX_RXQ_MAXNDESCS); + error = EINVAL; + goto fail_rx_ring_entries; + } + sc->rxq_entries = sfxge_rx_ring_entries; + + if (!ISP2(sfxge_tx_ring_entries) || + !(sfxge_tx_ring_entries & EFX_TXQ_NDESCS_MASK)) { + log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", + SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries, + EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS); + error = EINVAL; + goto fail_tx_ring_entries; + } + sc->txq_entries = sfxge_tx_ring_entries; + /* Initialize MCDI to talk to the microcontroller. */ if ((error = sfxge_mcdi_init(sc)) != 0) goto fail4; @@ -485,6 +525,8 @@ fail5: sfxge_mcdi_fini(sc); fail4: +fail_tx_ring_entries: +fail_rx_ring_entries: sc->enp = NULL; efx_nic_destroy(enp); mtx_destroy(&sc->enp_lock); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:01:07 2015 (r280502) @@ -86,6 +86,8 @@ #include "sfxge_rx.h" #include "sfxge_tx.h" +#define ROUNDUP_POW_OF_TWO(_n) (1ULL << flsl((_n) - 1)) + #define SFXGE_IP_ALIGN 2 #define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ @@ -105,6 +107,7 @@ struct sfxge_evq { enum sfxge_evq_state init_state; unsigned int index; + unsigned int entries; efsys_mem_t mem; unsigned int buf_base_id; @@ -120,7 +123,6 @@ struct sfxge_evq { struct sfxge_txq **txqs; }; -#define SFXGE_NEVS 4096 #define SFXGE_NDESCS 1024 #define SFXGE_MODERATION 30 @@ -208,6 +210,9 @@ struct sfxge_softc { efx_nic_t *enp; struct mtx enp_lock; + unsigned int rxq_entries; + unsigned int txq_entries; + bus_dma_tag_t parent_dma_tag; efsys_bar_t bar; @@ -245,6 +250,10 @@ struct sfxge_softc { #define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) #define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) +#define SFXGE_PARAM(_name) "hw.sfxge." #_name + +SYSCTL_DECL(_hw_sfxge); + /* * From sfxge.c. */ Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:01:07 2015 (r280502) @@ -97,7 +97,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u if (rxq->init_state != SFXGE_RXQ_STARTED) goto done; - expected = rxq->pending++ & (SFXGE_NDESCS - 1); + expected = rxq->pending++ & rxq->ptr_mask; if (id != expected) { evq->exception = B_TRUE; @@ -242,10 +242,10 @@ sfxge_ev_tx(void *arg, uint32_t label, u if (txq->init_state != SFXGE_TXQ_STARTED) goto done; - stop = (id + 1) & (SFXGE_NDESCS - 1); - id = txq->pending & (SFXGE_NDESCS - 1); + stop = (id + 1) & txq->ptr_mask; + id = txq->pending & txq->ptr_mask; - delta = (stop >= id) ? (stop - id) : (SFXGE_NDESCS - id + stop); + delta = (stop >= id) ? (stop - id) : (txq->entries - id + stop); txq->pending += delta; evq->tx_done++; @@ -630,7 +630,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, u efx_ev_qdestroy(evq->common); efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, - EFX_EVQ_NBUFS(SFXGE_NEVS)); + EFX_EVQ_NBUFS(evq->entries)); mtx_unlock(&evq->lock); } @@ -649,15 +649,15 @@ sfxge_ev_qstart(struct sfxge_softc *sc, ("evq->init_state != SFXGE_EVQ_INITIALIZED")); /* Clear all events. */ - (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(SFXGE_NEVS)); + (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(evq->entries)); /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, evq->buf_base_id, esmp, - EFX_EVQ_NBUFS(SFXGE_NEVS))) != 0) - return rc; + EFX_EVQ_NBUFS(evq->entries))) != 0) + return (rc); /* Create the common code event queue. */ - if ((rc = efx_ev_qcreate(sc->enp, index, esmp, SFXGE_NEVS, + if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, evq->buf_base_id, &evq->common)) != 0) goto fail; @@ -700,7 +700,7 @@ fail2: efx_ev_qdestroy(evq->common); fail: efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, - EFX_EVQ_NBUFS(SFXGE_NEVS)); + EFX_EVQ_NBUFS(evq->entries)); return (rc); } @@ -797,15 +797,31 @@ sfxge_ev_qinit(struct sfxge_softc *sc, u sc->evq[index] = evq; esmp = &evq->mem; + /* Build an event queue with room for one event per tx and rx buffer, + * plus some extra for link state events and MCDI completions. + * There are three tx queues in the first event queue and one in + * other. + */ + if (index == 0) + evq->entries = + ROUNDUP_POW_OF_TWO(sc->rxq_entries + + 3 * sc->txq_entries + + 128); + else + evq->entries = + ROUNDUP_POW_OF_TWO(sc->rxq_entries + + sc->txq_entries + + 128); + /* Initialise TX completion list */ evq->txqs = &evq->txq; /* Allocate DMA space. */ - if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(SFXGE_NEVS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(evq->entries), esmp)) != 0) return (rc); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(SFXGE_NEVS), + sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(evq->entries), &evq->buf_base_id); mtx_init(&evq->lock, "evq", NULL, MTX_DEF); Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:01:07 2015 (r280502) @@ -54,8 +54,7 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) -#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) +#define RX_REFILL_THRESHOLD(_entries) (EFX_RXQ_LIMIT(_entries) * 9 / 10) /* Size of the LRO hash table. Must be a power of 2. A larger table * means we can accelerate a larger number of streams. @@ -214,11 +213,11 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un return; rxfill = rxq->added - rxq->completed; - KASSERT(rxfill <= EFX_RXQ_LIMIT(SFXGE_NDESCS), - ("rxfill > EFX_RXQ_LIMIT(SFXGE_NDESCS)")); - ntodo = min(EFX_RXQ_LIMIT(SFXGE_NDESCS) - rxfill, target); - KASSERT(ntodo <= EFX_RXQ_LIMIT(SFXGE_NDESCS), - ("ntodo > EFX_RQX_LIMIT(SFXGE_NDESCS)")); + KASSERT(rxfill <= EFX_RXQ_LIMIT(rxq->entries), + ("rxfill > EFX_RXQ_LIMIT(rxq->entries)")); + ntodo = min(EFX_RXQ_LIMIT(rxq->entries) - rxfill, target); + KASSERT(ntodo <= EFX_RXQ_LIMIT(rxq->entries), + ("ntodo > EFX_RQX_LIMIT(rxq->entries)")); if (ntodo == 0) return; @@ -231,7 +230,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un bus_dma_segment_t seg; struct mbuf *m; - id = (rxq->added + batch) & (SFXGE_NDESCS - 1); + id = (rxq->added + batch) & rxq->ptr_mask; rx_desc = &rxq->queue[id]; KASSERT(rx_desc->mbuf == NULL, ("rx_desc->mbuf != NULL")); @@ -274,7 +273,7 @@ sfxge_rx_qrefill(struct sfxge_rxq *rxq) return; /* Make sure the queue is full */ - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_TRUE); + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_TRUE); } static void __sfxge_rx_deliver(struct sfxge_softc *sc, struct mbuf *m) @@ -757,7 +756,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq unsigned int id; struct sfxge_rx_sw_desc *rx_desc; - id = completed++ & (SFXGE_NDESCS - 1); + id = completed++ & rxq->ptr_mask; rx_desc = &rxq->queue[id]; m = rx_desc->mbuf; @@ -821,8 +820,8 @@ discard: sfxge_lro_end_of_burst(rxq); /* Top up the queue if necessary */ - if (level < RX_REFILL_THRESHOLD) - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE); + if (level < rxq->refill_threshold) + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_FALSE); } static void @@ -884,7 +883,7 @@ again: efx_rx_qdestroy(rxq->common); efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, - EFX_RXQ_NBUFS(SFXGE_NDESCS)); + EFX_RXQ_NBUFS(sc->rxq_entries)); mtx_unlock(&evq->lock); } @@ -908,12 +907,12 @@ sfxge_rx_qstart(struct sfxge_softc *sc, /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, rxq->buf_base_id, esmp, - EFX_RXQ_NBUFS(SFXGE_NDESCS))) != 0) - return rc; + EFX_RXQ_NBUFS(sc->rxq_entries))) != 0) + return (rc); /* Create the common code receive queue. */ if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT, - esmp, SFXGE_NDESCS, rxq->buf_base_id, evq->common, + esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, &rxq->common)) != 0) goto fail; @@ -925,7 +924,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, rxq->init_state = SFXGE_RXQ_STARTED; /* Try to fill the queue from the pool. */ - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE); + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(sc->rxq_entries), B_FALSE); mtx_unlock(&evq->lock); @@ -933,8 +932,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, fail: efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, - EFX_RXQ_NBUFS(SFXGE_NDESCS)); - return rc; + EFX_RXQ_NBUFS(sc->rxq_entries)); + return (rc); } void @@ -1105,6 +1104,9 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u rxq = malloc(sizeof(struct sfxge_rxq), M_SFXGE, M_ZERO | M_WAITOK); rxq->sc = sc; rxq->index = index; + rxq->entries = sc->rxq_entries; + rxq->ptr_mask = rxq->entries - 1; + rxq->refill_threshold = RX_REFILL_THRESHOLD(rxq->entries); sc->rxq[index] = rxq; esmp = &rxq->mem; @@ -1112,16 +1114,16 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u evq = sc->evq[index]; /* Allocate and zero DMA space. */ - if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(SFXGE_NDESCS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(sc->rxq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(SFXGE_NDESCS)); + (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(sc->rxq_entries)); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(SFXGE_NDESCS), + sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(sc->rxq_entries), &rxq->buf_base_id); /* Allocate the context array and the flow table. */ - rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * SFXGE_NDESCS, + rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * sc->rxq_entries, M_SFXGE, M_WAITOK | M_ZERO); sfxge_lro_init(rxq); Modified: stable/10/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 10:01:07 2015 (r280502) @@ -159,6 +159,8 @@ struct sfxge_rxq { efsys_mem_t mem; unsigned int buf_base_id; enum sfxge_rxq_state init_state; + unsigned int entries; + unsigned int ptr_mask; struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE); unsigned int added; @@ -166,6 +168,7 @@ struct sfxge_rxq { unsigned int completed; unsigned int loopback; struct sfxge_lro_state lro; + unsigned int refill_threshold; struct callout refill_callout; unsigned int refill_delay; Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:01:07 2015 (r280502) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * minimum MSS of 512. */ #define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) -#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) +#define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -101,7 +101,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq struct sfxge_tx_mapping *stmp; unsigned int id; - id = completed++ & (SFXGE_NDESCS - 1); + id = completed++ & txq->ptr_mask; stmp = &txq->stmp[id]; if (stmp->flags & TX_BUF_UNMAP) { @@ -125,7 +125,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) sfxge_tx_qunblock(txq); } } @@ -218,19 +218,19 @@ sfxge_tx_qlist_post(struct sfxge_txq *tx ("efx_tx_qpost() refragmented descriptors")); level = txq->added - txq->reaped; - KASSERT(level <= SFXGE_NDESCS, ("overfilled TX queue")); + KASSERT(level <= txq->entries, ("overfilled TX queue")); /* Clear the fragment list. */ txq->n_pend_desc = 0; /* Have we reached the block level? */ - if (level < SFXGE_TXQ_BLOCK_LEVEL) + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) return; /* Reap, and check again */ sfxge_tx_qreap(txq); level = txq->added - txq->reaped; - if (level < SFXGE_TXQ_BLOCK_LEVEL) + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) return; txq->blocked = 1; @@ -242,7 +242,7 @@ sfxge_tx_qlist_post(struct sfxge_txq *tx mb(); sfxge_tx_qreap(txq); level = txq->added - txq->reaped; - if (level < SFXGE_TXQ_BLOCK_LEVEL) { + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) { mb(); txq->blocked = 0; } @@ -271,7 +271,7 @@ static int sfxge_tx_queue_mbuf(struct sf } /* Load the packet for DMA. */ - id = txq->added & (SFXGE_NDESCS - 1); + id = txq->added & txq->ptr_mask; stmp = &txq->stmp[id]; rc = bus_dmamap_load_mbuf_sg(txq->packet_dma_tag, stmp->map, mbuf, dma_seg, &n_dma_seg, 0); @@ -318,7 +318,7 @@ static int sfxge_tx_queue_mbuf(struct sf stmp->flags = 0; if (__predict_false(stmp == - &txq->stmp[SFXGE_NDESCS - 1])) + &txq->stmp[txq->ptr_mask])) stmp = &txq->stmp[0]; else stmp++; @@ -762,20 +762,22 @@ static inline const struct tcphdr *tso_t * a TSO header buffer, since they must always be followed by a * payload descriptor referring to an mbuf. */ -#define TSOH_COUNT (SFXGE_NDESCS / 2u) +#define TSOH_COUNT(_txq_entries) ((_txq_entries) / 2u) #define TSOH_PER_PAGE (PAGE_SIZE / TSOH_STD_SIZE) -#define TSOH_PAGE_COUNT ((TSOH_COUNT + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE) +#define TSOH_PAGE_COUNT(_txq_entries) \ + ((TSOH_COUNT(_txq_entries) + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE) static int tso_init(struct sfxge_txq *txq) { struct sfxge_softc *sc = txq->sc; + unsigned int tsoh_page_count = TSOH_PAGE_COUNT(sc->txq_entries); int i, rc; /* Allocate TSO header buffers */ - txq->tsoh_buffer = malloc(TSOH_PAGE_COUNT * sizeof(txq->tsoh_buffer[0]), + txq->tsoh_buffer = malloc(tsoh_page_count * sizeof(txq->tsoh_buffer[0]), M_SFXGE, M_WAITOK); - for (i = 0; i < TSOH_PAGE_COUNT; i++) { + for (i = 0; i < tsoh_page_count; i++) { rc = sfxge_dma_alloc(sc, PAGE_SIZE, &txq->tsoh_buffer[i]); if (rc != 0) goto fail; @@ -796,7 +798,7 @@ static void tso_fini(struct sfxge_txq *t int i; if (txq->tsoh_buffer != NULL) { - for (i = 0; i < TSOH_PAGE_COUNT; i++) + for (i = 0; i < TSOH_PAGE_COUNT(txq->sc->txq_entries); i++) sfxge_dma_free(&txq->tsoh_buffer[i]); free(txq->tsoh_buffer, M_SFXGE); } @@ -1010,12 +1012,12 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq tso.dma_addr = dma_seg->ds_addr + tso.header_len; } - id = txq->added & (SFXGE_NDESCS - 1); + id = txq->added & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, id))) - return -1; + return (-1); while (1) { - id = (id + 1) & (SFXGE_NDESCS - 1); + id = (id + 1) & txq->ptr_mask; tso_fill_packet_with_fragment(txq, &tso); /* Move onto the next fragment? */ @@ -1038,7 +1040,7 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq if (txq->n_pend_desc > SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) break; - next_id = (id + 1) & (SFXGE_NDESCS - 1); + next_id = (id + 1) & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, next_id))) break; @@ -1070,7 +1072,7 @@ sfxge_tx_qunblock(struct sfxge_txq *txq) unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) txq->blocked = 0; } @@ -1146,7 +1148,7 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u txq->common = NULL; efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id, - EFX_TXQ_NBUFS(SFXGE_NDESCS)); + EFX_TXQ_NBUFS(sc->txq_entries)); mtx_unlock(&evq->lock); mtx_unlock(SFXGE_TXQ_LOCK(txq)); @@ -1172,8 +1174,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, txq->buf_base_id, esmp, - EFX_TXQ_NBUFS(SFXGE_NDESCS))) != 0) - return rc; + EFX_TXQ_NBUFS(sc->txq_entries))) != 0) + return (rc); /* Determine the kind of queue we are creating. */ switch (txq->type) { @@ -1194,7 +1196,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Create the common code transmit queue. */ if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, - SFXGE_NDESCS, txq->buf_base_id, flags, evq->common, + sc->txq_entries, txq->buf_base_id, flags, evq->common, &txq->common)) != 0) goto fail; @@ -1211,8 +1213,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, fail: efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id, - EFX_TXQ_NBUFS(SFXGE_NDESCS)); - return rc; + EFX_TXQ_NBUFS(sc->txq_entries)); + return (rc); } void @@ -1280,7 +1282,7 @@ static void sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index) { struct sfxge_txq *txq; - unsigned int nmaps = SFXGE_NDESCS; + unsigned int nmaps; txq = sc->txq[index]; @@ -1292,6 +1294,7 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u /* Free the context arrays. */ free(txq->pend_desc, M_SFXGE); + nmaps = sc->txq_entries; while (nmaps-- != 0) bus_dmamap_destroy(txq->packet_dma_tag, txq->stmp[nmaps].map); free(txq->stmp, M_SFXGE); @@ -1323,6 +1326,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u txq = malloc(sizeof(struct sfxge_txq), M_SFXGE, M_ZERO | M_WAITOK); txq->sc = sc; + txq->entries = sc->txq_entries; + txq->ptr_mask = txq->entries - 1; sc->txq[txq_index] = txq; esmp = &txq->mem; @@ -1330,12 +1335,12 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u evq = sc->evq[evq_index]; /* Allocate and zero DMA space for the descriptor ring. */ - if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(SFXGE_NDESCS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(sc->txq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(SFXGE_NDESCS)); + (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(sc->txq_entries)); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(SFXGE_NDESCS), + sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(sc->txq_entries), &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ @@ -1349,13 +1354,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u } /* Allocate pending descriptor array for batching writes. */ - txq->pend_desc = malloc(sizeof(efx_buffer_t) * SFXGE_NDESCS, + txq->pend_desc = malloc(sizeof(efx_buffer_t) * sc->txq_entries, M_SFXGE, M_ZERO | M_WAITOK); /* Allocate and initialise mbuf DMA mapping array. */ - txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * SFXGE_NDESCS, + txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * sc->txq_entries, M_SFXGE, M_ZERO | M_WAITOK); - for (nmaps = 0; nmaps < SFXGE_NDESCS; nmaps++) { + for (nmaps = 0; nmaps < sc->txq_entries; nmaps++) { rc = bus_dmamap_create(txq->packet_dma_tag, 0, &txq->stmp[nmaps].map); if (rc != 0) Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 09:59:38 2015 (r280501) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:01:07 2015 (r280502) @@ -106,7 +106,7 @@ enum sfxge_txq_type { SFXGE_TXQ_NTYPES }; -#define SFXGE_TXQ_UNBLOCK_LEVEL (EFX_TXQ_LIMIT(SFXGE_NDESCS) / 4) +#define SFXGE_TXQ_UNBLOCK_LEVEL(_entries) (EFX_TXQ_LIMIT(_entries) / 4) #define SFXGE_TX_BATCH 64 @@ -128,6 +128,8 @@ struct sfxge_txq { unsigned int evq_index; efsys_mem_t mem; unsigned int buf_base_id; + unsigned int entries; + unsigned int ptr_mask; struct sfxge_tx_mapping *stmp; /* Packets in flight. */ bus_dma_tag_t packet_dma_tag; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:02:16 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F26595; Wed, 25 Mar 2015 10:02:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F35CD2FC; Wed, 25 Mar 2015 10:02:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA2F18072587; Wed, 25 Mar 2015 10:02:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA2FVJ072586; Wed, 25 Mar 2015 10:02:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251002.t2PA2FVJ072586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:02: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: r280503 - 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.18-1 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, 25 Mar 2015 10:02:16 -0000 Author: arybchik Date: Wed Mar 25 10:02:14 2015 New Revision: 280503 URL: https://svnweb.freebsd.org/changeset/base/280503 Log: MFC: 272329 Update SolarFlare driver manual page with new tunables. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/share/man/man4/sfxge.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:01:07 2015 (r280502) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:02:14 2015 (r280503) @@ -76,6 +76,32 @@ The .Nm driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +Actual values can be obtained using +.Xr sysctl 8 . +.Bl -tag -width indent +.It Va hw.sfxge.rx_ring +Maximum number of descriptors in a receive queue ring. +Supported values are: 512, 1024, 2048 and 4096. +.It Va hw.sfxge.tx_ring +Maximum number of descriptors in a transmit queue ring. +Supported values are: 512, 1024, 2048 and 4096. +.It Va hw.sfxge.tx_dpl_get_max +The maximum length of the deferred packet 'get-list' for queued transmit +packets, used only if the transmit queue lock can be acquired. +If packet is dropped, \fItx_early_drops\fR counter grows and local sender +gets ENOBUFS error. +Value must be greater than 0. +.It Va hw.sfxge.tx_dpl_put_max +The maximum length of the deferred packet 'put-list' for queued transmit +packets, used if the transmit queue lock cannot be acquired. +If packet is dropped, \fItx_early_drops\fR counter grows and local sender +gets ENOBUFS error. +Value must be greater or equal to 0. .Sh SUPPORT For general information and support, go to the Solarflare support website at: From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:03:43 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27E6D1E8; Wed, 25 Mar 2015 10:03:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083EA30B; Wed, 25 Mar 2015 10:03:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA3gbU072807; Wed, 25 Mar 2015 10:03:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA3gtS072804; Wed, 25 Mar 2015 10:03:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251003.t2PA3gtS072804@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:03: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: r280504 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:03:43 -0000 Author: arybchik Date: Wed Mar 25 10:03:41 2015 New Revision: 280504 URL: https://svnweb.freebsd.org/changeset/base/280504 Log: MFC: 272330 The patch allows to check state of the software Tx queues at run time. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:02:14 2015 (r280503) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:03:41 2015 (r280504) @@ -201,6 +201,7 @@ struct sfxge_softc { struct ifnet *ifnet; unsigned int if_flags; struct sysctl_oid *stats_node; + struct sysctl_oid *txqs_node; struct task task_reset; Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:02:14 2015 (r280503) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:03:41 2015 (r280504) @@ -176,7 +176,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * KASSERT(*get_tailp == NULL, ("*get_tailp != NULL")); *stdp->std_getp = get_next; stdp->std_getp = get_tailp; - stdp->std_count += count; + stdp->std_get_count += count; } #endif /* SFXGE_HAVE_MQ */ @@ -380,7 +380,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx prefetch_read_many(txq->common); mbuf = stdp->std_get; - count = stdp->std_count; + count = stdp->std_get_count; while (count != 0) { KASSERT(mbuf != NULL, ("mbuf == NULL")); @@ -412,17 +412,17 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx if (count == 0) { KASSERT(mbuf == NULL, ("mbuf != NULL")); stdp->std_get = NULL; - stdp->std_count = 0; + stdp->std_get_count = 0; stdp->std_getp = &stdp->std_get; } else { stdp->std_get = mbuf; - stdp->std_count = count; + stdp->std_get_count = count; } if (txq->added != pushed) efx_tx_qpush(txq->common, txq->added); - KASSERT(txq->blocked || stdp->std_count == 0, + KASSERT(txq->blocked || stdp->std_get_count == 0, ("queue unblocked but count is non-zero")); } @@ -476,12 +476,12 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); - if (stdp->std_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + if (stdp->std_get_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) return (ENOBUFS); *(stdp->std_getp) = mbuf; stdp->std_getp = &mbuf->m_nextpkt; - stdp->std_count++; + stdp->std_get_count++; } else { volatile uintptr_t *putp; uintptr_t old; @@ -575,7 +575,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx m_freem(mbuf); } stdp->std_get = NULL; - stdp->std_count = 0; + stdp->std_get_count = 0; stdp->std_getp = &stdp->std_get; mtx_unlock(&txq->lock); @@ -1315,6 +1315,8 @@ static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { + char name[16]; + struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; #ifdef SFXGE_HAVE_MQ @@ -1367,6 +1369,16 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u goto fail2; } + snprintf(name, sizeof(name), "%u", txq_index); + txq_node = SYSCTL_ADD_NODE( + device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(sc->txqs_node), + OID_AUTO, name, CTLFLAG_RD, NULL, ""); + if (txq_node == NULL) { + rc = ENOMEM; + goto fail_txq_node; + } + if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM && (rc = tso_init(txq)) != 0) goto fail3; @@ -1377,6 +1389,11 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u stdp->std_getp = &stdp->std_get; mtx_init(&txq->lock, "txq", NULL, MTX_DEF); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS, + &stdp->std_get_count, 0, ""); #endif txq->type = type; @@ -1387,6 +1404,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); fail3: +fail_txq_node: free(txq->pend_desc, M_SFXGE); fail2: while (nmaps-- != 0) @@ -1480,6 +1498,15 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); + sc->txqs_node = SYSCTL_ADD_NODE( + device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "txq", CTLFLAG_RD, NULL, "Tx queues"); + if (sc->txqs_node == NULL) { + rc = ENOMEM; + goto fail_txq_node; + } + /* Initialize the transmit queues */ if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NON_CKSUM, SFXGE_TXQ_NON_CKSUM, 0)) != 0) @@ -1509,5 +1536,6 @@ fail2: sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); fail: +fail_txq_node: return (rc); } Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:02:14 2015 (r280503) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:03:41 2015 (r280504) @@ -82,10 +82,10 @@ struct sfxge_tx_mapping { * Deferred packet list. */ struct sfxge_tx_dpl { - uintptr_t std_put; /* Head of put list. */ - struct mbuf *std_get; /* Head of get list. */ - struct mbuf **std_getp; /* Tail of get list. */ - unsigned int std_count; /* Count of packets. */ + uintptr_t std_put; /* Head of put list. */ + struct mbuf *std_get; /* Head of get list. */ + struct mbuf **std_getp; /* Tail of get list. */ + unsigned int std_get_count; /* Packets in get list. */ }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:05:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3210E33D; Wed, 25 Mar 2015 10:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12A87322; Wed, 25 Mar 2015 10:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA5KTm073095; Wed, 25 Mar 2015 10:05:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA5K7a073093; Wed, 25 Mar 2015 10:05:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251005.t2PA5K7a073093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280505 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:05:21 -0000 Author: arybchik Date: Wed Mar 25 10:05:19 2015 New Revision: 280505 URL: https://svnweb.freebsd.org/changeset/base/280505 Log: MFC: 272331 Support tunable to control Tx deferred packet list limits Also increase default for Tx queue get-list limit. Too small limit results in TCP packets drops especiall when many streams are running simultaneously. Put list may be kept small enough since it is just a temporary location if transmit function can't get Tx queue lock. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:03:41 2015 (r280504) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:05:19 2015 (r280505) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,6 +78,25 @@ __FBSDID("$FreeBSD$"); #define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) #define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) +#ifdef SFXGE_HAVE_MQ + +#define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max) +static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT; +TUNABLE_INT(SFXGE_PARAM_TX_DPL_GET_MAX, &sfxge_tx_dpl_get_max); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_get_max, CTLFLAG_RDTUN, + &sfxge_tx_dpl_get_max, 0, + "Maximum number of packets in deferred packet get-list"); + +#define SFXGE_PARAM_TX_DPL_PUT_MAX SFXGE_PARAM(tx_dpl_put_max) +static int sfxge_tx_dpl_put_max = SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT; +TUNABLE_INT(SFXGE_PARAM_TX_DPL_PUT_MAX, &sfxge_tx_dpl_put_max); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN, + &sfxge_tx_dpl_put_max, 0, + "Maximum number of packets in deferred packet put-list"); + +#endif + + /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); @@ -476,7 +496,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); - if (stdp->std_get_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + if (stdp->std_get_count >= stdp->std_get_max) return (ENOBUFS); *(stdp->std_getp) = mbuf; @@ -498,7 +518,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, old_len = mp->m_pkthdr.csum_data; } else old_len = 0; - if (old_len >= SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT) + if (old_len >= stdp->std_put_max) return (ENOBUFS); mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; @@ -1384,8 +1404,23 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u goto fail3; #ifdef SFXGE_HAVE_MQ + if (sfxge_tx_dpl_get_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); + rc = EINVAL; + goto fail_tx_dpl_get_max; + } + if (sfxge_tx_dpl_put_max < 0) { + log(LOG_ERR, "%s=%d must be greater or equal to 0", + SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); + rc = EINVAL; + goto fail_tx_dpl_put_max; + } + /* Initialize the deferred packet list. */ stdp = &txq->dpl; + stdp->std_put_max = sfxge_tx_dpl_put_max; + stdp->std_get_max = sfxge_tx_dpl_get_max; stdp->std_getp = &stdp->std_get; mtx_init(&txq->lock, "txq", NULL, MTX_DEF); @@ -1403,6 +1438,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); +fail_tx_dpl_put_max: +fail_tx_dpl_get_max: fail3: fail_txq_node: free(txq->pend_desc, M_SFXGE); Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:03:41 2015 (r280504) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:05:19 2015 (r280505) @@ -75,13 +75,17 @@ struct sfxge_tx_mapping { enum sfxge_tx_buf_flags flags; }; -#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 1024 #define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 /* * Deferred packet list. */ struct sfxge_tx_dpl { + unsigned int std_get_max; /* Maximum number of packets + * in get list */ + unsigned int std_put_max; /* Maximum number of packets + * in put list */ uintptr_t std_put; /* Head of put list. */ struct mbuf *std_get; /* Head of get list. */ struct mbuf **std_getp; /* Tail of get list. */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:06:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 921CA485; Wed, 25 Mar 2015 10:06:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61C09335; Wed, 25 Mar 2015 10:06:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA6R6X073281; Wed, 25 Mar 2015 10:06:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA6RhI073280; Wed, 25 Mar 2015 10:06:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251006.t2PA6RhI073280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:06:27 +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: r280506 - 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.18-1 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, 25 Mar 2015 10:06:27 -0000 Author: arybchik Date: Wed Mar 25 10:06:26 2015 New Revision: 280506 URL: https://svnweb.freebsd.org/changeset/base/280506 Log: MFC: 272377 Some cleanup for sfxge.4 Use standard mdoc macros instead of pure roff, fix some other mdoc usage, make the style consistent, and fix some grammar issues. Approved by: hrs (mentor) Modified: stable/10/share/man/man4/sfxge.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:05:19 2015 (r280505) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:06:26 2015 (r280506) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd September 30, 2014 .Dt SFXGE 4 .Os .Sh NAME @@ -85,23 +85,30 @@ Actual values can be obtained using .Xr sysctl 8 . .Bl -tag -width indent .It Va hw.sfxge.rx_ring -Maximum number of descriptors in a receive queue ring. +The maximum number of descriptors in a receive queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_ring -Maximum number of descriptors in a transmit queue ring. +The maximum number of descriptors in a transmit queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_dpl_get_max -The maximum length of the deferred packet 'get-list' for queued transmit +The maximum length of the deferred packet +.Dq get-list +for queued transmit packets, used only if the transmit queue lock can be acquired. -If packet is dropped, \fItx_early_drops\fR counter grows and local sender -gets ENOBUFS error. -Value must be greater than 0. +If a packet is dropped, the +.Va tx_early_drops +counter is incremented and the local sender receives ENOBUFS. +The value must be greater than 0. .It Va hw.sfxge.tx_dpl_put_max -The maximum length of the deferred packet 'put-list' for queued transmit +The maximum length of the deferred packet +.Dq put-list +for queued transmit packets, used if the transmit queue lock cannot be acquired. -If packet is dropped, \fItx_early_drops\fR counter grows and local sender -gets ENOBUFS error. -Value must be greater or equal to 0. +If a packet is dropped, the +.Va tx_early_drops +counter is incremented and the local sender receives ENOBUFS. +The value must be greater than or equal to 0. +.El .Sh SUPPORT For general information and support, go to the Solarflare support website at: From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:08:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 406385EF; Wed, 25 Mar 2015 10:08:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC52354; Wed, 25 Mar 2015 10:08:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA8TvW073572; Wed, 25 Mar 2015 10:08:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA8Tc6073571; Wed, 25 Mar 2015 10:08:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251008.t2PA8Tc6073571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:08: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: r280507 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:08:29 -0000 Author: arybchik Date: Wed Mar 25 10:08:28 2015 New Revision: 280507 URL: https://svnweb.freebsd.org/changeset/base/280507 Log: MFC: 272411 Properly handle a case that should never happen (the bus_dma callback being called with error set to non-zero). Modified: stable/10/sys/dev/sfxge/sfxge_dma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:06:26 2015 (r280506) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:08:28 2015 (r280507) @@ -160,11 +160,14 @@ sfxge_dma_alloc(struct sfxge_softc *sc, /* * The callback gets error information about the mapping - * and will have set our vaddr to NULL if something went + * and will have set esm_addr to 0 if something went * wrong. */ - if (vaddr == NULL) + if (esmp->esm_addr == 0) { + bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); + bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); + } esmp->esm_base = vaddr; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:11:19 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B638782; Wed, 25 Mar 2015 10:11:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2D15F2; Wed, 25 Mar 2015 10:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PABJgR074665; Wed, 25 Mar 2015 10:11:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PABIep074661; Wed, 25 Mar 2015 10:11:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251011.t2PABIep074661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:11: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: r280508 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:11:19 -0000 Author: arybchik Date: Wed Mar 25 10:11:17 2015 New Revision: 280508 URL: https://svnweb.freebsd.org/changeset/base/280508 Log: MFC: 277884 sfxge: Change sfxge_ev_qpoll() proto to avoid EVQ pointers array access It was the only place on data path where sc->evq array is accessed. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_intr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:08:28 2015 (r280507) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:11:17 2015 (r280508) @@ -280,7 +280,7 @@ extern int sfxge_ev_init(struct sfxge_so extern void sfxge_ev_fini(struct sfxge_softc *sc); extern int sfxge_ev_start(struct sfxge_softc *sc); extern void sfxge_ev_stop(struct sfxge_softc *sc); -extern int sfxge_ev_qpoll(struct sfxge_softc *sc, unsigned int index); +extern int sfxge_ev_qpoll(struct sfxge_evq *evq); /* * From sfxge_intr.c. Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:08:28 2015 (r280507) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:11:17 2015 (r280508) @@ -564,13 +564,10 @@ static const efx_ev_callbacks_t sfxge_ev int -sfxge_ev_qpoll(struct sfxge_softc *sc, unsigned int index) +sfxge_ev_qpoll(struct sfxge_evq *evq) { - struct sfxge_evq *evq; int rc; - evq = sc->evq[index]; - mtx_lock(&evq->lock); if (evq->init_state != SFXGE_EVQ_STARTING && Modified: stable/10/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:08:28 2015 (r280507) +++ stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:11:17 2015 (r280508) @@ -106,9 +106,8 @@ static void sfxge_intr_line(void *arg) { struct sfxge_evq *evq = arg; - struct sfxge_softc *sc = evq->sc; - (void)sfxge_ev_qpoll(sc, 0); + (void)sfxge_ev_qpoll(evq); } static void @@ -142,7 +141,7 @@ sfxge_intr_message(void *arg) return; } - (void)sfxge_ev_qpoll(sc, index); + (void)sfxge_ev_qpoll(evq); } static int From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:12:14 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 556578BD; Wed, 25 Mar 2015 10:12:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FB135FE; Wed, 25 Mar 2015 10:12:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PACEk6077633; Wed, 25 Mar 2015 10:12:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PACEQ2077632; Wed, 25 Mar 2015 10:12:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251012.t2PACEQ2077632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:12: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: r280509 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:12:14 -0000 Author: arybchik Date: Wed Mar 25 10:12:13 2015 New Revision: 280509 URL: https://svnweb.freebsd.org/changeset/base/280509 Log: MFC: 277885 sfxge: Move txq->next pointer to part writable on completion path In fact the pointer is used only if more than one TXQ is processed in one interrupt. It is used (read-write) on completion path only. Also it makes the first part of the structure smaller and it fits now into one 128byte cache line. So, TXQ structure becomes 128 bytes smaller. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:11:17 2015 (r280508) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:12:13 2015 (r280509) @@ -139,7 +139,6 @@ struct sfxge_txq { bus_dma_tag_t packet_dma_tag; efx_buffer_t *pend_desc; efx_txq_t *common; - struct sfxge_txq *next; efsys_mem_t *tsoh_buffer; @@ -173,6 +172,7 @@ struct sfxge_txq { */ unsigned int pending __aligned(CACHE_LINE_SIZE); unsigned int completed; + struct sfxge_txq *next; }; extern int sfxge_tx_packet_add(struct sfxge_txq *, struct mbuf *); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:13:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D48F5A08; Wed, 25 Mar 2015 10:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE89160B; Wed, 25 Mar 2015 10:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PADLnQ077826; Wed, 25 Mar 2015 10:13:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PADKdS077819; Wed, 25 Mar 2015 10:13:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251013.t2PADKdS077819@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280510 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:13:22 -0000 Author: arybchik Date: Wed Mar 25 10:13:19 2015 New Revision: 280510 URL: https://svnweb.freebsd.org/changeset/base/280510 Log: MFC: 277886 sfxge: Make it possible to build without EVQ statistics Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:12:13 2015 (r280509) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:13:19 2015 (r280510) @@ -995,6 +995,7 @@ fail1: return (rc); } +#if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES /* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock 67e9bdcd920059bd */ static const char __cs * __cs __efx_ev_qstat_name[] = { @@ -1052,6 +1053,7 @@ efx_ev_qstat_name( return (__efx_ev_qstat_name[id]); } #endif /* EFSYS_OPT_NAMES */ +#endif /* EFSYS_OPT_QSTATS */ #if EFSYS_OPT_QSTATS void Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 10:12:13 2015 (r280509) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 10:13:19 2015 (r280510) @@ -358,6 +358,7 @@ fail1: return (rc); } +#if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES /* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 78ca9ab00287fffb */ static const char __cs * __cs __efx_tx_qstat_name[] = { @@ -378,6 +379,7 @@ efx_tx_qstat_name( return (__efx_tx_qstat_name[id]); } #endif /* EFSYS_OPT_NAMES */ +#endif /* EFSYS_OPT_QSTATS */ #if EFSYS_OPT_QSTATS void Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:12:13 2015 (r280509) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:13:19 2015 (r280510) @@ -224,8 +224,10 @@ struct sfxge_softc { struct sfxge_evq *evq[SFXGE_RX_SCALE_MAX]; unsigned int ev_moderation; +#if EFSYS_OPT_QSTATS clock_t ev_stats_update_time; uint64_t ev_stats[EV_NQSTATS]; +#endif uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:12:13 2015 (r280509) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:13:19 2015 (r280510) @@ -401,6 +401,8 @@ sfxge_ev_wake_up(void *arg, uint32_t ind return (B_FALSE); } +#if EFSYS_OPT_QSTATS + static void sfxge_ev_stat_update(struct sfxge_softc *sc) { @@ -462,6 +464,8 @@ sfxge_ev_stat_init(struct sfxge_softc *s } } +#endif /* EFSYS_OPT_QSTATS */ + static void sfxge_ev_qmoderate(struct sfxge_softc *sc, unsigned int idx, unsigned int us) { @@ -622,8 +626,10 @@ sfxge_ev_qstop(struct sfxge_softc *sc, u evq->read_ptr = 0; evq->exception = B_FALSE; +#if EFSYS_OPT_QSTATS /* Add event counts before discarding the common evq state */ efx_ev_qstats_update(evq->common, sc->ev_stats); +#endif efx_ev_qdestroy(evq->common); efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, @@ -878,7 +884,9 @@ sfxge_ev_init(struct sfxge_softc *sc) goto fail; } +#if EFSYS_OPT_QSTATS sfxge_ev_stat_init(sc); +#endif return (0); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:14:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 952B3B47; Wed, 25 Mar 2015 10:14:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65A05618; Wed, 25 Mar 2015 10:14:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAEVn0078032; Wed, 25 Mar 2015 10:14:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAEVjD078031; Wed, 25 Mar 2015 10:14:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251014.t2PAEVjD078031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:14: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: r280511 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:14:31 -0000 Author: arybchik Date: Wed Mar 25 10:14:30 2015 New Revision: 280511 URL: https://svnweb.freebsd.org/changeset/base/280511 Log: MFC: 277887 sfxge: Remove extra cache-line alignment and reorder sfxge_evq_t Remove the first member alignment to cacheline since it is nop. Use __aligned() for the whole structure to make sure that the structure size is cacheline aligned. Remove lock alignment to make the structure smaller and fit all members used on event queue processing into one cacheline (128 bytes) on x86-64. The lock is obtained as well from different context when event queue statistics are retrived from sysctl context, but it is infrequent. Reorder members to avoid padding and go in usage order on event processing. As the result all structure members used on event queue processing fit into exactly one cacheline (128 byte) now. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:13:19 2015 (r280510) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:14:30 2015 (r280511) @@ -102,26 +102,26 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 struct sfxge_evq { - struct sfxge_softc *sc __aligned(CACHE_LINE_SIZE); - struct mtx lock __aligned(CACHE_LINE_SIZE); - - enum sfxge_evq_state init_state; + /* Structure members below are sorted by usage order */ + struct sfxge_softc *sc; + struct mtx lock; unsigned int index; - unsigned int entries; + enum sfxge_evq_state init_state; efsys_mem_t mem; - unsigned int buf_base_id; - - boolean_t exception; - efx_evq_t *common; unsigned int read_ptr; + boolean_t exception; unsigned int rx_done; unsigned int tx_done; /* Linked list of TX queues with completions to process */ struct sfxge_txq *txq; struct sfxge_txq **txqs; -}; + + /* Structure members not used on event processing path */ + unsigned int buf_base_id; + unsigned int entries; +} __aligned(CACHE_LINE_SIZE); #define SFXGE_NDESCS 1024 #define SFXGE_MODERATION 30 From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:16:35 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AD65CDE; Wed, 25 Mar 2015 10:16:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA6C655; Wed, 25 Mar 2015 10:16:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAGYwF078377; Wed, 25 Mar 2015 10:16:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAGYZ8078376; Wed, 25 Mar 2015 10:16:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251016.t2PAGYZ8078376@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:16: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: r280512 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:16:35 -0000 Author: arybchik Date: Wed Mar 25 10:16:33 2015 New Revision: 280512 URL: https://svnweb.freebsd.org/changeset/base/280512 Log: MFC: 277888 sfxge: fixed TSO code to cope with VLAN headers Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:14:30 2015 (r280511) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:16:33 2015 (r280512) @@ -854,9 +854,7 @@ static void tso_start(struct sfxge_tso_s tso->tcph_off = tso->nh_off + sizeof(struct ip6_hdr); } - /* We assume all headers are linear in the head mbuf */ tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; - KASSERT(tso->header_len <= mbuf->m_len, ("packet headers fragmented")); tso->full_packet_size = tso->header_len + mbuf->m_pkthdr.tso_segsz; tso->seqnum = ntohl(tso_tcph(tso)->th_seq); @@ -971,7 +969,7 @@ static int tso_start_new_packet(struct s tsoh_th = (struct tcphdr *)(header + tso->tcph_off); /* Copy and update the headers. */ - memcpy(header, tso->mbuf->m_data, tso->header_len); + m_copydata(tso->mbuf, 0, tso->header_len, header); tsoh_th->th_seq = htonl(tso->seqnum); tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz; @@ -1017,20 +1015,18 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq { struct sfxge_tso_state tso; unsigned int id, next_id; + unsigned skipped = 0; tso_start(&tso, mbuf); - /* Grab the first payload fragment. */ - if (dma_seg->ds_len == tso.header_len) { + while (dma_seg->ds_len + skipped <= tso.header_len) { + skipped += dma_seg->ds_len; --n_dma_seg; KASSERT(n_dma_seg, ("no payload found in TSO packet")); ++dma_seg; - tso.in_len = dma_seg->ds_len; - tso.dma_addr = dma_seg->ds_addr; - } else { - tso.in_len = dma_seg->ds_len - tso.header_len; - tso.dma_addr = dma_seg->ds_addr + tso.header_len; } + tso.in_len = dma_seg->ds_len + (tso.header_len - skipped); + tso.dma_addr = dma_seg->ds_addr + (tso.header_len - skipped); id = txq->added & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, id))) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:17:26 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2485DE34; Wed, 25 Mar 2015 10:17:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03FEA669; Wed, 25 Mar 2015 10:17:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAHPC4078544; Wed, 25 Mar 2015 10:17:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAHPQs078541; Wed, 25 Mar 2015 10:17:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251017.t2PAHPQs078541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280513 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:17:26 -0000 Author: arybchik Date: Wed Mar 25 10:17:24 2015 New Revision: 280513 URL: https://svnweb.freebsd.org/changeset/base/280513 Log: MFC: 277889 sfxge: Add evq argument to sfxge_tx_qcomplete() It removes necessity to get evq pointer by its index in soft context. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:16:33 2015 (r280512) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:17:24 2015 (r280513) @@ -63,7 +63,7 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq ("txq->evq_index != index")); if (txq->pending != txq->completed) - sfxge_tx_qcomplete(txq); + sfxge_tx_qcomplete(txq, evq); txq = next; } while (txq != NULL); @@ -257,7 +257,7 @@ sfxge_ev_tx(void *arg, uint32_t label, u } if (txq->pending - txq->completed >= SFXGE_TX_BATCH) - sfxge_tx_qcomplete(txq); + sfxge_tx_qcomplete(txq, evq); done: return (evq->tx_done >= SFXGE_EV_BATCH); Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:16:33 2015 (r280512) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:17:24 2015 (r280513) @@ -105,15 +105,10 @@ static int sfxge_tx_queue_tso(struct sfx const bus_dma_segment_t *dma_seg, int n_dma_seg); void -sfxge_tx_qcomplete(struct sfxge_txq *txq) +sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq) { - struct sfxge_softc *sc; - struct sfxge_evq *evq; unsigned int completed; - sc = txq->sc; - evq = sc->evq[txq->evq_index]; - mtx_assert(&evq->lock, MA_OWNED); completed = txq->completed; @@ -1146,7 +1141,7 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u txq->blocked = 0; txq->pending = txq->added; - sfxge_tx_qcomplete(txq); + sfxge_tx_qcomplete(txq, evq); KASSERT(txq->completed == txq->added, ("txq->completed != txq->added")); Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:16:33 2015 (r280512) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:17:24 2015 (r280513) @@ -175,13 +175,15 @@ struct sfxge_txq { struct sfxge_txq *next; }; +struct sfxge_evq; + extern int sfxge_tx_packet_add(struct sfxge_txq *, struct mbuf *); extern int sfxge_tx_init(struct sfxge_softc *sc); extern void sfxge_tx_fini(struct sfxge_softc *sc); extern int sfxge_tx_start(struct sfxge_softc *sc); extern void sfxge_tx_stop(struct sfxge_softc *sc); -extern void sfxge_tx_qcomplete(struct sfxge_txq *txq); +extern void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq); extern void sfxge_tx_qflush_done(struct sfxge_txq *txq); #ifdef SFXGE_HAVE_MQ extern void sfxge_if_qflush(struct ifnet *ifp); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:18:24 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2C71F76; Wed, 25 Mar 2015 10:18:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD513676; Wed, 25 Mar 2015 10:18:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAIO9t078731; Wed, 25 Mar 2015 10:18:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAIOt0078730; Wed, 25 Mar 2015 10:18:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251018.t2PAIOt0078730@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280514 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:18:24 -0000 Author: arybchik Date: Wed Mar 25 10:18:23 2015 New Revision: 280514 URL: https://svnweb.freebsd.org/changeset/base/280514 Log: MFC: 277890 sfxge: Do not bzero() DMA allocated memory once again sfxge_dma_alloc() calls bus_dmamem_alloc() with BUS_DMA_ZERO flag, so allocated memory is already filled in by zeros Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:17:24 2015 (r280513) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:18:23 2015 (r280514) @@ -583,7 +583,6 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_PHY_STATS_SIZE, phy_stats_buf)) != 0) goto fail; - bzero(phy_stats_buf->esm_base, phy_stats_buf->esm_size); sfxge_phy_stat_init(sc); sysctl_ctx = device_get_sysctl_ctx(sc->dev); @@ -605,7 +604,6 @@ sfxge_port_init(struct sfxge_softc *sc) M_SFXGE, M_WAITOK | M_ZERO); if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) goto fail2; - bzero(mac_stats_buf->esm_base, mac_stats_buf->esm_size); sfxge_mac_stat_init(sc); port->init_state = SFXGE_PORT_INITIALIZED; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:19:44 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 359A514A; Wed, 25 Mar 2015 10:19:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEB7685; Wed, 25 Mar 2015 10:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAJhED078929; Wed, 25 Mar 2015 10:19:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAJhFM078928; Wed, 25 Mar 2015 10:19:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251019.t2PAJhFM078928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280515 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:19:44 -0000 Author: arybchik Date: Wed Mar 25 10:19:43 2015 New Revision: 280515 URL: https://svnweb.freebsd.org/changeset/base/280515 Log: MFC: 277891 sfxge: Remove unused esm_size member of the efsys_mem_t structure esm_size is not even initialized properly when memory is allocated. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:18:23 2015 (r280514) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:19:43 2015 (r280515) @@ -370,7 +370,6 @@ typedef struct efsys_mem_s { bus_dmamap_t esm_map; caddr_t esm_base; efsys_dma_addr_t esm_addr; - size_t esm_size; } efsys_mem_t; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:20:43 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B30B292; Wed, 25 Mar 2015 10:20:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75DC077C; Wed, 25 Mar 2015 10:20:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAKhqA080227; Wed, 25 Mar 2015 10:20:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAKhVn080226; Wed, 25 Mar 2015 10:20:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251020.t2PAKhVn080226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280516 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:20:43 -0000 Author: arybchik Date: Wed Mar 25 10:20:42 2015 New Revision: 280516 URL: https://svnweb.freebsd.org/changeset/base/280516 Log: MFC: 277892 sfxge: Pass correct address to free allocated memory in the case of load error Most likely is was just memory leak on the error handling path since typically efsys_mem_t is filled in by zeros on allocation. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:19:43 2015 (r280515) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:20:42 2015 (r280516) @@ -153,7 +153,7 @@ sfxge_dma_alloc(struct sfxge_softc *sc, if (bus_dmamap_load(esmp->esm_tag, esmp->esm_map, vaddr, len, sfxge_dma_cb, &esmp->esm_addr, 0) != 0) { device_printf(sc->dev, "Couldn't load DMA mapping\n"); - bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); + bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:21:43 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3CF23E4; Wed, 25 Mar 2015 10:21:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE0B7789; Wed, 25 Mar 2015 10:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PALhNt080868; Wed, 25 Mar 2015 10:21:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PALheD080867; Wed, 25 Mar 2015 10:21:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251021.t2PALheD080867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280517 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:21:43 -0000 Author: arybchik Date: Wed Mar 25 10:21:42 2015 New Revision: 280517 URL: https://svnweb.freebsd.org/changeset/base/280517 Log: MFC: 277893 sfxge: Use SFXGE_MODERATION to initialize event moderation Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:20:42 2015 (r280516) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:21:42 2015 (r280517) @@ -870,7 +870,7 @@ sfxge_ev_init(struct sfxge_softc *sc) /* Set default interrupt moderation; add a sysctl to * read and change it. */ - sc->ev_moderation = 30; + sc->ev_moderation = SFXGE_MODERATION; SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "int_mod", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, sfxge_int_mod_handler, "IU", From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:23:02 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA66E537; Wed, 25 Mar 2015 10:23:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B39C7A8; Wed, 25 Mar 2015 10:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAN2bi082967; Wed, 25 Mar 2015 10:23:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAN1aX082962; Wed, 25 Mar 2015 10:23:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251023.t2PAN1aX082962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280518 - in stable/10: share/man/man4 sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:23:02 -0000 Author: arybchik Date: Wed Mar 25 10:23:00 2015 New Revision: 280518 URL: https://svnweb.freebsd.org/changeset/base/280518 Log: MFC: 277894 sfxge: implemented parameter to restrict RSS channels Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_intr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:23:00 2015 (r280518) @@ -108,6 +108,10 @@ If a packet is dropped, the .Va tx_early_drops counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. +.It Va hw.sfxge.N.max_rss_channels +The maximum number of allocated RSS channels for the Nth adapter. +If set to 0 or unset, the number of channels is determined by the number +of CPU cores. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:23:00 2015 (r280518) @@ -396,11 +396,18 @@ sfxge_create(struct sfxge_softc *sc) device_t dev; efx_nic_t *enp; int error; + char rss_param_name[sizeof(SFXGE_PARAM(%d.max_rss_channels))]; dev = sc->dev; sx_init(&sc->softc_lock, "sfxge_softc"); + sc->max_rss_channels = 0; + snprintf(rss_param_name, sizeof(rss_param_name), + SFXGE_PARAM(%d.max_rss_channels), + (int)device_get_unit(dev)); + TUNABLE_INT_FETCH(rss_param_name, &sc->max_rss_channels); + sc->stats_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:23:00 2015 (r280518) @@ -229,6 +229,7 @@ struct sfxge_softc { uint64_t ev_stats[EV_NQSTATS]; #endif + unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; Modified: stable/10/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:23:00 2015 (r280518) @@ -298,6 +298,9 @@ sfxge_intr_setup_msix(struct sfxge_softc if (count > EFX_MAXRSS) count = EFX_MAXRSS; + if (sc->max_rss_channels > 0 && count > sc->max_rss_channels) + count = sc->max_rss_channels; + rid = PCIR_BAR(4); resp = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (resp == NULL) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:25:47 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 191496CC; Wed, 25 Mar 2015 10:25:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F40C27EC; Wed, 25 Mar 2015 10:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAPkT1083364; Wed, 25 Mar 2015 10:25:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAPkbi083358; Wed, 25 Mar 2015 10:25:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251025.t2PAPkbi083358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:25: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: r280519 - in stable/10: share/man/man4 sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:25:47 -0000 Author: arybchik Date: Wed Mar 25 10:25:45 2015 New Revision: 280519 URL: https://svnweb.freebsd.org/changeset/base/280519 Log: MFC: 277895 sfxge: Separate software Tx queue limit for non-TCP traffic Add separate software Tx queue limit for non-TCP traffic to make total limit higher and avoid local drops of TCP packets because of no backpressure. There is no point to make non-TCP limit high since without backpressure UDP stream easily overflows any sensible limit. Split early drops statistics since it is better to have separate counter for each drop reason to make it unabmiguous. Add software Tx queue high watermark. The information is very useful to understand how big queues grow under traffic load. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:23:00 2015 (r280518) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:25:45 2015 (r280519) @@ -93,10 +93,18 @@ Supported values are: 512, 1024, 2048 an .It Va hw.sfxge.tx_dpl_get_max The maximum length of the deferred packet .Dq get-list -for queued transmit -packets, used only if the transmit queue lock can be acquired. +for queued transmit packets (TCP and non-TCP), used only if the transmit +queue lock can be acquired. If a packet is dropped, the -.Va tx_early_drops +.Va tx_get_overflow +counter is incremented and the local sender receives ENOBUFS. +The value must be greater than 0. +.It Va hw.sfxge.tx_dpl_get_non_tcp_max +The maximum number of non-TCP packets in the deferred packet +.Dq get-list +, used only if the transmit queue lock can be acquired. +If packet is dropped, the +.Va tx_get_non_tcp_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than 0. .It Va hw.sfxge.tx_dpl_put_max @@ -105,7 +113,7 @@ The maximum length of the deferred packe for queued transmit packets, used if the transmit queue lock cannot be acquired. If a packet is dropped, the -.Va tx_early_drops +.Va tx_put_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. .It Va hw.sfxge.N.max_rss_channels Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:23:00 2015 (r280518) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:25:45 2015 (r280519) @@ -85,14 +85,23 @@ static int sfxge_tx_dpl_get_max = SFXGE_ TUNABLE_INT(SFXGE_PARAM_TX_DPL_GET_MAX, &sfxge_tx_dpl_get_max); SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_get_max, CTLFLAG_RDTUN, &sfxge_tx_dpl_get_max, 0, - "Maximum number of packets in deferred packet get-list"); + "Maximum number of any packets in deferred packet get-list"); + +#define SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX \ + SFXGE_PARAM(tx_dpl_get_non_tcp_max) +static int sfxge_tx_dpl_get_non_tcp_max = + SFXGE_TX_DPL_GET_NON_TCP_PKT_LIMIT_DEFAULT; +TUNABLE_INT(SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, &sfxge_tx_dpl_get_non_tcp_max); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_get_non_tcp_max, CTLFLAG_RDTUN, + &sfxge_tx_dpl_get_non_tcp_max, 0, + "Maximum number of non-TCP packets in deferred packet get-list"); #define SFXGE_PARAM_TX_DPL_PUT_MAX SFXGE_PARAM(tx_dpl_put_max) static int sfxge_tx_dpl_put_max = SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT; TUNABLE_INT(SFXGE_PARAM_TX_DPL_PUT_MAX, &sfxge_tx_dpl_put_max); SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN, &sfxge_tx_dpl_put_max, 0, - "Maximum number of packets in deferred packet put-list"); + "Maximum number of any packets in deferred packet put-list"); #endif @@ -147,6 +156,15 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq #ifdef SFXGE_HAVE_MQ +static inline unsigned int +sfxge_is_mbuf_non_tcp(struct mbuf *mbuf) +{ + /* Absense of TCP checksum flags does not mean that it is non-TCP + * but it should be true if user wants to achieve high throughput. + */ + return (!(mbuf->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP))); +} + /* * Reorder the put list and append it to the get list. */ @@ -158,6 +176,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * volatile uintptr_t *putp; uintptr_t put; unsigned int count; + unsigned int non_tcp_count; mtx_assert(&txq->lock, MA_OWNED); @@ -176,9 +195,11 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * get_next = NULL; count = 0; + non_tcp_count = 0; do { struct mbuf *put_next; + non_tcp_count += sfxge_is_mbuf_non_tcp(mbuf); put_next = mbuf->m_nextpkt; mbuf->m_nextpkt = get_next; get_next = mbuf; @@ -192,6 +213,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * *stdp->std_getp = get_next; stdp->std_getp = get_tailp; stdp->std_get_count += count; + stdp->std_get_non_tcp_count += non_tcp_count; } #endif /* SFXGE_HAVE_MQ */ @@ -382,6 +404,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx struct sfxge_tx_dpl *stdp; struct mbuf *mbuf, *next; unsigned int count; + unsigned int non_tcp_count; unsigned int pushed; int rc; @@ -396,6 +419,10 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx mbuf = stdp->std_get; count = stdp->std_get_count; + non_tcp_count = stdp->std_get_non_tcp_count; + + if (count > stdp->std_get_hiwat) + stdp->std_get_hiwat = count; while (count != 0) { KASSERT(mbuf != NULL, ("mbuf == NULL")); @@ -410,6 +437,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx rc = sfxge_tx_queue_mbuf(txq, mbuf); --count; + non_tcp_count -= sfxge_is_mbuf_non_tcp(mbuf); mbuf = next; if (rc != 0) continue; @@ -426,12 +454,16 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx if (count == 0) { KASSERT(mbuf == NULL, ("mbuf != NULL")); + KASSERT(non_tcp_count == 0, + ("inconsistent TCP/non-TCP detection")); stdp->std_get = NULL; stdp->std_get_count = 0; + stdp->std_get_non_tcp_count = 0; stdp->std_getp = &stdp->std_get; } else { stdp->std_get = mbuf; stdp->std_get_count = count; + stdp->std_get_non_tcp_count = non_tcp_count; } if (txq->added != pushed) @@ -491,8 +523,18 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); - if (stdp->std_get_count >= stdp->std_get_max) + if (stdp->std_get_count >= stdp->std_get_max) { + txq->get_overflow++; return (ENOBUFS); + } + if (sfxge_is_mbuf_non_tcp(mbuf)) { + if (stdp->std_get_non_tcp_count >= + stdp->std_get_non_tcp_max) { + txq->get_non_tcp_overflow++; + return (ENOBUFS); + } + stdp->std_get_non_tcp_count++; + } *(stdp->std_getp) = mbuf; stdp->std_getp = &mbuf->m_nextpkt; @@ -513,8 +555,10 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, old_len = mp->m_pkthdr.csum_data; } else old_len = 0; - if (old_len >= stdp->std_put_max) + if (old_len >= stdp->std_put_max) { + atomic_add_long(&txq->put_overflow, 1); return (ENOBUFS); + } mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; } while (atomic_cmpset_ptr(putp, old, new) == 0); @@ -535,6 +579,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx if (!SFXGE_LINK_UP(txq->sc)) { rc = ENETDOWN; + atomic_add_long(&txq->netdown_drops, 1); goto fail; } @@ -572,7 +617,6 @@ sfxge_tx_packet_add(struct sfxge_txq *tx fail: m_freem(m); - atomic_add_long(&txq->early_drops, 1); return (rc); } @@ -591,6 +635,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx } stdp->std_get = NULL; stdp->std_get_count = 0; + stdp->std_get_non_tcp_count = 0; stdp->std_getp = &stdp->std_get; mtx_unlock(&txq->lock); @@ -1401,6 +1446,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u rc = EINVAL; goto fail_tx_dpl_get_max; } + if (sfxge_tx_dpl_get_non_tcp_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, + sfxge_tx_dpl_get_non_tcp_max); + rc = EINVAL; + goto fail_tx_dpl_get_max; + } if (sfxge_tx_dpl_put_max < 0) { log(LOG_ERR, "%s=%d must be greater or equal to 0", SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); @@ -1412,6 +1464,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u stdp = &txq->dpl; stdp->std_put_max = sfxge_tx_dpl_put_max; stdp->std_get_max = sfxge_tx_dpl_get_max; + stdp->std_get_non_tcp_max = sfxge_tx_dpl_get_non_tcp_max; stdp->std_getp = &stdp->std_get; mtx_init(&txq->lock, "txq", NULL, MTX_DEF); @@ -1420,6 +1473,14 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u SYSCTL_CHILDREN(txq_node), OID_AUTO, "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_count, 0, ""); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl_get_non_tcp_count", CTLFLAG_RD | CTLFLAG_STATS, + &stdp->std_get_non_tcp_count, 0, ""); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl_get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + &stdp->std_get_hiwat, 0, ""); #endif txq->type = type; @@ -1457,7 +1518,10 @@ static const struct { SFXGE_TX_STAT(tso_long_headers, tso_long_headers), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), - SFXGE_TX_STAT(tx_early_drops, early_drops), + SFXGE_TX_STAT(tx_get_overflow, get_overflow), + SFXGE_TX_STAT(tx_get_non_tcp_overflow, get_non_tcp_overflow), + SFXGE_TX_STAT(tx_put_overflow, put_overflow), + SFXGE_TX_STAT(tx_netdown_drops, netdown_drops), }; static int Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:23:00 2015 (r280518) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:25:45 2015 (r280519) @@ -75,21 +75,29 @@ struct sfxge_tx_mapping { enum sfxge_tx_buf_flags flags; }; -#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 1024 -#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT (64 * 1024) +#define SFXGE_TX_DPL_GET_NON_TCP_PKT_LIMIT_DEFAULT 1024 +#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 /* * Deferred packet list. */ struct sfxge_tx_dpl { - unsigned int std_get_max; /* Maximum number of packets + unsigned int std_get_max; /* Maximum number of packets * in get list */ - unsigned int std_put_max; /* Maximum number of packets + unsigned int std_get_non_tcp_max; /* Maximum number + * of non-TCP packets + * in get list */ + unsigned int std_put_max; /* Maximum number of packets * in put list */ - uintptr_t std_put; /* Head of put list. */ - struct mbuf *std_get; /* Head of get list. */ - struct mbuf **std_getp; /* Tail of get list. */ - unsigned int std_get_count; /* Packets in get list. */ + uintptr_t std_put; /* Head of put list. */ + struct mbuf *std_get; /* Head of get list. */ + struct mbuf **std_getp; /* Tail of get list. */ + unsigned int std_get_count; /* Packets in get list. */ + unsigned int std_get_non_tcp_count; /* Non-TCP packets + * in get list */ + unsigned int std_get_hiwat; /* Packets in get list + * high watermark */ }; @@ -165,7 +173,10 @@ struct sfxge_txq { unsigned long tso_long_headers; unsigned long collapses; unsigned long drops; - unsigned long early_drops; + unsigned long get_overflow; + unsigned long get_non_tcp_overflow; + unsigned long put_overflow; + unsigned long netdown_drops; /* The following fields change more often, and are used mostly * on the completion path From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:26:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64D51962; Wed, 25 Mar 2015 10:26:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F15680E; Wed, 25 Mar 2015 10:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAQkSk083599; Wed, 25 Mar 2015 10:26:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAQkEb083598; Wed, 25 Mar 2015 10:26:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251026.t2PAQkEb083598@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:26: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: r280521 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:26:46 -0000 Author: arybchik Date: Wed Mar 25 10:26:45 2015 New Revision: 280521 URL: https://svnweb.freebsd.org/changeset/base/280521 Log: MFC: 278220 sfxge: Implement EFSYS_MEM_READ_BARRIER() Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:26:07 2015 (r280520) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:26:45 2015 (r280521) @@ -677,8 +677,7 @@ typedef struct efsys_bar_s { /* BARRIERS */ -/* Strict ordering guaranteed by devacc.devacc_attr_dataorder */ -#define EFSYS_MEM_READ_BARRIER() +#define EFSYS_MEM_READ_BARRIER() rmb() #define EFSYS_PIO_WRITE_BARRIER() /* TIMESTAMP */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:27:58 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08795AB6; Wed, 25 Mar 2015 10:27:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DDC82C; Wed, 25 Mar 2015 10:27:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PARvLP083857; Wed, 25 Mar 2015 10:27:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PARtv1083845; Wed, 25 Mar 2015 10:27:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251027.t2PARtv1083845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:27: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: r280522 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:27:58 -0000 Author: arybchik Date: Wed Mar 25 10:27:54 2015 New Revision: 280522 URL: https://svnweb.freebsd.org/changeset/base/280522 Log: MFC: 278221 sfxge: Add macros to init, destroy, acquire, release and assert locks Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_mcdi.c stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:27:54 2015 (r280522) @@ -517,6 +517,15 @@ typedef struct efsys_bar_s { struct resource *esb_res; } efsys_bar_t; +#define SFXGE_BAR_LOCK_INIT(_esbp, _name) \ + mtx_init(&(_esbp)->esb_lock, (_name), NULL, MTX_DEF) +#define SFXGE_BAR_LOCK_DESTROY(_esbp) \ + mtx_destroy(&(_esbp)->esb_lock) +#define SFXGE_BAR_LOCK(_esbp) \ + mtx_lock(&(_esbp)->esb_lock) +#define SFXGE_BAR_UNLOCK(_esbp) \ + mtx_unlock(&(_esbp)->esb_lock) + #define EFSYS_BAR_READD(_esbp, _offset, _edp, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -525,7 +534,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ (_edp)->ed_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ @@ -535,7 +544,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -545,7 +554,7 @@ typedef struct efsys_bar_s { KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ (_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ @@ -556,7 +565,7 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -568,7 +577,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ (_eop)->eo_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ @@ -587,7 +596,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -599,7 +608,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ @@ -609,7 +618,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -619,7 +628,7 @@ typedef struct efsys_bar_s { KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE3(bar_writeq, unsigned int, (_offset), \ uint32_t, (_eqp)->eq_u32[1], \ @@ -630,7 +639,7 @@ typedef struct efsys_bar_s { bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ (_offset+4), (_eqp)->eq_u32[1]); \ \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -642,7 +651,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE5(bar_writeo, unsigned int, (_offset), \ uint32_t, (_eop)->eo_u32[3], \ @@ -661,7 +670,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:27:54 2015 (r280522) @@ -94,7 +94,7 @@ sfxge_start(struct sfxge_softc *sc) { int rc; - sx_assert(&sc->softc_lock, LA_XLOCKED); + SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc); if (sc->init_state == SFXGE_STARTED) return (0); @@ -163,15 +163,15 @@ sfxge_if_init(void *arg) sc = (struct sfxge_softc *)arg; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); (void)sfxge_start(sc); - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); } static void sfxge_stop(struct sfxge_softc *sc) { - sx_assert(&sc->softc_lock, LA_XLOCKED); + SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc); if (sc->init_state != SFXGE_STARTED) return; @@ -211,7 +211,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign switch (command) { case SIOCSIFFLAGS: - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if ((ifp->if_flags ^ sc->if_flags) & @@ -224,7 +224,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign if (ifp->if_drv_flags & IFF_DRV_RUNNING) sfxge_stop(sc); sc->if_flags = ifp->if_flags; - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); break; case SIOCSIFMTU: if (ifr->ifr_mtu == ifp->if_mtu) { @@ -237,11 +237,11 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign error = 0; } else { /* Restart required */ - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); sfxge_stop(sc); ifp->if_mtu = ifr->ifr_mtu; error = sfxge_start(sc); - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); if (error != 0) { ifp->if_flags &= ~IFF_UP; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -255,7 +255,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign sfxge_mac_filter_set(sc); break; case SIOCSIFCAP: - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); /* * The networking core already rejects attempts to @@ -265,7 +265,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign */ if (~ifr->ifr_reqcap & SFXGE_CAP_FIXED) { error = EINVAL; - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); break; } @@ -279,7 +279,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign else ifp->if_hwassist &= ~CSUM_TSO; - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: @@ -297,9 +297,9 @@ sfxge_ifnet_fini(struct ifnet *ifp) { struct sfxge_softc *sc = ifp->if_softc; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); sfxge_stop(sc); - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); ifmedia_removeall(&sc->media); ether_ifdetach(ifp); @@ -375,7 +375,7 @@ sfxge_bar_init(struct sfxge_softc *sc) } esbp->esb_tag = rman_get_bustag(esbp->esb_res); esbp->esb_handle = rman_get_bushandle(esbp->esb_res); - mtx_init(&esbp->esb_lock, "sfxge_efsys_bar", NULL, MTX_DEF); + SFXGE_BAR_LOCK_INIT(esbp, "sfxge_efsys_bar"); return (0); } @@ -387,7 +387,7 @@ sfxge_bar_fini(struct sfxge_softc *sc) bus_release_resource(sc->dev, SYS_RES_MEMORY, esbp->esb_rid, esbp->esb_res); - mtx_destroy(&esbp->esb_lock); + SFXGE_BAR_LOCK_DESTROY(esbp); } static int @@ -400,7 +400,7 @@ sfxge_create(struct sfxge_softc *sc) dev = sc->dev; - sx_init(&sc->softc_lock, "sfxge_softc"); + SFXGE_ADAPTER_LOCK_INIT(sc, "sfxge_softc"); sc->max_rss_channels = 0; snprintf(rss_param_name, sizeof(rss_param_name), @@ -544,7 +544,7 @@ fail3: fail: sc->dev = NULL; - sx_destroy(&sc->softc_lock); + SFXGE_ADAPTER_LOCK_DESTROY(sc); return (error); } @@ -593,7 +593,7 @@ sfxge_destroy(struct sfxge_softc *sc) taskqueue_drain(taskqueue_thread, &sc->task_reset); /* Destroy the softc lock. */ - sx_destroy(&sc->softc_lock); + SFXGE_ADAPTER_LOCK_DESTROY(sc); } static int @@ -695,7 +695,7 @@ sfxge_reset(void *arg, int npending) sc = (struct sfxge_softc *)arg; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); if (sc->init_state != SFXGE_STARTED) goto done; @@ -708,7 +708,7 @@ sfxge_reset(void *arg, int npending) rc); done: - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); } void Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:27:54 2015 (r280522) @@ -313,4 +313,48 @@ extern int sfxge_port_ifmedia_init(struc #define SFXGE_MAX_MTU (9 * 1024) +#define SFXGE_ADAPTER_LOCK_INIT(_sc, _name) \ + sx_init(&(_sc)->softc_lock, (_name)) +#define SFXGE_ADAPTER_LOCK_DESTROY(_sc) \ + sx_destroy(&(_sc)->softc_lock) +#define SFXGE_ADAPTER_LOCK(_sc) \ + sx_xlock(&(_sc)->softc_lock) +#define SFXGE_ADAPTER_UNLOCK(_sc) \ + sx_xunlock(&(_sc)->softc_lock) +#define SFXGE_ADAPTER_LOCK_ASSERT_OWNED(_sc) \ + sx_assert(&(_sc)->softc_lock, LA_XLOCKED) + +#define SFXGE_PORT_LOCK_INIT(_port, _name) \ + mtx_init(&(_port)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_PORT_LOCK_DESTROY(_port) \ + mtx_destroy(&(_port)->lock) +#define SFXGE_PORT_LOCK(_port) \ + mtx_lock(&(_port)->lock) +#define SFXGE_PORT_UNLOCK(_port) \ + mtx_unlock(&(_port)->lock) +#define SFXGE_PORT_LOCK_ASSERT_OWNED(_port) \ + mtx_assert(&(_port)->lock, MA_OWNED) + +#define SFXGE_MCDI_LOCK_INIT(_mcdi, _name) \ + mtx_init(&(_mcdi)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_MCDI_LOCK_DESTROY(_mcdi) \ + mtx_destroy(&(_mcdi)->lock) +#define SFXGE_MCDI_LOCK(_mcdi) \ + mtx_lock(&(_mcdi)->lock) +#define SFXGE_MCDI_UNLOCK(_mcdi) \ + mtx_unlock(&(_mcdi)->lock) +#define SFXGE_MCDI_LOCK_ASSERT_OWNED(_mcdi) \ + mtx_assert(&(_mcdi)->lock, MA_OWNED) + +#define SFXGE_EVQ_LOCK_INIT(_evq, _name) \ + mtx_init(&(_evq)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_EVQ_LOCK_DESTROY(_evq) \ + mtx_destroy(&(_evq)->lock) +#define SFXGE_EVQ_LOCK(_evq) \ + mtx_lock(&(_evq)->lock) +#define SFXGE_EVQ_UNLOCK(_evq) \ + mtx_unlock(&(_evq)->lock) +#define SFXGE_EVQ_LOCK_ASSERT_OWNED(_evq) \ + mtx_assert(&(_evq)->lock, MA_OWNED) + #endif /* _SFXGE_H */ Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:27:54 2015 (r280522) @@ -410,7 +410,7 @@ sfxge_ev_stat_update(struct sfxge_softc unsigned int index; clock_t now; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); if (sc->evq[0]->init_state != SFXGE_EVQ_STARTED) goto out; @@ -424,12 +424,12 @@ sfxge_ev_stat_update(struct sfxge_softc /* Add event counts from each event queue in turn */ for (index = 0; index < sc->intr.n_alloc; index++) { evq = sc->evq[index]; - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); efx_ev_qstats_update(evq->common, sc->ev_stats); - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); } out: - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); } static int @@ -490,7 +490,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG int error; int index; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &moderation, sizeof(moderation))) @@ -517,7 +517,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG } out: - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); return (error); } @@ -572,7 +572,7 @@ sfxge_ev_qpoll(struct sfxge_evq *evq) { int rc; - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); if (evq->init_state != SFXGE_EVQ_STARTING && evq->init_state != SFXGE_EVQ_STARTED) { @@ -602,12 +602,12 @@ sfxge_ev_qpoll(struct sfxge_evq *evq) if ((rc = efx_ev_qprime(evq->common, evq->read_ptr)) != 0) goto fail; - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); return (0); fail: - mtx_unlock(&(evq->lock)); + SFXGE_EVQ_UNLOCK(evq); return (rc); } @@ -621,7 +621,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, u KASSERT(evq->init_state == SFXGE_EVQ_STARTED, ("evq->init_state != SFXGE_EVQ_STARTED")); - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); evq->init_state = SFXGE_EVQ_INITIALIZED; evq->read_ptr = 0; evq->exception = B_FALSE; @@ -634,7 +634,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, u efx_ev_qdestroy(evq->common); efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, EFX_EVQ_NBUFS(evq->entries)); - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); } static int @@ -664,7 +664,7 @@ sfxge_ev_qstart(struct sfxge_softc *sc, evq->buf_base_id, &evq->common)) != 0) goto fail; - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); /* Set the default moderation */ (void)efx_ev_qmoderate(evq->common, sc->ev_moderation); @@ -675,7 +675,7 @@ sfxge_ev_qstart(struct sfxge_softc *sc, evq->init_state = SFXGE_EVQ_STARTING; - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); /* Wait for the initialization event */ count = 0; @@ -696,10 +696,10 @@ done: return (0); fail3: - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); evq->init_state = SFXGE_EVQ_INITIALIZED; fail2: - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); efx_ev_qdestroy(evq->common); fail: efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, @@ -780,7 +780,7 @@ sfxge_ev_qfini(struct sfxge_softc *sc, u sc->evq[index] = NULL; - mtx_destroy(&evq->lock); + SFXGE_EVQ_LOCK_DESTROY(evq); free(evq, M_SFXGE); } @@ -827,7 +827,7 @@ sfxge_ev_qinit(struct sfxge_softc *sc, u sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(evq->entries), &evq->buf_base_id); - mtx_init(&evq->lock, "evq", NULL, MTX_DEF); + SFXGE_EVQ_LOCK_INIT(evq, "evq"); evq->init_state = SFXGE_EVQ_INITIALIZED; Modified: stable/10/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_mcdi.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge_mcdi.c Wed Mar 25 10:27:54 2015 (r280522) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); static void sfxge_mcdi_acquire(struct sfxge_mcdi *mcdi) { - - mtx_lock(&mcdi->lock); + SFXGE_MCDI_LOCK(mcdi); KASSERT(mcdi->state != SFXGE_MCDI_UNINITIALIZED, ("MCDI not initialized")); @@ -61,15 +60,14 @@ sfxge_mcdi_acquire(struct sfxge_mcdi *mc (void)cv_wait_sig(&mcdi->cv, &mcdi->lock); mcdi->state = SFXGE_MCDI_BUSY; - mtx_unlock(&mcdi->lock); + SFXGE_MCDI_UNLOCK(mcdi); } /* Release ownership of MCDI on request completion. */ static void sfxge_mcdi_release(struct sfxge_mcdi *mcdi) { - - mtx_lock(&mcdi->lock); + SFXGE_MCDI_LOCK(mcdi); KASSERT((mcdi->state == SFXGE_MCDI_BUSY || mcdi->state == SFXGE_MCDI_COMPLETED), ("MCDI not busy or task not completed")); @@ -77,7 +75,7 @@ sfxge_mcdi_release(struct sfxge_mcdi *mc mcdi->state = SFXGE_MCDI_INITIALIZED; cv_broadcast(&mcdi->cv); - mtx_unlock(&mcdi->lock); + SFXGE_MCDI_UNLOCK(mcdi); } static void @@ -160,11 +158,11 @@ sfxge_mcdi_ev_cpl(void *arg) sc = (struct sfxge_softc *)arg; mcdi = &sc->mcdi; - mtx_lock(&mcdi->lock); + SFXGE_MCDI_LOCK(mcdi); KASSERT(mcdi->state == SFXGE_MCDI_BUSY, ("MCDI not busy")); mcdi->state = SFXGE_MCDI_COMPLETED; cv_broadcast(&mcdi->cv); - mtx_unlock(&mcdi->lock); + SFXGE_MCDI_UNLOCK(mcdi); } static void @@ -203,7 +201,7 @@ sfxge_mcdi_init(struct sfxge_softc *sc) KASSERT(mcdi->state == SFXGE_MCDI_UNINITIALIZED, ("MCDI already initialized")); - mtx_init(&mcdi->lock, "sfxge_mcdi", NULL, MTX_DEF); + SFXGE_MCDI_LOCK_INIT(mcdi, "sfxge_mcdi"); mcdi->state = SFXGE_MCDI_INITIALIZED; @@ -220,7 +218,7 @@ sfxge_mcdi_init(struct sfxge_softc *sc) return (0); fail: - mtx_destroy(&mcdi->lock); + SFXGE_MCDI_LOCK_DESTROY(mcdi); mcdi->state = SFXGE_MCDI_UNINITIALIZED; return (rc); } @@ -236,7 +234,7 @@ sfxge_mcdi_fini(struct sfxge_softc *sc) mcdi = &sc->mcdi; emtp = &mcdi->transport; - mtx_lock(&mcdi->lock); + SFXGE_MCDI_LOCK(mcdi); KASSERT(mcdi->state == SFXGE_MCDI_INITIALIZED, ("MCDI not initialized")); @@ -244,7 +242,7 @@ sfxge_mcdi_fini(struct sfxge_softc *sc) bzero(emtp, sizeof(*emtp)); cv_destroy(&mcdi->cv); - mtx_unlock(&mcdi->lock); + SFXGE_MCDI_UNLOCK(mcdi); - mtx_destroy(&mcdi->lock); + SFXGE_MCDI_LOCK_DESTROY(mcdi); } Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:27:54 2015 (r280522) @@ -48,7 +48,7 @@ sfxge_mac_stat_update(struct sfxge_softc unsigned int count; int rc; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); if (port->init_state != SFXGE_PORT_STARTED) { rc = 0; @@ -82,7 +82,7 @@ sfxge_mac_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (rc); } @@ -170,7 +170,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND sc = arg1; port = &sc->port; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0) @@ -191,7 +191,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND } out: - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (error); } @@ -207,13 +207,13 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE sc = arg1; port = &sc->port; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); if (port->init_state == SFXGE_PORT_STARTED && SFXGE_LINK_UP(sc)) efx_mac_fcntl_get(sc->enp, &wanted_fc, &link_fc); else link_fc = 0; error = SYSCTL_OUT(req, &link_fc, sizeof(link_fc)); - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (error); } @@ -262,7 +262,7 @@ sfxge_mac_poll_work(void *arg, int npend enp = sc->enp; port = &sc->port; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); if (port->init_state != SFXGE_PORT_STARTED) goto done; @@ -272,7 +272,7 @@ sfxge_mac_poll_work(void *arg, int npend sfxge_mac_link_update(sc, mode); done: - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); } static int @@ -320,7 +320,7 @@ sfxge_mac_filter_set(struct sfxge_softc struct sfxge_port *port = &sc->port; int rc; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); /* * The function may be called without softc_lock held in the * case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler @@ -335,7 +335,7 @@ sfxge_mac_filter_set(struct sfxge_softc rc = sfxge_mac_filter_set_locked(sc); else rc = 0; - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (rc); } @@ -348,7 +348,7 @@ sfxge_port_stop(struct sfxge_softc *sc) port = &sc->port; enp = sc->enp; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); KASSERT(port->init_state == SFXGE_PORT_STARTED, ("port not started")); @@ -367,7 +367,7 @@ sfxge_port_stop(struct sfxge_softc *sc) /* Destroy the common code port object. */ efx_port_fini(sc->enp); - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); } int @@ -383,7 +383,7 @@ sfxge_port_start(struct sfxge_softc *sc) port = &sc->port; enp = sc->enp; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); KASSERT(port->init_state == SFXGE_PORT_INITIALIZED, ("port not initialized")); @@ -426,7 +426,7 @@ sfxge_port_start(struct sfxge_softc *sc) port->init_state = SFXGE_PORT_STARTED; /* Single poll in case there were missing initial events */ - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); sfxge_mac_poll_work(sc, 0); return (0); @@ -439,7 +439,7 @@ fail3: fail2: efx_port_fini(sc->enp); fail: - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (rc); } @@ -453,7 +453,7 @@ sfxge_phy_stat_update(struct sfxge_softc unsigned int count; int rc; - mtx_lock(&port->lock); + SFXGE_PORT_LOCK(port); if (port->init_state != SFXGE_PORT_STARTED) { rc = 0; @@ -487,7 +487,7 @@ sfxge_phy_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: - mtx_unlock(&port->lock); + SFXGE_PORT_UNLOCK(port); return (rc); } @@ -554,7 +554,7 @@ sfxge_port_fini(struct sfxge_softc *sc) sfxge_dma_free(esmp); free(port->mac_stats.decode_buf, M_SFXGE); - mtx_destroy(&port->lock); + SFXGE_PORT_LOCK_DESTROY(port); port->sc = NULL; } @@ -577,7 +577,7 @@ sfxge_port_init(struct sfxge_softc *sc) port->sc = sc; - mtx_init(&port->lock, "sfxge_port", NULL, MTX_DEF); + SFXGE_PORT_LOCK_INIT(port, "sfxge_port"); port->phy_stats.decode_buf = malloc(EFX_PHY_NSTATS * sizeof(uint32_t), M_SFXGE, M_WAITOK | M_ZERO); @@ -615,7 +615,7 @@ fail2: sfxge_dma_free(phy_stats_buf); fail: free(port->phy_stats.decode_buf, M_SFXGE); - (void)mtx_destroy(&port->lock); + SFXGE_PORT_LOCK_DESTROY(port); port->sc = NULL; return (rc); } @@ -655,7 +655,7 @@ sfxge_media_status(struct ifnet *ifp, st efx_link_mode_t mode; sc = ifp->if_softc; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -669,7 +669,7 @@ sfxge_media_status(struct ifnet *ifp, st ifmr->ifm_active |= sfxge_port_link_fc_ifm(sc); } - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); } static int @@ -682,7 +682,7 @@ sfxge_media_change(struct ifnet *ifp) sc = ifp->if_softc; ifm = sc->media.ifm_cur; - sx_xlock(&sc->softc_lock); + SFXGE_ADAPTER_LOCK(sc); if (!SFXGE_RUNNING(sc)) { rc = 0; @@ -695,7 +695,7 @@ sfxge_media_change(struct ifnet *ifp) rc = efx_phy_adv_cap_set(sc->enp, ifm->ifm_data); out: - sx_xunlock(&sc->softc_lock); + SFXGE_ADAPTER_UNLOCK(sc); return (rc); } Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:27:54 2015 (r280522) @@ -207,7 +207,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un prefetch_read_many(sc->enp); prefetch_read_many(rxq->common); - mtx_assert(&evq->lock, MA_OWNED); + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); if (rxq->init_state != SFXGE_RXQ_STARTED) return; @@ -749,7 +749,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq index = rxq->index; evq = sc->evq[index]; - mtx_assert(&evq->lock, MA_OWNED); + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); completed = rxq->completed; while (completed != rxq->pending) { @@ -834,7 +834,7 @@ sfxge_rx_qstop(struct sfxge_softc *sc, u rxq = sc->rxq[index]; evq = sc->evq[index]; - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); KASSERT(rxq->init_state == SFXGE_RXQ_STARTED, ("rxq not started")); @@ -849,7 +849,7 @@ again: /* Flush the receive queue */ efx_rx_qflush(rxq->common); - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); count = 0; do { @@ -861,7 +861,7 @@ again: } while (++count < 20); - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); if (rxq->flush_state == SFXGE_FLUSH_FAILED) goto again; @@ -885,7 +885,7 @@ again: efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, EFX_RXQ_NBUFS(sc->rxq_entries)); - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); } static int @@ -916,7 +916,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, &rxq->common)) != 0) goto fail; - mtx_lock(&evq->lock); + SFXGE_EVQ_LOCK(evq); /* Enable the receive queue. */ efx_rx_qenable(rxq->common); @@ -926,7 +926,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, /* Try to fill the queue from the pool. */ sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(sc->rxq_entries), B_FALSE); - mtx_unlock(&evq->lock); + SFXGE_EVQ_UNLOCK(evq); return (0); Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:26:45 2015 (r280521) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:27:54 2015 (r280522) @@ -118,7 +118,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq { unsigned int completed; - mtx_assert(&evq->lock, MA_OWNED); + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); completed = txq->completed; while (completed != txq->pending) { @@ -178,7 +178,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * unsigned int count; unsigned int non_tcp_count; - mtx_assert(&txq->lock, MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); stdp = &txq->dpl; @@ -221,7 +221,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * static void sfxge_tx_qreap(struct sfxge_txq *txq) { - mtx_assert(SFXGE_TXQ_LOCK(txq), MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); txq->reaped = txq->completed; } @@ -233,7 +233,7 @@ sfxge_tx_qlist_post(struct sfxge_txq *tx unsigned int level; int rc; - mtx_assert(SFXGE_TXQ_LOCK(txq), MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); KASSERT(txq->n_pend_desc != 0, ("txq->n_pend_desc == 0")); KASSERT(txq->n_pend_desc <= SFXGE_TSO_MAX_DESC, @@ -408,7 +408,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx unsigned int pushed; int rc; - mtx_assert(&txq->lock, MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); sc = txq->sc; stdp = &txq->dpl; @@ -484,7 +484,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { - mtx_assert(&txq->lock, MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); do { if (SFXGE_TX_QDPL_PENDING(txq)) @@ -493,9 +493,9 @@ sfxge_tx_qdpl_service(struct sfxge_txq * if (!txq->blocked) sfxge_tx_qdpl_drain(txq); - mtx_unlock(&txq->lock); + SFXGE_TXQ_UNLOCK(txq); } while (SFXGE_TX_QDPL_PENDING(txq) && - mtx_trylock(&txq->lock)); + SFXGE_TXQ_TRYLOCK(txq)); } /* @@ -519,7 +519,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, KASSERT(mbuf->m_nextpkt == NULL, ("mbuf->m_nextpkt != NULL")); if (locked) { - mtx_assert(&txq->lock, MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); sfxge_tx_qdpl_swizzle(txq); @@ -588,11 +588,11 @@ sfxge_tx_packet_add(struct sfxge_txq *tx * the packet will be appended to the "get list" of the deferred * packet list. Otherwise, it will be pushed on the "put list". */ - locked = mtx_trylock(&txq->lock); + locked = SFXGE_TXQ_TRYLOCK(txq); if (sfxge_tx_qdpl_put(txq, m, locked) != 0) { if (locked) - mtx_unlock(&txq->lock); + SFXGE_TXQ_UNLOCK(txq); rc = ENOBUFS; goto fail; } @@ -605,7 +605,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx * is processing the list. */ if (!locked) - locked = mtx_trylock(&txq->lock); + locked = SFXGE_TXQ_TRYLOCK(txq); if (locked) { /* Try to service the list. */ @@ -626,7 +626,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx struct sfxge_tx_dpl *stdp = &txq->dpl; struct mbuf *mbuf, *next; - mtx_lock(&txq->lock); + SFXGE_TXQ_LOCK(txq); sfxge_tx_qdpl_swizzle(txq); for (mbuf = stdp->std_get; mbuf != NULL; mbuf = next) { @@ -638,7 +638,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx stdp->std_get_non_tcp_count = 0; stdp->std_getp = &stdp->std_get; - mtx_unlock(&txq->lock); + SFXGE_TXQ_UNLOCK(txq); } void @@ -752,21 +752,20 @@ void sfxge_if_start(struct ifnet *ifp) { struct sfxge_softc *sc = ifp->if_softc; - mtx_lock(&sc->tx_lock); + SFXGE_TXQ_LOCK(sc->txq[0]); sfxge_if_start_locked(ifp); - mtx_unlock(&sc->tx_lock); + SFXGE_TXQ_UNLOCK(sc->txq[0]); } static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { - struct sfxge_softc *sc = txq->sc; - struct ifnet *ifp = sc->ifnet; + struct ifnet *ifp = txq->sc->ifnet; - mtx_assert(&sc->tx_lock, MA_OWNED); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sfxge_if_start_locked(ifp); - mtx_unlock(&sc->tx_lock); + SFXGE_TXQ_UNLOCK(txq); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:29:09 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1747C09; Wed, 25 Mar 2015 10:29:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91C8D849; Wed, 25 Mar 2015 10:29:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAT9rN084076; Wed, 25 Mar 2015 10:29:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAT9fB084075; Wed, 25 Mar 2015 10:29:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251029.t2PAT9fB084075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:29: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: r280523 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:29:09 -0000 Author: arybchik Date: Wed Mar 25 10:29:08 2015 New Revision: 280523 URL: https://svnweb.freebsd.org/changeset/base/280523 Log: MFC: 278248 sfxge: access statistics buffers under port lock Allow access to statistics data not only from sysctl handlers. Submitted by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:27:54 2015 (r280522) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:29:08 2015 (r280523) @@ -48,7 +48,7 @@ sfxge_mac_stat_update(struct sfxge_softc unsigned int count; int rc; - SFXGE_PORT_LOCK(port); + SFXGE_PORT_LOCK_ASSERT_OWNED(port); if (port->init_state != SFXGE_PORT_STARTED) { rc = 0; @@ -82,7 +82,6 @@ sfxge_mac_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: - SFXGE_PORT_UNLOCK(port); return (rc); } @@ -93,12 +92,16 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_AR unsigned int id = arg2; int rc; + SFXGE_PORT_LOCK(&sc->port); if ((rc = sfxge_mac_stat_update(sc)) != 0) - return (rc); + goto out; - return (SYSCTL_OUT(req, - (uint64_t *)sc->port.mac_stats.decode_buf + id, - sizeof(uint64_t))); + rc = SYSCTL_OUT(req, + (uint64_t *)sc->port.mac_stats.decode_buf + id, + sizeof(uint64_t)); +out: + SFXGE_PORT_UNLOCK(&sc->port); + return (rc); } static void @@ -453,7 +456,7 @@ sfxge_phy_stat_update(struct sfxge_softc unsigned int count; int rc; - SFXGE_PORT_LOCK(port); + SFXGE_PORT_LOCK_ASSERT_OWNED(port); if (port->init_state != SFXGE_PORT_STARTED) { rc = 0; @@ -487,7 +490,6 @@ sfxge_phy_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: - SFXGE_PORT_UNLOCK(port); return (rc); } @@ -498,12 +500,16 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_AR unsigned int id = arg2; int rc; + SFXGE_PORT_LOCK(&sc->port); if ((rc = sfxge_phy_stat_update(sc)) != 0) - return (rc); + goto out; - return (SYSCTL_OUT(req, - (uint32_t *)sc->port.phy_stats.decode_buf + id, - sizeof(uint32_t))); + rc = SYSCTL_OUT(req, + (uint32_t *)sc->port.phy_stats.decode_buf + id, + sizeof(uint32_t)); +out: + SFXGE_PORT_UNLOCK(&sc->port); + return (rc); } static void From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:30:49 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71E5DD5E; Wed, 25 Mar 2015 10:30:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 528F6864; Wed, 25 Mar 2015 10:30:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAUnZj086023; Wed, 25 Mar 2015 10:30:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAUkox084873; Wed, 25 Mar 2015 10:30:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251030.t2PAUkox084873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:30: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: r280524 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:30:49 -0000 Author: arybchik Date: Wed Mar 25 10:30:45 2015 New Revision: 280524 URL: https://svnweb.freebsd.org/changeset/base/280524 Log: MFC: 278250 sfxge: make lock names unique Lock name should include interface name. Tx queue and event queue lock name should include queue number. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_mcdi.c stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:30:45 2015 (r280524) @@ -509,16 +509,26 @@ typedef struct efsys_mem_s { /* BAR */ +#define SFXGE_LOCK_NAME_MAX 16 + typedef struct efsys_bar_s { struct mtx esb_lock; + char esb_lock_name[SFXGE_LOCK_NAME_MAX]; bus_space_tag_t esb_tag; bus_space_handle_t esb_handle; int esb_rid; struct resource *esb_res; } efsys_bar_t; -#define SFXGE_BAR_LOCK_INIT(_esbp, _name) \ - mtx_init(&(_esbp)->esb_lock, (_name), NULL, MTX_DEF) +#define SFXGE_BAR_LOCK_INIT(_esbp, _ifname) \ + do { \ + snprintf((_esbp)->esb_lock_name, \ + sizeof((_esbp)->esb_lock_name), \ + "%s:bar", (_ifname)); \ + mtx_init(&(_esbp)->esb_lock, (_esbp)->esb_lock_name, \ + NULL, MTX_DEF); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) #define SFXGE_BAR_LOCK_DESTROY(_esbp) \ mtx_destroy(&(_esbp)->esb_lock) #define SFXGE_BAR_LOCK(_esbp) \ @@ -721,13 +731,35 @@ typedef clock_t efsys_timestamp_t; /* LOCK */ -typedef struct mtx efsys_lock_t; +typedef struct efsys_lock_s { + struct mtx lock; + char lock_name[SFXGE_LOCK_NAME_MAX]; +} efsys_lock_t; + +#define SFXGE_EFSYS_LOCK_INIT(_eslp, _ifname, _label) \ + do { \ + efsys_lock_t *__eslp = (_eslp); \ + \ + snprintf((__eslp)->lock_name, \ + sizeof((__eslp)->lock_name), \ + "%s:%s", (_ifname), (_label)); \ + mtx_init(&(__eslp)->lock, (__eslp)->lock_name, \ + NULL, MTX_DEF); \ + } while (B_FALSE) +#define SFXGE_EFSYS_LOCK_DESTROY(_eslp) \ + mtx_destroy(&(_eslp)->lock) +#define SFXGE_EFSYS_LOCK(_eslp) \ + mtx_lock(&(_eslp)->lock) +#define SFXGE_EFSYS_UNLOCK(_eslp) \ + mtx_unlock(&(_eslp)->lock) +#define SFXGE_EFSYS_LOCK_ASSERT_OWNED(_eslp) \ + mtx_assert(&(_eslp)->lock, MA_OWNED) #define EFSYS_LOCK_MAGIC 0x000010c4 #define EFSYS_LOCK(_lockp, _state) \ do { \ - mtx_lock(_lockp); \ + SFXGE_EFSYS_LOCK(_lockp); \ (_state) = EFSYS_LOCK_MAGIC; \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -736,7 +768,7 @@ typedef struct mtx efsys_lock_t; do { \ if ((_state) != EFSYS_LOCK_MAGIC) \ KASSERT(B_FALSE, ("not locked")); \ - mtx_unlock(_lockp); \ + SFXGE_EFSYS_UNLOCK(_lockp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:30:45 2015 (r280524) @@ -337,7 +337,9 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1; IFQ_SET_READY(&ifp->if_snd); - mtx_init(&sc->tx_lock, "txq", NULL, MTX_DEF); + snprintf(sc->tx_lock_name, sizeof(sc->tx_lock_name), + "%s:tx", device_get_nameunit(sc->dev)); + mtx_init(&sc->tx_lock, sc->tx_lock_name, NULL, MTX_DEF); #endif if ((rc = sfxge_port_ifmedia_init(sc)) != 0) @@ -375,7 +377,8 @@ sfxge_bar_init(struct sfxge_softc *sc) } esbp->esb_tag = rman_get_bustag(esbp->esb_res); esbp->esb_handle = rman_get_bushandle(esbp->esb_res); - SFXGE_BAR_LOCK_INIT(esbp, "sfxge_efsys_bar"); + + SFXGE_BAR_LOCK_INIT(esbp, device_get_nameunit(sc->dev)); return (0); } @@ -400,7 +403,7 @@ sfxge_create(struct sfxge_softc *sc) dev = sc->dev; - SFXGE_ADAPTER_LOCK_INIT(sc, "sfxge_softc"); + SFXGE_ADAPTER_LOCK_INIT(sc, device_get_nameunit(sc->dev)); sc->max_rss_channels = 0; snprintf(rss_param_name, sizeof(rss_param_name), @@ -434,7 +437,8 @@ sfxge_create(struct sfxge_softc *sc) KASSERT(error == 0, ("Family should be filtered by sfxge_probe()")); /* Create the common code nic object. */ - mtx_init(&sc->enp_lock, "sfxge_nic", NULL, MTX_DEF); + SFXGE_EFSYS_LOCK_INIT(&sc->enp_lock, + device_get_nameunit(sc->dev), "nic"); if ((error = efx_nic_create(sc->family, (efsys_identifier_t *)sc, &sc->bar, &sc->enp_lock, &enp)) != 0) goto fail3; @@ -536,7 +540,7 @@ fail_tx_ring_entries: fail_rx_ring_entries: sc->enp = NULL; efx_nic_destroy(enp); - mtx_destroy(&sc->enp_lock); + SFXGE_EFSYS_LOCK_DESTROY(&sc->enp_lock); fail3: sfxge_bar_fini(sc); Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:30:45 2015 (r280524) @@ -121,6 +121,7 @@ struct sfxge_evq { /* Structure members not used on event processing path */ unsigned int buf_base_id; unsigned int entries; + char lock_name[SFXGE_LOCK_NAME_MAX]; } __aligned(CACHE_LINE_SIZE); #define SFXGE_NDESCS 1024 @@ -161,6 +162,9 @@ struct sfxge_mcdi { struct cv cv; enum sfxge_mcdi_state state; efx_mcdi_transport_t transport; + + /* Only used in debugging output */ + char lock_name[SFXGE_LOCK_NAME_MAX]; }; struct sfxge_hw_stats { @@ -185,6 +189,9 @@ struct sfxge_port { struct sfxge_hw_stats phy_stats; struct sfxge_hw_stats mac_stats; efx_link_mode_t link_mode; + + /* Only used in debugging output */ + char lock_name[SFXGE_LOCK_NAME_MAX]; }; enum sfxge_softc_state { @@ -197,6 +204,7 @@ enum sfxge_softc_state { struct sfxge_softc { device_t dev; struct sx softc_lock; + char softc_lock_name[SFXGE_LOCK_NAME_MAX]; enum sfxge_softc_state init_state; struct ifnet *ifnet; unsigned int if_flags; @@ -209,7 +217,7 @@ struct sfxge_softc { caddr_t vpd_data; size_t vpd_size; efx_nic_t *enp; - struct mtx enp_lock; + efsys_lock_t enp_lock; unsigned int rxq_entries; unsigned int txq_entries; @@ -248,6 +256,7 @@ struct sfxge_softc { #ifndef SFXGE_HAVE_MQ struct mtx tx_lock __aligned(CACHE_LINE_SIZE); + char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif }; @@ -313,8 +322,15 @@ extern int sfxge_port_ifmedia_init(struc #define SFXGE_MAX_MTU (9 * 1024) -#define SFXGE_ADAPTER_LOCK_INIT(_sc, _name) \ - sx_init(&(_sc)->softc_lock, (_name)) +#define SFXGE_ADAPTER_LOCK_INIT(_sc, _ifname) \ + do { \ + struct sfxge_softc *__sc = (_sc); \ + \ + snprintf((__sc)->softc_lock_name, \ + sizeof((__sc)->softc_lock_name), \ + "%s:softc", (_ifname)); \ + sx_init(&(__sc)->softc_lock, (__sc)->softc_lock_name); \ + } while (B_FALSE) #define SFXGE_ADAPTER_LOCK_DESTROY(_sc) \ sx_destroy(&(_sc)->softc_lock) #define SFXGE_ADAPTER_LOCK(_sc) \ @@ -324,8 +340,16 @@ extern int sfxge_port_ifmedia_init(struc #define SFXGE_ADAPTER_LOCK_ASSERT_OWNED(_sc) \ sx_assert(&(_sc)->softc_lock, LA_XLOCKED) -#define SFXGE_PORT_LOCK_INIT(_port, _name) \ - mtx_init(&(_port)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_PORT_LOCK_INIT(_port, _ifname) \ + do { \ + struct sfxge_port *__port = (_port); \ + \ + snprintf((__port)->lock_name, \ + sizeof((__port)->lock_name), \ + "%s:port", (_ifname)); \ + mtx_init(&(__port)->lock, (__port)->lock_name, \ + NULL, MTX_DEF); \ + } while (B_FALSE) #define SFXGE_PORT_LOCK_DESTROY(_port) \ mtx_destroy(&(_port)->lock) #define SFXGE_PORT_LOCK(_port) \ @@ -335,8 +359,16 @@ extern int sfxge_port_ifmedia_init(struc #define SFXGE_PORT_LOCK_ASSERT_OWNED(_port) \ mtx_assert(&(_port)->lock, MA_OWNED) -#define SFXGE_MCDI_LOCK_INIT(_mcdi, _name) \ - mtx_init(&(_mcdi)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_MCDI_LOCK_INIT(_mcdi, _ifname) \ + do { \ + struct sfxge_mcdi *__mcdi = (_mcdi); \ + \ + snprintf((__mcdi)->lock_name, \ + sizeof((__mcdi)->lock_name), \ + "%s:mcdi", (_ifname)); \ + mtx_init(&(__mcdi)->lock, (__mcdi)->lock_name, \ + NULL, MTX_DEF); \ + } while (B_FALSE) #define SFXGE_MCDI_LOCK_DESTROY(_mcdi) \ mtx_destroy(&(_mcdi)->lock) #define SFXGE_MCDI_LOCK(_mcdi) \ @@ -346,8 +378,16 @@ extern int sfxge_port_ifmedia_init(struc #define SFXGE_MCDI_LOCK_ASSERT_OWNED(_mcdi) \ mtx_assert(&(_mcdi)->lock, MA_OWNED) -#define SFXGE_EVQ_LOCK_INIT(_evq, _name) \ - mtx_init(&(_evq)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_EVQ_LOCK_INIT(_evq, _ifname, _evq_index) \ + do { \ + struct sfxge_evq *__evq = (_evq); \ + \ + snprintf((__evq)->lock_name, \ + sizeof((__evq)->lock_name), \ + "%s:evq%u", (_ifname), (_evq_index)); \ + mtx_init(&(__evq)->lock, (__evq)->lock_name, \ + NULL, MTX_DEF); \ + } while (B_FALSE) #define SFXGE_EVQ_LOCK_DESTROY(_evq) \ mtx_destroy(&(_evq)->lock) #define SFXGE_EVQ_LOCK(_evq) \ Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:30:45 2015 (r280524) @@ -827,7 +827,7 @@ sfxge_ev_qinit(struct sfxge_softc *sc, u sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(evq->entries), &evq->buf_base_id); - SFXGE_EVQ_LOCK_INIT(evq, "evq"); + SFXGE_EVQ_LOCK_INIT(evq, device_get_nameunit(sc->dev), index); evq->init_state = SFXGE_EVQ_INITIALIZED; Modified: stable/10/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_mcdi.c Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge_mcdi.c Wed Mar 25 10:30:45 2015 (r280524) @@ -201,7 +201,7 @@ sfxge_mcdi_init(struct sfxge_softc *sc) KASSERT(mcdi->state == SFXGE_MCDI_UNINITIALIZED, ("MCDI already initialized")); - SFXGE_MCDI_LOCK_INIT(mcdi, "sfxge_mcdi"); + SFXGE_MCDI_LOCK_INIT(mcdi, device_get_nameunit(sc->dev)); mcdi->state = SFXGE_MCDI_INITIALIZED; Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:30:45 2015 (r280524) @@ -583,7 +583,7 @@ sfxge_port_init(struct sfxge_softc *sc) port->sc = sc; - SFXGE_PORT_LOCK_INIT(port, "sfxge_port"); + SFXGE_PORT_LOCK_INIT(port, device_get_nameunit(sc->dev)); port->phy_stats.decode_buf = malloc(EFX_PHY_NSTATS * sizeof(uint32_t), M_SFXGE, M_WAITOK | M_ZERO); Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:30:45 2015 (r280524) @@ -1466,7 +1466,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u stdp->std_get_non_tcp_max = sfxge_tx_dpl_get_non_tcp_max; stdp->std_getp = &stdp->std_get; - SFXGE_TXQ_LOCK_INIT(txq, "txq"); + SFXGE_TXQ_LOCK_INIT(txq, device_get_nameunit(sc->dev), txq_index); SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(txq_node), OID_AUTO, Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:29:08 2015 (r280523) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:30:45 2015 (r280524) @@ -130,8 +130,16 @@ enum sfxge_txq_type { #define SFXGE_TX_SCALE(sc) 1 #endif -#define SFXGE_TXQ_LOCK_INIT(_txq, _name) \ - mtx_init(&(_txq)->lock, (_name), NULL, MTX_DEF) +#define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \ + do { \ + struct sfxge_txq *__txq = (_txq); \ + \ + snprintf((__txq)->lock_name, \ + sizeof((__txq)->lock_name), \ + "%s:txq%u", (_ifname), (_txq_index)); \ + mtx_init(&(__txq)->lock, (__txq)->lock_name, \ + NULL, MTX_DEF); \ + } while (B_FALSE) #define SFXGE_TXQ_LOCK_DESTROY(_txq) \ mtx_destroy(&(_txq)->lock) #define SFXGE_TXQ_LOCK(_txq) \ @@ -164,6 +172,8 @@ struct sfxge_txq { efsys_mem_t *tsoh_buffer; + char lock_name[SFXGE_LOCK_NAME_MAX]; + /* This field changes more often and is read regularly on both * the initiation and completion paths */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:31:44 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA43BEAE; Wed, 25 Mar 2015 10:31:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C411C90B; Wed, 25 Mar 2015 10:31:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAVi30087680; Wed, 25 Mar 2015 10:31:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAViQV087661; Wed, 25 Mar 2015 10:31:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251031.t2PAViQV087661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:31: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: r280525 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:31:45 -0000 Author: arybchik Date: Wed Mar 25 10:31:43 2015 New Revision: 280525 URL: https://svnweb.freebsd.org/changeset/base/280525 Log: MFC: 278254 sfxge: using 64-bit access for x86-64 Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:30:45 2015 (r280524) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 10:31:43 2015 (r280525) @@ -51,7 +51,11 @@ extern "C" { #include #define EFSYS_HAS_UINT64 1 +#if defined(__x86_64__) +#define EFSYS_USE_UINT64 1 +#else #define EFSYS_USE_UINT64 0 +#endif #if _BYTE_ORDER == _BIG_ENDIAN #define EFSYS_IS_BIG_ENDIAN 1 #define EFSYS_IS_LITTLE_ENDIAN 0 @@ -398,6 +402,26 @@ typedef struct efsys_mem_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#if defined(__x86_64__) +#define EFSYS_MEM_READQ(_esmp, _offset, _eqp) \ + do { \ + uint64_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + (_eqp)->eq_u64[0] = *addr; \ + \ + EFSYS_PROBE3(mem_readq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) +#else #define EFSYS_MEM_READQ(_esmp, _offset, _eqp) \ do { \ uint32_t *addr; \ @@ -417,7 +441,31 @@ typedef struct efsys_mem_s { \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif +#if defined(__x86_64__) +#define EFSYS_MEM_READO(_esmp, _offset, _eop) \ + do { \ + uint64_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + (_eop)->eo_u64[0] = *addr++; \ + (_eop)->eo_u64[1] = *addr; \ + \ + EFSYS_PROBE5(mem_reado, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) +#else #define EFSYS_MEM_READO(_esmp, _offset, _eop) \ do { \ uint32_t *addr; \ @@ -441,6 +489,7 @@ typedef struct efsys_mem_s { \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif #define EFSYS_MEM_WRITED(_esmp, _offset, _edp) \ do { \ @@ -460,6 +509,27 @@ typedef struct efsys_mem_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#if defined(__x86_64__) +#define EFSYS_MEM_WRITEQ(_esmp, _offset, _eqp) \ + do { \ + uint64_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + *addr = (_eqp)->eq_u64[0]; \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#else #define EFSYS_MEM_WRITEQ(_esmp, _offset, _eqp) \ do { \ uint32_t *addr; \ @@ -479,7 +549,31 @@ typedef struct efsys_mem_s { \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif +#if defined(__x86_64__) +#define EFSYS_MEM_WRITEO(_esmp, _offset, _eop) \ + do { \ + uint64_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + *addr++ = (_eop)->eo_u64[0]; \ + *addr = (_eop)->eo_u64[1]; \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) +#else #define EFSYS_MEM_WRITEO(_esmp, _offset, _eop) \ do { \ uint32_t *addr; \ @@ -503,6 +597,7 @@ typedef struct efsys_mem_s { \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif #define EFSYS_MEM_ADDR(_esmp) \ ((_esmp)->esm_addr) @@ -558,6 +653,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#if defined(__x86_64__) #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -566,6 +662,53 @@ typedef struct efsys_bar_s { \ SFXGE_BAR_LOCK(_esbp); \ \ + (_eqp)->eq_u64[0] = bus_space_read_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset)); \ + \ + EFSYS_PROBE3(bar_readq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_READO(_esbp, _offset, _eop, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + (_eop)->eo_u64[0] = bus_space_read_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset)); \ + (_eop)->eo_u64[1] = bus_space_read_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset+8)); \ + \ + EFSYS_PROBE5(bar_reado, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#else +#define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ (_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ (_eqp)->eq_u32[1] = bus_space_read_4((_esbp)->esb_tag, \ @@ -609,6 +752,7 @@ typedef struct efsys_bar_s { SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif #define EFSYS_BAR_WRITED(_esbp, _offset, _edp, _lock) \ do { \ @@ -632,6 +776,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#if defined(__x86_64__) #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -644,6 +789,25 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ + bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), (_eqp)->eq_u64[0]); \ + \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) +#else +#define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + EFSYS_PROBE3(bar_writeq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ (_offset), (_eqp)->eq_u32[0]); \ bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ @@ -652,7 +816,9 @@ typedef struct efsys_bar_s { SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif +#if defined(__x86_64__) #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -669,6 +835,34 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ + bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), (_eop)->eo_u64[0]); \ + bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset+8), (_eop)->eo_u64[1]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#else +#define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + EFSYS_PROBE5(bar_writeo, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ (_offset), (_eop)->eo_u32[0]); \ bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ @@ -683,6 +877,7 @@ typedef struct efsys_bar_s { SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +#endif /* SPIN */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:32:51 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BBA1FEC; Wed, 25 Mar 2015 10:32:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C036915; Wed, 25 Mar 2015 10:32:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAWoBU088162; Wed, 25 Mar 2015 10:32:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAWouY088160; Wed, 25 Mar 2015 10:32:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251032.t2PAWouY088160@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280526 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:32:51 -0000 Author: arybchik Date: Wed Mar 25 10:32:49 2015 New Revision: 280526 URL: https://svnweb.freebsd.org/changeset/base/280526 Log: MFC: 278255 sfxge: Add statistics for partially dropped TSO packets Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:31:43 2015 (r280525) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:32:49 2015 (r280526) @@ -1093,12 +1093,16 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq * roll back the work we have done. */ if (txq->n_pend_desc > - SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) + SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) { + txq->tso_pdrop_too_many++; break; + } next_id = (id + 1) & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, - next_id))) + next_id))) { + txq->tso_pdrop_no_rsrc++; break; + } id = next_id; } } @@ -1515,6 +1519,8 @@ static const struct { SFXGE_TX_STAT(tso_bursts, tso_bursts), SFXGE_TX_STAT(tso_packets, tso_packets), SFXGE_TX_STAT(tso_long_headers, tso_long_headers), + SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), + SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), SFXGE_TX_STAT(tx_get_overflow, get_overflow), Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:31:43 2015 (r280525) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:32:49 2015 (r280526) @@ -201,6 +201,8 @@ struct sfxge_txq { unsigned long get_non_tcp_overflow; unsigned long put_overflow; unsigned long netdown_drops; + unsigned long tso_pdrop_too_many; + unsigned long tso_pdrop_no_rsrc; /* The following fields change more often, and are used mostly * on the completion path From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:34:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 667321D3; Wed, 25 Mar 2015 10:34:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 505E492E; Wed, 25 Mar 2015 10:34:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAYLbi088433; Wed, 25 Mar 2015 10:34:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAYLc6088431; Wed, 25 Mar 2015 10:34:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251034.t2PAYLc6088431@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:34:21 +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: r280527 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:34:21 -0000 Author: arybchik Date: Wed Mar 25 10:34:20 2015 New Revision: 280527 URL: https://svnweb.freebsd.org/changeset/base/280527 Log: MFC: 278833 sfxge: remove unused variable Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:32:49 2015 (r280526) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:34:20 2015 (r280527) @@ -1279,7 +1279,6 @@ fail: void sfxge_tx_stop(struct sfxge_softc *sc) { - const efx_nic_cfg_t *encp; int index; index = SFXGE_TX_SCALE(sc); @@ -1288,7 +1287,6 @@ sfxge_tx_stop(struct sfxge_softc *sc) sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - encp = efx_nic_cfg_get(sc->enp); sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); /* Tear down the transmit module */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:35:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E01A311; Wed, 25 Mar 2015 10:35:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E273593C; Wed, 25 Mar 2015 10:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAZK5f088652; Wed, 25 Mar 2015 10:35:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAZK3L088650; Wed, 25 Mar 2015 10:35:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251035.t2PAZK3L088650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280528 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:35:21 -0000 Author: arybchik Date: Wed Mar 25 10:35:19 2015 New Revision: 280528 URL: https://svnweb.freebsd.org/changeset/base/280528 Log: MFC: 278835 sfxge: remove full_packet_size from sfxge_tso_state It makes sfxge_tso_state smaller and even makes tso_start_new_packet() few bytes smaller. Data used to calculate packet size are used nearby, so it should be no problems with cache etc. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:34:20 2015 (r280527) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:35:19 2015 (r280528) @@ -791,8 +791,6 @@ struct sfxge_tso_state { ssize_t nh_off; /* Offset of network header */ ssize_t tcph_off; /* Offset of TCP header */ unsigned header_len; /* Number of bytes of header */ - int full_packet_size; /* Number of bytes to put in each outgoing - * segment */ }; static inline const struct ip *tso_iph(const struct sfxge_tso_state *tso) @@ -894,7 +892,6 @@ static void tso_start(struct sfxge_tso_s } tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; - tso->full_packet_size = tso->header_len + mbuf->m_pkthdr.tso_segsz; tso->seqnum = ntohl(tso_tcph(tso)->th_seq); @@ -1014,7 +1011,8 @@ static int tso_start_new_packet(struct s tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz; if (tso->out_len > tso->mbuf->m_pkthdr.tso_segsz) { /* This packet will not finish the TSO burst. */ - ip_length = tso->full_packet_size - tso->nh_off; + ip_length = tso->header_len - tso->nh_off + + tso->mbuf->m_pkthdr.tso_segsz; tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH); } else { /* This packet will be the last in the TSO burst. */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:35:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 283DE453; Wed, 25 Mar 2015 10:35:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12589949; Wed, 25 Mar 2015 10:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAZsdt088776; Wed, 25 Mar 2015 10:35:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAZsJb088775; Wed, 25 Mar 2015 10:35:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251035.t2PAZsJb088775@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 10:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280529 - stable/10/sys/dev/usb/input 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.18-1 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, 25 Mar 2015 10:35:55 -0000 Author: hselasky Date: Wed Mar 25 10:35:54 2015 New Revision: 280529 URL: https://svnweb.freebsd.org/changeset/base/280529 Log: MFC r279854: Lock softc before clearing bits. Modified: stable/10/sys/dev/usb/input/uhid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/uhid.c ============================================================================== --- stable/10/sys/dev/usb/input/uhid.c Wed Mar 25 10:35:19 2015 (r280528) +++ stable/10/sys/dev/usb/input/uhid.c Wed Mar 25 10:35:54 2015 (r280529) @@ -518,7 +518,9 @@ uhid_open(struct usb_fifo *fifo, int ffl */ if (fflags & FREAD) { /* reset flags */ + mtx_lock(&sc->sc_mtx); sc->sc_flags &= ~UHID_FLAG_IMMED; + mtx_unlock(&sc->sc_mtx); if (usb_fifo_alloc_buffer(fifo, sc->sc_isize + 1, UHID_FRAME_NUM)) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:36:38 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7490D593; Wed, 25 Mar 2015 10:36:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9E4959; Wed, 25 Mar 2015 10:36:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAaccb088949; Wed, 25 Mar 2015 10:36:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAacf3088948; Wed, 25 Mar 2015 10:36:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251036.t2PAacf3088948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:36: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: r280530 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:36:38 -0000 Author: arybchik Date: Wed Mar 25 10:36:37 2015 New Revision: 280530 URL: https://svnweb.freebsd.org/changeset/base/280530 Log: MFC: 278836 sfxge: remove used sfxge_tso_state member dma_seg_i Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:35:54 2015 (r280529) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:36:37 2015 (r280530) @@ -782,7 +782,6 @@ struct sfxge_tso_state { unsigned packet_space; /* Remaining space in current packet */ /* Input position */ - unsigned dma_seg_i; /* Current DMA segment number */ uint64_t dma_addr; /* DMA address of current position */ unsigned in_len; /* Remaining length in current mbuf */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:37:38 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BFC481D; Wed, 25 Mar 2015 10:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06417978; Wed, 25 Mar 2015 10:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAbbYp089184; Wed, 25 Mar 2015 10:37:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAbbUo089181; Wed, 25 Mar 2015 10:37:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251037.t2PAbbUo089181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:37: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: r280532 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:37:38 -0000 Author: arybchik Date: Wed Mar 25 10:37:36 2015 New Revision: 280532 URL: https://svnweb.freebsd.org/changeset/base/280532 Log: MFC: 278837 sfxge: remove inline specifiers Now compiler does not need any help. The patch does not change generated code. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:37:17 2015 (r280531) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:37:36 2015 (r280532) @@ -92,8 +92,8 @@ static int lro_loss_packets = 20; #define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) /* Compare IPv6 addresses, avoiding conditional branches */ -static __inline unsigned long ipv6_addr_cmp(const struct in6_addr *left, - const struct in6_addr *right) +static unsigned long ipv6_addr_cmp(const struct in6_addr *left, + const struct in6_addr *right) { #if LONG_BIT == 64 const uint64_t *left64 = (const uint64_t *)left; @@ -167,7 +167,7 @@ sfxge_rx_schedule_refill(struct sfxge_rx sfxge_rx_post_refill, rxq); } -static inline struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) +static struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) { struct mb_args args; struct mbuf *m; Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:37:17 2015 (r280531) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:37:36 2015 (r280532) @@ -107,7 +107,7 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p /* Forward declarations. */ -static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); static void sfxge_tx_qunblock(struct sfxge_txq *txq); static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf, @@ -156,7 +156,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq #ifdef SFXGE_HAVE_MQ -static inline unsigned int +static unsigned int sfxge_is_mbuf_non_tcp(struct mbuf *mbuf) { /* Absense of TCP checksum flags does not mean that it is non-TCP @@ -481,7 +481,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx * * NOTE: drops the txq mutex! */ -static inline void +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); @@ -509,7 +509,7 @@ sfxge_tx_qdpl_service(struct sfxge_txq * * overload the csum_data field in the mbuf to keep track of this length * because there is no cheap alternative to avoid races. */ -static inline int +static int sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked) { struct sfxge_tx_dpl *stdp; @@ -757,7 +757,7 @@ void sfxge_if_start(struct ifnet *ifp) SFXGE_TXQ_UNLOCK(sc->txq[0]); } -static inline void +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { struct ifnet *ifp = txq->sc->ifnet; @@ -792,19 +792,19 @@ struct sfxge_tso_state { unsigned header_len; /* Number of bytes of header */ }; -static inline const struct ip *tso_iph(const struct sfxge_tso_state *tso) +static const struct ip *tso_iph(const struct sfxge_tso_state *tso) { KASSERT(tso->protocol == htons(ETHERTYPE_IP), ("tso_iph() in non-IPv4 state")); return (const struct ip *)(tso->mbuf->m_data + tso->nh_off); } -static inline const struct ip6_hdr *tso_ip6h(const struct sfxge_tso_state *tso) +static __unused const struct ip6_hdr *tso_ip6h(const struct sfxge_tso_state *tso) { KASSERT(tso->protocol == htons(ETHERTYPE_IPV6), ("tso_ip6h() in non-IPv6 state")); return (const struct ip6_hdr *)(tso->mbuf->m_data + tso->nh_off); } -static inline const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso) +static const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso) { return (const struct tcphdr *)(tso->mbuf->m_data + tso->tcph_off); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:38:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B3F795E; Wed, 25 Mar 2015 10:38:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153A9984; Wed, 25 Mar 2015 10:38:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAcMf5089415; Wed, 25 Mar 2015 10:38:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAcMIS089414; Wed, 25 Mar 2015 10:38:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251038.t2PAcMIS089414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280533 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:38:23 -0000 Author: arybchik Date: Wed Mar 25 10:38:22 2015 New Revision: 280533 URL: https://svnweb.freebsd.org/changeset/base/280533 Log: MFC: 278838 sfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held The problem is found using WITNESS option enabled. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:37:36 2015 (r280532) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 10:38:22 2015 (r280533) @@ -91,16 +91,15 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_AR struct sfxge_softc *sc = arg1; unsigned int id = arg2; int rc; + uint64_t val; SFXGE_PORT_LOCK(&sc->port); - if ((rc = sfxge_mac_stat_update(sc)) != 0) - goto out; - - rc = SYSCTL_OUT(req, - (uint64_t *)sc->port.mac_stats.decode_buf + id, - sizeof(uint64_t)); -out: + if ((rc = sfxge_mac_stat_update(sc)) == 0) + val = ((uint64_t *)sc->port.mac_stats.decode_buf)[id]; SFXGE_PORT_UNLOCK(&sc->port); + + if (rc == 0) + rc = SYSCTL_OUT(req, &val, sizeof(val)); return (rc); } @@ -173,28 +172,29 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND sc = arg1; port = &sc->port; - SFXGE_PORT_LOCK(port); - if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0) - goto out; - - if (port->wanted_fc == fcntl) - goto out; + return (error); - port->wanted_fc = fcntl; + SFXGE_PORT_LOCK(port); - if (port->init_state != SFXGE_PORT_STARTED) - goto out; + if (port->wanted_fc != fcntl) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_fcntl_set(sc->enp, + port->wanted_fc, + B_TRUE); + if (error == 0) + port->wanted_fc = fcntl; + } - error = efx_mac_fcntl_set(sc->enp, port->wanted_fc, B_TRUE); + SFXGE_PORT_UNLOCK(port); } else { - error = SYSCTL_OUT(req, &port->wanted_fc, - sizeof(port->wanted_fc)); - } + SFXGE_PORT_LOCK(port); + fcntl = port->wanted_fc; + SFXGE_PORT_UNLOCK(port); -out: - SFXGE_PORT_UNLOCK(port); + error = SYSCTL_OUT(req, &fcntl, sizeof(fcntl)); + } return (error); } @@ -205,7 +205,6 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE struct sfxge_softc *sc; struct sfxge_port *port; unsigned int wanted_fc, link_fc; - int error; sc = arg1; port = &sc->port; @@ -215,10 +214,9 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE efx_mac_fcntl_get(sc->enp, &wanted_fc, &link_fc); else link_fc = 0; - error = SYSCTL_OUT(req, &link_fc, sizeof(link_fc)); SFXGE_PORT_UNLOCK(port); - return (error); + return (SYSCTL_OUT(req, &link_fc, sizeof(link_fc))); } #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ @@ -499,16 +497,15 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_AR struct sfxge_softc *sc = arg1; unsigned int id = arg2; int rc; + uint32_t val; SFXGE_PORT_LOCK(&sc->port); - if ((rc = sfxge_phy_stat_update(sc)) != 0) - goto out; - - rc = SYSCTL_OUT(req, - (uint32_t *)sc->port.phy_stats.decode_buf + id, - sizeof(uint32_t)); -out: + if ((rc = sfxge_phy_stat_update(sc)) == 0) + val = ((uint32_t *)sc->port.phy_stats.decode_buf)[id]; SFXGE_PORT_UNLOCK(&sc->port); + + if (rc == 0) + rc = SYSCTL_OUT(req, &val, sizeof(val)); return (rc); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:39:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF978BFA; Wed, 25 Mar 2015 10:39:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04B8998; Wed, 25 Mar 2015 10:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAdMCL089647; Wed, 25 Mar 2015 10:39:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAdJ58089633; Wed, 25 Mar 2015 10:39:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251039.t2PAdJ58089633@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280535 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:39:23 -0000 Author: arybchik Date: Wed Mar 25 10:39:18 2015 New Revision: 280535 URL: https://svnweb.freebsd.org/changeset/base/280535 Log: MFC: 278839 sfxge: style fixes Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_mac.c stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_nic.c stable/10/sys/dev/sfxge/common/efx_rx.c stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/common/siena_mon.c stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/common/siena_vpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:39:18 2015 (r280535) @@ -89,7 +89,8 @@ efx_ev_rx_not_ok( if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_TOBE_DISC) != 0) { EFX_EV_QSTAT_INCR(eep, EV_RX_TOBE_DISC); EFSYS_PROBE(tobe_disc); - /* Assume this is a unicast address mismatch, unless below + /* + * Assume this is a unicast address mismatch, unless below * we find either FSF_AZ_RX_EV_ETH_CRC_ERR or * EV_RX_PAUSE_FRM_ERR is set. */ @@ -102,7 +103,8 @@ efx_ev_rx_not_ok( (*flagsp) |= EFX_DISCARD; #if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER) - /* Lookout for payload queue ran dry errors and ignore them. + /* + * Lookout for payload queue ran dry errors and ignore them. * * Sadly for the header/data split cases, the descriptor * pointer in this event refers to the header queue and Modified: stable/10/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mac.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_mac.c Wed Mar 25 10:39:18 2015 (r280535) @@ -669,11 +669,11 @@ chosen: EFSYS_ASSERT(emop != NULL); epp->ep_mac_type = type; - + if (emop->emo_reset != NULL) { if ((rc = emop->emo_reset(enp)) != 0) goto fail1; - + EFSYS_ASSERT(enp->en_reset_flags & EFX_RESET_MAC); enp->en_reset_flags &= ~EFX_RESET_MAC; } Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 10:39:18 2015 (r280535) @@ -44,7 +44,8 @@ __FBSDID("$FreeBSD$"); #define MCDI_P1_REBOOT_OFST 0x1fe #define MCDI_P2_REBOOT_OFST 0x1ff -/* A reboot/assertion causes the MCDI status word to be set after the +/* + * A reboot/assertion causes the MCDI status word to be set after the * command word is set or a REBOOT event is sent. If we notice a reboot * via these mechanisms then wait 10ms for the status word to be set. */ @@ -459,7 +460,8 @@ efx_mcdi_ev_death( ++emip->emi_aborted; } - /* Since we're running in parallel with a request, consume the + /* + * Since we're running in parallel with a request, consume the * status word before dropping the lock. */ if (rc == EIO || rc == EINTR) { Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Wed Mar 25 10:39:18 2015 (r280535) @@ -253,7 +253,8 @@ efx_nic_create( EFX_FEATURE_LFSR_HASH_INSERT | EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS | EFX_FEATURE_WOL | EFX_FEATURE_MCDI | - EFX_FEATURE_LOOKAHEAD_SPLIT | EFX_FEATURE_MAC_HEADER_FILTERS; + EFX_FEATURE_LOOKAHEAD_SPLIT | + EFX_FEATURE_MAC_HEADER_FILTERS; break; #endif /* EFSYS_OPT_SIENA */ Modified: stable/10/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_rx.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_rx.c Wed Mar 25 10:39:18 2015 (r280535) @@ -527,7 +527,7 @@ efx_rx_filter_insert( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)erp->er_index; - return efx_filter_insert_filter(erp->er_enp, spec, B_FALSE); + return (efx_filter_insert_filter(erp->er_enp, spec, B_FALSE)); } #endif @@ -541,7 +541,7 @@ efx_rx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)erp->er_index; - return efx_filter_remove_filter(erp->er_enp, spec); + return (efx_filter_remove_filter(erp->er_enp, spec)); } #endif @@ -673,7 +673,8 @@ efx_rx_qcreate( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); + EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == + (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit); Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 10:39:18 2015 (r280535) @@ -114,7 +114,7 @@ efx_tx_filter_insert( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)etp->et_index; - return efx_filter_insert_filter(etp->et_enp, spec, B_FALSE); + return (efx_filter_insert_filter(etp->et_enp, spec, B_FALSE)); } #endif @@ -128,7 +128,7 @@ efx_tx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)etp->et_index; - return efx_filter_remove_filter(etp->et_enp, spec); + return (efx_filter_remove_filter(etp->et_enp, spec)); } #endif Modified: stable/10/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 10:39:18 2015 (r280535) @@ -138,13 +138,13 @@ siena_mon_decode_stats( efx_dword_t dword; EFSYS_MEM_READD(esmp, 4 * mc_sensor, &dword); emsvp->emsv_value = - (uint16_t)EFX_DWORD_FIELD( - dword, - MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE); + (uint16_t)EFX_DWORD_FIELD( + dword, + MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE); emsvp->emsv_state = - (uint16_t)EFX_DWORD_FIELD( - dword, - MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE); + (uint16_t)EFX_DWORD_FIELD( + dword, + MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE); } } Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:39:18 2015 (r280535) @@ -324,7 +324,8 @@ siena_board_cfg( efx_mcdi_execute(enp, &req); if (req.emr_rc == 0) { - if (req.emr_out_length_used < MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) { + if (req.emr_out_length_used < + MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) { rc = EMSGSIZE; goto fail3; } Modified: stable/10/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_vpd.c Wed Mar 25 10:38:59 2015 (r280534) +++ stable/10/sys/dev/sfxge/common/siena_vpd.c Wed Mar 25 10:39:18 2015 (r280535) @@ -541,11 +541,9 @@ siena_vpd_write( /* Copy in new vpd and update header */ vpd_offset = dcfg_size - vpd_length; - EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_offset, - EFX_DWORD_0, vpd_offset); + EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_offset, EFX_DWORD_0, vpd_offset); memcpy((caddr_t)dcfg + vpd_offset, data, vpd_length); - EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_length, - EFX_DWORD_0, vpd_length); + EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_length, EFX_DWORD_0, vpd_length); /* Update the checksum */ cksum = 0; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:40:18 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93603D47; Wed, 25 Mar 2015 10:40:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5EC9AC; Wed, 25 Mar 2015 10:40:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAeIAs089890; Wed, 25 Mar 2015 10:40:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAeIHb089889; Wed, 25 Mar 2015 10:40:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251040.t2PAeIHb089889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:40: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: r280536 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:40:18 -0000 Author: arybchik Date: Wed Mar 25 10:40:17 2015 New Revision: 280536 URL: https://svnweb.freebsd.org/changeset/base/280536 Log: MFC: 278841 sfxge: flush all Tx queues from if_qflush Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:39:18 2015 (r280535) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:40:17 2015 (r280536) @@ -649,7 +649,7 @@ sfxge_if_qflush(struct ifnet *ifp) sc = ifp->if_softc; - for (i = 0; i < SFXGE_TX_SCALE(sc); i++) + for (i = 0; i < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); i++) sfxge_tx_qdpl_flush(sc->txq[i]); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:41:10 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ACD2E99; Wed, 25 Mar 2015 10:41:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD2DA54; Wed, 25 Mar 2015 10:41:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAfAdq090509; Wed, 25 Mar 2015 10:41:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAfAUm090508; Wed, 25 Mar 2015 10:41:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251041.t2PAfAUm090508@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:41:10 +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: r280537 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:41:10 -0000 Author: arybchik Date: Wed Mar 25 10:41:09 2015 New Revision: 280537 URL: https://svnweb.freebsd.org/changeset/base/280537 Log: MFC: 278937 sfxge: add TCP segment size to sfxge_tso_state It avoids access to m_pkthdr when TSO packet is started and also makes tso_start_new_packet() function smaller. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:40:17 2015 (r280536) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:41:09 2015 (r280537) @@ -790,6 +790,7 @@ struct sfxge_tso_state { ssize_t nh_off; /* Offset of network header */ ssize_t tcph_off; /* Offset of TCP header */ unsigned header_len; /* Number of bytes of header */ + unsigned seg_size; /* TCP segment size */ }; static const struct ip *tso_iph(const struct sfxge_tso_state *tso) @@ -891,6 +892,7 @@ static void tso_start(struct sfxge_tso_s } tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; + tso->seg_size = mbuf->m_pkthdr.tso_segsz; tso->seqnum = ntohl(tso_tcph(tso)->th_seq); @@ -1007,11 +1009,10 @@ static int tso_start_new_packet(struct s m_copydata(tso->mbuf, 0, tso->header_len, header); tsoh_th->th_seq = htonl(tso->seqnum); - tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz; - if (tso->out_len > tso->mbuf->m_pkthdr.tso_segsz) { + tso->seqnum += tso->seg_size; + if (tso->out_len > tso->seg_size) { /* This packet will not finish the TSO burst. */ - ip_length = tso->header_len - tso->nh_off + - tso->mbuf->m_pkthdr.tso_segsz; + ip_length = tso->header_len - tso->nh_off + tso->seg_size; tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH); } else { /* This packet will be the last in the TSO burst. */ @@ -1033,7 +1034,7 @@ static int tso_start_new_packet(struct s /* Make the header visible to the hardware. */ bus_dmamap_sync(txq->packet_dma_tag, map, BUS_DMASYNC_PREWRITE); - tso->packet_space = tso->mbuf->m_pkthdr.tso_segsz; + tso->packet_space = tso->seg_size; txq->tso_packets++; /* Form a descriptor for this header. */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:42:20 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCB51FDF; Wed, 25 Mar 2015 10:42:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD97FA62; Wed, 25 Mar 2015 10:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAgK9r093627; Wed, 25 Mar 2015 10:42:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAgJjn093624; Wed, 25 Mar 2015 10:42:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251042.t2PAgJjn093624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280538 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:42:21 -0000 Author: arybchik Date: Wed Mar 25 10:42:19 2015 New Revision: 280538 URL: https://svnweb.freebsd.org/changeset/base/280538 Log: MFC: 278938 sfxge: add driver context member with number of transmit queues Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:41:09 2015 (r280537) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:42:19 2015 (r280538) @@ -258,6 +258,8 @@ struct sfxge_softc { struct mtx tx_lock __aligned(CACHE_LINE_SIZE); char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + + unsigned int txq_count; }; #define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:41:09 2015 (r280537) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:42:19 2015 (r280538) @@ -649,7 +649,7 @@ sfxge_if_qflush(struct ifnet *ifp) sc = ifp->if_softc; - for (i = 0; i < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); i++) + for (i = 0; i < sc->txq_count; i++) sfxge_tx_qdpl_flush(sc->txq[i]); } @@ -1279,13 +1279,9 @@ sfxge_tx_stop(struct sfxge_softc *sc) { int index; - index = SFXGE_TX_SCALE(sc); + index = sc->txq_count; while (--index >= 0) - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); - - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - - sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); + sfxge_tx_qstop(sc, index); /* Tear down the transmit module */ efx_tx_fini(sc->enp); @@ -1301,30 +1297,17 @@ sfxge_tx_start(struct sfxge_softc *sc) if ((rc = efx_tx_init(sc->enp)) != 0) return (rc); - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_NON_CKSUM)) != 0) - goto fail; - - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_IP_CKSUM)) != 0) - goto fail2; - - for (index = 0; index < SFXGE_TX_SCALE(sc); index++) { - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + - index)) != 0) - goto fail3; + for (index = 0; index < sc->txq_count; index++) { + if ((rc = sfxge_tx_qstart(sc, index)) != 0) + goto fail; } return (0); -fail3: +fail: while (--index >= 0) - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); - - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - -fail2: - sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); + sfxge_tx_qstop(sc, index); -fail: efx_tx_fini(sc->enp); return (rc); @@ -1535,9 +1518,7 @@ sfxge_tx_stat_handler(SYSCTL_HANDLER_ARG /* Sum across all TX queues */ sum = 0; - for (index = 0; - index < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); - index++) + for (index = 0; index < sc->txq_count; index++) sum += *(unsigned long *)((caddr_t)sc->txq[index] + sfxge_tx_stats[id].offset); @@ -1570,12 +1551,11 @@ sfxge_tx_fini(struct sfxge_softc *sc) { int index; - index = SFXGE_TX_SCALE(sc); + index = sc->txq_count; while (--index >= 0) - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); + sfxge_tx_qfini(sc, index); - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); - sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); + sc->txq_count = 0; } @@ -1591,6 +1571,12 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); +#ifdef SFXGE_HAVE_MQ + sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; +#else + sc->txq_count = SFXGE_TXQ_NTYPES; +#endif + sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), @@ -1609,8 +1595,10 @@ sfxge_tx_init(struct sfxge_softc *sc) SFXGE_TXQ_IP_CKSUM, 0)) != 0) goto fail2; - for (index = 0; index < SFXGE_TX_SCALE(sc); index++) { - if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index, + for (index = 0; + index < sc->txq_count - SFXGE_TXQ_NTYPES + 1; + index++) { + if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index, SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0) goto fail3; } @@ -1620,15 +1608,16 @@ sfxge_tx_init(struct sfxge_softc *sc) return (0); fail3: - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); - while (--index >= 0) sfxge_tx_qfini(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); + sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); + fail2: sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); fail: fail_txq_node: + sc->txq_count = 0; return (rc); } Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:41:09 2015 (r280537) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:42:19 2015 (r280538) @@ -124,10 +124,8 @@ enum sfxge_txq_type { #ifdef SFXGE_HAVE_MQ #define SFXGE_TX_LOCK(txq) (&(txq)->lock) -#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc) #else #define SFXGE_TX_LOCK(txq) (&(txq)->sc->tx_lock) -#define SFXGE_TX_SCALE(sc) 1 #endif #define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:43:08 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E12351A8; Wed, 25 Mar 2015 10:43:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB060A6D; Wed, 25 Mar 2015 10:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAh7dD093790; Wed, 25 Mar 2015 10:43:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAh7HT093788; Wed, 25 Mar 2015 10:43:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251043.t2PAh7HT093788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280539 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:43:08 -0000 Author: arybchik Date: Wed Mar 25 10:43:06 2015 New Revision: 280539 URL: https://svnweb.freebsd.org/changeset/base/280539 Log: MFC: 278939 sfxge: add driver context member with number of receive queues Mainly to unify with similar member for transmit queues. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:42:19 2015 (r280538) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:43:06 2015 (r280539) @@ -259,6 +259,7 @@ struct sfxge_softc { char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + unsigned int rxq_count; unsigned int txq_count; }; Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:42:19 2015 (r280538) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:43:06 2015 (r280539) @@ -939,13 +939,10 @@ fail: void sfxge_rx_stop(struct sfxge_softc *sc) { - struct sfxge_intr *intr; int index; - intr = &sc->intr; - /* Stop the receive queue(s) */ - index = intr->n_alloc; + index = sc->rxq_count; while (--index >= 0) sfxge_rx_qstop(sc, index); @@ -987,7 +984,7 @@ sfxge_rx_start(struct sfxge_softc *sc) * Set up the scale table. Enable all hash types and hash insertion. */ for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) - sc->rx_indir_table[index] = index % sc->intr.n_alloc; + sc->rx_indir_table[index] = index % sc->rxq_count; if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, SFXGE_RX_SCALE_MAX)) != 0) goto fail; @@ -1000,7 +997,7 @@ sfxge_rx_start(struct sfxge_softc *sc) goto fail; /* Start the receive queue(s). */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->rxq_count; index++) { if ((rc = sfxge_rx_qstart(sc, index)) != 0) goto fail2; } @@ -1099,7 +1096,7 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u efsys_mem_t *esmp; int rc; - KASSERT(index < sc->intr.n_alloc, ("index >= %d", sc->intr.n_alloc)); + KASSERT(index < sc->rxq_count, ("index >= %d", sc->rxq_count)); rxq = malloc(sizeof(struct sfxge_rxq), M_SFXGE, M_ZERO | M_WAITOK); rxq->sc = sc; @@ -1159,7 +1156,7 @@ sfxge_rx_stat_handler(SYSCTL_HANDLER_ARG /* Sum across all RX queues */ sum = 0; - for (index = 0; index < sc->intr.n_alloc; index++) + for (index = 0; index < sc->rxq_count; index++) sum += *(unsigned int *)((caddr_t)sc->rxq[index] + sfxge_rx_stats[id].offset); @@ -1190,14 +1187,13 @@ sfxge_rx_stat_init(struct sfxge_softc *s void sfxge_rx_fini(struct sfxge_softc *sc) { - struct sfxge_intr *intr; int index; - intr = &sc->intr; - - index = intr->n_alloc; + index = sc->rxq_count; while (--index >= 0) sfxge_rx_qfini(sc, index); + + sc->rxq_count = 0; } int @@ -1212,11 +1208,13 @@ sfxge_rx_init(struct sfxge_softc *sc) intr = &sc->intr; + sc->rxq_count = intr->n_alloc; + KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); /* Initialize the receive queue(s) - one per interrupt. */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->rxq_count; index++) { if ((rc = sfxge_rx_qinit(sc, index)) != 0) goto fail; } @@ -1230,5 +1228,6 @@ fail: while (--index >= 0) sfxge_rx_qfini(sc, index); + sc->rxq_count = 0; return (rc); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:44:10 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32C9F2F7; Wed, 25 Mar 2015 10:44:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C980A80; Wed, 25 Mar 2015 10:44:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAi9Bo093996; Wed, 25 Mar 2015 10:44:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAi97X093995; Wed, 25 Mar 2015 10:44:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251044.t2PAi97X093995@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 10:44: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: r280540 - stable/10/sys/ofed/include/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.18-1 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, 25 Mar 2015 10:44:10 -0000 Author: hselasky Date: Wed Mar 25 10:44:09 2015 New Revision: 280540 URL: https://svnweb.freebsd.org/changeset/base/280540 Log: MFC r280211: Add missing void pointer argument to SYSINIT() functions. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Wed Mar 25 10:43:06 2015 (r280539) +++ stable/10/sys/ofed/include/linux/linux_compat.c Wed Mar 25 10:44:09 2015 (r280540) @@ -689,7 +689,7 @@ vunmap(void *addr) } static void -linux_compat_init(void) +linux_compat_init(void *arg) { struct sysctl_oid *rootoid; int i; @@ -719,7 +719,7 @@ linux_compat_init(void) SYSINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_init, NULL); static void -linux_compat_uninit(void) +linux_compat_uninit(void *arg) { kobject_kfree_name(&class_root); kobject_kfree_name(&linux_rootdev.kobj); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:44:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9795424; Wed, 25 Mar 2015 10:44:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC95A84; Wed, 25 Mar 2015 10:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAiVjB094109; Wed, 25 Mar 2015 10:44:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAiV5T094104; Wed, 25 Mar 2015 10:44:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251044.t2PAiV5T094104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:44: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: r280541 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:44:31 -0000 Author: arybchik Date: Wed Mar 25 10:44:30 2015 New Revision: 280541 URL: https://svnweb.freebsd.org/changeset/base/280541 Log: MFC: 278940 sfxge: add driver context member with number of event queues Mainly to unify with similar member for transmit and receive queues. It will be used in the future for resources allocation processing. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:44:09 2015 (r280540) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:44:30 2015 (r280541) @@ -259,6 +259,7 @@ struct sfxge_softc { char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + unsigned int evq_count; unsigned int rxq_count; unsigned int txq_count; }; Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:44:09 2015 (r280540) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 10:44:30 2015 (r280541) @@ -422,7 +422,7 @@ sfxge_ev_stat_update(struct sfxge_softc sc->ev_stats_update_time = now; /* Add event counts from each event queue in turn */ - for (index = 0; index < sc->intr.n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { evq = sc->evq[index]; SFXGE_EVQ_LOCK(evq); efx_ev_qstats_update(evq->common, sc->ev_stats); @@ -488,7 +488,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG struct sfxge_intr *intr = &sc->intr; unsigned int moderation; int error; - int index; + unsigned int index; SFXGE_ADAPTER_LOCK(sc); @@ -508,7 +508,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG sc->ev_moderation = moderation; if (intr->state == SFXGE_INTR_STARTED) { - for (index = 0; index < intr->n_alloc; index++) + for (index = 0; index < sc->evq_count; index++) sfxge_ev_qmoderate(sc, index, moderation); } } else { @@ -722,7 +722,7 @@ sfxge_ev_stop(struct sfxge_softc *sc) ("Interrupts not started")); /* Stop the event queue(s) */ - index = intr->n_alloc; + index = sc->evq_count; while (--index >= 0) sfxge_ev_qstop(sc, index); @@ -747,7 +747,7 @@ sfxge_ev_start(struct sfxge_softc *sc) return (rc); /* Start the event queues */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { if ((rc = sfxge_ev_qstart(sc, index)) != 0) goto fail; } @@ -848,9 +848,11 @@ sfxge_ev_fini(struct sfxge_softc *sc) sc->ev_moderation = 0; /* Tear down the event queue(s). */ - index = intr->n_alloc; + index = sc->evq_count; while (--index >= 0) sfxge_ev_qfini(sc, index); + + sc->evq_count = 0; } int @@ -864,6 +866,8 @@ sfxge_ev_init(struct sfxge_softc *sc) intr = &sc->intr; + sc->evq_count = intr->n_alloc; + KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); @@ -879,7 +883,7 @@ sfxge_ev_init(struct sfxge_softc *sc) /* * Initialize the event queue(s) - one per interrupt. */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { if ((rc = sfxge_ev_qinit(sc, index)) != 0) goto fail; } @@ -894,5 +898,6 @@ fail: while (--index >= 0) sfxge_ev_qfini(sc, index); + sc->evq_count = 0; return (rc); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:46:05 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3171C574; Wed, 25 Mar 2015 10:46:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B66DA97; Wed, 25 Mar 2015 10:46:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAk4E5094398; Wed, 25 Mar 2015 10:46:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAk4tc094397; Wed, 25 Mar 2015 10:46:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251046.t2PAk4tc094397@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280542 - stable/10/sys/modules/sfxge 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.18-1 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, 25 Mar 2015 10:46:05 -0000 Author: arybchik Date: Wed Mar 25 10:46:04 2015 New Revision: 280542 URL: https://svnweb.freebsd.org/changeset/base/280542 Log: MFC: 279180 sfxge: list header in SRCS Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/modules/sfxge/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/sfxge/Makefile ============================================================================== --- stable/10/sys/modules/sfxge/Makefile Wed Mar 25 10:44:30 2015 (r280541) +++ stable/10/sys/modules/sfxge/Makefile Wed Mar 25 10:46:04 2015 (r280542) @@ -11,14 +11,19 @@ SRCS+= opt_inet.h opt_sched.h SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c SRCS+= sfxge_intr.c sfxge_mcdi.c SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c +SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h .PATH: ${.CURDIR}/../../dev/sfxge/common SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c SRCS+= efx_vpd.c efx_wol.c +SRCS+= efsys.h +SRCS+= efx.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h +SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h SRCS+= siena_mac.c siena_nic.c siena_nvram.c siena_phy.c SRCS+= siena_sram.c siena_vpd.c +SRCS+= siena_flash.h siena_impl.h DEBUG_FLAGS= -DDEBUG=1 From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:48:30 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 109458F4; Wed, 25 Mar 2015 10:48:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE956ABC; Wed, 25 Mar 2015 10:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAmTvF094832; Wed, 25 Mar 2015 10:48:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAmTed094829; Wed, 25 Mar 2015 10:48:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251048.t2PAmTed094829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:48: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: r280544 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:48:30 -0000 Author: arybchik Date: Wed Mar 25 10:48:28 2015 New Revision: 280544 URL: https://svnweb.freebsd.org/changeset/base/280544 Log: MFC: 278941 sfxge: support variable-length response to MCDI GET_BOARD_CFG Allocate the minimum or maximum response length for GET_BOARD_CFG as appropriate. When looking up firmware subtypes by partition ID, check the ID against the actual response length. Merge of the patch made by Ben Hutchings in 2011. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/common/siena_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Mar 25 10:46:13 2015 (r280543) +++ stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Mar 25 10:48:28 2015 (r280544) @@ -709,7 +709,9 @@ #define MC_CMD_GET_BOARD_CFG_IN_LEN 0 /* MC_CMD_GET_BOARD_CFG_OUT msgresponse */ -#define MC_CMD_GET_BOARD_CFG_OUT_LEN 96 +#define MC_CMD_GET_BOARD_CFG_OUT_LENMIN 96 +#define MC_CMD_GET_BOARD_CFG_OUT_LENMAX 136 +#define MC_CMD_GET_BOARD_CFG_OUT_LEN(num) (72+2*(num)) #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32 @@ -729,7 +731,8 @@ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68 #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72 #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2 -#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_NUM 12 +#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12 +#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM 32 /***********************************/ Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:46:13 2015 (r280543) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:48:28 2015 (r280544) @@ -276,7 +276,7 @@ siena_board_cfg( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip); - uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LEN, + uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LENMIN, MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)]; efx_mcdi_req_t req; uint8_t *src; @@ -288,7 +288,7 @@ siena_board_cfg( req.emr_in_buf = NULL; req.emr_in_length = 0; req.emr_out_buf = outbuf; - req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LEN; + req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LENMIN; efx_mcdi_execute(enp, &req); @@ -297,7 +297,7 @@ siena_board_cfg( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) { rc = EMSGSIZE; goto fail2; } Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 10:46:13 2015 (r280543) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 10:48:28 2015 (r280544) @@ -587,7 +587,7 @@ siena_nvram_get_subtype( __out uint32_t *subtypep) { efx_mcdi_req_t req; - uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LEN]; + uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LENMAX]; efx_word_t *fw_list; int rc; @@ -605,17 +605,26 @@ siena_nvram_get_subtype( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) { rc = EMSGSIZE; goto fail2; } + if (req.emr_out_length_used < + MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST + + (partn + 1) * sizeof(efx_word_t)) { + rc = ENOENT; + goto fail3; + } + fw_list = MCDI_OUT2(req, efx_word_t, GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST); *subtypep = EFX_WORD_FIELD(fw_list[partn], EFX_WORD_0); return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:49:48 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D934DA6F; Wed, 25 Mar 2015 10:49:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7EEAD8; Wed, 25 Mar 2015 10:49:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAnlO0095046; Wed, 25 Mar 2015 10:49:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAnkLd095043; Wed, 25 Mar 2015 10:49:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251049.t2PAnkLd095043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:49: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: r280545 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:49:48 -0000 Author: arybchik Date: Wed Mar 25 10:49:45 2015 New Revision: 280545 URL: https://svnweb.freebsd.org/changeset/base/280545 Log: MFC: 278942 sfxge: fix broken MCDI_EV_FIELD() macro Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_mcdi.h stable/10/sys/dev/sfxge/common/siena_phy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:48:28 2015 (r280544) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:49:45 2015 (r280545) @@ -577,9 +577,9 @@ efx_ev_mcdi( case MCDI_EVENT_CODE_CMDDONE: efx_mcdi_ev_cpl(enp, - MCDI_EV_FIELD(*eqp, CMDDONE_SEQ), - MCDI_EV_FIELD(*eqp, CMDDONE_DATALEN), - MCDI_EV_FIELD(*eqp, CMDDONE_ERRNO)); + MCDI_EV_FIELD(eqp, CMDDONE_SEQ), + MCDI_EV_FIELD(eqp, CMDDONE_DATALEN), + MCDI_EV_FIELD(eqp, CMDDONE_ERRNO)); break; case MCDI_EVENT_CODE_LINKCHANGE: { Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Mar 25 10:48:28 2015 (r280544) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Mar 25 10:49:45 2015 (r280545) @@ -231,7 +231,7 @@ efx_mcdi_version( MC_CMD_ ## _field) #define MCDI_EV_FIELD(_eqp, _field) \ - EFX_QWORD_FIELD(*eqp, MCDI_EVENT_ ## _field) + EFX_QWORD_FIELD(*_eqp, MCDI_EVENT_ ## _field) #ifdef __cplusplus } Modified: stable/10/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_phy.c Wed Mar 25 10:48:28 2015 (r280544) +++ stable/10/sys/dev/sfxge/common/siena_phy.c Wed Mar 25 10:49:45 2015 (r280545) @@ -122,7 +122,7 @@ siena_phy_link_ev( * Convert the LINKCHANGE speed enumeration into mbit/s, in the * same way as GET_LINK encodes the speed */ - switch (MCDI_EV_FIELD(*eqp, LINKCHANGE_SPEED)) { + switch (MCDI_EV_FIELD(eqp, LINKCHANGE_SPEED)) { case MCDI_EVENT_LINKCHANGE_SPEED_100M: speed = 100; break; @@ -137,11 +137,11 @@ siena_phy_link_ev( break; } - link_flags = MCDI_EV_FIELD(*eqp, LINKCHANGE_LINK_FLAGS); + link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); siena_phy_decode_link_mode(enp, link_flags, speed, - MCDI_EV_FIELD(*eqp, LINKCHANGE_FCNTL), + MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), &link_mode, &fcntl); - siena_phy_decode_cap(MCDI_EV_FIELD(*eqp, LINKCHANGE_LP_CAP), + siena_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:50:14 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EDDCBB1; Wed, 25 Mar 2015 10:50:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 781D8AE4; Wed, 25 Mar 2015 10:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAoEAB095249; Wed, 25 Mar 2015 10:50:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAoDWg095247; Wed, 25 Mar 2015 10:50:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251050.t2PAoDWg095247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 10:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280546 - in stable/10/contrib/ofed: libibverbs/examples/build librdmacm/examples/build 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.18-1 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, 25 Mar 2015 10:50:14 -0000 Author: hselasky Date: Wed Mar 25 10:50:13 2015 New Revision: 280546 URL: https://svnweb.freebsd.org/changeset/base/280546 Log: MFC r280264: Define BINDIR for some test utilities. Sponsored by: Mellanox Technologies Modified: stable/10/contrib/ofed/libibverbs/examples/build/Makefile.inc stable/10/contrib/ofed/librdmacm/examples/build/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ofed/libibverbs/examples/build/Makefile.inc ============================================================================== --- stable/10/contrib/ofed/libibverbs/examples/build/Makefile.inc Wed Mar 25 10:49:45 2015 (r280545) +++ stable/10/contrib/ofed/libibverbs/examples/build/Makefile.inc Wed Mar 25 10:50:13 2015 (r280546) @@ -1,3 +1,5 @@ +BINDIR?= /usr/bin + CFLAGS+= \ -I../../../../../../sys/ofed/include \ -I../../../../libibverbs/include \ Modified: stable/10/contrib/ofed/librdmacm/examples/build/Makefile.inc ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/Makefile.inc Wed Mar 25 10:49:45 2015 (r280545) +++ stable/10/contrib/ofed/librdmacm/examples/build/Makefile.inc Wed Mar 25 10:50:13 2015 (r280546) @@ -1,3 +1,5 @@ +BINDIR?= /usr/bin + IBDIR=../../../.. CFLAGS+= \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:51:09 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA640CF7; Wed, 25 Mar 2015 10:51:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A8D7BCE; Wed, 25 Mar 2015 10:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAp9ZI098355; Wed, 25 Mar 2015 10:51:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAp9DJ098353; Wed, 25 Mar 2015 10:51:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251051.t2PAp9DJ098353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:51: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: r280547 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:51:09 -0000 Author: arybchik Date: Wed Mar 25 10:51:08 2015 New Revision: 280547 URL: https://svnweb.freebsd.org/changeset/base/280547 Log: MFC: 279046 sfxge: handle fragmented TCP header in mbuf TCP header is fragmented in the case of VLAN tagged IPv6 traffic without HW VLAN tagging. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:50:13 2015 (r280546) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:51:08 2015 (r280547) @@ -864,6 +864,8 @@ static void tso_fini(struct sfxge_txq *t static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf) { struct ether_header *eh = mtod(mbuf, struct ether_header *); + const struct tcphdr *th; + struct tcphdr th_copy; tso->mbuf = mbuf; @@ -891,13 +893,24 @@ static void tso_start(struct sfxge_tso_s tso->tcph_off = tso->nh_off + sizeof(struct ip6_hdr); } - tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; + KASSERT(mbuf->m_len >= tso->tcph_off, + ("network header is fragmented in mbuf")); + /* We need TCP header including flags (window is the next) */ + if (mbuf->m_len < tso->tcph_off + offsetof(struct tcphdr, th_win)) { + m_copydata(tso->mbuf, tso->tcph_off, sizeof(th_copy), + (caddr_t)&th_copy); + th = &th_copy; + } else { + th = tso_tcph(tso); + } + + tso->header_len = tso->tcph_off + 4 * th->th_off; tso->seg_size = mbuf->m_pkthdr.tso_segsz; - tso->seqnum = ntohl(tso_tcph(tso)->th_seq); + tso->seqnum = ntohl(th->th_seq); /* These flags must not be duplicated */ - KASSERT(!(tso_tcph(tso)->th_flags & (TH_URG | TH_SYN | TH_RST)), + KASSERT(!(th->th_flags & (TH_URG | TH_SYN | TH_RST)), ("incompatible TCP flag on TSO packet")); tso->out_len = mbuf->m_pkthdr.len - tso->header_len; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:52:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D04CF9D; Wed, 25 Mar 2015 10:52:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56A6FBFF; Wed, 25 Mar 2015 10:52:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAqalu099082; Wed, 25 Mar 2015 10:52:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAqaIH099081; Wed, 25 Mar 2015 10:52:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251052.t2PAqaIH099081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280549 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:52:36 -0000 Author: arybchik Date: Wed Mar 25 10:52:35 2015 New Revision: 280549 URL: https://svnweb.freebsd.org/changeset/base/280549 Log: MFC: 279047 sfxge: regenerate MCDI protocol headers Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Mar 25 10:51:09 2015 (r280548) +++ stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Mar 25 10:52:35 2015 (r280549) @@ -40,6 +40,18 @@ /* The Scheduler has started. */ #define MC_FW_STATE_SCHED (8) +/* Siena MC shared memmory offsets */ +/* The 'doorbell' addresses are hard-wired to alert the MC when written */ +#define MC_SMEM_P0_DOORBELL_OFST 0x000 +#define MC_SMEM_P1_DOORBELL_OFST 0x004 +/* The rest of these are firmware-defined */ +#define MC_SMEM_P0_PDU_OFST 0x008 +#define MC_SMEM_P1_PDU_OFST 0x108 +#define MC_SMEM_PDU_LEN 0x100 +#define MC_SMEM_P0_PTP_TIME_OFST 0x7f0 +#define MC_SMEM_P0_STATUS_OFST 0x7f8 +#define MC_SMEM_P1_STATUS_OFST 0x7fc + /* Values to be written to the per-port status dword in shared * memory on reboot and assert */ #define MC_STATUS_DWORD_REBOOT (0xb007b007) @@ -58,10 +70,7 @@ /* Unused commands: 0x23, 0x27, 0x30, 0x31 */ -/* Unused commands: 0x23, 0x27, 0x30, 0x31 */ - -/** - * MCDI version 1 +/* MCDI version 1 * * Each MCDI request starts with an MCDI_HEADER, which is a 32byte * structure, filled in by the client. @@ -113,10 +122,10 @@ #define MCDI_HEADER_XFLAGS_EVREQ 0x01 /* Maximum number of payload bytes */ -#if MCDI_PCOL_VERSION == 1 -#define MCDI_CTL_SDU_LEN_MAX 0xfc -#elif MCDI_PCOL_VERSION == 2 +#ifdef WITH_MCDI_V2 #define MCDI_CTL_SDU_LEN_MAX 0x400 +#else +#define MCDI_CTL_SDU_LEN_MAX 0xfc #endif /* The MC can generate events for two reasons: @@ -133,7 +142,7 @@ * * If Code==CMDDONE, then the fields are further interpreted as: * - * - LEVEL==INFO Command succeded + * - LEVEL==INFO Command succeeded * - LEVEL==ERR Command failed * * 0 8 16 24 32 @@ -293,6 +302,27 @@ #define MCDI_EVENT_TX_ERR_INFO_WIDTH 16 #define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0 #define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12 +#define MCDI_EVENT_PTP_ERR_TYPE_LBN 0 +#define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8 +#define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1 /* enum */ +#define MCDI_EVENT_PTP_ERR_FILTER 0x2 /* enum */ +#define MCDI_EVENT_PTP_ERR_FIFO 0x3 /* enum */ +#define MCDI_EVENT_PTP_ERR_QUEUE 0x4 /* enum */ +#define MCDI_EVENT_AOE_ERR_TYPE_LBN 0 +#define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8 +#define MCDI_EVENT_AOE_NO_LOAD 0x1 /* enum */ +#define MCDI_EVENT_AOE_FC_ASSERT 0x2 /* enum */ +#define MCDI_EVENT_AOE_FC_WATCHDOG 0x3 /* enum */ +#define MCDI_EVENT_AOE_FC_NO_START 0x4 /* enum */ +#define MCDI_EVENT_AOE_FAULT 0x5 /* enum */ +#define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6 /* enum */ +#define MCDI_EVENT_AOE_LOAD 0x7 /* enum */ +#define MCDI_EVENT_AOE_DMA 0x8 /* enum */ +#define MCDI_EVENT_AOE_BYTEBLASTER 0x9 /* enum */ +#define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa /* enum */ +#define MCDI_EVENT_AOE_PTP_STATUS 0xb /* enum */ +#define MCDI_EVENT_AOE_ERR_DATA_LBN 8 +#define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8 #define MCDI_EVENT_DATA_LBN 0 #define MCDI_EVENT_DATA_WIDTH 32 #define MCDI_EVENT_SRC_LBN 36 @@ -313,6 +343,12 @@ #define MCDI_EVENT_CODE_FLR 0xa /* enum */ #define MCDI_EVENT_CODE_TX_ERR 0xb /* enum */ #define MCDI_EVENT_CODE_TX_FLUSH 0xc /* enum */ +#define MCDI_EVENT_CODE_PTP_RX 0xd /* enum */ +#define MCDI_EVENT_CODE_PTP_FAULT 0xe /* enum */ +#define MCDI_EVENT_CODE_PTP_PPS 0xf /* enum */ +#define MCDI_EVENT_CODE_AOE 0x12 /* enum */ +#define MCDI_EVENT_CODE_VCAL_FAIL 0x13 /* enum */ +#define MCDI_EVENT_CODE_HW_PPS 0x14 /* enum */ #define MCDI_EVENT_CMDDONE_DATA_OFST 0 #define MCDI_EVENT_CMDDONE_DATA_LBN 0 #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32 @@ -328,6 +364,94 @@ #define MCDI_EVENT_TX_ERR_DATA_OFST 0 #define MCDI_EVENT_TX_ERR_DATA_LBN 0 #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32 +#define MCDI_EVENT_PTP_SECONDS_OFST 0 +#define MCDI_EVENT_PTP_SECONDS_LBN 0 +#define MCDI_EVENT_PTP_SECONDS_WIDTH 32 +#define MCDI_EVENT_PTP_NANOSECONDS_OFST 0 +#define MCDI_EVENT_PTP_NANOSECONDS_LBN 0 +#define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32 +#define MCDI_EVENT_PTP_UUID_OFST 0 +#define MCDI_EVENT_PTP_UUID_LBN 0 +#define MCDI_EVENT_PTP_UUID_WIDTH 32 + +/* FCDI_EVENT structuredef */ +#define FCDI_EVENT_LEN 8 +#define FCDI_EVENT_CONT_LBN 32 +#define FCDI_EVENT_CONT_WIDTH 1 +#define FCDI_EVENT_LEVEL_LBN 33 +#define FCDI_EVENT_LEVEL_WIDTH 3 +#define FCDI_EVENT_LEVEL_INFO 0x0 /* enum */ +#define FCDI_EVENT_LEVEL_WARN 0x1 /* enum */ +#define FCDI_EVENT_LEVEL_ERR 0x2 /* enum */ +#define FCDI_EVENT_LEVEL_FATAL 0x3 /* enum */ +#define FCDI_EVENT_DATA_OFST 0 +#define FCDI_EVENT_LINK_STATE_STATUS_LBN 0 +#define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1 +#define FCDI_EVENT_LINK_DOWN 0x0 /* enum */ +#define FCDI_EVENT_LINK_UP 0x1 /* enum */ +#define FCDI_EVENT_DATA_LBN 0 +#define FCDI_EVENT_DATA_WIDTH 32 +#define FCDI_EVENT_SRC_LBN 36 +#define FCDI_EVENT_SRC_WIDTH 8 +#define FCDI_EVENT_EV_CODE_LBN 60 +#define FCDI_EVENT_EV_CODE_WIDTH 4 +#define FCDI_EVENT_CODE_LBN 44 +#define FCDI_EVENT_CODE_WIDTH 8 +#define FCDI_EVENT_CODE_REBOOT 0x1 /* enum */ +#define FCDI_EVENT_CODE_ASSERT 0x2 /* enum */ +#define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3 /* enum */ +#define FCDI_EVENT_CODE_LINK_STATE 0x4 /* enum */ +#define FCDI_EVENT_CODE_TIMED_READ 0x5 /* enum */ +#define FCDI_EVENT_CODE_PPS_IN 0x6 /* enum */ +#define FCDI_EVENT_CODE_PTP_TICK 0x7 /* enum */ +#define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8 /* enum */ +#define FCDI_EVENT_CODE_PTP_STATUS 0x9 /* enum */ +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0 +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0 +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32 +#define FCDI_EVENT_ASSERT_TYPE_LBN 36 +#define FCDI_EVENT_ASSERT_TYPE_WIDTH 8 +#define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36 +#define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32 +#define FCDI_EVENT_LINK_STATE_DATA_OFST 0 +#define FCDI_EVENT_LINK_STATE_DATA_LBN 0 +#define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32 +#define FCDI_EVENT_PTP_STATE_OFST 0 +#define FCDI_EVENT_PTP_UNDEFINED 0x0 /* enum */ +#define FCDI_EVENT_PTP_SETUP_FAILED 0x1 /* enum */ +#define FCDI_EVENT_PTP_OPERATIONAL 0x2 /* enum */ +#define FCDI_EVENT_PTP_STATE_LBN 0 +#define FCDI_EVENT_PTP_STATE_WIDTH 32 +#define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36 +#define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32 + +/* FCDI_EXTENDED_EVENT_PPS structuredef */ +#define FCDI_EXTENDED_EVENT_PPS_LENMIN 16 +#define FCDI_EXTENDED_EVENT_PPS_LENMAX 248 +#define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num)) +#define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0 +#define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0 +#define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_HI_OFST 12 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MINNUM 1 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MAXNUM 30 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64 /***********************************/ @@ -478,6 +602,8 @@ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff /* enum */ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM 0xb0070000 /* enum */ +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000 /* enum */ +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001 /* enum */ /* MC_CMD_GET_VERSION_OUT msgresponse */ #define MC_CMD_GET_VERSION_OUT_LEN 32 @@ -494,6 +620,2059 @@ /***********************************/ +/* MC_CMD_FC + * Perform an FC operation + */ +#define MC_CMD_FC 0x9 + +/* MC_CMD_FC_IN msgrequest */ +#define MC_CMD_FC_IN_LEN 4 +#define MC_CMD_FC_IN_OP_HDR_OFST 0 +#define MC_CMD_FC_IN_OP_LBN 0 +#define MC_CMD_FC_IN_OP_WIDTH 8 +#define MC_CMD_FC_OP_NULL 0x1 /* enum */ +#define MC_CMD_FC_OP_UNUSED 0x2 /* enum */ +#define MC_CMD_FC_OP_MAC 0x3 /* enum */ +#define MC_CMD_FC_OP_READ32 0x4 /* enum */ +#define MC_CMD_FC_OP_WRITE32 0x5 /* enum */ +#define MC_CMD_FC_OP_TRC_READ 0x6 /* enum */ +#define MC_CMD_FC_OP_TRC_WRITE 0x7 /* enum */ +#define MC_CMD_FC_OP_GET_VERSION 0x8 /* enum */ +#define MC_CMD_FC_OP_TRC_RX_READ 0x9 /* enum */ +#define MC_CMD_FC_OP_TRC_RX_WRITE 0xa /* enum */ +#define MC_CMD_FC_OP_SFP 0xb /* enum */ +#define MC_CMD_FC_OP_DDR_TEST 0xc /* enum */ +#define MC_CMD_FC_OP_GET_ASSERT 0xd /* enum */ +#define MC_CMD_FC_OP_FPGA_BUILD 0xe /* enum */ +#define MC_CMD_FC_OP_READ_MAP 0xf /* enum */ +#define MC_CMD_FC_OP_CAPABILITIES 0x10 /* enum */ +#define MC_CMD_FC_OP_GLOBAL_FLAGS 0x11 /* enum */ +#define MC_CMD_FC_OP_IO_REL 0x12 /* enum */ +#define MC_CMD_FC_OP_UHLINK 0x13 /* enum */ +#define MC_CMD_FC_OP_SET_LINK 0x14 /* enum */ +#define MC_CMD_FC_OP_LICENSE 0x15 /* enum */ +#define MC_CMD_FC_OP_STARTUP 0x16 /* enum */ +#define MC_CMD_FC_OP_DMA 0x17 /* enum */ +#define MC_CMD_FC_OP_TIMED_READ 0x18 /* enum */ +#define MC_CMD_FC_OP_LOG 0x19 /* enum */ +#define MC_CMD_FC_OP_CLOCK 0x1a /* enum */ +#define MC_CMD_FC_OP_DDR 0x1b /* enum */ +#define MC_CMD_FC_OP_TIMESTAMP 0x1c /* enum */ +#define MC_CMD_FC_OP_SPI 0x1d /* enum */ +#define MC_CMD_FC_OP_DIAG 0x1e /* enum */ +#define MC_CMD_FC_IN_PORT_EXT_OFST 0x0 /* enum */ +#define MC_CMD_FC_IN_PORT_INT_OFST 0x40 /* enum */ + +/* MC_CMD_FC_IN_NULL msgrequest */ +#define MC_CMD_FC_IN_NULL_LEN 4 +#define MC_CMD_FC_IN_CMD_OFST 0 + +/* MC_CMD_FC_IN_MAC msgrequest */ +#define MC_CMD_FC_IN_MAC_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_MAC_HEADER_OFST 4 +#define MC_CMD_FC_IN_MAC_OP_LBN 0 +#define MC_CMD_FC_IN_MAC_OP_WIDTH 8 +#define MC_CMD_FC_OP_MAC_OP_RECONFIGURE 0x1 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_SET_LINK 0x2 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_STATS 0x3 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_RX_STATS 0x6 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_TX_STATS 0x7 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_READ_STATUS 0x8 /* enum */ +#define MC_CMD_FC_IN_MAC_PORT_TYPE_LBN 8 +#define MC_CMD_FC_IN_MAC_PORT_TYPE_WIDTH 8 +#define MC_CMD_FC_PORT_EXT 0x0 /* enum */ +#define MC_CMD_FC_PORT_INT 0x1 /* enum */ +#define MC_CMD_FC_IN_MAC_PORT_IDX_LBN 16 +#define MC_CMD_FC_IN_MAC_PORT_IDX_WIDTH 8 +#define MC_CMD_FC_IN_MAC_CMD_FORMAT_LBN 24 +#define MC_CMD_FC_IN_MAC_CMD_FORMAT_WIDTH 8 +#define MC_CMD_FC_OP_MAC_CMD_FORMAT_DEFAULT 0x0 /* enum */ +#define MC_CMD_FC_OP_MAC_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */ + +/* MC_CMD_FC_IN_MAC_RECONFIGURE msgrequest */ +#define MC_CMD_FC_IN_MAC_RECONFIGURE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_SET_LINK msgrequest */ +#define MC_CMD_FC_IN_MAC_SET_LINK_LEN 32 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAC_SET_LINK_MTU_OFST 8 +#define MC_CMD_FC_IN_MAC_SET_LINK_DRAIN_OFST 12 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_OFST 16 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LEN 8 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LO_OFST 16 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_HI_OFST 20 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_OFST 24 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_LBN 0 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_WIDTH 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_LBN 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_WIDTH 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_FCNTL_OFST 28 + +/* MC_CMD_FC_IN_MAC_READ_STATUS msgrequest */ +#define MC_CMD_FC_IN_MAC_READ_STATUS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_RX_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_RX_STATS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_TX_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_TX_STATS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_STATS_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAC_GET_STATS_STATS_INDEX_OFST 8 +#define MC_CMD_FC_IN_MAC_GET_STATS_FLAGS_OFST 12 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_LBN 0 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_LBN 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_LBN 2 +#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_NUM_OFST 16 +#define MC_CMD_FC_MAC_NSTATS_PER_BLOCK 0x1e /* enum */ +#define MC_CMD_FC_MAC_NBYTES_PER_STAT 0x8 /* enum */ + +/* MC_CMD_FC_IN_READ32 msgrequest */ +#define MC_CMD_FC_IN_READ32_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_READ32_ADDR_HI_OFST 4 +#define MC_CMD_FC_IN_READ32_ADDR_LO_OFST 8 +#define MC_CMD_FC_IN_READ32_NUMWORDS_OFST 12 + +/* MC_CMD_FC_IN_WRITE32 msgrequest */ +#define MC_CMD_FC_IN_WRITE32_LENMIN 16 +#define MC_CMD_FC_IN_WRITE32_LENMAX 252 +#define MC_CMD_FC_IN_WRITE32_LEN(num) (12+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_WRITE32_ADDR_HI_OFST 4 +#define MC_CMD_FC_IN_WRITE32_ADDR_LO_OFST 8 +#define MC_CMD_FC_IN_WRITE32_BUFFER_OFST 12 +#define MC_CMD_FC_IN_WRITE32_BUFFER_LEN 4 +#define MC_CMD_FC_IN_WRITE32_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_WRITE32_BUFFER_MAXNUM 60 + +/* MC_CMD_FC_IN_TRC_READ msgrequest */ +#define MC_CMD_FC_IN_TRC_READ_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_READ_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_READ_CHANNEL_OFST 8 + +/* MC_CMD_FC_IN_TRC_WRITE msgrequest */ +#define MC_CMD_FC_IN_TRC_WRITE_LEN 28 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_WRITE_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_WRITE_CHANNEL_OFST 8 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_OFST 12 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_LEN 4 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_NUM 4 + +/* MC_CMD_FC_IN_GET_VERSION msgrequest */ +#define MC_CMD_FC_IN_GET_VERSION_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_TRC_RX_READ msgrequest */ +#define MC_CMD_FC_IN_TRC_RX_READ_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_RX_READ_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_RX_READ_CHANNEL_OFST 8 + +/* MC_CMD_FC_IN_TRC_RX_WRITE msgrequest */ +#define MC_CMD_FC_IN_TRC_RX_WRITE_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_RX_WRITE_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_RX_WRITE_CHANNEL_OFST 8 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_OFST 12 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_LEN 4 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_NUM 2 + +/* MC_CMD_FC_IN_SFP msgrequest */ +#define MC_CMD_FC_IN_SFP_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SFP_SPEED_OFST 4 +#define MC_CMD_FC_IN_SFP_COPPER_LEN_OFST 8 +#define MC_CMD_FC_IN_SFP_DUAL_SPEED_OFST 12 +#define MC_CMD_FC_IN_SFP_PRESENT_OFST 16 +#define MC_CMD_FC_IN_SFP_TYPE_OFST 20 + +/* MC_CMD_FC_IN_DDR_TEST msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 +#define MC_CMD_FC_IN_DDR_TEST_OP_LBN 0 +#define MC_CMD_FC_IN_DDR_TEST_OP_WIDTH 8 +#define MC_CMD_FC_OP_DDR_TEST_START 0x1 /* enum */ +#define MC_CMD_FC_OP_DDR_TEST_POLL 0x2 /* enum */ + +/* MC_CMD_FC_IN_DDR_TEST_START msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_START_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_DDR_TEST_START_MASK_OFST 8 +#define MC_CMD_FC_IN_DDR_TEST_START_T0_LBN 0 +#define MC_CMD_FC_IN_DDR_TEST_START_T0_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_T1_LBN 1 +#define MC_CMD_FC_IN_DDR_TEST_START_T1_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_B0_LBN 2 +#define MC_CMD_FC_IN_DDR_TEST_START_B0_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_B1_LBN 3 +#define MC_CMD_FC_IN_DDR_TEST_START_B1_WIDTH 1 + +/* MC_CMD_FC_IN_DDR_TEST_POLL msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_POLL_LEN 8 +#define MC_CMD_FC_IN_DDR_TEST_CMD_OFST 0 +/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_GET_ASSERT msgrequest */ +#define MC_CMD_FC_IN_GET_ASSERT_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_FPGA_BUILD msgrequest */ +#define MC_CMD_FC_IN_FPGA_BUILD_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_FPGA_BUILD_OP_OFST 4 +#define MC_CMD_FC_IN_FPGA_BUILD_BUILD 0x1 /* enum */ +#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2 /* enum */ +#define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3 /* enum */ + +/* MC_CMD_FC_IN_READ_MAP msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 +#define MC_CMD_FC_IN_READ_MAP_OP_LBN 0 +#define MC_CMD_FC_IN_READ_MAP_OP_WIDTH 8 +#define MC_CMD_FC_OP_READ_MAP_COUNT 0x1 /* enum */ +#define MC_CMD_FC_OP_READ_MAP_INDEX 0x2 /* enum */ + +/* MC_CMD_FC_IN_READ_MAP_COUNT msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_COUNT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_READ_MAP_INDEX msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_INDEX_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAP_INDEX_OFST 8 + +/* MC_CMD_FC_IN_CAPABILITIES msgrequest */ +#define MC_CMD_FC_IN_CAPABILITIES_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_GLOBAL_FLAGS msgrequest */ +#define MC_CMD_FC_IN_GLOBAL_FLAGS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_GLOBAL_FLAGS_FLAGS_OFST 4 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_CABLE_PLUGGED_IN_LBN 0 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_CABLE_PLUGGED_IN_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_LINK_MONITORING_LBN 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_LINK_MONITORING_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_DFE_ENABLE_LBN 2 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_DFE_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_EYE_ENABLE_LBN 3 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_EYE_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_TUNING_ENABLE_LBN 4 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_TUNING_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_OFFCAL_ENABLE_LBN 5 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_OFFCAL_ENABLE_WIDTH 1 + +/* MC_CMD_FC_IN_IO_REL msgrequest */ +#define MC_CMD_FC_IN_IO_REL_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 +#define MC_CMD_FC_IN_IO_REL_OP_LBN 0 +#define MC_CMD_FC_IN_IO_REL_OP_WIDTH 8 +#define MC_CMD_FC_IN_IO_REL_GET_ADDR 0x1 /* enum */ +#define MC_CMD_FC_IN_IO_REL_READ32 0x2 /* enum */ +#define MC_CMD_FC_IN_IO_REL_WRITE32 0x3 /* enum */ +#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_LBN 8 +#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_WIDTH 8 +#define MC_CMD_FC_COMP_TYPE_APP_ADDR_SPACE 0x1 /* enum */ +#define MC_CMD_FC_COMP_TYPE_FLASH 0x2 /* enum */ + +/* MC_CMD_FC_IN_IO_REL_GET_ADDR msgrequest */ +#define MC_CMD_FC_IN_IO_REL_GET_ADDR_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_IO_REL_READ32 msgrequest */ +#define MC_CMD_FC_IN_IO_REL_READ32_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_IO_REL_READ32_ADDR_HI_OFST 8 +#define MC_CMD_FC_IN_IO_REL_READ32_ADDR_LO_OFST 12 +#define MC_CMD_FC_IN_IO_REL_READ32_NUMWORDS_OFST 16 + +/* MC_CMD_FC_IN_IO_REL_WRITE32 msgrequest */ +#define MC_CMD_FC_IN_IO_REL_WRITE32_LENMIN 20 +#define MC_CMD_FC_IN_IO_REL_WRITE32_LENMAX 252 +#define MC_CMD_FC_IN_IO_REL_WRITE32_LEN(num) (16+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_IO_REL_WRITE32_ADDR_HI_OFST 8 +#define MC_CMD_FC_IN_IO_REL_WRITE32_ADDR_LO_OFST 12 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_OFST 16 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_LEN 4 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_MAXNUM 59 + +/* MC_CMD_FC_IN_UHLINK msgrequest */ +#define MC_CMD_FC_IN_UHLINK_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 +#define MC_CMD_FC_IN_UHLINK_OP_LBN 0 +#define MC_CMD_FC_IN_UHLINK_OP_WIDTH 8 +#define MC_CMD_FC_OP_UHLINK_PHY 0x1 /* enum */ +#define MC_CMD_FC_OP_UHLINK_MAC 0x2 /* enum */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE 0x3 /* enum */ +#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT 0x4 /* enum */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT 0x5 /* enum */ +#define MC_CMD_FC_OP_UHLINK_RX_TUNE 0x6 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET 0x7 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET 0x8 /* enum */ +#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_LBN 8 +#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_WIDTH 8 +#define MC_CMD_FC_IN_UHLINK_PORT_IDX_LBN 16 +#define MC_CMD_FC_IN_UHLINK_PORT_IDX_WIDTH 8 +#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_LBN 24 +#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_WIDTH 8 +#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_DEFAULT 0x0 /* enum */ +#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_PHY msgrequest */ +#define MC_CMD_FC_OP_UHLINK_PHY_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_MAC msgrequest */ +#define MC_CMD_FC_OP_UHLINK_MAC_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_RX_EYE msgrequest */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE_INDEX_OFST 8 +#define MC_CMD_FC_UHLINK_RX_EYE_PER_BLOCK 0x30 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT msgrequest */ +#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT msgrequest */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_DC_GAIN_OFST 8 +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_EQ_CONTROL_OFST 12 +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_INDEX_OFST 16 +#define MC_CMD_FC_UHLINK_RX_EYE_PLOT_ROWS_PER_BLOCK 0x1e /* enum */ + +/* MC_CMD_FC_OP_UHLINK_RX_TUNE msgrequest */ +#define MC_CMD_FC_OP_UHLINK_RX_TUNE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_LOOPBACK_SET msgrequest */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_TYPE_OFST 8 +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PCS_SERIAL 0x0 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PMA_PRE_CDR 0x1 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PMA_POST_CDR 0x2 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_STATE_OFST 12 +#define MC_CMD_FC_UHLINK_LOOPBACK_STATE_OFF 0x0 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_STATE_ON 0x1 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_LOOPBACK_GET msgrequest */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET_TYPE_OFST 8 + +/* MC_CMD_FC_IN_SET_LINK msgrequest */ +#define MC_CMD_FC_IN_SET_LINK_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SET_LINK_MODE_OFST 4 +#define MC_CMD_FC_IN_SET_LINK_SPEED_OFST 8 +#define MC_CMD_FC_IN_SET_LINK_FLAGS_OFST 12 +#define MC_CMD_FC_IN_SET_LINK_LOWPOWER_LBN 0 +#define MC_CMD_FC_IN_SET_LINK_LOWPOWER_WIDTH 1 +#define MC_CMD_FC_IN_SET_LINK_POWEROFF_LBN 1 +#define MC_CMD_FC_IN_SET_LINK_POWEROFF_WIDTH 1 +#define MC_CMD_FC_IN_SET_LINK_TXDIS_LBN 2 +#define MC_CMD_FC_IN_SET_LINK_TXDIS_WIDTH 1 + +/* MC_CMD_FC_IN_LICENSE msgrequest */ +#define MC_CMD_FC_IN_LICENSE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_LICENSE_OP_OFST 4 +#define MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE 0x0 /* enum */ +#define MC_CMD_FC_IN_LICENSE_GET_KEY_STATS 0x1 /* enum */ + +/* MC_CMD_FC_IN_STARTUP msgrequest */ +#define MC_CMD_FC_IN_STARTUP_LEN 40 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_STARTUP_BASE_OFST 4 +#define MC_CMD_FC_IN_STARTUP_LENGTH_OFST 8 +#define MC_CMD_FC_IN_STARTUP_IDLENGTH_OFST 12 +#define MC_CMD_FC_IN_STARTUP_ID_OFST 16 +#define MC_CMD_FC_IN_STARTUP_ID_LEN 1 +#define MC_CMD_FC_IN_STARTUP_ID_NUM 24 + +/* MC_CMD_FC_IN_DMA msgrequest */ +#define MC_CMD_FC_IN_DMA_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DMA_OP_OFST 4 +#define MC_CMD_FC_IN_DMA_STOP 0x0 /* enum */ +#define MC_CMD_FC_IN_DMA_READ 0x1 /* enum */ + +/* MC_CMD_FC_IN_DMA_STOP msgrequest */ +#define MC_CMD_FC_IN_DMA_STOP_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DMA_OP_OFST 4 */ +#define MC_CMD_FC_IN_DMA_STOP_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_DMA_READ msgrequest */ +#define MC_CMD_FC_IN_DMA_READ_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DMA_OP_OFST 4 */ +#define MC_CMD_FC_IN_DMA_READ_OFFSET_OFST 8 +#define MC_CMD_FC_IN_DMA_READ_LENGTH_OFST 12 + +/* MC_CMD_FC_IN_TIMED_READ msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 +#define MC_CMD_FC_IN_TIMED_READ_SET 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_GET 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR 0x2 /* enum */ + +/* MC_CMD_FC_IN_TIMED_READ_SET msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_SET_LEN 52 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_HANDLE_OFST 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_OFST 12 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LEN 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LO_OFST 12 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_HI_OFST 16 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_OFST 20 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LEN 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LO_OFST 20 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_HI_OFST 24 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_LENGTH_OFST 28 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_LENGTH_OFST 32 +#define MC_CMD_FC_IN_TIMED_READ_SET_OFFSET_OFST 36 +#define MC_CMD_FC_IN_TIMED_READ_SET_DATA_OFST 40 +#define MC_CMD_FC_IN_TIMED_READ_SET_FLAGS_OFST 44 +#define MC_CMD_FC_IN_TIMED_READ_SET_INDIRECT_LBN 0 +#define MC_CMD_FC_IN_TIMED_READ_SET_INDIRECT_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_DOUBLE_LBN 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_DOUBLE_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_EVENT_LBN 2 +#define MC_CMD_FC_IN_TIMED_READ_SET_EVENT_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_PREREAD_LBN 3 +#define MC_CMD_FC_IN_TIMED_READ_SET_PREREAD_WIDTH 2 +#define MC_CMD_FC_IN_TIMED_READ_SET_NONE 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_READ 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_WRITE 0x2 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_READWRITE 0x3 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_PERIOD_OFST 48 + +/* MC_CMD_FC_IN_TIMED_READ_GET msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_GET_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_GET_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_TIMED_READ_CLEAR msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_LOG msgrequest */ +#define MC_CMD_FC_IN_LOG_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_LOG_OP_OFST 4 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE 0x0 /* enum */ +#define MC_CMD_FC_IN_LOG_JTAG_UART 0x1 /* enum */ + +/* MC_CMD_FC_IN_LOG_ADDR_RANGE msgrequest */ +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_LOG_OP_OFST 4 */ +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_OFFSET_OFST 8 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LENGTH_OFST 12 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_ERASE_SIZE_OFST 16 + +/* MC_CMD_FC_IN_LOG_JTAG_UART msgrequest */ +#define MC_CMD_FC_IN_LOG_JTAG_UART_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_LOG_OP_OFST 4 */ +#define MC_CMD_FC_IN_LOG_JTAG_UART_ENABLE_OFST 8 + +/* MC_CMD_FC_IN_CLOCK msgrequest */ +#define MC_CMD_FC_IN_CLOCK_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_CLOCK_OP_OFST 4 +#define MC_CMD_FC_IN_CLOCK_GET_TIME 0x0 /* enum */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME 0x1 /* enum */ +#define MC_CMD_FC_IN_CLOCK_ID_OFST 8 +#define MC_CMD_FC_IN_CLOCK_STATS 0x0 /* enum */ +#define MC_CMD_FC_IN_CLOCK_MAC 0x1 /* enum */ + +/* MC_CMD_FC_IN_CLOCK_GET_TIME msgrequest */ +#define MC_CMD_FC_IN_CLOCK_GET_TIME_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_CLOCK_OP_OFST 4 */ +/* MC_CMD_FC_IN_CLOCK_ID_OFST 8 */ + +/* MC_CMD_FC_IN_CLOCK_SET_TIME msgrequest */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_CLOCK_OP_OFST 4 */ +/* MC_CMD_FC_IN_CLOCK_ID_OFST 8 */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_OFST 12 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LEN 8 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LO_OFST 12 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_HI_OFST 16 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_NANOSECONDS_OFST 20 + +/* MC_CMD_FC_IN_DDR msgrequest */ +#define MC_CMD_FC_IN_DDR_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DDR_OP_OFST 4 +#define MC_CMD_FC_IN_DDR_SET_SPD 0x0 /* enum */ +#define MC_CMD_FC_IN_DDR_GET_STATUS 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_OFST 8 +#define MC_CMD_FC_IN_DDR_BANK_B0 0x0 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_B1 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_T0 0x2 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_T1 0x3 /* enum */ +#define MC_CMD_FC_IN_DDR_NUM_BANKS 0x4 /* enum */ + +/* MC_CMD_FC_IN_DDR_SET_SPD msgrequest */ +#define MC_CMD_FC_IN_DDR_SET_SPD_LEN 148 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_OP_OFST 4 */ +/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */ +#define MC_CMD_FC_IN_DDR_FLAGS_OFST 12 +#define MC_CMD_FC_IN_DDR_SET_SPD_ACTIVE 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_SPD_OFST 16 +#define MC_CMD_FC_IN_DDR_SPD_LEN 1 +#define MC_CMD_FC_IN_DDR_SPD_NUM 128 +#define MC_CMD_FC_IN_DDR_SPD_PAGE_ID_OFST 144 + +/* MC_CMD_FC_IN_DDR_GET_STATUS msgrequest */ +#define MC_CMD_FC_IN_DDR_GET_STATUS_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_OP_OFST 4 */ +/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */ + +/* MC_CMD_FC_IN_TIMESTAMP msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_OP_OFST 4 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT 0x2 /* enum */ + +/* MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LEN 28 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_OP_OFST 4 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_FILTER_OFST 8 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LATEST 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_MATCH 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_OFST 12 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LEN 8 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LO_OFST 12 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_HI_OFST 16 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_PORT_NUM_OFST 20 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_SEQ_NUM_OFST 24 + +/* MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT_OP_OFST 4 + +/* MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT_OP_OFST 4 + +/* MC_CMD_FC_IN_SPI msgrequest */ +#define MC_CMD_FC_IN_SPI_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_READ 0x0 /* enum */ +#define MC_CMD_FC_IN_SPI_WRITE 0x1 /* enum */ +#define MC_CMD_FC_IN_SPI_ERASE 0x2 /* enum */ + +/* MC_CMD_FC_IN_SPI_READ msgrequest */ +#define MC_CMD_FC_IN_SPI_READ_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_READ_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_READ_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_READ_NUMBYTES_OFST 12 + +/* MC_CMD_FC_IN_SPI_WRITE msgrequest */ +#define MC_CMD_FC_IN_SPI_WRITE_LENMIN 16 +#define MC_CMD_FC_IN_SPI_WRITE_LENMAX 252 +#define MC_CMD_FC_IN_SPI_WRITE_LEN(num) (12+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_WRITE_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_WRITE_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_OFST 12 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_LEN 4 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_MAXNUM 60 + +/* MC_CMD_FC_IN_SPI_ERASE msgrequest */ +#define MC_CMD_FC_IN_SPI_ERASE_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_ERASE_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_ERASE_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_ERASE_NUMBYTES_OFST 12 + +/* MC_CMD_FC_IN_DIAG msgrequest */ +#define MC_CMD_FC_IN_DIAG_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL 0x2 /* enum */ + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_SUB_OP_OFST 8 + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_TOGGLE_COUNT_OFST 12 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_CLKEN_COUNT_OFST 16 + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP 0x2 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR 0x3 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_START msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_BANK_MASK_OFST 12 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_PATTERN_OFST 16 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ZEROS 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONES 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_TYPE_OFST 20 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONGOING_TEST 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SINGLE_TEST 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_BANK_ID_OFST 12 +#define MC_CMD_FC_DDR_BANK0 0x0 /* enum */ +#define MC_CMD_FC_DDR_BANK1 0x1 /* enum */ +#define MC_CMD_FC_DDR_BANK2 0x2 /* enum */ +#define MC_CMD_FC_DDR_BANK3 0x3 /* enum */ +#define MC_CMD_FC_DDR_AOEMEM_MAX_BANKS 0x4 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_BANK_MASK_OFST 12 + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_BANK_MASK_OFST 12 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_FLAG_ACTION_OFST 16 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_CLEAR 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_SET 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_MODE_OFST 12 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_PASSTHROUGH 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SNAKE 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL1_OFST 12 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL2_OFST 16 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL3_OFST 20 + +/* MC_CMD_FC_OUT msgresponse */ +#define MC_CMD_FC_OUT_LEN 0 + +/* MC_CMD_FC_OUT_NULL msgresponse */ +#define MC_CMD_FC_OUT_NULL_LEN 0 + +/* MC_CMD_FC_OUT_READ32 msgresponse */ +#define MC_CMD_FC_OUT_READ32_LENMIN 4 +#define MC_CMD_FC_OUT_READ32_LENMAX 252 +#define MC_CMD_FC_OUT_READ32_LEN(num) (0+4*(num)) +#define MC_CMD_FC_OUT_READ32_BUFFER_OFST 0 +#define MC_CMD_FC_OUT_READ32_BUFFER_LEN 4 +#define MC_CMD_FC_OUT_READ32_BUFFER_MINNUM 1 +#define MC_CMD_FC_OUT_READ32_BUFFER_MAXNUM 63 + +/* MC_CMD_FC_OUT_WRITE32 msgresponse */ +#define MC_CMD_FC_OUT_WRITE32_LEN 0 + +/* MC_CMD_FC_OUT_TRC_READ msgresponse */ +#define MC_CMD_FC_OUT_TRC_READ_LEN 16 +#define MC_CMD_FC_OUT_TRC_READ_DATA_OFST 0 +#define MC_CMD_FC_OUT_TRC_READ_DATA_LEN 4 +#define MC_CMD_FC_OUT_TRC_READ_DATA_NUM 4 + +/* MC_CMD_FC_OUT_TRC_WRITE msgresponse */ +#define MC_CMD_FC_OUT_TRC_WRITE_LEN 0 + +/* MC_CMD_FC_OUT_GET_VERSION msgresponse */ +#define MC_CMD_FC_OUT_GET_VERSION_LEN 12 +#define MC_CMD_FC_OUT_GET_VERSION_FIRMWARE_OFST 0 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_OFST 4 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_LEN 8 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_LO_OFST 4 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_HI_OFST 8 + +/* MC_CMD_FC_OUT_TRC_RX_READ msgresponse */ +#define MC_CMD_FC_OUT_TRC_RX_READ_LEN 8 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_OFST 0 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_LEN 4 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_NUM 2 + +/* MC_CMD_FC_OUT_TRC_RX_WRITE msgresponse */ +#define MC_CMD_FC_OUT_TRC_RX_WRITE_LEN 0 + +/* MC_CMD_FC_OUT_MAC_RECONFIGURE msgresponse */ +#define MC_CMD_FC_OUT_MAC_RECONFIGURE_LEN 0 + +/* MC_CMD_FC_OUT_MAC_SET_LINK msgresponse */ +#define MC_CMD_FC_OUT_MAC_SET_LINK_LEN 0 + +/* MC_CMD_FC_OUT_MAC_READ_STATUS msgresponse */ +#define MC_CMD_FC_OUT_MAC_READ_STATUS_LEN 4 +#define MC_CMD_FC_OUT_MAC_READ_STATUS_STATUS_OFST 0 + +/* MC_CMD_FC_OUT_MAC_GET_RX_STATS msgresponse */ +#define MC_CMD_FC_OUT_MAC_GET_RX_STATS_LEN ((((0-1+(64*MC_CMD_FC_MAC_RX_NSTATS))+1))>>3) +#define MC_CMD_FC_OUT_MAC_GET_RX_STATS_STATISTICS_OFST 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:53:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87E6517A; Wed, 25 Mar 2015 10:53:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68564C13; Wed, 25 Mar 2015 10:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PArT4J099256; Wed, 25 Mar 2015 10:53:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PArSNa099251; Wed, 25 Mar 2015 10:53:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251053.t2PArSNa099251@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:53: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: r280550 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:53:29 -0000 Author: arybchik Date: Wed Mar 25 10:53:27 2015 New Revision: 280550 URL: https://svnweb.freebsd.org/changeset/base/280550 Log: MFC: 279048 sfxge: add Florence R7 turbo mode support to common code Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_mcdi.h stable/10/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:52:35 2015 (r280549) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:53:27 2015 (r280550) @@ -861,6 +861,7 @@ efx_phy_bist_stop( #define EFX_FEATURE_MCDI 0x00000020 #define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040 #define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080 +#define EFX_FEATURE_TURBO 0x00000100 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -881,6 +882,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rxq_limit; uint32_t enc_buftbl_limit; uint32_t enc_evq_moderation_max; + uint32_t enc_clk_mult; #if EFSYS_OPT_LOOPBACK uint32_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:52:35 2015 (r280549) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:53:27 2015 (r280550) @@ -844,13 +844,14 @@ efx_ev_qmoderate( __in unsigned int us) { efx_nic_t *enp = eep->ee_enp; + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); unsigned int locked; efx_dword_t dword; int rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); - if (us > enp->en_nic_cfg.enc_evq_moderation_max) { + if (us > encp->enc_evq_moderation_max) { rc = EINVAL; goto fail1; } @@ -869,21 +870,20 @@ efx_ev_qmoderate( uint32_t timer_val; /* Calculate the timer value in quanta */ - us -= (us % EFX_EV_TIMER_QUANTUM); - if (us < EFX_EV_TIMER_QUANTUM) - us = EFX_EV_TIMER_QUANTUM; - - timer_val = us / EFX_EV_TIMER_QUANTUM; + timer_val = us * encp->enc_clk_mult / EFX_EV_TIMER_QUANTUM; /* Moderation value is base 0 so we need to deduct 1 */ + if (timer_val > 0) + timer_val--; + if (enp->en_family == EFX_FAMILY_FALCON) EFX_POPULATE_DWORD_2(dword, FRF_AB_TC_TIMER_MODE, FFE_AB_TIMER_MODE_INT_HLDOFF, - FRF_AB_TIMER_VAL, timer_val - 1); + FRF_AB_TIMER_VAL, timer_val); else EFX_POPULATE_DWORD_2(dword, FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, - FRF_CZ_TC_TIMER_VAL, timer_val - 1); + FRF_CZ_TC_TIMER_VAL, timer_val); } locked = (eep->ee_index == 0) ? 1 : 0; Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Mar 25 10:52:35 2015 (r280549) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.h Wed Mar 25 10:53:27 2015 (r280550) @@ -233,6 +233,9 @@ efx_mcdi_version( #define MCDI_EV_FIELD(_eqp, _field) \ EFX_QWORD_FIELD(*_eqp, MCDI_EVENT_ ## _field) +#define MCDI_CMD_DWORD_FIELD(_edp, _field) \ + EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field) + #ifdef __cplusplus } #endif Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:52:35 2015 (r280549) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:53:27 2015 (r280550) @@ -279,7 +279,8 @@ siena_board_cfg( uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LENMIN, MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)]; efx_mcdi_req_t req; - uint8_t *src; + uint8_t *mac_addr; + efx_dword_t *capabilities; int rc; /* Board configuration */ @@ -302,17 +303,35 @@ siena_board_cfg( goto fail2; } - if (emip->emi_port == 1) - src = MCDI_OUT2(req, uint8_t, + if (emip->emi_port == 1) { + mac_addr = MCDI_OUT2(req, uint8_t, GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0); - else - src = MCDI_OUT2(req, uint8_t, + capabilities = MCDI_OUT2(req, efx_dword_t, + GET_BOARD_CFG_OUT_CAPABILITIES_PORT0); + } else { + mac_addr = MCDI_OUT2(req, uint8_t, GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1); - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, src); + capabilities = MCDI_OUT2(req, efx_dword_t, + GET_BOARD_CFG_OUT_CAPABILITIES_PORT1); + } + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); encp->enc_board_type = MCDI_OUT_DWORD(req, GET_BOARD_CFG_OUT_BOARD_TYPE); + /* Additional capabilities */ + encp->enc_clk_mult = 1; + if (MCDI_CMD_DWORD_FIELD(capabilities, CAPABILITIES_TURBO)) { + enp->en_features |= EFX_FEATURE_TURBO; + + if (MCDI_CMD_DWORD_FIELD(capabilities, + CAPABILITIES_TURBO_ACTIVE)) + encp->enc_clk_mult = 2; + } + + encp->enc_evq_moderation_max = EFX_EV_TIMER_QUANTUM << + FRF_AB_TIMER_VAL_WIDTH / encp->enc_clk_mult; + /* Resource limits */ req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS; EFX_STATIC_ASSERT(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN == 0); @@ -607,9 +626,6 @@ siena_nic_probe( if ((rc = siena_board_cfg(enp)) != 0) goto fail4; - encp->enc_evq_moderation_max = - EFX_EV_TIMER_QUANTUM << FRF_CZ_TIMER_VAL_WIDTH; - if ((rc = siena_phy_cfg(enp)) != 0) goto fail5; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:54:25 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58F3B401; Wed, 25 Mar 2015 10:54:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28E5AC2D; Wed, 25 Mar 2015 10:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAsPhO099434; Wed, 25 Mar 2015 10:54:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAsOcV099432; Wed, 25 Mar 2015 10:54:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251054.t2PAsOcV099432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280551 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:54:25 -0000 Author: arybchik Date: Wed Mar 25 10:54:23 2015 New Revision: 280551 URL: https://svnweb.freebsd.org/changeset/base/280551 Log: MFC: 279076 sfxge: regenerate sensor map Add Florence R7 and Modena sensors. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_mon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:53:27 2015 (r280550) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:54:23 2015 (r280551) @@ -459,7 +459,7 @@ efx_mon_init( #define EFX_MON_STATS_SIZE 0x100 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 16a14e61aa4f8d80 */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 58706a378332aeee */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -477,6 +477,20 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_1_2V, EFX_MON_STAT_1_8V, EFX_MON_STAT_3_3V, + EFX_MON_STAT_1_2VA, + EFX_MON_STAT_VREF, + EFX_MON_STAT_VAOE, + EFX_MON_STAT_AOE_TEMP, + EFX_MON_STAT_PSU_AOE_TEMP, + EFX_MON_STAT_PSU_TEMP, + EFX_MON_STAT_FAN0, + EFX_MON_STAT_FAN1, + EFX_MON_STAT_FAN2, + EFX_MON_STAT_FAN3, + EFX_MON_STAT_FAN4, + EFX_MON_STAT_VAOE_IN, + EFX_MON_STAT_IAOE, + EFX_MON_STAT_IAOE_IN, EFX_MON_NSTATS } efx_mon_stat_t; Modified: stable/10/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mon.c Wed Mar 25 10:53:27 2015 (r280550) +++ stable/10/sys/dev/sfxge/common/efx_mon.c Wed Mar 25 10:54:23 2015 (r280551) @@ -195,7 +195,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 08518fd1fb4e2612 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 89ff37f1d74ad8b3 */ static const char __cs * __cs __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -213,6 +213,20 @@ static const char __cs * __cs __mon_sta "1_2v", "1_8v", "3_3v", + "1_2va", + "vref", + "vaoe", + "aoe_temperature", + "psu_aoe_temperature", + "psu_temperature", + "fan0", + "fan1", + "fan2", + "fan3", + "fan4", + "vaoe_in", + "iaoe", + "iaoe_in", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:55:09 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1CDC544; Wed, 25 Mar 2015 10:55:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BB02C3B; Wed, 25 Mar 2015 10:55:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAt92Y099649; Wed, 25 Mar 2015 10:55:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAt9P5099648; Wed, 25 Mar 2015 10:55:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251055.t2PAt9P5099648@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 10:55: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: r280552 - stable/10/sys/netinet 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.18-1 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, 25 Mar 2015 10:55:09 -0000 Author: hselasky Date: Wed Mar 25 10:55:08 2015 New Revision: 280552 URL: https://svnweb.freebsd.org/changeset/base/280552 Log: MFC r279281: Fix a special case in ip_fragment() to produce a more sensible chain of packets. When the data payload length excluding any headers, of an outgoing IPv4 packet exceeds PAGE_SIZE bytes, a special case in ip_fragment() can kick in to optimise the outgoing payload(s). The code which was added in r98849 as part of zero copy socket support assumes that the beginning of any MTU sized payload is aligned to where a MBUF's "m_data" pointer points. This is not always the case and can sometimes cause large IPv4 packets, as part of ping replies, to be split more than needed. Instead of iterating the MBUFs to figure out how much data is in the current chain, use the value already in the "m_pkthdr.len" field of the first MBUF in the chain. Reviewed by: ken @ Differential Revision: https://reviews.freebsd.org/D1893 Sponsored by: Mellanox Technologies Modified: stable/10/sys/netinet/ip_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_output.c ============================================================================== --- stable/10/sys/netinet/ip_output.c Wed Mar 25 10:54:23 2015 (r280551) +++ stable/10/sys/netinet/ip_output.c Wed Mar 25 10:55:08 2015 (r280552) @@ -752,10 +752,8 @@ ip_fragment(struct ip *ip, struct mbuf * * be less than the receiver's page size ? */ int newlen; - struct mbuf *m; - for (m = m0, off = 0; m && (off+m->m_len) <= mtu; m = m->m_next) - off += m->m_len; + off = MIN(mtu, m0->m_pkthdr.len); /* * firstlen (off - hlen) must be aligned on an From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:56:13 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A6FC6A3; Wed, 25 Mar 2015 10:56:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 310C5C57; Wed, 25 Mar 2015 10:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAuDBb099851; Wed, 25 Mar 2015 10:56:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAuBo2099844; Wed, 25 Mar 2015 10:56:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251056.t2PAuBo2099844@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:56: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: r280553 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:56:13 -0000 Author: arybchik Date: Wed Mar 25 10:56:10 2015 New Revision: 280553 URL: https://svnweb.freebsd.org/changeset/base/280553 Log: MFC: 279077 sfxge: style fixes Use nitem() to get number of array elements. Remove unused define. Use TAB to indent. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:55:08 2015 (r280552) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 10:56:10 2015 (r280553) @@ -1614,14 +1614,14 @@ efx_rx_scale_toeplitz_ipv6_key_set( #endif /* EFSYS_OPT_RX_SCALE */ -#define EFX_RXQ_MAXNDESCS 4096 -#define EFX_RXQ_MINNDESCS 512 +#define EFX_RXQ_MAXNDESCS 4096 +#define EFX_RXQ_MINNDESCS 512 -#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) +#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) -#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, @@ -1700,14 +1700,14 @@ extern void efx_tx_fini( __in efx_nic_t *enp); -#define EFX_TXQ_MAXNDESCS 4096 -#define EFX_TXQ_MINNDESCS 512 +#define EFX_TXQ_MAXNDESCS 4096 +#define EFX_TXQ_MINNDESCS 512 -#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) +#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) -#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) extern __checkReturn int efx_tx_qcreate( Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:55:08 2015 (r280552) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 10:56:10 2015 (r280553) @@ -1172,9 +1172,7 @@ sfxge_rx_stat_init(struct sfxge_softc *s stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_rx_stats) / sizeof(sfxge_rx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_rx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_rx_stats[id].name, Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:55:08 2015 (r280552) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:56:10 2015 (r280553) @@ -1547,9 +1547,7 @@ sfxge_tx_stat_init(struct sfxge_softc *s stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_tx_stats) / sizeof(sfxge_tx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_tx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_tx_stats[id].name, Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:55:08 2015 (r280552) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:56:10 2015 (r280553) @@ -41,13 +41,7 @@ * clusters. (The chain could be longer than this initially, but can * be shortened with m_collapse().) */ -#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) - -/* Maximum number of DMA segments needed to map an output packet. It - * could overlap all mbufs in the chain and also require an extra - * segment for a TSO header. - */ -#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1) +#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) /* * Buffer mapping flags. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:57:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 080A8927; Wed, 25 Mar 2015 10:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E645AC6F; Wed, 25 Mar 2015 10:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAvQcJ000220; Wed, 25 Mar 2015 10:57:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAvQmB000219; Wed, 25 Mar 2015 10:57:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251057.t2PAvQmB000219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:57: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: r280555 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 10:57:27 -0000 Author: arybchik Date: Wed Mar 25 10:57:26 2015 New Revision: 280555 URL: https://svnweb.freebsd.org/changeset/base/280555 Log: MFC: 279078 sfxge: add assertions that required event handlers are implemented efx_ev_mcdi() does not assert or check that all event handlers it calls are non-null. Add assertions at the top for all required event handlers, as some events (in the case of this bug, monitor events) are rare. Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:56:53 2015 (r280554) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 10:57:26 2015 (r280555) @@ -567,6 +567,12 @@ efx_ev_mcdi( if (enp->en_family != EFX_FAMILY_SIENA) goto out; + EFSYS_ASSERT(eecp->eec_link_change != NULL); + EFSYS_ASSERT(eecp->eec_exception != NULL); +#if EFSYS_OPT_MON_STATS + EFSYS_ASSERT(eecp->eec_monitor != NULL); +#endif + EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE); code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:58:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFB29A86; Wed, 25 Mar 2015 10:58:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9C86C82; Wed, 25 Mar 2015 10:58:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAwM0T000409; Wed, 25 Mar 2015 10:58:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAwMvj000408; Wed, 25 Mar 2015 10:58:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251058.t2PAwMvj000408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280556 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:58:23 -0000 Author: arybchik Date: Wed Mar 25 10:58:21 2015 New Revision: 280556 URL: https://svnweb.freebsd.org/changeset/base/280556 Log: MFC: 279080 sfxge: reap Tx descriptors on unblock Otherwise when processing finally comes to efx_tx_qdesc_post() it could be insufficient space between reaped and added to post pending descriptors. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:57:26 2015 (r280555) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:58:21 2015 (r280556) @@ -1142,8 +1142,11 @@ sfxge_tx_qunblock(struct sfxge_txq *txq) unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) { + /* reaped must be in sync with blocked */ + sfxge_tx_qreap(txq); txq->blocked = 0; + } } sfxge_tx_qdpl_service(txq); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 10:59:25 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C0F8BD1; Wed, 25 Mar 2015 10:59:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D646C94; Wed, 25 Mar 2015 10:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAxPK2000590; Wed, 25 Mar 2015 10:59:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAxOaj000587; Wed, 25 Mar 2015 10:59:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251059.t2PAxOaj000587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280557 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 10:59:25 -0000 Author: arybchik Date: Wed Mar 25 10:59:24 2015 New Revision: 280557 URL: https://svnweb.freebsd.org/changeset/base/280557 Log: MFC: 279094 sfxge: more accurate calculation of maximum number of TSO segments Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:58:21 2015 (r280556) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 10:59:24 2015 (r280557) @@ -72,10 +72,10 @@ __FBSDID("$FreeBSD$"); * maximum mbuf length we might need more than a ring-ful of * descriptors, but this should not happen in practice except * due to deliberate attack. In that case we will truncate - * the output at a packet boundary. Allow for a reasonable - * minimum MSS of 512. + * the output at a packet boundary. */ -#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) +#define SFXGE_TSO_MAX_DESC \ + (SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) #define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) #ifdef SFXGE_HAVE_MQ Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:58:21 2015 (r280556) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 10:59:24 2015 (r280557) @@ -36,12 +36,22 @@ #include #include +/* Maximum size of TSO packet */ +#define SFXGE_TSO_MAX_SIZE (65535) + +/* + * Maximum number of segments to be created for a TSO packet. + * Allow for a reasonable minimum MSS of 512. + */ +#define SFXGE_TSO_MAX_SEGS howmany(SFXGE_TSO_MAX_SIZE, 512) + /* Maximum number of DMA segments needed to map an mbuf chain. With * TSO, the mbuf length may be just over 64K, divided into 2K mbuf * clusters. (The chain could be longer than this initially, but can * be shortened with m_collapse().) */ -#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) +#define SFXGE_TX_MAPPING_MAX_SEG \ + (1 + howmany(SFXGE_TSO_MAX_SIZE, MCLBYTES)) /* * Buffer mapping flags. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:00:10 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5499AE4B; Wed, 25 Mar 2015 11:00:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E477CA6; Wed, 25 Mar 2015 11:00:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB0A6A001027; Wed, 25 Mar 2015 11:00:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB0AfG001026; Wed, 25 Mar 2015 11:00:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251100.t2PB0AfG001026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:00:10 +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: r280559 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:00:10 -0000 Author: arybchik Date: Wed Mar 25 11:00:09 2015 New Revision: 280559 URL: https://svnweb.freebsd.org/changeset/base/280559 Log: MFC: 279095 sfxge: never set RX_DESCQ_EN during self-test We must not enable RX queues with random parameters when they are mapped into a VF with an untrusted driver. It's probably not a good idea to do this anyway, so take this bit out of the table test masks. Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 10:59:42 2015 (r280558) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 11:00:09 2015 (r280559) @@ -903,7 +903,7 @@ static efx_register_set_t __cs __siena_t static const uint32_t __cs __siena_table_masks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000003FF, 0xFFFF0FFF, 0xFFFFFFFF, 0x00000E7F, 0x00000000, - 0xFFFFFFFF, 0x0FFFFFFF, 0x01800000, 0x00000000, + 0xFFFFFFFE, 0x0FFFFFFF, 0x01800000, 0x00000000, 0xFFFFFFFE, 0x0FFFFFFF, 0x0C000000, 0x00000000, 0x3FFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000013FF, From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:01:04 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E4C0F97; Wed, 25 Mar 2015 11:01:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28223D48; Wed, 25 Mar 2015 11:01:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB14xv002285; Wed, 25 Mar 2015 11:01:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB14HT002284; Wed, 25 Mar 2015 11:01:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251101.t2PB14HT002284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280560 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:01:04 -0000 Author: arybchik Date: Wed Mar 25 11:01:03 2015 New Revision: 280560 URL: https://svnweb.freebsd.org/changeset/base/280560 Log: MFC: 279096 sfxge: keep fw and driver view of autoneg parameters consistent Previously the driver's view was the expected outcome of any reconfiguration even if that reconfiguration failed. Submitted by: Ben Horgan Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_phy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_phy.c Wed Mar 25 11:00:09 2015 (r280559) +++ stable/10/sys/dev/sfxge/common/efx_phy.c Wed Mar 25 11:01:03 2015 (r280560) @@ -427,6 +427,7 @@ efx_phy_adv_cap_set( { efx_port_t *epp = &(enp->en_port); efx_phy_ops_t *epop = epp->ep_epop; + uint32_t old_mask; int rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -440,6 +441,7 @@ efx_phy_adv_cap_set( if (epp->ep_adv_cap_mask == mask) goto done; + old_mask = epp->ep_adv_cap_mask; epp->ep_adv_cap_mask = mask; if ((rc = epop->epo_reconfigure(enp)) != 0) @@ -450,6 +452,17 @@ done: fail2: EFSYS_PROBE(fail2); + + epp->ep_adv_cap_mask = old_mask; + /* Reconfigure for robustness */ + if (epop->epo_reconfigure(enp) != 0) { + /* + * We may have an inconsistent view of our advertised speed + * capabilities. + */ + EFSYS_ASSERT(0); + } + fail1: EFSYS_PROBE1(fail1, int, rc); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:01:59 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9481B19A; Wed, 25 Mar 2015 11:01:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65B4ED5D; Wed, 25 Mar 2015 11:01:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB1xeW004763; Wed, 25 Mar 2015 11:01:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB1xX7004762; Wed, 25 Mar 2015 11:01:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251101.t2PB1xX7004762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280561 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:01:59 -0000 Author: arybchik Date: Wed Mar 25 11:01:58 2015 New Revision: 280561 URL: https://svnweb.freebsd.org/changeset/base/280561 Log: MFC: 279097 sfxge: check allocations are non-NULL before freeing them Caught when efx_filter_init() failed and called efx_filter_fini() in the teardown path. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Mar 25 11:01:03 2015 (r280560) +++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Mar 25 11:01:58 2015 (r280561) @@ -721,7 +721,7 @@ efx_filter_init( eftp->eft_spec); if (!eftp->eft_spec) { rc = ENOMEM; - goto fail2; + goto fail3; } memset(eftp->eft_spec, 0, eftp->eft_size * sizeof(*eftp->eft_spec)); } @@ -729,6 +729,9 @@ efx_filter_init( return (0); +fail3: + EFSYS_PROBE(fail3); + fail2: EFSYS_PROBE(fail2); efx_filter_fini(enp); @@ -755,12 +758,17 @@ efx_filter_fini( EFX_STATIC_ASSERT(sizeof(eftp->eft_bitmap[0]) == sizeof(uint32_t)); bitmap_size = (eftp->eft_size + (sizeof(uint32_t) * 8) - 1) / 8; - EFSYS_KMEM_FREE(enp->en_esip, bitmap_size, eftp->eft_bitmap); - eftp->eft_bitmap = NULL; + if (eftp->eft_bitmap != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, bitmap_size, + eftp->eft_bitmap); + eftp->eft_bitmap = NULL; + } - EFSYS_KMEM_FREE(enp->en_esip, eftp->eft_size * sizeof(*eftp->eft_spec), - eftp->eft_spec); - eftp->eft_spec = NULL; + if (eftp->eft_spec != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, eftp->eft_size * + sizeof(*eftp->eft_spec), eftp->eft_spec); + eftp->eft_spec = NULL; + } } enp->en_mod_flags &= ~EFX_MOD_FILTER; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:04:14 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81B4B41F; Wed, 25 Mar 2015 11:04:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6310ED81; Wed, 25 Mar 2015 11:04:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB4EYm005230; Wed, 25 Mar 2015 11:04:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB4Dtl005220; Wed, 25 Mar 2015 11:04:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251104.t2PB4Dtl005220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280562 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:04:14 -0000 Author: arybchik Date: Wed Mar 25 11:04:12 2015 New Revision: 280562 URL: https://svnweb.freebsd.org/changeset/base/280562 Log: MFC: 279098 sfxge: allow TX and RX queue limits to be changed Before the common code had hard coded limits on the IDs RXQs and TXQs could be created with which were suited for the Windows driver with VMQ, and so would prevent queues with IDs greater than or equal to 259 (for TXQs) or 768 (for RXQs) from being created. This change allows the limits to be set in efsys.h, so that all 1024 queues can be created during new manftest tests. Also, the descriptor cache sizes were also hard coded to values suited to the smaller queue counts, and so it was necessary to make them configurable as well. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/common/siena_sram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 11:01:58 2015 (r280561) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 11:04:12 2015 (r280562) @@ -1622,6 +1622,7 @@ efx_rx_scale_toeplitz_ipv6_key_set( #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_RXQ_DC_NDESCS(_dcsize) (8 << _dcsize) typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, @@ -1708,6 +1709,7 @@ efx_tx_fini( #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize) extern __checkReturn int efx_tx_qcreate( Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 11:01:58 2015 (r280561) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 11:04:12 2015 (r280562) @@ -200,8 +200,18 @@ typedef struct efx_nic_ops_s { void (*eno_unprobe)(efx_nic_t *); } efx_nic_ops_t; -#define EFX_TXQ_LIMIT_TARGET 259 -#define EFX_RXQ_LIMIT_TARGET 768 +#ifndef EFX_TXQ_LIMIT_TARGET +# define EFX_TXQ_LIMIT_TARGET 259 +#endif +#ifndef EFX_RXQ_LIMIT_TARGET +# define EFX_RXQ_LIMIT_TARGET 768 +#endif +#ifndef EFX_TXQ_DC_SIZE +#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ +#endif +#ifndef EFX_RXQ_DC_SIZE +#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ +#endif #if EFSYS_OPT_FILTER Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 11:01:58 2015 (r280561) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 11:04:12 2015 (r280562) @@ -365,7 +365,8 @@ siena_board_cfg( } encp->enc_buftbl_limit = SIENA_SRAM_ROWS - - (encp->enc_txq_limit * 16) - (encp->enc_rxq_limit * 64); + (encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) - + (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); return (0); Modified: stable/10/sys/dev/sfxge/common/siena_sram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_sram.c Wed Mar 25 11:01:58 2015 (r280561) +++ stable/10/sys/dev/sfxge/common/siena_sram.c Wed Mar 25 11:04:12 2015 (r280562) @@ -44,20 +44,21 @@ siena_sram_init( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); rx_base = encp->enc_buftbl_limit; - tx_base = rx_base + (encp->enc_rxq_limit * 64); + tx_base = rx_base + (encp->enc_rxq_limit * + EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); /* Initialize the transmit descriptor cache */ EFX_POPULATE_OWORD_1(oword, FRF_AZ_SRM_TX_DC_BASE_ADR, tx_base); EFX_BAR_WRITEO(enp, FR_AZ_SRM_TX_DC_CFG_REG, &oword); - EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_DC_SIZE, 1); /* 16 descriptors */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_DC_SIZE, EFX_TXQ_DC_SIZE); EFX_BAR_WRITEO(enp, FR_AZ_TX_DC_CFG_REG, &oword); /* Initialize the receive descriptor cache */ EFX_POPULATE_OWORD_1(oword, FRF_AZ_SRM_RX_DC_BASE_ADR, rx_base); EFX_BAR_WRITEO(enp, FR_AZ_SRM_RX_DC_CFG_REG, &oword); - EFX_POPULATE_OWORD_1(oword, FRF_AZ_RX_DC_SIZE, 3); /* 64 descriptors */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_RX_DC_SIZE, EFX_RXQ_DC_SIZE); EFX_BAR_WRITEO(enp, FR_AZ_RX_DC_CFG_REG, &oword); /* Set receive descriptor pre-fetch low water mark */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:06:20 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8B516A7; Wed, 25 Mar 2015 11:06:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 893DFD96; Wed, 25 Mar 2015 11:06:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB6KLc005572; Wed, 25 Mar 2015 11:06:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB6HXJ005562; Wed, 25 Mar 2015 11:06:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251106.t2PB6HXJ005562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280563 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:06:20 -0000 Author: arybchik Date: Wed Mar 25 11:06:16 2015 New Revision: 280563 URL: https://svnweb.freebsd.org/changeset/base/280563 Log: MFC: 279141 sfxge: style fixes and cleanup Sync endif comment with conditional. BOOTROM and SIENA_BOOTROM are the same, but highlight that it is Siena. Restore commented out assertion. Sync comments with out-of-tree driver. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_filter.c stable/10/sys/dev/sfxge/common/efx_mcdi.c stable/10/sys/dev/sfxge/common/efx_nic.c stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/common/siena_mac.c stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/common/siena_nvram.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 11:06:16 2015 (r280563) @@ -654,7 +654,7 @@ out: return (should_abort); } -#endif /* EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_MCDI */ __checkReturn int efx_ev_qprime( @@ -970,7 +970,7 @@ efx_ev_qcreate( eep->ee_handler[FSE_AZ_EV_CODE_DRV_GEN_EV] = efx_ev_drv_gen; #if EFSYS_OPT_MCDI eep->ee_handler[FSE_AZ_EV_CODE_MCDI_EVRESPONSE] = efx_ev_mcdi; -#endif /* EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_MCDI */ /* Set up the new event queue */ if (enp->en_family != EFX_FAMILY_FALCON) { Modified: stable/10/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Mar 25 11:06:16 2015 (r280563) @@ -412,7 +412,7 @@ efx_filter_search( __in uint32_t key, __in boolean_t for_insert, __out int *filter_index, - __out int *depth_required) + __out unsigned int *depth_required) { unsigned hash, incr, filter_idx, depth; @@ -528,7 +528,8 @@ efx_filter_remove_filter( efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id]; efx_filter_spec_t *saved_spec; efx_oword_t filter; - int filter_idx, depth; + int filter_idx; + unsigned int depth; int state; uint32_t key; int rc; @@ -561,7 +562,7 @@ efx_filter_remove_index( __in int index) { efx_filter_t *efp = &enp->en_filter; - enum efx_filter_tbl_id tbl_id = efx_filter_tbl_id(type); + efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(type); efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id]; int state; Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 11:06:16 2015 (r280563) @@ -532,7 +532,7 @@ efx_mcdi_version( version: /* The bootrom doesn't understand BOOT_STATUS */ - if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM) { + if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM) { status = EFX_MCDI_BOOT_ROM; goto out; } Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Wed Mar 25 11:06:16 2015 (r280563) @@ -249,10 +249,13 @@ efx_nic_create( #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops; - enp->en_features = EFX_FEATURE_IPV6 | + enp->en_features = + EFX_FEATURE_IPV6 | EFX_FEATURE_LFSR_HASH_INSERT | - EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS | - EFX_FEATURE_WOL | EFX_FEATURE_MCDI | + EFX_FEATURE_LINK_EVENTS | + EFX_FEATURE_PERIODIC_MAC_STATS | + EFX_FEATURE_WOL | + EFX_FEATURE_MCDI | EFX_FEATURE_LOOKAHEAD_SPLIT | EFX_FEATURE_MAC_HEADER_FILTERS; break; Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 11:06:16 2015 (r280563) @@ -289,8 +289,9 @@ efx_tx_qcreate( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); - EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); - /* EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);*/ + EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == + (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); + EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); if (!ISP2(n) || !(n & EFX_TXQ_NDESCS_MASK)) { Modified: stable/10/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mac.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/siena_mac.c Wed Mar 25 11:06:16 2015 (r280563) @@ -534,6 +534,7 @@ siena_mac_stats_update( &generation_start); /* Check that we didn't read the stats in the middle of a DMA */ + /* Not a good enough check ? */ if (memcmp(&generation_start, &generation_end, sizeof (generation_start))) return (EAGAIN); Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 11:06:16 2015 (r280563) @@ -478,7 +478,7 @@ siena_phy_cfg( if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS, GET_PHY_CFG_OUT_BIST)) encp->enc_bist_mask |= (1 << EFX_PHY_BIST_TYPE_NORMAL); -#endif /* EFSYS_OPT_BIST */ +#endif /* EFSYS_OPT_PHY_BIST */ return (0); Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 11:06:16 2015 (r280563) @@ -612,7 +612,7 @@ siena_nvram_get_subtype( if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST + - (partn + 1) * sizeof(efx_word_t)) { + (partn + 1) * sizeof (efx_word_t)) { rc = ENOENT; goto fail3; } Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 11:04:12 2015 (r280562) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 11:06:16 2015 (r280563) @@ -505,7 +505,7 @@ sfxge_tx_qdpl_service(struct sfxge_txq * * list", otherwise we atomically push it on the "put list". The swizzle * function takes care of ordering. * - * The length of the put list is bounded by SFXGE_TX_MAX_DEFFERED. We + * The length of the put list is bounded by SFXGE_TX_MAX_DEFERRED. We * overload the csum_data field in the mbuf to keep track of this length * because there is no cheap alternative to avoid races. */ @@ -569,7 +569,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, /* * Called from if_transmit - will try to grab the txq lock and enqueue to the - * put list if it succeeds, otherwise will push onto the defer list. + * put list if it succeeds, otherwise try to push onto the defer list if space. */ int sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:07:11 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAB817F6; Wed, 25 Mar 2015 11:07:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4B72DAE; Wed, 25 Mar 2015 11:07:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB7BBe005735; Wed, 25 Mar 2015 11:07:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB7BvN005734; Wed, 25 Mar 2015 11:07:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251107.t2PB7BvN005734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:07: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: r280564 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:07:11 -0000 Author: arybchik Date: Wed Mar 25 11:07:10 2015 New Revision: 280564 URL: https://svnweb.freebsd.org/changeset/base/280564 Log: MFC: 279142 sfxge: synchronize EF10 registers header Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Wed Mar 25 11:06:16 2015 (r280563) +++ stable/10/sys/dev/sfxge/common/efx_regs_ef10.h Wed Mar 25 11:07:10 2015 (r280564) @@ -1732,8 +1732,8 @@ extern "C" { #define ESF_DZ_RX_U_QST1_SPARE_WIDTH 12 #define ESF_DZ_RX_U_SOFT16_B0R3_0_LBN 48 #define ESF_DZ_RX_U_SOFT16_B0R3_0_WIDTH 16 -#define ESF_DZ_RX_U_PKT_EDIT_LBN 51 -#define ESF_DZ_RX_U_PKT_EDIT_WIDTH 1 +#define ESF_DZ_RX_U_TIMESTAMP_LBN 51 +#define ESF_DZ_RX_U_TIMESTAMP_WIDTH 1 #define ESF_DZ_RX_U_DOORBELL_ENABLED_LBN 50 #define ESF_DZ_RX_U_DOORBELL_ENABLED_WIDTH 1 #define ESF_DZ_RX_U_WORK_PENDING_LBN 49 @@ -2677,6 +2677,138 @@ extern "C" { #define ESF_DZ_B2T_CPL_RSP_CPL_ADRS_WIDTH 7 + +/* Enum DPCPU_INSTR_BRTYPE */ +#define ESE_DZ_BNEZAL 19 +#define ESE_DZ_BEQZAL 18 +#define ESE_DZ_BGEZAL 17 +#define ESE_DZ_BLTZAL 16 +#define ESE_DZ_BNEZ 3 +#define ESE_DZ_BEQZ 2 +#define ESE_DZ_BGEZ 1 +#define ESE_DZ_BLTZ 0 + +/* Enum DPCPU_INSTR_FUNCT */ +#define ESE_DZ_MASKMOD 44 +#define ESE_DZ_SLTU 43 +#define ESE_DZ_SLT 42 +#define ESE_DZ_INCMOD 40 +#define ESE_DZ_NOR 39 +#define ESE_DZ_XOR 38 +#define ESE_DZ_OR 37 +#define ESE_DZ_AND 36 +#define ESE_DZ_SUBU 35 +#define ESE_DZ_SUB 34 +#define ESE_DZ_ADDU 33 +#define ESE_DZ_ADD 32 +#define ESE_DZ_MULT 25 +#define ESE_DZ_MFLO 18 +#define ESE_DZ_MFHI 16 +#define ESE_DZ_JALR 9 +#define ESE_DZ_JR 8 +#define ESE_DZ_SRAV 7 +#define ESE_DZ_SRLV 6 +#define ESE_DZ_SLLV 4 +#define ESE_DZ_SRA 3 +#define ESE_DZ_SRL 2 +#define ESE_DZ_SLL 0 + +/* Enum DPCPU_INSTR_OP */ +#define ESE_DZ_LM_MSG 49 +#define ESE_DZ_MSG 48 +#define ESE_DZ_SHA 43 +#define ESE_DZ_SBA 42 +#define ESE_DZ_SH 41 +#define ESE_DZ_SB 40 +#define ESE_DZ_LHUA 39 +#define ESE_DZ_LBUA 38 +#define ESE_DZ_LHU 37 +#define ESE_DZ_LBU 36 +#define ESE_DZ_LHA 35 +#define ESE_DZ_LBA 34 +#define ESE_DZ_LH 33 +#define ESE_DZ_LB 32 +#define ESE_DZ_BGTU 31 +#define ESE_DZ_BLEU 30 +#define ESE_DZ_MODI 28 +#define ESE_DZ_NEGU 27 +#define ESE_DZ_NEG 26 +#define ESE_DZ_LI 25 +#define ESE_DZ_INCMODI 24 +#define ESE_DZ_BGT 23 +#define ESE_DZ_BLE 22 +#define ESE_DZ_BBS 21 +#define ESE_DZ_BBC 20 +#define ESE_DZ_JAL_EVT 19 +#define ESE_DZ_J_EVT 18 +#define ESE_DZ_HALT 16 +#define ESE_DZ_NORI 15 +#define ESE_DZ_XORI 14 +#define ESE_DZ_ORI 13 +#define ESE_DZ_ANDI 12 +#define ESE_DZ_SLTIU 11 +#define ESE_DZ_SLTI 10 +#define ESE_DZ_ADDIU 9 +#define ESE_DZ_ADDI 8 +#define ESE_DZ_BGTZ 7 +#define ESE_DZ_BLEZ 6 +#define ESE_DZ_BNE 5 +#define ESE_DZ_BEQ 4 +#define ESE_DZ_JAL 3 +#define ESE_DZ_J 2 +#define ESE_DZ_BRANCH 1 +#define ESE_DZ_REG2REG 0 + +/* Enum DPCPU_MSG_DIR */ +#define ESE_DPCPU_MSG_DZ_OUTB 0x1 +#define ESE_DPCPU_MSG_DZ_INB 0x0 + +/* Enum DPCPU_PDBUS_OP */ +#define ESE_DPCPU_PDBUS_DZ_RD 0x1 +#define ESE_DPCPU_PDBUS_DZ_WR 0x0 + +/* Enum INI_OP */ +#define ESE_DZ_RD_COMPL 0x3 +#define ESE_DZ_NOP 0x2 +#define ESE_DZ_WR 0x1 +#define ESE_DZ_RD 0x0 + +/* Enum INT_OP */ +#define ESE_DZ_LEGACY 0x2 +#define ESE_DZ_MSI 0x1 +#define ESE_DZ_MSIX 0x0 + +/* Enum PKT_STRM_CTL */ +#define ESE_DZ_EOP_TRUNC 0x3 +#define ESE_DZ_EOP_CRC_ERR 0x2 +#define ESE_DZ_EOP 0x1 +#define ESE_DZ_NOOP 0x0 + +/* Enum PM_EPI_PKT_MARKER */ +#define ESE_DZ_PM_EPI_LST 0x3 +#define ESE_DZ_PM_EPI_OBL 0x2 +#define ESE_DZ_PM_EPI_TBL 0x1 +#define ESE_DZ_PM_EPI_MDL 0x0 + +/* Enum PM_IPI_TO_PM_MM_COMMAND */ +#define ESE_DZ_FREE_CHAIN 0x3 +#define ESE_DZ_FREE_BUFFER 0x2 +#define ESE_DZ_ADD_BUFFER 0x1 +#define ESE_DZ_PM_MM_NOOP 0x0 + +/* Enum PM_MA_TO_PM_EPI_COMMAND */ +#define ESE_DZ_FROM_PORT_D 0x4 +#define ESE_DZ_FROM_PORT_C 0x3 +#define ESE_DZ_FROM_PORT_B 0x2 +#define ESE_DZ_FROM_PORT_A 0x1 +#define ESE_DZ_PM_EPI_NOOP 0x0 + +/* Enum PM_MA_TO_PM_IPI_COMMAND */ +#define ESE_DZ_TO_PORT_D 0x4 +#define ESE_DZ_TO_PORT_C 0x3 +#define ESE_DZ_TO_PORT_B 0x2 +#define ESE_DZ_TO_PORT_A 0x1 +#define ESE_DZ_PM_IPI_NOOP 0x0 #ifdef __cplusplus } #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:07:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70B7093A; Wed, 25 Mar 2015 11:07:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40801DBC; Wed, 25 Mar 2015 11:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB7vlA005880; Wed, 25 Mar 2015 11:07:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB7vR1005879; Wed, 25 Mar 2015 11:07:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251107.t2PB7vR1005879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280565 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:07:57 -0000 Author: arybchik Date: Wed Mar 25 11:07:56 2015 New Revision: 280565 URL: https://svnweb.freebsd.org/changeset/base/280565 Log: MFC: 279143 sfxge: use common definitions of MC shared memory offsets and PDU length Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 11:07:10 2015 (r280564) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 11:07:56 2015 (r280565) @@ -35,15 +35,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MCDI -/* Shared memory layout */ - -#define MCDI_P1_DBL_OFST 0x0 -#define MCDI_P2_DBL_OFST 0x1 -#define MCDI_P1_PDU_OFST 0x2 -#define MCDI_P2_PDU_OFST 0x42 -#define MCDI_P1_REBOOT_OFST 0x1fe -#define MCDI_P2_REBOOT_OFST 0x1ff - /* * A reboot/assertion causes the MCDI status word to be set after the * command word is set or a REBOOT event is sent. If we notice a reboot @@ -72,12 +63,12 @@ efx_mcdi_request_start( switch (emip->emi_port) { case 1: - pdur = MCDI_P1_PDU_OFST; - dbr = MCDI_P1_DBL_OFST; + pdur = MC_SMEM_P0_PDU_OFST >> 2; + dbr = MC_SMEM_P0_DOORBELL_OFST >> 2; break; case 2: - pdur = MCDI_P2_PDU_OFST; - dbr = MCDI_P2_DBL_OFST; + pdur = MC_SMEM_P1_PDU_OFST >> 2; + dbr = MC_SMEM_P1_DOORBELL_OFST >> 2; break; default: EFSYS_ASSERT(0); @@ -140,7 +131,9 @@ efx_mcdi_request_copyout( unsigned int pdur; efx_dword_t data; - pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST; + pdur = (emip->emi_port == 1) + ? MC_SMEM_P0_PDU_OFST >> 2 + : MC_SMEM_P1_PDU_OFST >> 2; /* Copy payload out if caller supplied buffer */ if (emrp->emr_out_buf != NULL) { @@ -227,8 +220,8 @@ efx_mcdi_poll_reboot( EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); rebootr = ((emip->emi_port == 1) - ? MCDI_P1_REBOOT_OFST - : MCDI_P2_REBOOT_OFST); + ? MC_SMEM_P0_STATUS_OFST >> 2 + : MC_SMEM_P1_STATUS_OFST >> 2); EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE); value = EFX_DWORD_FIELD(dword, EFX_DWORD_0); @@ -281,7 +274,9 @@ efx_mcdi_request_poll( } EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); - pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST; + pdur = (emip->emi_port == 1) + ? MC_SMEM_P0_PDU_OFST >> 2 + : MC_SMEM_P1_PDU_OFST >> 2; /* Read the command header */ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:08:42 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1C57A87; Wed, 25 Mar 2015 11:08:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD71DCB; Wed, 25 Mar 2015 11:08:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB8gIO006038; Wed, 25 Mar 2015 11:08:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB8g7C006037; Wed, 25 Mar 2015 11:08:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251108.t2PB8g7C006037@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:08: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: r280566 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 11:08:42 -0000 Author: arybchik Date: Wed Mar 25 11:08:41 2015 New Revision: 280566 URL: https://svnweb.freebsd.org/changeset/base/280566 Log: MFC: 279144 sfxge: packet can't require more than n_dma_seg descriptors plus one Use remaining number of DMA segment instead of maximum number in mapping when checking space for one more TSO segment packet. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 11:07:56 2015 (r280565) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 11:08:41 2015 (r280566) @@ -1103,8 +1103,8 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq * the remainder of the input mbuf but do not * roll back the work we have done. */ - if (txq->n_pend_desc > - SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) { + if (txq->n_pend_desc + 1 /* header */ + n_dma_seg > + SFXGE_TSO_MAX_DESC) { txq->tso_pdrop_too_many++; break; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:09:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23321BD0; Wed, 25 Mar 2015 11:09:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D27EDDA; Wed, 25 Mar 2015 11:09:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PB9ZbP006211; Wed, 25 Mar 2015 11:09:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PB9Z6B006210; Wed, 25 Mar 2015 11:09:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251109.t2PB9Z6B006210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:09: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: r280567 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:09:36 -0000 Author: arybchik Date: Wed Mar 25 11:09:35 2015 New Revision: 280567 URL: https://svnweb.freebsd.org/changeset/base/280567 Log: MFC: 279145 sfxge: use macros to acquire and release BAR locks everywhere It was the result of invalid merge of the patch from out-of-tree driver. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 11:08:41 2015 (r280566) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 11:09:35 2015 (r280567) @@ -669,7 +669,7 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -681,7 +681,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ (_eop)->eo_u64[0] = bus_space_read_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ @@ -696,7 +696,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -707,7 +707,7 @@ typedef struct efsys_bar_s { KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ (_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, (_offset)); \ @@ -762,7 +762,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - SFXGE_BAR_LOCK(_esbp); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ @@ -772,7 +772,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - SFXGE_BAR_UNLOCK(_esbp); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -792,7 +792,7 @@ typedef struct efsys_bar_s { bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ (_offset), (_eqp)->eq_u64[0]); \ \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #else @@ -802,7 +802,7 @@ typedef struct efsys_bar_s { KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE3(bar_writeq, unsigned int, (_offset), \ uint32_t, (_eqp)->eq_u32[1], \ @@ -842,7 +842,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_unlock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) @@ -855,7 +855,7 @@ typedef struct efsys_bar_s { \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ - mtx_lock(&((_esbp)->esb_lock)); \ + SFXGE_BAR_LOCK(_esbp); \ \ EFSYS_PROBE5(bar_writeo, unsigned int, (_offset), \ uint32_t, (_eop)->eo_u32[3], \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:10:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AE48D27; Wed, 25 Mar 2015 11:10:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 054F9E80; Wed, 25 Mar 2015 11:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PBAugt009399; Wed, 25 Mar 2015 11:10:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PBAui7009398; Wed, 25 Mar 2015 11:10:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251110.t2PBAui7009398@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 11:10: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: r280568 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 11:10:57 -0000 Author: arybchik Date: Wed Mar 25 11:10:56 2015 New Revision: 280568 URL: https://svnweb.freebsd.org/changeset/base/280568 Log: MFC: 279146 sfxge: use sparse index to retrieve sensor value Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 11:09:35 2015 (r280567) +++ stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 11:10:56 2015 (r280568) @@ -105,6 +105,7 @@ siena_mon_decode_stats( uint16_t mc_sensor; size_t mc_sensor_max; uint32_t vmask = 0; + uint32_t idx = 0; /* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */ SIENA_STATIC_SENSOR_ASSERT(OK); @@ -125,18 +126,19 @@ siena_mon_decode_stats( for (mc_sensor = 0; mc_sensor < mc_sensor_max; ++mc_sensor) { uint16_t efx_sensor = sensor_map[mc_sensor]; - if (efx_sensor == SIENA_MON_WRONG_PORT) + if (~dmask & (1 << mc_sensor)) continue; - EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS); + idx++; - if (~dmask & (1 << mc_sensor)) + if (efx_sensor == SIENA_MON_WRONG_PORT) continue; + EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS); vmask |= (1 << efx_sensor); if (value != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) { efx_mon_stat_value_t *emsvp = value + efx_sensor; efx_dword_t dword; - EFSYS_MEM_READD(esmp, 4 * mc_sensor, &dword); + EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword); emsvp->emsv_value = (uint16_t)EFX_DWORD_FIELD( dword, From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 11:12:49 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE4F5E86; Wed, 25 Mar 2015 11:12:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF83E9C; Wed, 25 Mar 2015 11:12:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PBCnhT010174; Wed, 25 Mar 2015 11:12:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PBCmmK010170; Wed, 25 Mar 2015 11:12:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251112.t2PBCmmK010170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 11:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280569 - in stable/10/sys/dev/usb: . quirk serial 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.18-1 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, 25 Mar 2015 11:12:50 -0000 Author: hselasky Date: Wed Mar 25 11:12:48 2015 New Revision: 280569 URL: https://svnweb.freebsd.org/changeset/base/280569 Log: MFC r279725: Add more USB IDs. PR: 197753 Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Mar 25 11:10:56 2015 (r280568) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Mar 25 11:12:48 2015 (r280569) @@ -483,7 +483,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), - + USB_QUIRK(QUALCOMMINC, ZTE_MF730M, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0), /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Wed Mar 25 11:10:56 2015 (r280568) +++ stable/10/sys/dev/usb/serial/u3g.c Wed Mar 25 11:12:48 2015 (r280569) @@ -481,6 +481,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), + /* the following is a RNDIS device, no modem features */ + U3G_DEV(QUALCOMMINC, ZTE_MF730M, U3GINIT_SCSIEJECT), U3G_DEV(QUANTA, GKE, 0), U3G_DEV(QUANTA, GLE, 0), U3G_DEV(QUANTA, GLX, 0), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed Mar 25 11:10:56 2015 (r280568) +++ stable/10/sys/dev/usb/usbdevs Wed Mar 25 11:12:48 2015 (r280569) @@ -3649,6 +3649,7 @@ product QUALCOMMINC E0086 0x0086 3G mode product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z +product QUALCOMMINC ZTE_MF730M 0x1420 3G modem product QUALCOMMINC MF195E_INIT 0x1514 MF195E initial product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 12:57:44 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E845FB; Wed, 25 Mar 2015 12:57:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76F74D1B; Wed, 25 Mar 2015 12:57:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCvihj058791; Wed, 25 Mar 2015 12:57:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCvinQ058790; Wed, 25 Mar 2015 12:57:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251257.t2PCvinQ058790@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 12:57: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: r280575 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 12:57:44 -0000 Author: arybchik Date: Wed Mar 25 12:57:43 2015 New Revision: 280575 URL: https://svnweb.freebsd.org/changeset/base/280575 Log: MFC: 279147 sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 12:46:19 2015 (r280574) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 12:57:43 2015 (r280575) @@ -67,16 +67,22 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_tx.h" -/* Set the block level to ensure there is space to generate a - * large number of descriptors for TSO. With minimum MSS and - * maximum mbuf length we might need more than a ring-ful of - * descriptors, but this should not happen in practice except - * due to deliberate attack. In that case we will truncate - * the output at a packet boundary. +/* + * Estimate maximum number of Tx descriptors required for TSO packet. + * With minimum MSS and maximum mbuf length we might need more (even + * than a ring-ful of descriptors), but this should not happen in + * practice except due to deliberate attack. In that case we will + * truncate the output at a packet boundary. */ #define SFXGE_TSO_MAX_DESC \ (SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) -#define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) + +/* + * Set the block level to ensure there is space to generate a + * large number of descriptors for TSO. + */ +#define SFXGE_TXQ_BLOCK_LEVEL(_entries) \ + (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC) #ifdef SFXGE_HAVE_MQ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 12:59:02 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B382F3FF; Wed, 25 Mar 2015 12:59:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C81AD39; Wed, 25 Mar 2015 12:59:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCx2d2059699; Wed, 25 Mar 2015 12:59:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCx2Mx059698; Wed, 25 Mar 2015 12:59:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251259.t2PCx2Mx059698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 12:59: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: r280576 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 12:59:02 -0000 Author: arybchik Date: Wed Mar 25 12:59:01 2015 New Revision: 280576 URL: https://svnweb.freebsd.org/changeset/base/280576 Log: MFC: 279172 sfxge: add new identities to Siena static config Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/siena_flash.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_flash.h Wed Mar 25 12:57:43 2015 (r280575) +++ stable/10/sys/dev/sfxge/common/siena_flash.h Wed Mar 25 12:59:01 2015 (r280576) @@ -81,7 +81,9 @@ typedef struct siena_mc_static_config_hd efx_byte_t green_mode_valid; /* Whether cal holds a valid value */ efx_word_t mac_addr_count; efx_word_t mac_addr_stride; - efx_dword_t reserved2[2]; /* (write as zero) */ + efx_word_t calibrated_vref; + efx_word_t adc_vref; + efx_dword_t reserved2[1]; /* (write as zero) */ efx_dword_t num_dbi_items; struct { efx_word_t addr; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 12:59:51 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85FB854F; Wed, 25 Mar 2015 12:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55464D48; Wed, 25 Mar 2015 12:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCxpA9059846; Wed, 25 Mar 2015 12:59:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCxobj059844; Wed, 25 Mar 2015 12:59:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251259.t2PCxobj059844@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 12:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280577 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 12:59:51 -0000 Author: arybchik Date: Wed Mar 25 12:59:49 2015 New Revision: 280577 URL: https://svnweb.freebsd.org/changeset/base/280577 Log: MFC: 279173 sfxge: add missing common code NVRAM types and map from MCDI Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/siena_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 12:59:01 2015 (r280576) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 12:59:49 2015 (r280577) @@ -1024,6 +1024,10 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_MC_GOLDEN, EFX_NVRAM_PHY, EFX_NVRAM_NULLPHY, + EFX_NVRAM_FPGA, + EFX_NVRAM_FCFW, + EFX_NVRAM_CPLD, + EFX_NVRAM_FPGA_BACKUP, EFX_NVRAM_NTYPES, } efx_nvram_type_t; Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 12:59:01 2015 (r280576) +++ stable/10/sys/dev/sfxge/common/siena_nvram.c Wed Mar 25 12:59:49 2015 (r280577) @@ -330,6 +330,14 @@ static siena_parttbl_entry_t siena_partt {MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1, 2, EFX_NVRAM_BOOTROM_CFG}, {MC_CMD_NVRAM_TYPE_PHY_PORT0, 1, EFX_NVRAM_PHY}, {MC_CMD_NVRAM_TYPE_PHY_PORT1, 2, EFX_NVRAM_PHY}, + {MC_CMD_NVRAM_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, + {MC_CMD_NVRAM_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, + {MC_CMD_NVRAM_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, + {MC_CMD_NVRAM_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, + {MC_CMD_NVRAM_TYPE_FC_FW, 1, EFX_NVRAM_FCFW}, + {MC_CMD_NVRAM_TYPE_FC_FW, 2, EFX_NVRAM_FCFW}, + {MC_CMD_NVRAM_TYPE_CPLD, 1, EFX_NVRAM_CPLD}, + {MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD}, {0, 0, 0}, }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:01:11 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ABA869A; Wed, 25 Mar 2015 13:01:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49DF8DEE; Wed, 25 Mar 2015 13:01:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD1BXM063157; Wed, 25 Mar 2015 13:01:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD1BbG063156; Wed, 25 Mar 2015 13:01:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251301.t2PD1BbG063156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:01: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: r280578 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:01:11 -0000 Author: arybchik Date: Wed Mar 25 13:01:10 2015 New Revision: 280578 URL: https://svnweb.freebsd.org/changeset/base/280578 Log: MFC: 279174 sfxge: add missing Siena sensors to common code Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 12:59:49 2015 (r280577) +++ stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 13:01:10 2015 (r280578) @@ -70,6 +70,21 @@ static __cs uint16_t __siena_mon_port0_m EFX_MON_STAT_2_5V, /* MC_CMD_SENSOR_IN_2V5 */ EFX_MON_STAT_3_3V, /* MC_CMD_SENSOR_IN_3V3 */ EFX_MON_STAT_12V, /* MC_CMD_SENSOR_IN_12V0 */ + EFX_MON_STAT_1_2VA, /* MC_CMD_SENSOR_IN_1V2A */ + EFX_MON_STAT_VREF, /* MC_CMD_SENSOR_IN_VREF */ + EFX_MON_STAT_VAOE, /* MC_CMD_SENSOR_OUT_VAOE */ + EFX_MON_STAT_AOE_TEMP, /* MC_CMD_SENSOR_AOE_TEMP */ + EFX_MON_STAT_PSU_AOE_TEMP, /* MC_CMD_SENSOR_PSU_AOE_TEMP */ + EFX_MON_STAT_PSU_TEMP, /* MC_CMD_SENSOR_PSE_TEMP */ + EFX_MON_STAT_FAN0, /* MC_CMD_SENSOR_FAN_0 */ + EFX_MON_STAT_FAN1, /* MC_CMD_SENSOR_FAN_1 */ + EFX_MON_STAT_FAN2, /* MC_CMD_SENSOR_FAN_2 */ + EFX_MON_STAT_FAN3, /* MC_CMD_SENSOR_FAN_3 */ + EFX_MON_STAT_FAN4, /* MC_CMD_SENSOR_FAN_4 */ + EFX_MON_STAT_VAOE_IN, /* MC_CMD_SENSOR_IN_VAOE */ + EFX_MON_STAT_IAOE, /* MC_CMD_SENSOR_OUT_IAOE */ + EFX_MON_STAT_IAOE_IN, /* MC_CMD_SENSOR_IN_IAOE */ + }; static __cs uint16_t __siena_mon_port1_map[] = { @@ -86,6 +101,21 @@ static __cs uint16_t __siena_mon_port1_m EFX_MON_STAT_2_5V, /* MC_CMD_SENSOR_IN_2V5 */ EFX_MON_STAT_3_3V, /* MC_CMD_SENSOR_IN_3V3 */ EFX_MON_STAT_12V, /* MC_CMD_SENSOR_IN_12V0 */ + EFX_MON_STAT_1_2VA, /* MC_CMD_SENSOR_IN_1V2A */ + EFX_MON_STAT_VREF, /* MC_CMD_SENSOR_IN_VREF */ + EFX_MON_STAT_VAOE, /* MC_CMD_SENSOR_OUT_VAOE */ + EFX_MON_STAT_AOE_TEMP, /* MC_CMD_SENSOR_AOE_TEMP */ + EFX_MON_STAT_PSU_AOE_TEMP, /* MC_CMD_SENSOR_PSU_AOE_TEMP */ + EFX_MON_STAT_PSU_TEMP, /* MC_CMD_SENSOR_PSE_TEMP */ + EFX_MON_STAT_FAN0, /* MC_CMD_SENSOR_FAN_0 */ + EFX_MON_STAT_FAN1, /* MC_CMD_SENSOR_FAN_1 */ + EFX_MON_STAT_FAN2, /* MC_CMD_SENSOR_FAN_2 */ + EFX_MON_STAT_FAN3, /* MC_CMD_SENSOR_FAN_3 */ + EFX_MON_STAT_FAN4, /* MC_CMD_SENSOR_FAN_4 */ + EFX_MON_STAT_VAOE_IN, /* MC_CMD_SENSOR_IN_VAOE */ + EFX_MON_STAT_IAOE, /* MC_CMD_SENSOR_OUT_IAOE */ + EFX_MON_STAT_IAOE_IN, /* MC_CMD_SENSOR_IN_IAOE */ + }; #define SIENA_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:01:52 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BD907E4; Wed, 25 Mar 2015 13:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF4CDFC; Wed, 25 Mar 2015 13:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD1qxh063758; Wed, 25 Mar 2015 13:01:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD1ql3063757; Wed, 25 Mar 2015 13:01:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251301.t2PD1ql3063757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 13:01: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: r280579 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:01:52 -0000 Author: hselasky Date: Wed Mar 25 13:01:51 2015 New Revision: 280579 URL: https://svnweb.freebsd.org/changeset/base/280579 Log: MFC r280345: Fix for out of order device destruction notifications when using the delist_dev() function. In addition to this change: - add a proper description of this function - add a proper witness assert inside this function - switch a nearby line to use the "cdp" pointer instead of cdev2priv() Modified: stable/10/sys/kern/kern_conf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_conf.c ============================================================================== --- stable/10/sys/kern/kern_conf.c Wed Mar 25 13:01:10 2015 (r280578) +++ stable/10/sys/kern/kern_conf.c Wed Mar 25 13:01:51 2015 (r280579) @@ -1093,9 +1093,12 @@ destroy_devl(struct cdev *dev) } dev_unlock(); - notify_destroy(dev); + if ((cdp->cdp_flags & CDP_UNREF_DTR) == 0) { + /* avoid out of order notify events */ + notify_destroy(dev); + } mtx_lock(&cdevpriv_mtx); - while ((p = LIST_FIRST(&cdev2priv(dev)->cdp_fdpriv)) != NULL) { + while ((p = LIST_FIRST(&cdp->cdp_fdpriv)) != NULL) { devfs_destroy_cdevpriv(p); mtx_lock(&cdevpriv_mtx); } @@ -1141,12 +1144,25 @@ delist_dev_locked(struct cdev *dev) devfs_destroy(dev); LIST_FOREACH(child, &dev->si_children, si_siblings) delist_dev_locked(child); + dev_unlock(); + /* ensure the destroy event is queued in order */ + notify_destroy(dev); + dev_lock(); } +/* + * This function will delist a character device and its children from + * the directory listing and create a destroy event without waiting + * for all character device references to go away. At some later point + * destroy_dev() must be called to complete the character device + * destruction. After calling this function the character device name + * can instantly be re-used. + */ void delist_dev(struct cdev *dev) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "delist_dev"); dev_lock(); delist_dev_locked(dev); dev_unlock(); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:02:34 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9459B5; Wed, 25 Mar 2015 13:02:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A88DE0D; Wed, 25 Mar 2015 13:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD2YVl063929; Wed, 25 Mar 2015 13:02:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD2YEd063928; Wed, 25 Mar 2015 13:02:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251302.t2PD2YEd063928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:02: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: r280580 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:02:34 -0000 Author: arybchik Date: Wed Mar 25 13:02:33 2015 New Revision: 280580 URL: https://svnweb.freebsd.org/changeset/base/280580 Log: MFC: 279175 sfxge: using bus_space_*_stream_* API for better portability Host-bus byte order translation is not requred. Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:01:51 2015 (r280579) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:02:33 2015 (r280580) @@ -94,6 +94,15 @@ extern "C" { #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif +#if defined(__x86_64__) +#if !defined(bus_space_read_stream_8) +#define bus_space_read_stream_8(t, h, o) \ + bus_space_read_8((t), (h), (o)) +#define bus_space_write_stream_8(t, h, o, v) \ + bus_space_write_8((t), (h), (o), (v)) +#endif +#endif + #define ENOTACTIVE EINVAL /* Memory type to use on FreeBSD */ @@ -641,8 +650,9 @@ typedef struct efsys_bar_s { if (_lock) \ SFXGE_BAR_LOCK(_esbp); \ \ - (_edp)->ed_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset)); \ + (_edp)->ed_u32[0] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset)); \ \ EFSYS_PROBE2(bar_readd, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ @@ -662,8 +672,9 @@ typedef struct efsys_bar_s { \ SFXGE_BAR_LOCK(_esbp); \ \ - (_eqp)->eq_u64[0] = bus_space_read_8((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset)); \ + (_eqp)->eq_u64[0] = bus_space_read_stream_8( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset)); \ \ EFSYS_PROBE3(bar_readq, unsigned int, (_offset), \ uint32_t, (_eqp)->eq_u32[1], \ @@ -683,10 +694,12 @@ typedef struct efsys_bar_s { if (_lock) \ SFXGE_BAR_LOCK(_esbp); \ \ - (_eop)->eo_u64[0] = bus_space_read_8((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset)); \ - (_eop)->eo_u64[1] = bus_space_read_8((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset+8)); \ + (_eop)->eo_u64[0] = bus_space_read_stream_8( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset)); \ + (_eop)->eo_u64[1] = bus_space_read_stream_8( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset) + 8); \ \ EFSYS_PROBE5(bar_reado, unsigned int, (_offset), \ uint32_t, (_eop)->eo_u32[3], \ @@ -709,10 +722,12 @@ typedef struct efsys_bar_s { \ SFXGE_BAR_LOCK(_esbp); \ \ - (_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset)); \ - (_eqp)->eq_u32[1] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset+4)); \ + (_eqp)->eq_u32[0] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset)); \ + (_eqp)->eq_u32[1] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset) + 4); \ \ EFSYS_PROBE3(bar_readq, unsigned int, (_offset), \ uint32_t, (_eqp)->eq_u32[1], \ @@ -732,14 +747,18 @@ typedef struct efsys_bar_s { if (_lock) \ SFXGE_BAR_LOCK(_esbp); \ \ - (_eop)->eo_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset)); \ - (_eop)->eo_u32[1] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset+4)); \ - (_eop)->eo_u32[2] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset+8)); \ - (_eop)->eo_u32[3] = bus_space_read_4((_esbp)->esb_tag, \ - (_esbp)->esb_handle, (_offset+12)); \ + (_eop)->eo_u32[0] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset)); \ + (_eop)->eo_u32[1] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset) + 4); \ + (_eop)->eo_u32[2] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset) + 8); \ + (_eop)->eo_u32[3] = bus_space_read_stream_4( \ + (_esbp)->esb_tag, (_esbp)->esb_handle, \ + (_offset) + 12); \ \ EFSYS_PROBE5(bar_reado, unsigned int, (_offset), \ uint32_t, (_eop)->eo_u32[3], \ @@ -767,7 +786,8 @@ typedef struct efsys_bar_s { EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ (_offset), (_edp)->ed_u32[0]); \ \ _NOTE(CONSTANTCONDITION) \ @@ -789,7 +809,8 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ - bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ + bus_space_write_stream_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u64[0]); \ \ SFXGE_BAR_UNLOCK(_esbp); \ @@ -808,10 +829,12 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u32[0]); \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ - (_offset+4), (_eqp)->eq_u32[1]); \ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ + (_offset) + 4, (_eqp)->eq_u32[1]); \ \ SFXGE_BAR_UNLOCK(_esbp); \ _NOTE(CONSTANTCONDITION) \ @@ -835,10 +858,12 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ - bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ + bus_space_write_stream_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u64[0]); \ - bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\ - (_offset+8), (_eop)->eo_u64[1]); \ + bus_space_write_stream_8((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ + (_offset) + 8, (_eop)->eo_u64[1]); \ \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ @@ -863,14 +888,18 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u32[0]); \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ - (_offset+4), (_eop)->eo_u32[1]); \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ - (_offset+8), (_eop)->eo_u32[2]); \ - bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ - (_offset+12), (_eop)->eo_u32[3]); \ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ + (_offset) + 4, (_eop)->eo_u32[1]); \ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ + (_offset) + 8, (_eop)->eo_u32[2]); \ + bus_space_write_stream_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, \ + (_offset) + 12, (_eop)->eo_u32[3]); \ \ _NOTE(CONSTANTCONDITION) \ if (_lock) \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:03:37 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CF38B8D; Wed, 25 Mar 2015 13:03:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65DDAE2A; Wed, 25 Mar 2015 13:03:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD3bWj064199; Wed, 25 Mar 2015 13:03:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD3b18064198; Wed, 25 Mar 2015 13:03:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251303.t2PD3b18064198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:03: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: r280581 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:03:37 -0000 Author: arybchik Date: Wed Mar 25 13:03:36 2015 New Revision: 280581 URL: https://svnweb.freebsd.org/changeset/base/280581 Log: MFC: 279176 sfxge: pass correct address to free allocated memory in the case of load error It is one more place missed in the previous fix. Most likely is was just memory leak on the error handling path since typically efsys_mem_t is filled in by zeros on allocation. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 13:02:33 2015 (r280580) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 13:03:36 2015 (r280581) @@ -164,8 +164,8 @@ sfxge_dma_alloc(struct sfxge_softc *sc, * wrong. */ if (esmp->esm_addr == 0) { - bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); - bus_dma_tag_destroy(esmp->esm_tag); + bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); + bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:04:30 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF0C9DAE; Wed, 25 Mar 2015 13:04:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEDC9E3F; Wed, 25 Mar 2015 13:04:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD4Ta3064376; Wed, 25 Mar 2015 13:04:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD4T5n064375; Wed, 25 Mar 2015 13:04:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251304.t2PD4T5n064375@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:04: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: r280582 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:04:30 -0000 Author: arybchik Date: Wed Mar 25 13:04:28 2015 New Revision: 280582 URL: https://svnweb.freebsd.org/changeset/base/280582 Log: MFC: 279177 sfxge: assert event queue lock in event handlers It is useful to highlight lock context. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:03:36 2015 (r280581) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:04:28 2015 (r280582) @@ -45,6 +45,8 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq struct sfxge_rxq *rxq; struct sfxge_txq *txq; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; index = evq->index; rxq = sc->rxq[index]; @@ -84,6 +86,8 @@ sfxge_ev_rx(void *arg, uint32_t label, u struct sfxge_rx_sw_desc *rx_desc; evq = arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; if (evq->exception) @@ -135,6 +139,8 @@ sfxge_ev_exception(void *arg, uint32_t c struct sfxge_softc *sc; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; evq->exception = B_TRUE; @@ -160,6 +166,8 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; rxq = sc->rxq[rxq_index]; @@ -192,6 +200,8 @@ sfxge_ev_rxq_flush_failed(void *arg, uin uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; rxq = sc->rxq[rxq_index]; @@ -233,6 +243,8 @@ sfxge_ev_tx(void *arg, uint32_t label, u unsigned int delta; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); @@ -273,6 +285,8 @@ sfxge_ev_txq_flush_done(void *arg, uint3 uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; txq = sc->txq[txq_index]; @@ -303,6 +317,8 @@ sfxge_ev_software(void *arg, uint16_t ma unsigned int label; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; label = magic & SFXGE_MAGIC_DMAQ_LABEL_MASK; @@ -528,6 +544,7 @@ sfxge_ev_initialized(void *arg) struct sfxge_evq *evq; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); KASSERT(evq->init_state == SFXGE_EVQ_STARTING, ("evq not starting")); @@ -544,6 +561,8 @@ sfxge_ev_link_change(void *arg, efx_link struct sfxge_softc *sc; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; sfxge_mac_link_update(sc, link_mode); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:05:34 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13265AA; Wed, 25 Mar 2015 13:05:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F061CE53; Wed, 25 Mar 2015 13:05:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD5XFe064647; Wed, 25 Mar 2015 13:05:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD5XTr064646; Wed, 25 Mar 2015 13:05:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251305.t2PD5XTr064646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:05: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: r280584 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:05:34 -0000 Author: arybchik Date: Wed Mar 25 13:05:33 2015 New Revision: 280584 URL: https://svnweb.freebsd.org/changeset/base/280584 Log: MFC: 279178 sfxge: do no allow EFSYS_MEM_ALLOC sleep It solves locking problem when EFSYS_MEM_ALLOC is called in the context holding a mutex (not allowed to sleep). E.g. on interface bring up or multicast addresses addition. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:17 2015 (r280583) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:33 2015 (r280584) @@ -941,7 +941,11 @@ typedef clock_t efsys_timestamp_t; #define EFSYS_KMEM_ALLOC(_esip, _size, _p) \ do { \ (_esip) = (_esip); \ - (_p) = malloc((_size), M_SFXGE, M_WAITOK|M_ZERO); \ + /* \ + * The macro is used in non-sleepable contexts, for \ + * example, holding a mutex. \ + */ \ + (_p) = malloc((_size), M_SFXGE, M_NOWAIT|M_ZERO); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:06:39 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58F09200; Wed, 25 Mar 2015 13:06:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF98E66; Wed, 25 Mar 2015 13:06:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD6d5P064894; Wed, 25 Mar 2015 13:06:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD6ccl064892; Wed, 25 Mar 2015 13:06:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251306.t2PD6ccl064892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:06: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: r280585 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:06:39 -0000 Author: arybchik Date: Wed Mar 25 13:06:37 2015 New Revision: 280585 URL: https://svnweb.freebsd.org/changeset/base/280585 Log: MFC: 279179 sfxge: DMA allocated memory is set to zeros because of BUS_DMA_ZERO flag It is not required to set it to zeros once again. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:05:33 2015 (r280584) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:06:37 2015 (r280585) @@ -1113,7 +1113,6 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u /* Allocate and zero DMA space. */ if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(sc->rxq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(sc->rxq_entries)); /* Allocate buffer table entries. */ sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(sc->rxq_entries), Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:05:33 2015 (r280584) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:06:37 2015 (r280585) @@ -1399,7 +1399,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u /* Allocate and zero DMA space for the descriptor ring. */ if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(sc->txq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(sc->txq_entries)); /* Allocate buffer table entries. */ sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(sc->txq_entries), From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:09:47 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E599C594; Wed, 25 Mar 2015 13:09:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CED87E95; Wed, 25 Mar 2015 13:09:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PD9lhl065376; Wed, 25 Mar 2015 13:09:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PD9lnb065375; Wed, 25 Mar 2015 13:09:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251309.t2PD9lnb065375@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:09: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: r280587 - 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.18-1 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, 25 Mar 2015 13:09:48 -0000 Author: arybchik Date: Wed Mar 25 13:09:46 2015 New Revision: 280587 URL: https://svnweb.freebsd.org/changeset/base/280587 Log: MFC: 279181 sfxge: add indefinite article and update timestamp Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/share/man/man4/sfxge.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 13:08:57 2015 (r280586) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 13:09:46 2015 (r280587) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2014 +.Dd February 22, 2015 .Dt SFXGE 4 .Os .Sh NAME @@ -103,7 +103,7 @@ The value must be greater than 0. The maximum number of non-TCP packets in the deferred packet .Dq get-list , used only if the transmit queue lock can be acquired. -If packet is dropped, the +If a packet is dropped, the .Va tx_get_non_tcp_overflow counter is incremented and the local sender receives ENOBUFS. The value must be greater than 0. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:11:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 351236E9; Wed, 25 Mar 2015 13:11:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D933F41; Wed, 25 Mar 2015 13:11:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDBL30067676; Wed, 25 Mar 2015 13:11:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDBKIX066782; Wed, 25 Mar 2015 13:11:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251311.t2PDBKIX066782@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280588 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:11:22 -0000 Author: arybchik Date: Wed Mar 25 13:11:19 2015 New Revision: 280588 URL: https://svnweb.freebsd.org/changeset/base/280588 Log: MFC: 279182 sfxge: correct event queue interrupt moderation timer quanta Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:11:19 2015 (r280588) @@ -895,7 +895,8 @@ typedef struct efx_nic_cfg_s { uint32_t enc_txq_limit; uint32_t enc_rxq_limit; uint32_t enc_buftbl_limit; - uint32_t enc_evq_moderation_max; + uint32_t enc_evq_timer_quantum_ns; + uint32_t enc_evq_timer_max_us; uint32_t enc_clk_mult; #if EFSYS_OPT_LOOPBACK uint32_t enc_loopback_types[EFX_LINK_NMODES]; Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 13:11:19 2015 (r280588) @@ -857,7 +857,7 @@ efx_ev_qmoderate( EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); - if (us > encp->enc_evq_moderation_max) { + if (us > encp->enc_evq_timer_max_us) { rc = EINVAL; goto fail1; } @@ -876,7 +876,7 @@ efx_ev_qmoderate( uint32_t timer_val; /* Calculate the timer value in quanta */ - timer_val = us * encp->enc_clk_mult / EFX_EV_TIMER_QUANTUM; + timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; /* Moderation value is base 0 so we need to deduct 1 */ if (timer_val > 0) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:11:19 2015 (r280588) @@ -408,7 +408,8 @@ struct efx_evq_s { #define EFX_EVQ_MAGIC 0x08081997 -#define EFX_EV_TIMER_QUANTUM 5 +#define EFX_EVQ_FALCON_TIMER_QUANTUM_NS 4968 /* 621 cycles */ +#define EFX_EVQ_SIENA_TIMER_QUANTUM_NS 6144 /* 768 cycles */ struct efx_rxq_s { uint32_t er_magic; Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 13:11:19 2015 (r280588) @@ -329,8 +329,10 @@ siena_board_cfg( encp->enc_clk_mult = 2; } - encp->enc_evq_moderation_max = EFX_EV_TIMER_QUANTUM << - FRF_AB_TIMER_VAL_WIDTH / encp->enc_clk_mult; + encp->enc_evq_timer_quantum_ns = + EFX_EVQ_SIENA_TIMER_QUANTUM_NS / encp->enc_clk_mult; + encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << + FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; /* Resource limits */ req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS; Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:11:19 2015 (r280588) @@ -517,7 +517,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG * so we have to range-check the value ourselves. */ if (moderation > - efx_nic_cfg_get(sc->enp)->enc_evq_moderation_max) { + efx_nic_cfg_get(sc->enp)->enc_evq_timer_max_us) { error = EINVAL; goto out; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:12:17 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B72A690E; Wed, 25 Mar 2015 13:12:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02B5F58; Wed, 25 Mar 2015 13:12:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDCHuJ069410; Wed, 25 Mar 2015 13:12:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDCGSF069407; Wed, 25 Mar 2015 13:12:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251312.t2PDCGSF069407@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280589 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:12:17 -0000 Author: arybchik Date: Wed Mar 25 13:12:15 2015 New Revision: 280589 URL: https://svnweb.freebsd.org/changeset/base/280589 Log: MFC: 279183 sfxge: add common code support for changing TX queue pace To delay packets from a particular TX queue by a particular time, write a value into the TX Pace table s.t. pace time <= TX Pace Clock Period * (2 ^ pace value) - the TX pace clock is 1/13 of the system clock, so its period should be 104 or 52 ns depending on whether turbo mode is active. EFX_TX_PACE_CLOCK_BASE added by me. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_regs.h stable/10/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:11:19 2015 (r280588) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:12:15 2015 (r280589) @@ -1736,6 +1736,11 @@ efx_tx_qpost( __in unsigned int completed, __inout unsigned int *addedp); +extern __checkReturn int +efx_tx_qpace( + __in efx_txq_t *etp, + __in unsigned int ns); + extern void efx_tx_qpush( __in efx_txq_t *etp, Modified: stable/10/sys/dev/sfxge/common/efx_regs.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs.h Wed Mar 25 13:11:19 2015 (r280588) +++ stable/10/sys/dev/sfxge/common/efx_regs.h Wed Mar 25 13:12:15 2015 (r280589) @@ -34,6 +34,13 @@ extern "C" { #endif +/************************************************************************** + * + * Falcon/Siena registers and descriptors + * + ************************************************************************** + */ + /* * FR_AB_EE_VPD_CFG0_REG_SF(128bit): * SPI/VPD configuration register 0 @@ -3838,6 +3845,18 @@ extern "C" { #define FSF_AZ_DRIVER_EV_RX_DESCQ_ID_WIDTH 12 + +/************************************************************************** + * + * Falcon non-volatile configuration + * + ************************************************************************** + */ + + +#define FR_AZ_TX_PACE_TBL_OFST FR_BZ_TX_PACE_TBL_OFST + + #ifdef __cplusplus } #endif Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 13:11:19 2015 (r280588) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Mar 25 13:12:15 2015 (r280589) @@ -224,6 +224,53 @@ efx_tx_qpush( etp->et_index, &dword, B_FALSE); } +#define EFX_MAX_PACE_VALUE 20 +#define EFX_TX_PACE_CLOCK_BASE 104 + + __checkReturn int +efx_tx_qpace( + __in efx_txq_t *etp, + __in unsigned int ns) +{ + efx_nic_t *enp = etp->et_enp; + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_oword_t oword; + unsigned int pace_val; + unsigned int timer_period; + int rc; + + EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + + if (ns == 0) { + pace_val = 0; + } else { + /* + * The pace_val to write into the table is s.t + * ns <= timer_period * (2 ^ pace_val) + */ + timer_period = EFX_TX_PACE_CLOCK_BASE / encp->enc_clk_mult; + for (pace_val = 1; pace_val <= EFX_MAX_PACE_VALUE; pace_val++) { + if ((timer_period << pace_val) >= ns) + break; + } + } + if (pace_val > EFX_MAX_PACE_VALUE) { + rc = EINVAL; + goto fail1; + } + + /* Update the pacing table */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_PACE, pace_val); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_PACE_TBL, etp->et_index, &oword); + + return (0); + +fail1: + EFSYS_PROBE1(fail1, int, rc); + + return (rc); +} + void efx_tx_qflush( __in efx_txq_t *etp) @@ -234,6 +281,8 @@ efx_tx_qflush( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + efx_tx_qpace(etp, 0); + label = etp->et_index; /* Flush the queue */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:13:34 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3730CA81; Wed, 25 Mar 2015 13:13:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04354F78; Wed, 25 Mar 2015 13:13:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDDXto069628; Wed, 25 Mar 2015 13:13:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDDXil069627; Wed, 25 Mar 2015 13:13:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251313.t2PDDXil069627@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:13: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: r280590 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:13:34 -0000 Author: arybchik Date: Wed Mar 25 13:13:32 2015 New Revision: 280590 URL: https://svnweb.freebsd.org/changeset/base/280590 Log: MFC: 279230 sfxge: use goto to cleanup to avoid duplicate cleanup code Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 13:12:15 2015 (r280589) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 13:13:32 2015 (r280590) @@ -137,7 +137,7 @@ sfxge_dma_alloc(struct sfxge_softc *sc, MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, &esmp->esm_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); - return (ENOMEM); + goto fail_tag_create; } /* Allocate kernel memory. */ @@ -145,17 +145,14 @@ sfxge_dma_alloc(struct sfxge_softc *sc, BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, &esmp->esm_map) != 0) { device_printf(sc->dev, "Couldn't allocate DMA memory\n"); - bus_dma_tag_destroy(esmp->esm_tag); - return (ENOMEM); + goto fail_alloc; } /* Load map into device memory. */ if (bus_dmamap_load(esmp->esm_tag, esmp->esm_map, vaddr, len, sfxge_dma_cb, &esmp->esm_addr, 0) != 0) { device_printf(sc->dev, "Couldn't load DMA mapping\n"); - bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); - bus_dma_tag_destroy(esmp->esm_tag); - return (ENOMEM); + goto fail_load; } /* @@ -163,15 +160,20 @@ sfxge_dma_alloc(struct sfxge_softc *sc, * and will have set esm_addr to 0 if something went * wrong. */ - if (esmp->esm_addr == 0) { - bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); - bus_dma_tag_destroy(esmp->esm_tag); - return (ENOMEM); - } + if (esmp->esm_addr == 0) + goto fail_load_check; esmp->esm_base = vaddr; return (0); + +fail_load_check: +fail_load: + bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); +fail_alloc: + bus_dma_tag_destroy(esmp->esm_tag); +fail_tag_create: + return (ENOMEM); } void From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:14:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B416CA9; Wed, 25 Mar 2015 13:14:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7536F90; Wed, 25 Mar 2015 13:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDEQNR069924; Wed, 25 Mar 2015 13:14:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDEQSa069921; Wed, 25 Mar 2015 13:14:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251314.t2PDEQSa069921@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 13:14: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: r280591 - stable/10/sys/dev/sound/usb 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.18-1 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, 25 Mar 2015 13:14:27 -0000 Author: hselasky Date: Wed Mar 25 13:14:25 2015 New Revision: 280591 URL: https://svnweb.freebsd.org/changeset/base/280591 Log: MFC r280322 and r280429: The synchronisation value returned by the so-called feedback endpoint appears to be too inaccurate that it can be used to synchronize the playback data stream. If there is a recording endpoint associated with the playback endpoint, use that instead. That means if the isochronous OUT endpoint is asynchronus the USB audio driver will automatically start recording, if possible, to get exact information about the needed sample rate adjustments. In no recording endpoint is present, no rate adaption will be done. While at it fix an issue where the hardware buffer pointers don't get reset at the first device PCM trigger. Make some variables 32-bit to avoid problems with multithreading. Use the feedback value from the synchronization endpoint as fallback when there is no recording channel. PR: 198444 Modified: stable/10/sys/dev/sound/usb/uaudio.c stable/10/sys/dev/sound/usb/uaudio.h stable/10/sys/dev/sound/usb/uaudio_pcm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Wed Mar 25 13:13:32 2015 (r280590) +++ stable/10/sys/dev/sound/usb/uaudio.c Wed Mar 25 13:14:25 2015 (r280591) @@ -218,26 +218,25 @@ struct uaudio_chan { uint32_t sample_rem; uint32_t sample_curr; uint32_t max_buf; + int32_t jitter_rem; + int32_t jitter_curr; + + int feedback_rate; uint32_t pcm_format[2]; uint16_t bytes_per_frame[2]; - uint8_t num_alt; - uint8_t cur_alt; - uint8_t set_alt; - uint8_t operation; + uint32_t intr_counter; + uint32_t running; + uint32_t num_alt; + uint32_t cur_alt; + uint32_t set_alt; + uint32_t operation; #define CHAN_OP_NONE 0 #define CHAN_OP_START 1 #define CHAN_OP_STOP 2 #define CHAN_OP_DRAIN 3 - - /* USB audio feedback endpoint state */ - struct { - uint16_t time; /* I/O interrupt count */ - int16_t constant; /* sample rate adjustment in Hz */ - int16_t remainder; /* current remainder */ - } feedback; }; #define UMIDI_EMB_JACK_MAX 16 /* units */ @@ -1096,6 +1095,11 @@ uaudio_attach_sub(device_t dev, kobj_cla uaudio_mixer_register_sysctl(sc, dev); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "feedback_rate", CTLFLAG_RD, &sc->sc_play_chan.feedback_rate, + 0, "Feedback sample rate in Hz"); + return (0); /* success */ detach: @@ -1294,7 +1298,6 @@ uaudio_configure_msg_sub(struct uaudio_s chan->frames_per_second = fps; chan->sample_rem = chan_alt->sample_rate % fps; chan->sample_curr = 0; - chan->frames_per_second = fps; /* compute required buffer size */ buf_size = (chan->bytes_per_frame[1] * frames); @@ -1974,7 +1977,7 @@ uaudio_chan_play_sync_callback(struct us { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint64_t sample_rate = ch->usb_alt[ch->cur_alt].sample_rate; + uint64_t sample_rate; uint8_t buf[4]; uint64_t temp; int len; @@ -2017,6 +2020,8 @@ uaudio_chan_play_sync_callback(struct us temp *= 125ULL; + sample_rate = ch->usb_alt[ch->cur_alt].sample_rate; + /* auto adjust */ while (temp < (sample_rate - (sample_rate / 4))) temp *= 2; @@ -2024,35 +2029,17 @@ uaudio_chan_play_sync_callback(struct us while (temp > (sample_rate + (sample_rate / 2))) temp /= 2; - /* - * Some USB audio devices only report a sample rate - * different from the nominal one when they want one - * more or less sample. Make sure we catch this case - * by pulling the sample rate offset slowly towards - * zero if the reported value is equal to the sample - * rate. - */ - if (temp > sample_rate) - ch->feedback.constant += 1; - else if (temp < sample_rate) - ch->feedback.constant -= 1; - else if (ch->feedback.constant > 0) - ch->feedback.constant--; - else if (ch->feedback.constant < 0) - ch->feedback.constant++; - - DPRINTF("Comparing %d Hz :: %d Hz :: %d samples drift\n", - (int)temp, (int)sample_rate, (int)ch->feedback.constant); + DPRINTF("Comparing %d Hz :: %d Hz\n", + (int)temp, (int)sample_rate); /* - * Range check sync constant. We cannot change the - * number of samples per second by more than the value - * defined by "UAUDIO_IRQS": + * Use feedback value as fallback when there is no + * recording channel: */ - if (ch->feedback.constant > UAUDIO_IRQS) - ch->feedback.constant = UAUDIO_IRQS; - else if (ch->feedback.constant < -UAUDIO_IRQS) - ch->feedback.constant = -UAUDIO_IRQS; + if (ch->priv_sc->sc_rec_chan.num_alt == 0) + ch->jitter_curr = temp - sample_rate; + + ch->feedback_rate = temp; break; case USB_ST_SETUP: @@ -2066,43 +2053,98 @@ uaudio_chan_play_sync_callback(struct us } } +static int +uaudio_chan_is_async(struct uaudio_chan *ch, uint8_t alt) +{ + uint8_t attr = ch->usb_alt[alt].p_ed1->bmAttributes; + return (UE_GET_ISO_TYPE(attr) == UE_ISO_ASYNC); +} + static void uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); + struct uaudio_chan *ch_rec; struct usb_page_cache *pc; - uint32_t sample_size = ch->usb_alt[ch->cur_alt].sample_size; uint32_t mfl; uint32_t total; uint32_t blockcount; uint32_t n; uint32_t offset; + int sample_size; int actlen; int sumlen; - usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); - - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); + if (ch->running == 0 || ch->start == ch->end) { + DPRINTF("not running or no buffer!\n"); return; } + /* check if there is a record channel */ + if (ch->priv_sc->sc_rec_chan.num_alt > 0) + ch_rec = &ch->priv_sc->sc_rec_chan; + else + ch_rec = NULL; + + usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + switch (USB_GET_STATE(xfer)) { + case USB_ST_SETUP: +tr_setup: + if (ch_rec != NULL) { + /* reset receive jitter counters */ + mtx_lock(ch_rec->pcm_mtx); + ch_rec->jitter_curr = 0; + ch_rec->jitter_rem = 0; + mtx_unlock(ch_rec->pcm_mtx); + } + + /* reset transmit jitter counters */ + ch->jitter_curr = 0; + ch->jitter_rem = 0; + + /* FALLTHROUGH */ case USB_ST_TRANSFERRED: -tr_transferred: if (actlen < sumlen) { DPRINTF("short transfer, " "%d of %d bytes\n", actlen, sumlen); } chn_intr(ch->pcm_ch); + /* + * Check for asynchronous playback endpoint and that + * the playback endpoint is properly configured: + */ + if (ch_rec != NULL && + uaudio_chan_is_async(ch, ch->cur_alt) != 0) { + mtx_lock(ch_rec->pcm_mtx); + if (ch_rec->cur_alt < ch_rec->num_alt) { + int64_t tx_jitter; + int64_t rx_rate; + + /* translate receive jitter into transmit jitter */ + tx_jitter = ch->usb_alt[ch->cur_alt].sample_rate; + tx_jitter = (tx_jitter * ch_rec->jitter_curr) + + ch->jitter_rem; + + /* reset receive jitter counters */ + ch_rec->jitter_curr = 0; + ch_rec->jitter_rem = 0; + + /* compute exact number of transmit jitter samples */ + rx_rate = ch_rec->usb_alt[ch_rec->cur_alt].sample_rate; + ch->jitter_curr += tx_jitter / rx_rate; + ch->jitter_rem = tx_jitter % rx_rate; + } + mtx_unlock(ch_rec->pcm_mtx); + } + /* start the SYNC transfer one time per second, if any */ - if (++(ch->feedback.time) >= UAUDIO_IRQS) { - ch->feedback.time = 0; + if (++(ch->intr_counter) >= UAUDIO_IRQS) { + ch->intr_counter = 0; usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } - case USB_ST_SETUP: mfl = usbd_xfer_max_framelen(xfer); if (ch->bytes_per_frame[1] > mfl) { @@ -2118,6 +2160,9 @@ tr_transferred: /* setup number of frames */ usbd_xfer_set_frames(xfer, blockcount); + /* get sample size */ + sample_size = ch->usb_alt[ch->cur_alt].sample_size; + /* reset total length */ total = 0; @@ -2133,31 +2178,23 @@ tr_transferred: frame_len = ch->bytes_per_frame[0]; } - if (n == (blockcount - 1)) { - /* - * Update sync remainder and check if - * we should transmit more or less - * data: - */ - ch->feedback.remainder += ch->feedback.constant; - if (ch->feedback.remainder >= UAUDIO_IRQS) { - ch->feedback.remainder -= UAUDIO_IRQS; - DPRINTFN(6, "sending one sample more\n"); - if ((frame_len + sample_size) <= mfl) - frame_len += sample_size; - } else if (ch->feedback.remainder <= -UAUDIO_IRQS) { - ch->feedback.remainder += UAUDIO_IRQS; - DPRINTFN(6, "sending one sample less\n"); - if (frame_len >= sample_size) - frame_len -= sample_size; - } + /* handle free running clock case */ + if (ch->jitter_curr > 0 && + (frame_len + sample_size) <= mfl) { + DPRINTFN(6, "sending one sample more\n"); + ch->jitter_curr--; + frame_len += sample_size; + } else if (ch->jitter_curr < 0 && + frame_len >= sample_size) { + DPRINTFN(6, "sending one sample less\n"); + ch->jitter_curr++; + frame_len -= sample_size; } - usbd_xfer_set_frame_len(xfer, n, frame_len); total += frame_len; } - DPRINTFN(6, "transfer %d bytes\n", total); + DPRINTFN(6, "transferring %d bytes\n", total); offset = 0; @@ -2165,28 +2202,25 @@ tr_transferred: while (total > 0) { n = (ch->end - ch->cur); - if (n > total) { + if (n > total) n = total; - } + usbd_copy_in(pc, offset, ch->cur, n); total -= n; ch->cur += n; offset += n; - if (ch->cur >= ch->end) { + if (ch->cur >= ch->end) ch->cur = ch->start; - } } - usbd_transfer_submit(xfer); break; default: /* Error */ - if (error == USB_ERR_CANCELLED) { - break; - } - goto tr_transferred; + if (error != USB_ERR_CANCELLED) + goto tr_setup; + break; } } @@ -2202,36 +2236,59 @@ uaudio_chan_record_callback(struct usb_x struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t offset0; - uint32_t offset1; uint32_t mfl; int m; int n; int len; int actlen; int nframes; - int blockcount; - - usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); - mfl = usbd_xfer_max_framelen(xfer); + int expected_bytes; + int sample_size; - if (ch->end == ch->start) { + if (ch->start == ch->end) { DPRINTF("no buffer!\n"); return; } + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); + mfl = usbd_xfer_max_framelen(xfer); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - DPRINTFN(6, "transferred %d bytes\n", actlen); - offset0 = 0; pc = usbd_xfer_get_frame(xfer, 0); + /* try to compute the number of expected bytes */ + ch->sample_curr += (ch->sample_rem * ch->intr_frames); + + /* compute number of expected bytes */ + expected_bytes = (ch->intr_frames * ch->bytes_per_frame[0]) + + ((ch->sample_curr / ch->frames_per_second) * + (ch->bytes_per_frame[1] - ch->bytes_per_frame[0])); + + /* keep remainder */ + ch->sample_curr %= ch->frames_per_second; + + /* get current sample size */ + sample_size = ch->usb_alt[ch->cur_alt].sample_size; + for (n = 0; n != nframes; n++) { + uint32_t offset1 = offset0; - offset1 = offset0; len = usbd_xfer_frame_len(xfer, n); + /* make sure we only receive complete samples */ + len = len - (len % sample_size); + + /* subtract bytes received from expected payload */ + expected_bytes -= len; + + /* don't receive data when not ready */ + if (ch->running == 0 || ch->cur_alt != ch->set_alt) + continue; + + /* fill ring buffer with samples, if any */ while (len > 0) { m = (ch->end - ch->cur); @@ -2245,33 +2302,46 @@ uaudio_chan_record_callback(struct usb_x offset1 += m; ch->cur += m; - if (ch->cur >= ch->end) { + if (ch->cur >= ch->end) ch->cur = ch->start; - } } offset0 += mfl; } - chn_intr(ch->pcm_ch); + /* update current jitter */ + ch->jitter_curr -= (expected_bytes / sample_size); + + /* don't allow a huge amount of jitter to accumulate */ + nframes = 2 * ch->intr_frames; + + /* range check current jitter */ + if (ch->jitter_curr < -nframes) + ch->jitter_curr = -nframes; + else if (ch->jitter_curr > nframes) + ch->jitter_curr = nframes; + + DPRINTFN(6, "transferred %d bytes, jitter %d samples\n", + actlen, ch->jitter_curr); + + if (ch->running != 0) + chn_intr(ch->pcm_ch); case USB_ST_SETUP: tr_setup: - blockcount = ch->intr_frames; + nframes = ch->intr_frames; - usbd_xfer_set_frames(xfer, blockcount); - for (n = 0; n < blockcount; n++) { + usbd_xfer_set_frames(xfer, nframes); + for (n = 0; n != nframes; n++) usbd_xfer_set_frame_len(xfer, n, mfl); - } usbd_transfer_submit(xfer); break; default: /* Error */ - if (error == USB_ERR_CANCELLED) { - break; - } - goto tr_setup; + if (error != USB_ERR_CANCELLED) + goto tr_setup; + break; } } @@ -2344,13 +2414,7 @@ int uaudio_chan_set_param_blocksize(struct uaudio_chan *ch, uint32_t blocksize) { uint32_t temp = 2 * uaudio_get_buffer_size(ch, ch->set_alt); - sndbuf_setup(ch->pcm_buf, ch->buf, temp); - - ch->start = ch->buf; - ch->end = ch->buf + temp; - ch->cur = ch->buf; - return (temp / 2); } @@ -2364,8 +2428,11 @@ uaudio_chan_set_param_fragments(struct u int uaudio_chan_set_param_speed(struct uaudio_chan *ch, uint32_t speed) { + struct uaudio_softc *sc; uint8_t x; + sc = ch->priv_sc; + for (x = 0; x < ch->num_alt; x++) { if (ch->usb_alt[x].sample_rate < speed) { /* sample rate is too low */ @@ -2376,7 +2443,9 @@ uaudio_chan_set_param_speed(struct uaudi if (x != 0) x--; + usb_proc_explore_lock(sc->sc_udev); ch->set_alt = x; + usb_proc_explore_unlock(sc->sc_udev); DPRINTF("Selecting alt %d\n", (int)x); @@ -2447,16 +2516,16 @@ uaudio_chan_set_param_format(struct uaud return (0); } -int -uaudio_chan_start(struct uaudio_chan *ch) +static void +uaudio_chan_start_sub(struct uaudio_chan *ch) { struct uaudio_softc *sc = ch->priv_sc; int do_start = 0; - usb_proc_explore_lock(sc->sc_udev); if (ch->operation != CHAN_OP_DRAIN) { if (ch->cur_alt == ch->set_alt && - ch->operation == CHAN_OP_NONE) { + ch->operation == CHAN_OP_NONE && + mtx_owned(ch->pcm_mtx) != 0) { /* save doing the explore task */ do_start = 1; } else { @@ -2465,28 +2534,81 @@ uaudio_chan_start(struct uaudio_chan *ch &sc->sc_config_msg[0], &sc->sc_config_msg[1]); } } - usb_proc_explore_unlock(sc->sc_udev); - - /* reset feedback endpoint state */ - memset(&ch->feedback, 0, sizeof(ch->feedback)); - if (do_start) { usbd_transfer_start(ch->xfer[0]); usbd_transfer_start(ch->xfer[1]); } - return (0); } -int -uaudio_chan_stop(struct uaudio_chan *ch) +static int +uaudio_chan_need_both(struct uaudio_softc *sc) +{ + return (sc->sc_play_chan.num_alt > 0 && + sc->sc_play_chan.running != 0 && + uaudio_chan_is_async(&sc->sc_play_chan, + sc->sc_play_chan.set_alt) != 0 && + sc->sc_rec_chan.num_alt > 0 && + sc->sc_rec_chan.running == 0); +} + +static int +uaudio_chan_need_none(struct uaudio_softc *sc) +{ + return (sc->sc_play_chan.num_alt > 0 && + sc->sc_play_chan.running == 0 && + sc->sc_rec_chan.num_alt > 0 && + sc->sc_rec_chan.running == 0); +} + +void +uaudio_chan_start(struct uaudio_chan *ch) { struct uaudio_softc *sc = ch->priv_sc; - int do_stop = 0; + /* make operation atomic */ usb_proc_explore_lock(sc->sc_udev); + + /* check if not running */ + if (ch->running == 0) { + uint32_t temp; + + /* get current buffer size */ + temp = 2 * uaudio_get_buffer_size(ch, ch->set_alt); + + /* set running flag */ + ch->running = 1; + + /* ensure the hardware buffer is reset */ + ch->start = ch->buf; + ch->end = ch->buf + temp; + ch->cur = ch->buf; + + if (uaudio_chan_need_both(sc)) { + /* + * Start both endpoints because of need for + * jitter information: + */ + uaudio_chan_start_sub(&sc->sc_rec_chan); + uaudio_chan_start_sub(&sc->sc_play_chan); + } else { + uaudio_chan_start_sub(ch); + } + } + + /* exit atomic operation */ + usb_proc_explore_unlock(sc->sc_udev); +} + +static void +uaudio_chan_stop_sub(struct uaudio_chan *ch) +{ + struct uaudio_softc *sc = ch->priv_sc; + int do_stop = 0; + if (ch->operation != CHAN_OP_DRAIN) { if (ch->cur_alt == ch->set_alt && - ch->operation == CHAN_OP_NONE) { + ch->operation == CHAN_OP_NONE && + mtx_owned(ch->pcm_mtx) != 0) { /* save doing the explore task */ do_stop = 1; } else { @@ -2495,13 +2617,44 @@ uaudio_chan_stop(struct uaudio_chan *ch) &sc->sc_config_msg[0], &sc->sc_config_msg[1]); } } - usb_proc_explore_unlock(sc->sc_udev); - if (do_stop) { usbd_transfer_stop(ch->xfer[0]); usbd_transfer_stop(ch->xfer[1]); } - return (0); +} + +void +uaudio_chan_stop(struct uaudio_chan *ch) +{ + struct uaudio_softc *sc = ch->priv_sc; + + /* make operation atomic */ + usb_proc_explore_lock(sc->sc_udev); + + /* check if running */ + if (ch->running != 0) { + /* clear running flag */ + ch->running = 0; + + if (uaudio_chan_need_both(sc)) { + /* + * Leave the endpoints running because we need + * information about jitter! + */ + } else if (uaudio_chan_need_none(sc)) { + /* + * Stop both endpoints in case the one was used for + * jitter information: + */ + uaudio_chan_stop_sub(&sc->sc_rec_chan); + uaudio_chan_stop_sub(&sc->sc_play_chan); + } else { + uaudio_chan_stop_sub(ch); + } + } + + /* exit atomic operation */ + usb_proc_explore_unlock(sc->sc_udev); } /*========================================================================* Modified: stable/10/sys/dev/sound/usb/uaudio.h ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.h Wed Mar 25 13:13:32 2015 (r280590) +++ stable/10/sys/dev/sound/usb/uaudio.h Wed Mar 25 13:14:25 2015 (r280591) @@ -54,8 +54,8 @@ extern struct pcmchan_matrix *uaudio_cha uint32_t format); extern int uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format); -extern int uaudio_chan_start(struct uaudio_chan *ch); -extern int uaudio_chan_stop(struct uaudio_chan *ch); +extern void uaudio_chan_start(struct uaudio_chan *ch); +extern void uaudio_chan_stop(struct uaudio_chan *ch); extern int uaudio_mixer_init_sub(struct uaudio_softc *sc, struct snd_mixer *m); extern int uaudio_mixer_uninit_sub(struct uaudio_softc *sc); Modified: stable/10/sys/dev/sound/usb/uaudio_pcm.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio_pcm.c Wed Mar 25 13:13:32 2015 (r280590) +++ stable/10/sys/dev/sound/usb/uaudio_pcm.c Wed Mar 25 13:14:25 2015 (r280591) @@ -81,14 +81,14 @@ ua_chan_setfragments(kobj_t obj, void *d static int ua_chan_trigger(kobj_t obj, void *data, int go) { - if (!PCMTRIG_COMMON(go)) { - return (0); - } - if (go == PCMTRIG_START) { - return (uaudio_chan_start(data)); - } else { - return (uaudio_chan_stop(data)); + if (PCMTRIG_COMMON(go)) { + if (go == PCMTRIG_START) { + uaudio_chan_start(data); + } else { + uaudio_chan_stop(data); + } } + return (0); } static uint32_t From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:14:52 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7855DEA3; Wed, 25 Mar 2015 13:14:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4658EF9F; Wed, 25 Mar 2015 13:14:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDEq4A070051; Wed, 25 Mar 2015 13:14:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDEpew070046; Wed, 25 Mar 2015 13:14:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251314.t2PDEpew070046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280592 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:14:52 -0000 Author: arybchik Date: Wed Mar 25 13:14:50 2015 New Revision: 280592 URL: https://svnweb.freebsd.org/changeset/base/280592 Log: MFC: 279231 sfxge: add put-list high watermark It is interesting to know how long put-list grows. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:14:25 2015 (r280591) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:14:50 2015 (r280592) @@ -214,6 +214,9 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * count++; } while (mbuf != NULL); + if (count > stdp->std_put_hiwat) + stdp->std_put_hiwat = count; + /* Append the reversed put list to the get list. */ KASSERT(*get_tailp == NULL, ("*get_tailp != NULL")); *stdp->std_getp = get_next; @@ -1484,6 +1487,10 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u SYSCTL_CHILDREN(txq_node), OID_AUTO, "dpl_get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_hiwat, 0, ""); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl_put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + &stdp->std_put_hiwat, 0, ""); #endif txq->type = type; Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:14:25 2015 (r280591) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:14:50 2015 (r280592) @@ -102,6 +102,8 @@ struct sfxge_tx_dpl { * in get list */ unsigned int std_get_hiwat; /* Packets in get list * high watermark */ + unsigned int std_put_hiwat; /* Packets in put list + * high watermark */ }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:15:48 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9831B9; Wed, 25 Mar 2015 13:15:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8084AFBF; Wed, 25 Mar 2015 13:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDFmJp070289; Wed, 25 Mar 2015 13:15:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDFms1070288; Wed, 25 Mar 2015 13:15:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251315.t2PDFms1070288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280593 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:15:48 -0000 Author: arybchik Date: Wed Mar 25 13:15:47 2015 New Revision: 280593 URL: https://svnweb.freebsd.org/changeset/base/280593 Log: MFC: 279266 sfxge: correct limit for number of Rx queues Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:14:50 2015 (r280592) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:15:47 2015 (r280593) @@ -204,7 +204,7 @@ typedef struct efx_nic_ops_s { # define EFX_TXQ_LIMIT_TARGET 259 #endif #ifndef EFX_RXQ_LIMIT_TARGET -# define EFX_RXQ_LIMIT_TARGET 768 +# define EFX_RXQ_LIMIT_TARGET 512 #endif #ifndef EFX_TXQ_DC_SIZE #define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:18:54 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 720C259F; Wed, 25 Mar 2015 13:18:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF9A51; Wed, 25 Mar 2015 13:18:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDIsRE070896; Wed, 25 Mar 2015 13:18:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDIqM1070879; Wed, 25 Mar 2015 13:18:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251318.t2PDIqM1070879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:18: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: r280596 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:18:54 -0000 Author: arybchik Date: Wed Mar 25 13:18:51 2015 New Revision: 280596 URL: https://svnweb.freebsd.org/changeset/base/280596 Log: MFC: 279351 sfxge: expect required init_state on data path and in periodic calls With the patch applied the number of instruction events is 1% less and number of mispredicted branch events is 5% less under multistream TCP traffic load close to line rate. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_intr.c stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:18:36 2015 (r280595) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:18:51 2015 (r280596) @@ -98,7 +98,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u KASSERT(evq->index == rxq->index, ("evq->index != rxq->index")); - if (rxq->init_state != SFXGE_RXQ_STARTED) + if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) goto done; expected = rxq->pending++ & rxq->ptr_mask; @@ -251,7 +251,7 @@ sfxge_ev_tx(void *arg, uint32_t label, u KASSERT(evq->index == txq->evq_index, ("evq->index != txq->evq_index")); - if (txq->init_state != SFXGE_TXQ_STARTED) + if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) goto done; stop = (id + 1) & txq->ptr_mask; @@ -428,7 +428,7 @@ sfxge_ev_stat_update(struct sfxge_softc SFXGE_ADAPTER_LOCK(sc); - if (sc->evq[0]->init_state != SFXGE_EVQ_STARTED) + if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED)) goto out; now = ticks; @@ -593,8 +593,8 @@ sfxge_ev_qpoll(struct sfxge_evq *evq) SFXGE_EVQ_LOCK(evq); - if (evq->init_state != SFXGE_EVQ_STARTING && - evq->init_state != SFXGE_EVQ_STARTED) { + if (__predict_false(evq->init_state != SFXGE_EVQ_STARTING && + evq->init_state != SFXGE_EVQ_STARTED)) { rc = EINVAL; goto fail; } Modified: stable/10/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 13:18:36 2015 (r280595) +++ stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 13:18:51 2015 (r280596) @@ -130,7 +130,7 @@ sfxge_intr_message(void *arg) KASSERT(intr->type == EFX_INTR_MESSAGE, ("intr->type != EFX_INTR_MESSAGE")); - if (intr->state != SFXGE_INTR_STARTED) + if (__predict_false(intr->state != SFXGE_INTR_STARTED)) return; (void)efx_intr_status_message(enp, index, &fatal); Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 13:18:36 2015 (r280595) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 13:18:51 2015 (r280596) @@ -50,7 +50,7 @@ sfxge_mac_stat_update(struct sfxge_softc SFXGE_PORT_LOCK_ASSERT_OWNED(port); - if (port->init_state != SFXGE_PORT_STARTED) { + if (__predict_false(port->init_state != SFXGE_PORT_STARTED)) { rc = 0; goto out; } @@ -179,7 +179,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND SFXGE_PORT_LOCK(port); if (port->wanted_fc != fcntl) { - if (port->init_state == SFXGE_PORT_STARTED) + if (__predict_false(port->init_state == SFXGE_PORT_STARTED)) error = efx_mac_fcntl_set(sc->enp, port->wanted_fc, B_TRUE); @@ -210,7 +210,8 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE port = &sc->port; SFXGE_PORT_LOCK(port); - if (port->init_state == SFXGE_PORT_STARTED && SFXGE_LINK_UP(sc)) + if (__predict_true(port->init_state == SFXGE_PORT_STARTED) && + SFXGE_LINK_UP(sc)) efx_mac_fcntl_get(sc->enp, &wanted_fc, &link_fc); else link_fc = 0; @@ -265,7 +266,7 @@ sfxge_mac_poll_work(void *arg, int npend SFXGE_PORT_LOCK(port); - if (port->init_state != SFXGE_PORT_STARTED) + if (__predict_false(port->init_state != SFXGE_PORT_STARTED)) goto done; /* This may sleep waiting for MCDI completion */ @@ -332,7 +333,7 @@ sfxge_mac_filter_set(struct sfxge_softc * lock is held in sleeping thread. Both problems are repeatable * on LAG with LACP proto bring up. */ - if (port->init_state == SFXGE_PORT_STARTED) + if (__predict_true(port->init_state == SFXGE_PORT_STARTED)) rc = sfxge_mac_filter_set_locked(sc); else rc = 0; @@ -456,7 +457,7 @@ sfxge_phy_stat_update(struct sfxge_softc SFXGE_PORT_LOCK_ASSERT_OWNED(port); - if (port->init_state != SFXGE_PORT_STARTED) { + if (__predict_false(port->init_state != SFXGE_PORT_STARTED)) { rc = 0; goto out; } Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:18:36 2015 (r280595) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:18:51 2015 (r280596) @@ -209,7 +209,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); - if (rxq->init_state != SFXGE_RXQ_STARTED) + if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) return; rxfill = rxq->added - rxq->completed; @@ -269,7 +269,7 @@ void sfxge_rx_qrefill(struct sfxge_rxq *rxq) { - if (rxq->init_state != SFXGE_RXQ_STARTED) + if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) return; /* Make sure the queue is full */ @@ -760,7 +760,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq rx_desc = &rxq->queue[id]; m = rx_desc->mbuf; - if (rxq->init_state != SFXGE_RXQ_STARTED) + if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) goto discard; if (rx_desc->flags & (EFX_ADDR_MISMATCH | EFX_DISCARD)) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:18:36 2015 (r280595) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:18:51 2015 (r280596) @@ -311,7 +311,7 @@ static int sfxge_tx_queue_mbuf(struct sf if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); - if (txq->init_state != SFXGE_TXQ_STARTED) { + if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR; goto reject; } @@ -1142,7 +1142,7 @@ sfxge_tx_qunblock(struct sfxge_txq *txq) SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); - if (txq->init_state != SFXGE_TXQ_STARTED) + if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) return; SFXGE_TXQ_LOCK(txq); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:41:28 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F8D4E78; Wed, 25 Mar 2015 13:41:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F91358; Wed, 25 Mar 2015 13:41:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDfRST084424; Wed, 25 Mar 2015 13:41:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDfRm8084140; Wed, 25 Mar 2015 13:41:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251341.t2PDfRm8084140@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:41:27 +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: r280599 - in stable/10: share/man/man4 sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:41:28 -0000 Author: arybchik Date: Wed Mar 25 13:41:26 2015 New Revision: 280599 URL: https://svnweb.freebsd.org/changeset/base/280599 Log: MFC: 280160 sfxge: add tunables to control LRO parameters on driver load time Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 13:32:27 2015 (r280598) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 13:41:26 2015 (r280599) @@ -120,6 +120,27 @@ The value must be greater than or equal The maximum number of allocated RSS channels for the Nth adapter. If set to 0 or unset, the number of channels is determined by the number of CPU cores. +.It Va hw.sfxge.lro.table_size +Size of the LRO hash table. +Must be a power of 2. +A larger table means we can accelerate a larger number of streams. +.It Va hw.sfxge.lro.chain_max +The maximum length of a hash chain. +If chains get too long then the lookup time increases and may exceed +the benefit of LRO. +.It Va hw.sfxge.lro.idle_ticks +The maximum time (in ticks) that a connection can be idle before it's LRO +state is discarded. +.It Va hw.sfxge.lro.slow_start_packets +Number of packets with payload that must arrive in-order before a connection +is eligible for LRO. +The idea is we should avoid coalescing segments when the sender is in +slow-start because reducing the ACK rate can damage performance. +.It Va hw.sfxge.lro.loss_packets +Number of packets with payload that must arrive in-order following loss +before a connection is eligible for LRO. +The idea is we should avoid coalescing segments when the sender is recovering +from loss, because reducing the ACK rate can damage performance. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:32:27 2015 (r280598) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:41:26 2015 (r280599) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -56,20 +57,38 @@ __FBSDID("$FreeBSD$"); #define RX_REFILL_THRESHOLD(_entries) (EFX_RXQ_LIMIT(_entries) * 9 / 10) +SYSCTL_NODE(_hw_sfxge, OID_AUTO, lro, CTLFLAG_RD, NULL, + "Large receive offload (LRO) parameters"); + +#define SFXGE_LRO_PARAM(_param) SFXGE_PARAM(lro._param) + /* Size of the LRO hash table. Must be a power of 2. A larger table * means we can accelerate a larger number of streams. */ static unsigned lro_table_size = 128; +TUNABLE_INT(SFXGE_LRO_PARAM(table_size), &lro_table_size); +SYSCTL_UINT(_hw_sfxge_lro, OID_AUTO, table_size, CTLFLAG_RDTUN, + &lro_table_size, 0, + "Size of the LRO hash table (must be a power of 2)"); /* Maximum length of a hash chain. If chains get too long then the lookup * time increases and may exceed the benefit of LRO. */ static unsigned lro_chain_max = 20; +TUNABLE_INT(SFXGE_LRO_PARAM(chain_max), &lro_chain_max); +SYSCTL_UINT(_hw_sfxge_lro, OID_AUTO, chain_max, CTLFLAG_RDTUN, + &lro_chain_max, 0, + "The maximum length of a hash chain"); /* Maximum time (in ticks) that a connection can be idle before it's LRO * state is discarded. */ static unsigned lro_idle_ticks; /* initialised in sfxge_rx_init() */ +TUNABLE_INT(SFXGE_LRO_PARAM(idle_ticks), &lro_idle_ticks); +SYSCTL_UINT(_hw_sfxge_lro, OID_AUTO, idle_ticks, CTLFLAG_RDTUN, + &lro_idle_ticks, 0, + "The maximum time (in ticks) that a connection can be idle " + "before it's LRO state is discarded"); /* Number of packets with payload that must arrive in-order before a * connection is eligible for LRO. The idea is we should avoid coalescing @@ -77,6 +96,11 @@ static unsigned lro_idle_ticks; /* initi * can damage performance. */ static int lro_slow_start_packets = 2000; +TUNABLE_INT(SFXGE_LRO_PARAM(slow_start_packets), &lro_slow_start_packets); +SYSCTL_UINT(_hw_sfxge_lro, OID_AUTO, slow_start_packets, CTLFLAG_RDTUN, + &lro_slow_start_packets, 0, + "Number of packets with payload that must arrive in-order before " + "a connection is eligible for LRO"); /* Number of packets with payload that must arrive in-order following loss * before a connection is eligible for LRO. The idea is we should avoid @@ -84,6 +108,11 @@ static int lro_slow_start_packets = 2000 * reducing the ACK rate can damage performance. */ static int lro_loss_packets = 20; +TUNABLE_INT(SFXGE_LRO_PARAM(loss_packets), &lro_loss_packets); +SYSCTL_UINT(_hw_sfxge_lro, OID_AUTO, loss_packets, CTLFLAG_RDTUN, + &lro_loss_packets, 0, + "Number of packets with payload that must arrive in-order " + "following loss before a connection is eligible for LRO"); /* Flags for sfxge_lro_conn::l2_id; must not collide with EVL_VLID_MASK */ #define SFXGE_LRO_L2_ID_VLAN 0x4000 @@ -1200,6 +1229,13 @@ sfxge_rx_init(struct sfxge_softc *sc) int index; int rc; + if (!ISP2(lro_table_size)) { + log(LOG_ERR, "%s=%u must be power of 2", + SFXGE_LRO_PARAM(table_size), lro_table_size); + rc = EINVAL; + goto fail_lro_table_size; + } + if (lro_idle_ticks == 0) lro_idle_ticks = hz / 10 + 1; /* 100 ms */ @@ -1226,5 +1262,7 @@ fail: sfxge_rx_qfini(sc, index); sc->rxq_count = 0; + +fail_lro_table_size: return (rc); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:42:38 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A273FC2; Wed, 25 Mar 2015 13:42:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22EC75EB; Wed, 25 Mar 2015 13:42:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDgc7o085107; Wed, 25 Mar 2015 13:42:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDgcA5085105; Wed, 25 Mar 2015 13:42:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251342.t2PDgcA5085105@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:42: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: r280600 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:42:38 -0000 Author: arybchik Date: Wed Mar 25 13:42:37 2015 New Revision: 280600 URL: https://svnweb.freebsd.org/changeset/base/280600 Log: MFC: 280161 sfxge: move deferred packet list statistics to dedicated node It is done to structure sysctl and do not mix with Tx queue statistics to be added. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:41:26 2015 (r280599) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:42:37 2015 (r280600) @@ -1379,11 +1379,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u enum sfxge_txq_type type, unsigned int evq_index) { char name[16]; + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; #ifdef SFXGE_HAVE_MQ struct sfxge_tx_dpl *stdp; + struct sysctl_oid *dpl_node; #endif efsys_mem_t *esmp; unsigned int nmaps; @@ -1432,10 +1434,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u } snprintf(name, sizeof(name), "%u", txq_index); - txq_node = SYSCTL_ADD_NODE( - device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(sc->txqs_node), - OID_AUTO, name, CTLFLAG_RD, NULL, ""); + txq_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->txqs_node), + OID_AUTO, name, CTLFLAG_RD, NULL, ""); if (txq_node == NULL) { rc = ENOMEM; goto fail_txq_node; @@ -1475,21 +1475,25 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u SFXGE_TXQ_LOCK_INIT(txq, device_get_nameunit(sc->dev), txq_index); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS, + dpl_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl", CTLFLAG_RD, NULL, + "Deferred packet list statistics"); + if (dpl_node == NULL) { + rc = ENOMEM; + goto fail_dpl_node; + } + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_count", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_count, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_non_tcp_count", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_non_tcp_count", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_non_tcp_count, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_hiwat, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); #endif @@ -1500,6 +1504,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); +fail_dpl_node: fail_tx_dpl_put_max: fail_tx_dpl_get_max: fail3: From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:44:03 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98F0F1B5; Wed, 25 Mar 2015 13:44:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80F03600; Wed, 25 Mar 2015 13:44:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDi3i8085363; Wed, 25 Mar 2015 13:44:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDi2go085360; Wed, 25 Mar 2015 13:44:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251344.t2PDi2go085360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:44: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: r280601 - in stable/10/sys: dev/sfxge modules/sfxge 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.18-1 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, 25 Mar 2015 13:44:03 -0000 Author: arybchik Date: Wed Mar 25 13:44:01 2015 New Revision: 280601 URL: https://svnweb.freebsd.org/changeset/base/280601 Log: MFC: 280162 sfxge: adding version info to device description The information is required for NIC update and config tools. Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Added: stable/10/sys/dev/sfxge/sfxge_version.h - copied unchanged from r280162, head/sys/dev/sfxge/sfxge_version.h Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/modules/sfxge/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 13:42:37 2015 (r280600) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 13:44:01 2015 (r280601) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" +#include "sfxge_version.h" #define SFXGE_CAP (IFCAP_VLAN_MTU | \ IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \ @@ -472,6 +473,12 @@ sfxge_create(struct sfxge_softc *sc) if ((error = efx_nic_probe(enp)) != 0) goto fail5; + SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "version", CTLFLAG_RD, + SFXGE_VERSION_STRING, 0, + "Driver version"); + /* Initialize the NVRAM. */ if ((error = efx_nvram_init(enp)) != 0) goto fail6; Copied: stable/10/sys/dev/sfxge/sfxge_version.h (from r280162, head/sys/dev/sfxge/sfxge_version.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/sfxge/sfxge_version.h Wed Mar 25 13:44:01 2015 (r280601, copy of r280162, head/sys/dev/sfxge/sfxge_version.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2015 Solarflare Communications, Inc. + * All rights reserved. + * + * This software was developed in part by OKTET Labs under contract for + * Solarflare Communications, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SFXGE_VERSION_H +#define _SFXGE_VERSION_H + +#define SFXGE_VERSION_STRING "v3.3.4.6363" + +#endif /* _SFXGE_DRIVER_VERSION_H */ Modified: stable/10/sys/modules/sfxge/Makefile ============================================================================== --- stable/10/sys/modules/sfxge/Makefile Wed Mar 25 13:42:37 2015 (r280600) +++ stable/10/sys/modules/sfxge/Makefile Wed Mar 25 13:44:01 2015 (r280601) @@ -11,7 +11,7 @@ SRCS+= opt_inet.h opt_sched.h SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c SRCS+= sfxge_intr.c sfxge_mcdi.c SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c -SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h +SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${.CURDIR}/../../dev/sfxge/common SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:45:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5519E2FA; Wed, 25 Mar 2015 13:45:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF7A610; Wed, 25 Mar 2015 13:45:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDjL1E085626; Wed, 25 Mar 2015 13:45:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDjLlR085625; Wed, 25 Mar 2015 13:45:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251345.t2PDjLlR085625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:45:21 +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: r280602 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:45:21 -0000 Author: arybchik Date: Wed Mar 25 13:45:20 2015 New Revision: 280602 URL: https://svnweb.freebsd.org/changeset/base/280602 Log: MFC: 280163 sfxge: prefetch txq->common if TxQ is started only Transmit may be called when TxQ is not started yet (i.e. txq->common is invalid). TxQ state is checked below when mbuf is processed and dropped if TxQ is not started. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:44:01 2015 (r280601) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:45:20 2015 (r280602) @@ -423,8 +423,10 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx stdp = &txq->dpl; pushed = txq->added; - prefetch_read_many(sc->enp); - prefetch_read_many(txq->common); + if (__predict_true(txq->init_state == SFXGE_TXQ_STARTED)) { + prefetch_read_many(sc->enp); + prefetch_read_many(txq->common); + } mbuf = stdp->std_get; count = stdp->std_get_count; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:46:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89A8C44A; Wed, 25 Mar 2015 13:46:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A3F627; Wed, 25 Mar 2015 13:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDkVTj085834; Wed, 25 Mar 2015 13:46:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDkVXp085833; Wed, 25 Mar 2015 13:46:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251346.t2PDkVXp085833@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:46: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: r280603 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:46:31 -0000 Author: arybchik Date: Wed Mar 25 13:46:30 2015 New Revision: 280603 URL: https://svnweb.freebsd.org/changeset/base/280603 Log: MFC: 280164 sfxge: increase default put-list limit to 1024 Drops are observed under multi-stream TCP traffic due to put-list overflow with limit equal to 64. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:45:20 2015 (r280602) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:46:30 2015 (r280603) @@ -81,7 +81,7 @@ struct sfxge_tx_mapping { #define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT (64 * 1024) #define SFXGE_TX_DPL_GET_NON_TCP_PKT_LIMIT_DEFAULT 1024 -#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 1024 /* * Deferred packet list. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:47:50 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00AD558C; Wed, 25 Mar 2015 13:47:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3CA5638; Wed, 25 Mar 2015 13:47:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDlnqS086047; Wed, 25 Mar 2015 13:47:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDlnDs086046; Wed, 25 Mar 2015 13:47:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251347.t2PDlnDs086046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:47:49 +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: r280604 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:47:50 -0000 Author: arybchik Date: Wed Mar 25 13:47:48 2015 New Revision: 280604 URL: https://svnweb.freebsd.org/changeset/base/280604 Log: MFC: 280374 sfxge: assert either kernel or internal copy of interface flags ioctl to put interface down sets ifp->if_flags which holds the intended administratively defined state and calls driver callback to apply it. When everything is done, driver updates internal copy of interface flags sc->if_flags which holds the operational state. So, transmit from Rx path is possible when interface is intended to be administratively down in accordance with ifp->if_flags, but not applied yet and the operational state is up in accordance with sc->if_flags. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2075 Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:46:30 2015 (r280603) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:47:48 2015 (r280604) @@ -676,7 +676,16 @@ sfxge_if_transmit(struct ifnet *ifp, str sc = (struct sfxge_softc *)ifp->if_softc; - KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); + /* + * Transmit may be called when interface is up from the kernel + * point of view, but not yet up (in progress) from the driver + * point of view. I.e. link aggregation bring up. + * Transmit may be called when interface is up from the driver + * point of view, but already down from the kernel point of + * view. I.e. Rx when interface shutdown is in progress. + */ + KASSERT((ifp->if_flags & IFF_UP) || (sc->if_flags & IFF_UP), + ("interface not up")); /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:48:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E526CF; Wed, 25 Mar 2015 13:48:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53815645; Wed, 25 Mar 2015 13:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDmt2l086256; Wed, 25 Mar 2015 13:48:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDmtHA086255; Wed, 25 Mar 2015 13:48:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251348.t2PDmtHA086255@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:48: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: r280605 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:48:55 -0000 Author: arybchik Date: Wed Mar 25 13:48:54 2015 New Revision: 280605 URL: https://svnweb.freebsd.org/changeset/base/280605 Log: MFC: 280375 sfxge: add barriers to BAR write macros In theory the barriers are required to cope with write combining and reordering. Two barriers are added (sometimes merged to one): 1. Before the first write to guarantee that previous writes to the region have been done 2. Before the last write to guarantee that write to the last dword/qword is done after previous writes Barriers are inserted before in the assumption that it is better to postpone barriers as much as it is possible (more chances that the operation has already been already done and barrier does not stall CPU). On x86 and amd64 bus space write barriers are just compiler memory barriers which are definitely required. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2077 Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:47:48 2015 (r280604) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:48:54 2015 (r280605) @@ -786,6 +786,14 @@ typedef struct efsys_bar_s { EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ \ + /* \ + * Make sure that previous writes to the dword have \ + * been done. It should be cheaper than barrier just \ + * after the write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_dword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_edp)->ed_u32[0]); \ @@ -809,6 +817,14 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ + /* \ + * Make sure that previous writes to the qword have \ + * been done. It should be cheaper than barrier just \ + * after the write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u64[0]); \ @@ -829,9 +845,25 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ + /* \ + * Make sure that previous writes to the qword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u32[0]); \ + /* \ + * It should be guaranteed that the last dword comes \ + * the last, so barrier entire qword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 4, (_eqp)->eq_u32[1]); \ @@ -858,9 +890,25 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ + /* \ + * Make sure that previous writes to the oword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u64[0]); \ + /* \ + * It should be guaranteed that the last qword comes \ + * the last, so barrier entire oword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 8, (_eop)->eo_u64[1]); \ @@ -888,6 +936,14 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ + /* \ + * Make sure that previous writes to the oword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u32[0]); \ @@ -897,6 +953,14 @@ typedef struct efsys_bar_s { bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 8, (_eop)->eo_u32[2]); \ + /* \ + * It should be guaranteed that the last dword comes \ + * the last, so barrier entire oword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 12, (_eop)->eo_u32[3]); \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:50:41 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CBA387A; Wed, 25 Mar 2015 13:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C65E65F; Wed, 25 Mar 2015 13:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDofZA087200; Wed, 25 Mar 2015 13:50:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDodSD087190; Wed, 25 Mar 2015 13:50:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251350.t2PDodSD087190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280606 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:50:41 -0000 Author: arybchik Date: Wed Mar 25 13:50:38 2015 New Revision: 280606 URL: https://svnweb.freebsd.org/changeset/base/280606 Log: MFC: 280376 sfxge: remove obsolete Tx non-multi queue support Tx multi queue is added in FreeBSD 8.0. So, the changeset drops earlier versions support. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2081 Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 13:48:54 2015 (r280605) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 13:50:38 2015 (r280606) @@ -329,19 +329,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ether_ifattach(ifp, encp->enc_mac_addr); -#ifdef SFXGE_HAVE_MQ ifp->if_transmit = sfxge_if_transmit; ifp->if_qflush = sfxge_if_qflush; -#else - ifp->if_start = sfxge_if_start; - IFQ_SET_MAXLEN(&ifp->if_snd, sc->txq_entries - 1); - ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1; - IFQ_SET_READY(&ifp->if_snd); - - snprintf(sc->tx_lock_name, sizeof(sc->tx_lock_name), - "%s:tx", device_get_nameunit(sc->dev)); - mtx_init(&sc->tx_lock, sc->tx_lock_name, NULL, MTX_DEF); -#endif if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 13:48:54 2015 (r280605) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 13:50:38 2015 (r280606) @@ -66,12 +66,6 @@ #ifndef IFM_10G_KX4 #define IFM_10G_KX4 IFM_10G_CX4 #endif -#if __FreeBSD_version >= 800054 -/* Networking core is multiqueue aware. We can manage our own TX - * queues and use m_pkthdr.flowid. - */ -#define SFXGE_HAVE_MQ -#endif #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 #define SFXGE_HAVE_DESCRIBE_INTR @@ -242,11 +236,7 @@ struct sfxge_softc { struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; -#ifdef SFXGE_HAVE_MQ struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; -#else - struct sfxge_txq *txq[SFXGE_TXQ_NTYPES]; -#endif struct ifmedia media; @@ -254,11 +244,6 @@ struct sfxge_softc { size_t rx_buffer_size; uma_zone_t rx_buffer_zone; -#ifndef SFXGE_HAVE_MQ - struct mtx tx_lock __aligned(CACHE_LINE_SIZE); - char tx_lock_name[SFXGE_LOCK_NAME_MAX]; -#endif - unsigned int evq_count; unsigned int rxq_count; unsigned int txq_count; Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:48:54 2015 (r280605) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 13:50:38 2015 (r280606) @@ -326,14 +326,12 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (rx_desc->flags & EFX_CKSUM_TCPUDP) csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; -#ifdef SFXGE_HAVE_MQ /* The hash covers a 4-tuple for TCP only */ if (rx_desc->flags & EFX_PKT_TCP) { m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); m->m_flags |= M_FLOWID; } -#endif m->m_data += sc->rx_prefix_size; m->m_len = rx_desc->size - sc->rx_prefix_size; m->m_pkthdr.len = m->m_len; @@ -380,10 +378,9 @@ sfxge_lro_deliver(struct sfxge_lro_state memcpy(c_th + 1, c->th_last + 1, optlen); } -#ifdef SFXGE_HAVE_MQ m->m_pkthdr.flowid = c->conn_hash; m->m_flags |= M_FLOWID; -#endif + m->m_pkthdr.csum_flags = csum_flags; __sfxge_rx_deliver(sc, m); Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:48:54 2015 (r280605) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:50:38 2015 (r280606) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #define SFXGE_TXQ_BLOCK_LEVEL(_entries) \ (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC) -#ifdef SFXGE_HAVE_MQ #define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max) static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT; @@ -109,8 +108,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p &sfxge_tx_dpl_put_max, 0, "Maximum number of any packets in deferred packet put-list"); -#endif - /* Forward declarations. */ static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -160,8 +157,6 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq } } -#ifdef SFXGE_HAVE_MQ - static unsigned int sfxge_is_mbuf_non_tcp(struct mbuf *mbuf) { @@ -225,8 +220,6 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * stdp->std_get_non_tcp_count += non_tcp_count; } -#endif /* SFXGE_HAVE_MQ */ - static void sfxge_tx_qreap(struct sfxge_txq *txq) { @@ -401,8 +394,6 @@ reject: return (rc); } -#ifdef SFXGE_HAVE_MQ - /* * Drain the deferred packet list into the transmit queue. */ @@ -708,88 +699,6 @@ sfxge_if_transmit(struct ifnet *ifp, str return (rc); } -#else /* !SFXGE_HAVE_MQ */ - -static void sfxge_if_start_locked(struct ifnet *ifp) -{ - struct sfxge_softc *sc = ifp->if_softc; - struct sfxge_txq *txq; - struct mbuf *mbuf; - unsigned int pushed[SFXGE_TXQ_NTYPES]; - unsigned int q_index; - - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) - return; - - if (!sc->port.link_up) - return; - - for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) { - txq = sc->txq[q_index]; - pushed[q_index] = txq->added; - } - - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, mbuf); - if (mbuf == NULL) - break; - - ETHER_BPF_MTAP(ifp, mbuf); /* packet capture */ - - /* Pick the desired transmit queue. */ - if (mbuf->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) - q_index = SFXGE_TXQ_IP_TCP_UDP_CKSUM; - else if (mbuf->m_pkthdr.csum_flags & CSUM_DELAY_IP) - q_index = SFXGE_TXQ_IP_CKSUM; - else - q_index = SFXGE_TXQ_NON_CKSUM; - txq = sc->txq[q_index]; - - if (sfxge_tx_queue_mbuf(txq, mbuf) != 0) - continue; - - if (txq->blocked) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - - /* Push the fragments to the hardware in batches. */ - if (txq->added - pushed[q_index] >= SFXGE_TX_BATCH) { - efx_tx_qpush(txq->common, txq->added); - pushed[q_index] = txq->added; - } - } - - for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) { - txq = sc->txq[q_index]; - if (txq->added != pushed[q_index]) - efx_tx_qpush(txq->common, txq->added); - } -} - -void sfxge_if_start(struct ifnet *ifp) -{ - struct sfxge_softc *sc = ifp->if_softc; - - SFXGE_TXQ_LOCK(sc->txq[0]); - sfxge_if_start_locked(ifp); - SFXGE_TXQ_UNLOCK(sc->txq[0]); -} - -static void -sfxge_tx_qdpl_service(struct sfxge_txq *txq) -{ - struct ifnet *ifp = txq->sc->ifnet; - - SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sfxge_if_start_locked(ifp); - SFXGE_TXQ_UNLOCK(txq); -} - -#endif /* SFXGE_HAVE_MQ */ - /* * Software "TSO". Not quite as good as doing it in hardware, but * still faster than segmenting in the stack. @@ -1378,9 +1287,7 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u sc->txq[index] = NULL; -#ifdef SFXGE_HAVE_MQ SFXGE_TXQ_LOCK_DESTROY(txq); -#endif free(txq, M_SFXGE); } @@ -1394,10 +1301,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; -#ifdef SFXGE_HAVE_MQ struct sfxge_tx_dpl *stdp; struct sysctl_oid *dpl_node; -#endif efsys_mem_t *esmp; unsigned int nmaps; int rc; @@ -1456,7 +1361,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u (rc = tso_init(txq)) != 0) goto fail3; -#ifdef SFXGE_HAVE_MQ if (sfxge_tx_dpl_get_max <= 0) { log(LOG_ERR, "%s=%d must be greater than 0", SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); @@ -1506,7 +1410,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); -#endif txq->type = type; txq->evq_index = evq_index; @@ -1613,11 +1516,7 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); -#ifdef SFXGE_HAVE_MQ sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; -#else - sc->txq_count = SFXGE_TXQ_NTYPES; -#endif sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:48:54 2015 (r280605) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Wed Mar 25 13:50:38 2015 (r280606) @@ -128,12 +128,6 @@ enum sfxge_txq_type { #define SFXGE_TX_BATCH 64 -#ifdef SFXGE_HAVE_MQ -#define SFXGE_TX_LOCK(txq) (&(txq)->lock) -#else -#define SFXGE_TX_LOCK(txq) (&(txq)->sc->tx_lock) -#endif - #define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \ do { \ struct sfxge_txq *__txq = (_txq); \ @@ -147,13 +141,13 @@ enum sfxge_txq_type { #define SFXGE_TXQ_LOCK_DESTROY(_txq) \ mtx_destroy(&(_txq)->lock) #define SFXGE_TXQ_LOCK(_txq) \ - mtx_lock(SFXGE_TX_LOCK(_txq)) + mtx_lock(&(_txq)->lock) #define SFXGE_TXQ_TRYLOCK(_txq) \ - mtx_trylock(SFXGE_TX_LOCK(_txq)) + mtx_trylock(&(_txq)->lock) #define SFXGE_TXQ_UNLOCK(_txq) \ - mtx_unlock(SFXGE_TX_LOCK(_txq)) + mtx_unlock(&(_txq)->lock) #define SFXGE_TXQ_LOCK_ASSERT_OWNED(_txq) \ - mtx_assert(SFXGE_TX_LOCK(_txq), MA_OWNED) + mtx_assert(&(_txq)->lock, MA_OWNED) struct sfxge_txq { @@ -186,13 +180,9 @@ struct sfxge_txq { /* The following fields change more often, and are used mostly * on the initiation path */ -#ifdef SFXGE_HAVE_MQ struct mtx lock __aligned(CACHE_LINE_SIZE); struct sfxge_tx_dpl dpl; /* Deferred packet list. */ unsigned int n_pend_desc; -#else - unsigned int n_pend_desc __aligned(CACHE_LINE_SIZE); -#endif unsigned int added; unsigned int reaped; /* Statistics */ @@ -226,11 +216,7 @@ extern int sfxge_tx_start(struct sfxge_s extern void sfxge_tx_stop(struct sfxge_softc *sc); extern void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq); extern void sfxge_tx_qflush_done(struct sfxge_txq *txq); -#ifdef SFXGE_HAVE_MQ extern void sfxge_if_qflush(struct ifnet *ifp); extern int sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m); -#else -extern void sfxge_if_start(struct ifnet *ifp); -#endif #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:51:41 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2C2E9CE; Wed, 25 Mar 2015 13:51:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB6B7763; Wed, 25 Mar 2015 13:51:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDpeZu090142; Wed, 25 Mar 2015 13:51:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDpef5090141; Wed, 25 Mar 2015 13:51:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251351.t2PDpef5090141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:51: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: r280607 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:51:41 -0000 Author: arybchik Date: Wed Mar 25 13:51:39 2015 New Revision: 280607 URL: https://svnweb.freebsd.org/changeset/base/280607 Log: MFC: 280377 sfxge: add statistics for each Tx queue Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2082 Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:50:38 2015 (r280606) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:51:39 2015 (r280607) @@ -109,6 +109,26 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p "Maximum number of any packets in deferred packet put-list"); +static const struct { + const char *name; + size_t offset; +} sfxge_tx_stats[] = { +#define SFXGE_TX_STAT(name, member) \ + { #name, offsetof(struct sfxge_txq, member) } + SFXGE_TX_STAT(tso_bursts, tso_bursts), + SFXGE_TX_STAT(tso_packets, tso_packets), + SFXGE_TX_STAT(tso_long_headers, tso_long_headers), + SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), + SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), + SFXGE_TX_STAT(tx_collapses, collapses), + SFXGE_TX_STAT(tx_drops, drops), + SFXGE_TX_STAT(tx_get_overflow, get_overflow), + SFXGE_TX_STAT(tx_get_non_tcp_overflow, get_non_tcp_overflow), + SFXGE_TX_STAT(tx_put_overflow, put_overflow), + SFXGE_TX_STAT(tx_netdown_drops, netdown_drops), +}; + + /* Forward declarations. */ static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); @@ -1258,6 +1278,30 @@ fail: return (rc); } +static int +sfxge_txq_stat_init(struct sfxge_txq *txq, struct sysctl_oid *txq_node) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(txq->sc->dev); + struct sysctl_oid *stat_node; + unsigned int id; + + stat_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, + "stats", CTLFLAG_RD, NULL, + "Tx queue statistics"); + if (stat_node == NULL) + return (ENOMEM); + + for (id = 0; id < nitems(sfxge_tx_stats); id++) { + SYSCTL_ADD_ULONG( + ctx, SYSCTL_CHILDREN(stat_node), OID_AUTO, + sfxge_tx_stats[id].name, CTLFLAG_RD | CTLFLAG_STATS, + (unsigned long *)((caddr_t)txq + sfxge_tx_stats[id].offset), + ""); + } + + return (0); +} + /** * Destroy a transmit queue. */ @@ -1411,6 +1455,10 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); + rc = sfxge_txq_stat_init(txq, txq_node); + if (rc != 0) + goto fail_txq_stat_init; + txq->type = type; txq->evq_index = evq_index; txq->txq_index = txq_index; @@ -1418,6 +1466,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); +fail_txq_stat_init: fail_dpl_node: fail_tx_dpl_put_max: fail_tx_dpl_get_max: @@ -1436,25 +1485,6 @@ fail: return (rc); } -static const struct { - const char *name; - size_t offset; -} sfxge_tx_stats[] = { -#define SFXGE_TX_STAT(name, member) \ - { #name, offsetof(struct sfxge_txq, member) } - SFXGE_TX_STAT(tso_bursts, tso_bursts), - SFXGE_TX_STAT(tso_packets, tso_packets), - SFXGE_TX_STAT(tso_long_headers, tso_long_headers), - SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), - SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), - SFXGE_TX_STAT(tx_collapses, collapses), - SFXGE_TX_STAT(tx_drops, drops), - SFXGE_TX_STAT(tx_get_overflow, get_overflow), - SFXGE_TX_STAT(tx_get_non_tcp_overflow, get_non_tcp_overflow), - SFXGE_TX_STAT(tx_put_overflow, put_overflow), - SFXGE_TX_STAT(tx_netdown_drops, netdown_drops), -}; - static int sfxge_tx_stat_handler(SYSCTL_HANDLER_ARGS) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:52:32 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 427E5B14; Wed, 25 Mar 2015 13:52:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11C74777; Wed, 25 Mar 2015 13:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDqVWQ090324; Wed, 25 Mar 2015 13:52:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDqVm9090323; Wed, 25 Mar 2015 13:52:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251352.t2PDqVm9090323@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:52: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: r280608 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:52:32 -0000 Author: arybchik Date: Wed Mar 25 13:52:31 2015 New Revision: 280608 URL: https://svnweb.freebsd.org/changeset/base/280608 Log: MFC: 280378 sfxge: FreeBSD before 10 does not have bus_space_*_8 on amd64 bus_space_*_8() are not always macros, so it is not correct to use #ifndef. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2083 Modified: stable/10/sys/dev/sfxge/common/efsys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efsys.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:51:39 2015 (r280607) +++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:52:31 2015 (r280608) @@ -94,13 +94,20 @@ extern "C" { #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif -#if defined(__x86_64__) +#if defined(__x86_64__) && __FreeBSD_version >= 1000000 + +#define SFXGE_USE_BUS_SPACE_8 1 + #if !defined(bus_space_read_stream_8) + #define bus_space_read_stream_8(t, h, o) \ bus_space_read_8((t), (h), (o)) + #define bus_space_write_stream_8(t, h, o, v) \ bus_space_write_8((t), (h), (o), (v)) + #endif + #endif #define ENOTACTIVE EINVAL @@ -663,7 +670,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -804,7 +811,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -873,7 +880,7 @@ typedef struct efsys_bar_s { } while (B_FALSE) #endif -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:53:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55AD0C8D; Wed, 25 Mar 2015 13:53:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3F979F; Wed, 25 Mar 2015 13:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDrTO2090502; Wed, 25 Mar 2015 13:53:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDrTni090501; Wed, 25 Mar 2015 13:53:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251353.t2PDrTni090501@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:53: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: r280609 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 25 Mar 2015 13:53:29 -0000 Author: arybchik Date: Wed Mar 25 13:53:28 2015 New Revision: 280609 URL: https://svnweb.freebsd.org/changeset/base/280609 Log: MFC: 280379 sfxge: do not check MCDI status word This is a temporary workaround until we determine a reliable sequence of operations for detecting MC reboots. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2084 Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 13:52:31 2015 (r280608) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Wed Mar 25 13:53:28 2015 (r280609) @@ -213,6 +213,14 @@ static int efx_mcdi_poll_reboot( __in efx_nic_t *enp) { +#ifndef EFX_GRACEFUL_MC_REBOOT + /* + * This function is not being used properly. + * Until its callers are fixed, it should always return 0. + */ + _NOTE(ARGUNUSED(enp)) + return (0); +#else efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip); unsigned int rebootr; efx_dword_t dword; @@ -236,6 +244,7 @@ efx_mcdi_poll_reboot( return (EINTR); else return (EIO); +#endif } __checkReturn boolean_t From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:54:30 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48C68DF2; Wed, 25 Mar 2015 13:54:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 320B97BE; Wed, 25 Mar 2015 13:54:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDsToT090693; Wed, 25 Mar 2015 13:54:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDsTka090692; Wed, 25 Mar 2015 13:54:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251354.t2PDsTka090692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:54: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: r280610 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:54:30 -0000 Author: arybchik Date: Wed Mar 25 13:54:28 2015 New Revision: 280610 URL: https://svnweb.freebsd.org/changeset/base/280610 Log: MFC: 280380 sfxge: remove unnecessary and wrong prediction Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2085 Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 13:53:28 2015 (r280609) +++ stable/10/sys/dev/sfxge/sfxge_port.c Wed Mar 25 13:54:28 2015 (r280610) @@ -179,7 +179,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND SFXGE_PORT_LOCK(port); if (port->wanted_fc != fcntl) { - if (__predict_false(port->init_state == SFXGE_PORT_STARTED)) + if (port->init_state == SFXGE_PORT_STARTED) error = efx_mac_fcntl_set(sc->enp, port->wanted_fc, B_TRUE); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:55:37 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C292FF47; Wed, 25 Mar 2015 13:55:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB84E7D3; Wed, 25 Mar 2015 13:55:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDtbDK090941; Wed, 25 Mar 2015 13:55:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDtbfV090940; Wed, 25 Mar 2015 13:55:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251355.t2PDtbfV090940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:55: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: r280611 - stable/10/sys/modules/sfxge 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.18-1 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, 25 Mar 2015 13:55:37 -0000 Author: arybchik Date: Wed Mar 25 13:55:36 2015 New Revision: 280611 URL: https://svnweb.freebsd.org/changeset/base/280611 Log: MFC: 280431 sfxge: cleanup: remove trailing whitespaces Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/modules/sfxge/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/sfxge/Makefile ============================================================================== --- stable/10/sys/modules/sfxge/Makefile Wed Mar 25 13:54:28 2015 (r280610) +++ stable/10/sys/modules/sfxge/Makefile Wed Mar 25 13:55:36 2015 (r280611) @@ -14,7 +14,7 @@ SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx. SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${.CURDIR}/../../dev/sfxge/common -SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c +SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c SRCS+= efx_vpd.c efx_wol.c SRCS+= efsys.h @@ -22,7 +22,7 @@ SRCS+= efx.h efx_impl.h efx_mcdi.h efx_r SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h SRCS+= siena_mac.c siena_nic.c siena_nvram.c siena_phy.c -SRCS+= siena_sram.c siena_vpd.c +SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h DEBUG_FLAGS= -DDEBUG=1 From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:56:43 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDC23121; Wed, 25 Mar 2015 13:56:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67FC7E4; Wed, 25 Mar 2015 13:56:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDuhKM091149; Wed, 25 Mar 2015 13:56:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDuhqb091148; Wed, 25 Mar 2015 13:56:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251356.t2PDuhqb091148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280612 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:56:44 -0000 Author: arybchik Date: Wed Mar 25 13:56:42 2015 New Revision: 280612 URL: https://svnweb.freebsd.org/changeset/base/280612 Log: MFC: 280432 sfxge: cleanup: add a blank line before each #if to improve readability Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 13:55:36 2015 (r280611) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 13:56:42 2015 (r280612) @@ -54,25 +54,32 @@ */ #define CACHE_LINE_SIZE 128 #endif + #ifndef IFCAP_LINKSTATE #define IFCAP_LINKSTATE 0 #endif + #ifndef IFCAP_VLAN_HWTSO #define IFCAP_VLAN_HWTSO 0 #endif + #ifndef IFM_10G_T #define IFM_10G_T IFM_UNKNOWN #endif + #ifndef IFM_10G_KX4 #define IFM_10G_KX4 IFM_10G_CX4 #endif + #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 #define SFXGE_HAVE_DESCRIBE_INTR #endif + #ifdef IFM_ETH_RXPAUSE #define SFXGE_HAVE_PAUSE_MEDIAOPTS #endif + #ifndef CTLTYPE_U64 #define CTLTYPE_U64 CTLTYPE_QUAD #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 13:57:56 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 155002DE; Wed, 25 Mar 2015 13:57:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F947ED; Wed, 25 Mar 2015 13:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDvtkJ091348; Wed, 25 Mar 2015 13:57:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDvtkR091347; Wed, 25 Mar 2015 13:57:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251357.t2PDvtkR091347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 13:57: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: r280613 - stable/10/sys/dev/sfxge 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.18-1 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, 25 Mar 2015 13:57:56 -0000 Author: arybchik Date: Wed Mar 25 13:57:54 2015 New Revision: 280613 URL: https://svnweb.freebsd.org/changeset/base/280613 Log: MFC: 280433 sfxge: cleanup: fix index variable type to match upper boundary type Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:56:42 2015 (r280612) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Wed Mar 25 13:57:54 2015 (r280613) @@ -667,7 +667,7 @@ void sfxge_if_qflush(struct ifnet *ifp) { struct sfxge_softc *sc; - int i; + unsigned int i; sc = ifp->if_softc; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 14:10:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3F67923; Wed, 25 Mar 2015 14:10:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3618951; Wed, 25 Mar 2015 14:10:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PEALh6096743; Wed, 25 Mar 2015 14:10:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PEAKYX096739; Wed, 25 Mar 2015 14:10:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251410.t2PEAKYX096739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 14:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280615 - in stable/10/sys: dev/sfxge modules/sfxge 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.18-1 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, 25 Mar 2015 14:10:22 -0000 Author: arybchik Date: Wed Mar 25 14:10:20 2015 New Revision: 280615 URL: https://svnweb.freebsd.org/changeset/base/280615 Log: MFC: 279398 sfxge: compile out LRO if kernel is compiled without IPv4 and IPv6 Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) MFC: 279411 Unbreak 'make depend' with sfxge by removing debugging code activated in the INET || INET6 case X-MFC with: r279398 Pointyhat to: arybchik Modified: stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_rx.h stable/10/sys/modules/sfxge/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 14:05:51 2015 (r280614) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Wed Mar 25 14:10:20 2015 (r280615) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #define RX_REFILL_THRESHOLD(_entries) (EFX_RXQ_LIMIT(_entries) * 9 / 10) +#ifdef SFXGE_LRO + SYSCTL_NODE(_hw_sfxge, OID_AUTO, lro, CTLFLAG_RD, NULL, "Large receive offload (LRO) parameters"); @@ -136,6 +138,8 @@ static unsigned long ipv6_addr_cmp(const #endif } +#endif /* SFXGE_LRO */ + void sfxge_rx_qflush_done(struct sfxge_rxq *rxq) { @@ -342,6 +346,8 @@ sfxge_rx_deliver(struct sfxge_softc *sc, rx_desc->mbuf = NULL; } +#ifdef SFXGE_LRO + static void sfxge_lro_deliver(struct sfxge_lro_state *st, struct sfxge_lro_conn *c) { @@ -760,6 +766,20 @@ static void sfxge_lro_end_of_burst(struc sfxge_lro_purge_idle(rxq, t); } +#else /* !SFXGE_LRO */ + +static void +sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_buf) +{ +} + +static void +sfxge_lro_end_of_burst(struct sfxge_rxq *rxq) +{ +} + +#endif /* SFXGE_LRO */ + void sfxge_rx_qcomplete(struct sfxge_rxq *rxq, boolean_t eop) { @@ -1040,6 +1060,8 @@ fail: return (rc); } +#ifdef SFXGE_LRO + static void sfxge_lro_init(struct sfxge_rxq *rxq) { struct sfxge_lro_state *st = &rxq->lro; @@ -1092,6 +1114,20 @@ static void sfxge_lro_fini(struct sfxge_ st->conns = NULL; } +#else + +static void +sfxge_lro_init(struct sfxge_rxq *rxq) +{ +} + +static void +sfxge_lro_fini(struct sfxge_rxq *rxq) +{ +} + +#endif /* SFXGE_LRO */ + static void sfxge_rx_qfini(struct sfxge_softc *sc, unsigned int index) { @@ -1162,6 +1198,7 @@ static const struct { } sfxge_rx_stats[] = { #define SFXGE_RX_STAT(name, member) \ { #name, offsetof(struct sfxge_rxq, member) } +#ifdef SFXGE_LRO SFXGE_RX_STAT(lro_merges, lro.n_merges), SFXGE_RX_STAT(lro_bursts, lro.n_bursts), SFXGE_RX_STAT(lro_slow_start, lro.n_slow_start), @@ -1170,6 +1207,7 @@ static const struct { SFXGE_RX_STAT(lro_new_stream, lro.n_new_stream), SFXGE_RX_STAT(lro_drop_idle, lro.n_drop_idle), SFXGE_RX_STAT(lro_drop_closed, lro.n_drop_closed) +#endif }; static int @@ -1226,6 +1264,7 @@ sfxge_rx_init(struct sfxge_softc *sc) int index; int rc; +#ifdef SFXGE_LRO if (!ISP2(lro_table_size)) { log(LOG_ERR, "%s=%u must be power of 2", SFXGE_LRO_PARAM(table_size), lro_table_size); @@ -1235,6 +1274,7 @@ sfxge_rx_init(struct sfxge_softc *sc) if (lro_idle_ticks == 0) lro_idle_ticks = hz / 10 + 1; /* 100 ms */ +#endif intr = &sc->intr; @@ -1260,6 +1300,8 @@ fail: sc->rxq_count = 0; +#ifdef SFXGE_LRO fail_lro_table_size: +#endif return (rc); } Modified: stable/10/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 14:05:51 2015 (r280614) +++ stable/10/sys/dev/sfxge/sfxge_rx.h Wed Mar 25 14:10:20 2015 (r280615) @@ -32,6 +32,13 @@ #ifndef _SFXGE_RX_H #define _SFXGE_RX_H +#include "opt_inet.h" +#include "opt_inet6.h" + +#if defined(INET) || defined(INET6) +#define SFXGE_LRO 1 +#endif + #define SFXGE_MAGIC_RESERVED 0x8000 #define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 @@ -59,6 +66,8 @@ struct sfxge_rx_sw_desc { int size; }; +#ifdef SFXGE_LRO + /** * struct sfxge_lro_conn - Connection state for software LRO * @link: Link for hash table and free list. @@ -139,6 +148,8 @@ struct sfxge_lro_state { unsigned n_drop_closed; }; +#endif /* SFXGE_LRO */ + enum sfxge_flush_state { SFXGE_FLUSH_DONE = 0, SFXGE_FLUSH_PENDING, @@ -167,7 +178,9 @@ struct sfxge_rxq { unsigned int pending; unsigned int completed; unsigned int loopback; +#ifdef SFXGE_LRO struct sfxge_lro_state lro; +#endif unsigned int refill_threshold; struct callout refill_callout; unsigned int refill_delay; Modified: stable/10/sys/modules/sfxge/Makefile ============================================================================== --- stable/10/sys/modules/sfxge/Makefile Wed Mar 25 14:05:51 2015 (r280614) +++ stable/10/sys/modules/sfxge/Makefile Wed Mar 25 14:10:20 2015 (r280615) @@ -1,11 +1,13 @@ # $FreeBSD$ +.include + KMOD= sfxge SFXGE= ${.CURDIR}/../../dev/sfxge SRCS= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_sched.h .PATH: ${.CURDIR}/../../dev/sfxge SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c @@ -27,4 +29,16 @@ SRCS+= siena_flash.h siena_impl.h DEBUG_FLAGS= -DDEBUG=1 +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 17:58:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18E03279; Wed, 25 Mar 2015 17:58:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E03B64; Wed, 25 Mar 2015 17:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PHwjxQ009852; Wed, 25 Mar 2015 17:58:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PHwjX4009851; Wed, 25 Mar 2015 17:58:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503251758.t2PHwjX4009851@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 25 Mar 2015 17:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280628 - in stable: 10/release/doc/share/xml 8/release/doc/share/xml 9/release/doc/share/xml 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.18-1 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, 25 Mar 2015 17:58:46 -0000 Author: gjb Date: Wed Mar 25 17:58:44 2015 New Revision: 280628 URL: https://svnweb.freebsd.org/changeset/base/280628 Log: Document SA-15:06. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/8/release/doc/share/xml/security.xml stable/9/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Wed Mar 25 17:20:59 2015 (r280627) +++ stable/10/release/doc/share/xml/security.xml Wed Mar 25 17:58:44 2015 (r280628) @@ -79,6 +79,13 @@ 25 February 2015 Integer overflow in IGMP protocol + + + FreeBSD-SA-15:06.openssl + 19 March 2015 + Multiple vulnerabilities + From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 25 20:57:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC4D1251; Wed, 25 Mar 2015 20:57:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E80101; Wed, 25 Mar 2015 20:57:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PKvvqV097048; Wed, 25 Mar 2015 20:57:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PKvtXT097039; Wed, 25 Mar 2015 20:57:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503252057.t2PKvtXT097039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Mar 2015 20:57: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: r280632 - in stable/10: sys/kern sys/sys usr.sbin/jail 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.18-1 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, 25 Mar 2015 20:57:58 -0000 Author: ian Date: Wed Mar 25 20:57:54 2015 New Revision: 280632 URL: https://svnweb.freebsd.org/changeset/base/280632 Log: MFC r279361, r279395, r279396: Allow the kern.osrelease and kern.osreldate sysctl values to be set in a jail's creation parameters. This allows the kernel version to be reliably spoofed within the jail whether examined directly with sysctl or indirectly with the uname -r and -K options. Export the new osreldate and osrelease jail parms in jail_get(2). Fix line wrap. Modified: stable/10/sys/kern/imgact_elf.c stable/10/sys/kern/init_main.c stable/10/sys/kern/kern_jail.c stable/10/sys/kern/kern_mib.c stable/10/sys/sys/jail.h stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/sys/kern/imgact_elf.c Wed Mar 25 20:57:54 2015 (r280632) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -996,7 +997,8 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_BASE, args->base); if (imgp->execpathp != 0) AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp); - AUXARGS_ENTRY(pos, AT_OSRELDATE, osreldate); + AUXARGS_ENTRY(pos, AT_OSRELDATE, + imgp->proc->p_ucred->cr_prison->pr_osreldate); if (imgp->canary != 0) { AUXARGS_ENTRY(pos, AT_CANARY, imgp->canary); AUXARGS_ENTRY(pos, AT_CANARYLEN, imgp->canarylen); Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/sys/kern/init_main.c Wed Mar 25 20:57:54 2015 (r280632) @@ -493,7 +493,7 @@ proc0_init(void *dummy __unused) td->td_flags = TDF_INMEM; td->td_pflags = TDP_KTHREAD; td->td_cpuset = cpuset_thread0(); - prison0.pr_cpuset = cpuset_ref(td->td_cpuset); + prison0_init(); p->p_peers = 0; p->p_leader = p; p->p_reaper = p; Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/sys/kern/kern_jail.c Wed Mar 25 20:57:54 2015 (r280632) @@ -238,6 +238,19 @@ static int jail_default_devfs_rsnum = JA static unsigned jail_max_af_ips = 255; #endif +/* + * Initialize the parts of prison0 that can't be static-initialized with + * constants. This is called from proc0_init() after creating thread0 cpuset. + */ +void +prison0_init(void) +{ + + prison0.pr_cpuset = cpuset_ref(thread0.td_cpuset); + prison0.pr_osreldate = osreldate; + strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); +} + #ifdef INET static int qcmp_v4(const void *ip1, const void *ip2) @@ -537,7 +550,7 @@ kern_jail_set(struct thread *td, struct struct prison *pr, *deadpr, *mypr, *ppr, *tpr; struct vnode *root; char *domain, *errmsg, *host, *name, *namelc, *p, *path, *uuid; - char *g_path; + char *g_path, *osrelstr; #if defined(INET) || defined(INET6) struct prison *tppr; void *op; @@ -547,7 +560,7 @@ kern_jail_set(struct thread *td, struct int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; int fi, jid, jsys, len, level; - int childmax, rsnum, slevel; + int childmax, osreldt, rsnum, slevel; int fullpath_disabled; #if defined(INET) || defined(INET6) int ii, ij; @@ -962,6 +975,46 @@ kern_jail_set(struct thread *td, struct } } + error = vfs_getopt(opts, "osrelease", (void **)&osrelstr, &len); + if (error == ENOENT) + osrelstr = NULL; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osrelease cannot be changed after creation"); + goto done_errmsg; + } + if (len == 0 || len >= OSRELEASELEN) { + error = EINVAL; + vfs_opterror(opts, + "osrelease string must be 1-%d bytes long", + OSRELEASELEN - 1); + goto done_errmsg; + } + } + + error = vfs_copyopt(opts, "osreldate", &osreldt, sizeof(osreldt)); + if (error == ENOENT) + osreldt = 0; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osreldate cannot be changed after creation"); + goto done_errmsg; + } + if (osreldt == 0) { + error = EINVAL; + vfs_opterror(opts, "osreldate cannot be 0"); + goto done_errmsg; + } + } + /* * Grab the allprison lock before letting modules check their * parameters. Once we have it, do not let go so we'll have a @@ -1290,6 +1343,12 @@ kern_jail_set(struct thread *td, struct pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; + pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; + if (osrelstr == NULL) + strcpy(pr->pr_osrelease, ppr->pr_osrelease); + else + strcpy(pr->pr_osrelease, osrelstr); + LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); @@ -2126,6 +2185,13 @@ kern_jail_get(struct thread *td, struct error = vfs_setopt(opts, "nodying", &i, sizeof(i)); if (error != 0 && error != ENOENT) goto done_deref; + error = vfs_setopt(opts, "osreldate", &pr->pr_osreldate, + sizeof(pr->pr_osreldate)); + if (error != 0 && error != ENOENT) + goto done_deref; + error = vfs_setopts(opts, "osrelease", pr->pr_osrelease); + if (error != 0 && error != ENOENT) + goto done_deref; /* Get the module parameters. */ mtx_unlock(&pr->pr_mtx); @@ -4321,12 +4387,20 @@ sysctl_jail_param(SYSCTL_HANDLER_ARGS) return (0); } +/* + * CTLFLAG_RDTUN in the following indicates jail parameters that can be set at + * jail creation time but cannot be changed in an existing jail. + */ SYSCTL_JAIL_PARAM(, jid, CTLTYPE_INT | CTLFLAG_RDTUN, "I", "Jail ID"); SYSCTL_JAIL_PARAM(, parent, CTLTYPE_INT | CTLFLAG_RD, "I", "Jail parent ID"); SYSCTL_JAIL_PARAM_STRING(, name, CTLFLAG_RW, MAXHOSTNAMELEN, "Jail name"); SYSCTL_JAIL_PARAM_STRING(, path, CTLFLAG_RDTUN, MAXPATHLEN, "Jail root path"); SYSCTL_JAIL_PARAM(, securelevel, CTLTYPE_INT | CTLFLAG_RW, "I", "Jail secure level"); +SYSCTL_JAIL_PARAM(, osreldate, CTLTYPE_INT | CTLFLAG_RDTUN, "I", + "Jail value for kern.osreldate and uname -K"); +SYSCTL_JAIL_PARAM_STRING(, osrelease, CTLFLAG_RDTUN, OSRELEASELEN, + "Jail value for kern.osrelease and uname -r"); SYSCTL_JAIL_PARAM(, enforce_statfs, CTLTYPE_INT | CTLFLAG_RW, "I", "Jail cannot see all mounted file systems"); SYSCTL_JAIL_PARAM(, devfs_ruleset, CTLTYPE_INT | CTLFLAG_RW, Modified: stable/10/sys/kern/kern_mib.c ============================================================================== --- stable/10/sys/kern/kern_mib.c Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/sys/kern/kern_mib.c Wed Mar 25 20:57:54 2015 (r280632) @@ -90,9 +90,6 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, C SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, kern_ident, 0, "Kernel identifier"); -SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD|CTLFLAG_MPSAFE| - CTLFLAG_CAPRD, osrelease, 0, "Operating system release"); - SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD|CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); @@ -105,13 +102,6 @@ SYSCTL_STRING(_kern, OID_AUTO, compiler_ SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| CTLFLAG_CAPRD, ostype, 0, "Operating system type"); -/* - * NOTICE: The *userland* release date is available in - * /usr/include/osreldate.h - */ -SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD|CTLFLAG_CAPRD, - &osreldate, 0, "Kernel release date"); - SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN, &maxproc, 0, "Maximum number of processes"); @@ -429,6 +419,48 @@ SYSCTL_PROC(_kern, KERN_HOSTID, hostid, CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, NULL, 0, sysctl_hostid, "LU", "Host ID"); +/* + * The osrelease string is copied from the global (osrelease in vers.c) into + * prison0 by a sysinit and is inherited by child jails if not changed at jail + * creation, so we always return the copy from the current prison data. + */ +static int +sysctl_osrelease(SYSCTL_HANDLER_ARGS) +{ + struct prison *pr; + + pr = req->td->td_ucred->cr_prison; + return (SYSCTL_OUT(req, pr->pr_osrelease, strlen(pr->pr_osrelease) + 1)); + +} + +SYSCTL_PROC(_kern, KERN_OSRELEASE, osrelease, + CTLTYPE_STRING | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_osrelease, "A", "Operating system release"); + +/* + * The osreldate number is copied from the global (osreldate in vers.c) into + * prison0 by a sysinit and is inherited by child jails if not changed at jail + * creation, so we always return the value from the current prison data. + */ +static int +sysctl_osreldate(SYSCTL_HANDLER_ARGS) +{ + struct prison *pr; + + pr = req->td->td_ucred->cr_prison; + return (SYSCTL_OUT(req, &pr->pr_osreldate, sizeof(pr->pr_osreldate))); + +} + +/* + * NOTICE: The *userland* release date is available in + * /usr/include/osreldate.h + */ +SYSCTL_PROC(_kern, KERN_OSRELDATE, osreldate, + CTLTYPE_INT | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_osreldate, "I", "Kernel release date"); + SYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD, 0, "Kernel Features"); #ifdef COMPAT_FREEBSD4 Modified: stable/10/sys/sys/jail.h ============================================================================== --- stable/10/sys/sys/jail.h Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/sys/sys/jail.h Wed Mar 25 20:57:54 2015 (r280632) @@ -134,6 +134,7 @@ MALLOC_DECLARE(M_PRISON); #include #define HOSTUUIDLEN 64 +#define OSRELEASELEN 32 struct racct; struct prison_racct; @@ -177,13 +178,15 @@ struct prison { int pr_securelevel; /* (p) securelevel */ int pr_enforce_statfs; /* (p) statfs permission */ int pr_devfs_rsnum; /* (p) devfs ruleset */ - int pr_spare[4]; + int pr_spare[3]; + int pr_osreldate; /* (c) kern.osreldate value */ unsigned long pr_hostid; /* (p) jail hostid */ char pr_name[MAXHOSTNAMELEN]; /* (p) admin jail name */ char pr_path[MAXPATHLEN]; /* (c) chroot path */ char pr_hostname[MAXHOSTNAMELEN]; /* (p) jail hostname */ char pr_domainname[MAXHOSTNAMELEN]; /* (p) jail domainname */ char pr_hostuuid[HOSTUUIDLEN]; /* (p) jail hostuuid */ + char pr_osrelease[OSRELEASELEN]; /* (c) kern.osrelease value */ }; struct prison_racct { @@ -364,6 +367,7 @@ void getcredhostname(struct ucred *, cha void getcreddomainname(struct ucred *, char *, size_t); void getcredhostuuid(struct ucred *, char *, size_t); void getcredhostid(struct ucred *, unsigned long *); +void prison0_init(void); int prison_allow(struct ucred *, unsigned); int prison_check(struct ucred *cred1, struct ucred *cred2); int prison_owns_vnet(struct ucred *); Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Wed Mar 25 20:57:08 2015 (r280631) +++ stable/10/usr.sbin/jail/jail.8 Wed Mar 25 20:57:54 2015 (r280632) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd February 25, 2015 .Dt JAIL 8 .Os .Sh NAME @@ -276,7 +276,7 @@ Then there are pseudo-parameters that ar .Nm itself. .Pp -Jails have a set a core parameters, and kernel modules can add their own +Jails have a set of core parameters, and kernel modules can add their own jail parameters. The current set of available parameters can be retrieved via .Dq Nm sysctl Fl d Va security.jail.param . @@ -471,6 +471,14 @@ The .Va jid of the parent of this jail, or zero if this is a top-level jail (read-only). +.It Va osrelease +The string for the jail's +.Va kern.osrelease +sysctl and uname -r. +.It Va osreldate +The number for the jail's +.Va kern.osreldate +and uname -K. .It Va allow.* Some restrictions of the jail environment may be set on a per-jail basis. From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 04:55:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89939475; Thu, 26 Mar 2015 04:55:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A007A87; Thu, 26 Mar 2015 04:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q4tN6S031072; Thu, 26 Mar 2015 04:55:23 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q4tNeH031071; Thu, 26 Mar 2015 04:55:23 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503260455.t2Q4tNeH031071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 26 Mar 2015 04:55: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: r280657 - stable/10/sys/dev/sis 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.18-1 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, 26 Mar 2015 04:55:23 -0000 Author: yongari Date: Thu Mar 26 04:55:22 2015 New Revision: 280657 URL: https://svnweb.freebsd.org/changeset/base/280657 Log: MFC r275816: Fix a bug introdiced in r217548. According to NS DP83815 data sheet, RX filter should be disabled before programming. Previously it was clearing wrong bits so RX filter was not disabled in RX filter configuration. MFC r277048: Enable receive filter in sis_rxfilter(). While I'm here add a check for driver running state for multicast filter handling. Modified: stable/10/sys/dev/sis/if_sis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sis/if_sis.c ============================================================================== --- stable/10/sys/dev/sis/if_sis.c Thu Mar 26 03:43:38 2015 (r280656) +++ stable/10/sys/dev/sis/if_sis.c Thu Mar 26 04:55:22 2015 (r280657) @@ -757,7 +757,8 @@ sis_rxfilter_ns(struct sis_softc *sc) if_maddr_runlock(ifp); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + /* Turn the receive filter on */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter | SIS_RXFILTCTL_ENABLE); CSR_READ_4(sc, SIS_RXFILT_CTL); } @@ -779,7 +780,7 @@ sis_rxfilter_sis(struct sis_softc *sc) filter = CSR_READ_4(sc, SIS_RXFILT_CTL); if (filter & SIS_RXFILTCTL_ENABLE) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); CSR_READ_4(sc, SIS_RXFILT_CTL); } filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | @@ -819,7 +820,8 @@ sis_rxfilter_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + /* Turn the receive filter on */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter | SIS_RXFILTCTL_ENABLE); CSR_READ_4(sc, SIS_RXFILT_CTL); } @@ -2014,8 +2016,6 @@ sis_initl(struct sis_softc *sc) } sis_rxfilter(sc); - /* Turn the receive filter on */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); /* * Load the address of the RX and TX lists. @@ -2137,7 +2137,8 @@ sis_ioctl(struct ifnet *ifp, u_long comm case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - sis_rxfilter(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 05:07:20 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31083753; Thu, 26 Mar 2015 05:07:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01789BB2; Thu, 26 Mar 2015 05:07:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q57JrW036285; Thu, 26 Mar 2015 05:07:19 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q57Jk7036284; Thu, 26 Mar 2015 05:07:19 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503260507.t2Q57Jk7036284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 26 Mar 2015 05:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280659 - stable/10/sys/dev/nge 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.18-1 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, 26 Mar 2015 05:07:20 -0000 Author: yongari Date: Thu Mar 26 05:07:18 2015 New Revision: 280659 URL: https://svnweb.freebsd.org/changeset/base/280659 Log: MFC r277050: Receive filter configuration is done in nge_rxfilter(). Remove unnecessary filter configuration code in nge_init_locked(). While I'm here add a check for driver running state for multicast filter handling. Also remove unnecessary assignment to error variable since it is cleared in the function entry. Modified: stable/10/sys/dev/nge/if_nge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nge/if_nge.c ============================================================================== --- stable/10/sys/dev/nge/if_nge.c Thu Mar 26 04:58:47 2015 (r280658) +++ stable/10/sys/dev/nge/if_nge.c Thu Mar 26 05:07:18 2015 (r280659) @@ -2102,27 +2102,6 @@ nge_init_locked(struct nge_softc *sc) */ nge_list_tx_init(sc); - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ARP); - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_PERFECT); - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_BROAD); - } else { - NGE_CLRBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_BROAD); - } - - /* Turn the receive filter on. */ - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ENABLE); - /* Set Rx filter. */ nge_rxfilter(sc); @@ -2335,9 +2314,9 @@ nge_ioctl(struct ifnet *ifp, u_long comm case SIOCADDMULTI: case SIOCDELMULTI: NGE_LOCK(sc); - nge_rxfilter(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + nge_rxfilter(sc); NGE_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 05:12:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65733B7C; Thu, 26 Mar 2015 05:12:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FCEFC7A; Thu, 26 Mar 2015 05:12:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q5CV6U040492; Thu, 26 Mar 2015 05:12:31 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q5CVHV040491; Thu, 26 Mar 2015 05:12:31 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503260512.t2Q5CVHV040491@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 26 Mar 2015 05:12: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: r280661 - stable/10/sys/dev/alc 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.18-1 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, 26 Mar 2015 05:12:31 -0000 Author: yongari Date: Thu Mar 26 05:12:30 2015 New Revision: 280661 URL: https://svnweb.freebsd.org/changeset/base/280661 Log: MFC r277907: Correct device description message. Modified: stable/10/sys/dev/alc/if_alc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/alc/if_alc.c ============================================================================== --- stable/10/sys/dev/alc/if_alc.c Thu Mar 26 05:08:35 2015 (r280660) +++ stable/10/sys/dev/alc/if_alc.c Thu Mar 26 05:12:30 2015 (r280661) @@ -113,11 +113,11 @@ static struct alc_ident alc_ident_table[ { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8161, 9 * 1024, "Atheros AR8161 PCIe Gigabit Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8162, 9 * 1024, - "Atheros AR8161 PCIe Fast Ethernet" }, + "Atheros AR8162 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8171, 9 * 1024, - "Atheros AR8161 PCIe Gigabit Ethernet" }, + "Atheros AR8171 PCIe Gigabit Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8172, 9 * 1024, - "Atheros AR8161 PCIe Fast Ethernet" }, + "Atheros AR8172 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, "Killer E2200 Gigabit Ethernet" }, { 0, 0, 0, NULL} From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 05:17:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6049E32; Thu, 26 Mar 2015 05:17:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B094FC9C; Thu, 26 Mar 2015 05:17:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q5HLeG041238; Thu, 26 Mar 2015 05:17:21 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q5HLnP041237; Thu, 26 Mar 2015 05:17:21 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503260517.t2Q5HLnP041237@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 26 Mar 2015 05:17:21 +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: r280663 - stable/10/sys/dev/bce 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.18-1 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, 26 Mar 2015 05:17:21 -0000 Author: yongari Date: Thu Mar 26 05:17:20 2015 New Revision: 280663 URL: https://svnweb.freebsd.org/changeset/base/280663 Log: MFC r279223: Correct a typo. Modified: stable/10/sys/dev/bce/if_bcereg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/10/sys/dev/bce/if_bcereg.h Thu Mar 26 05:13:03 2015 (r280662) +++ stable/10/sys/dev/bce/if_bcereg.h Thu Mar 26 05:17:20 2015 (r280663) @@ -464,7 +464,7 @@ /* Returns FALSE in "defects" per 2^31 - 1 calls, otherwise returns TRUE. */ #define DB_RANDOMFALSE(defects) (random() > defects) #define DB_OR_RANDOMFALSE(defects) || (random() > defects) -#define DB_AND_RANDOMFALSE(defects) && (random() > ddfects) +#define DB_AND_RANDOMFALSE(defects) && (random() > defects) /* Returns TRUE in "defects" per 2^31 - 1 calls, otherwise returns FALSE. */ #define DB_RANDOMTRUE(defects) (random() < defects) From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 05:44:23 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 205E851C; Thu, 26 Mar 2015 05:44:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0243CF1E; Thu, 26 Mar 2015 05:44:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q5iMg2054949; Thu, 26 Mar 2015 05:44:22 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q5iMa9054947; Thu, 26 Mar 2015 05:44:22 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503260544.t2Q5iMa9054947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 26 Mar 2015 05:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280667 - stable/10/sys/dev/mii 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.18-1 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, 26 Mar 2015 05:44:23 -0000 Author: yongari Date: Thu Mar 26 05:44:21 2015 New Revision: 280667 URL: https://svnweb.freebsd.org/changeset/base/280667 Log: MFC r279903,279941: Add RTL8211F gigabit PHY support. PR: 197265 Modified: stable/10/sys/dev/mii/rgephy.c stable/10/sys/dev/mii/rgephyreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mii/rgephy.c ============================================================================== --- stable/10/sys/dev/mii/rgephy.c Thu Mar 26 05:37:44 2015 (r280666) +++ stable/10/sys/dev/mii/rgephy.c Thu Mar 26 05:44:21 2015 (r280667) @@ -85,6 +85,7 @@ static int rgephy_service(struct mii_sof static void rgephy_status(struct mii_softc *); static int rgephy_mii_phy_auto(struct mii_softc *, int); static void rgephy_reset(struct mii_softc *); +static int rgephy_linkup(struct mii_softc *); static void rgephy_loop(struct mii_softc *); static void rgephy_load_dspcode(struct mii_softc *); @@ -147,7 +148,7 @@ static int rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg, speed, gig, anar; + int speed, gig, anar; switch (cmd) { case MII_POLLSTAT: @@ -249,20 +250,9 @@ setit: * Check to see if we have link. If we do, we don't * need to restart the autonegotiation process. */ - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && - sc->mii_mpd_rev >= 2) { - /* RTL8211B(L) */ - reg = PHY_READ(sc, RGEPHY_MII_SSR); - if (reg & RGEPHY_SSR_LINK) { - sc->mii_ticks = 0; - break; - } - } else { - reg = PHY_READ(sc, RL_GMEDIASTAT); - if (reg & RL_GMEDIASTAT_LINK) { - sc->mii_ticks = 0; - break; - } + if (rgephy_linkup(sc) != 0) { + sc->mii_ticks = 0; + break; } /* Announce link loss right after it happens. */ @@ -295,6 +285,33 @@ setit: return (0); } +static int +rgephy_linkup(struct mii_softc *sc) +{ + int linkup; + uint16_t reg; + + linkup = 0; + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && + sc->mii_mpd_rev >= RGEPHY_8211B) { + if (sc->mii_mpd_rev == RGEPHY_8211F) { + reg = PHY_READ(sc, RGEPHY_F_MII_SSR); + if (reg & RGEPHY_F_SSR_LINK) + linkup++; + } else { + reg = PHY_READ(sc, RGEPHY_MII_SSR); + if (reg & RGEPHY_SSR_LINK) + linkup++; + } + } else { + reg = PHY_READ(sc, RL_GMEDIASTAT); + if (reg & RL_GMEDIASTAT_LINK) + linkup++; + } + + return (linkup); +} + static void rgephy_status(struct mii_softc *sc) { @@ -305,18 +322,10 @@ rgephy_status(struct mii_softc *sc) mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - if (ssr & RGEPHY_SSR_LINK) - mii->mii_media_status |= IFM_ACTIVE; - } else { - bmsr = PHY_READ(sc, RL_GMEDIASTAT); - if (bmsr & RL_GMEDIASTAT_LINK) - mii->mii_media_status |= IFM_ACTIVE; - } + if (rgephy_linkup(sc) != 0) + mii->mii_media_status |= IFM_ACTIVE; bmsr = PHY_READ(sc, RGEPHY_MII_BMSR); - bmcr = PHY_READ(sc, RGEPHY_MII_BMCR); if (bmcr & RGEPHY_BMCR_ISO) { mii->mii_media_active |= IFM_NONE; @@ -335,26 +344,50 @@ rgephy_status(struct mii_softc *sc) } } - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - switch (ssr & RGEPHY_SSR_SPD_MASK) { - case RGEPHY_SSR_S1000: - mii->mii_media_active |= IFM_1000_T; - break; - case RGEPHY_SSR_S100: - mii->mii_media_active |= IFM_100_TX; - break; - case RGEPHY_SSR_S10: - mii->mii_media_active |= IFM_10_T; - break; - default: - mii->mii_media_active |= IFM_NONE; - break; + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && + sc->mii_mpd_rev >= RGEPHY_8211B) { + if (sc->mii_mpd_rev == RGEPHY_8211F) { + ssr = PHY_READ(sc, RGEPHY_F_MII_SSR); + switch (ssr & RGEPHY_F_SSR_SPD_MASK) { + case RGEPHY_F_SSR_S1000: + mii->mii_media_active |= IFM_1000_T; + break; + case RGEPHY_F_SSR_S100: + mii->mii_media_active |= IFM_100_TX; + break; + case RGEPHY_F_SSR_S10: + mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + break; + } + if (ssr & RGEPHY_F_SSR_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; + + } else { + ssr = PHY_READ(sc, RGEPHY_MII_SSR); + switch (ssr & RGEPHY_SSR_SPD_MASK) { + case RGEPHY_SSR_S1000: + mii->mii_media_active |= IFM_1000_T; + break; + case RGEPHY_SSR_S100: + mii->mii_media_active |= IFM_100_TX; + break; + case RGEPHY_SSR_S10: + mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + break; + } + if (ssr & RGEPHY_SSR_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } - if (ssr & RGEPHY_SSR_FDX) - mii->mii_media_active |= IFM_FDX; - else - mii->mii_media_active |= IFM_HDX; } else { bmsr = PHY_READ(sc, RL_GMEDIASTAT); if (bmsr & RL_GMEDIASTAT_1000MBPS) @@ -408,7 +441,7 @@ rgephy_loop(struct mii_softc *sc) int i; if (sc->mii_mpd_model != MII_MODEL_REALTEK_RTL8251 && - sc->mii_mpd_rev < 2) { + sc->mii_mpd_rev < RGEPHY_8211B) { PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_PDOWN); DELAY(1000); } @@ -442,7 +475,7 @@ rgephy_load_dspcode(struct mii_softc *sc int val; if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8251 || - sc->mii_mpd_rev >= 2) + sc->mii_mpd_rev >= RGEPHY_8211B) return; PHY_WRITE(sc, 31, 0x0001); @@ -493,22 +526,34 @@ rgephy_reset(struct mii_softc *sc) { uint16_t pcr, ssr; - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev == 3) { - /* RTL8211C(L) */ - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - if ((ssr & RGEPHY_SSR_ALDPS) != 0) { - ssr &= ~RGEPHY_SSR_ALDPS; - PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); + switch (sc->mii_mpd_rev) { + case RGEPHY_8211F: + pcr = PHY_READ(sc, RGEPHY_F_MII_PCR1); + if ((pcr & RGEPHY_F_PCR1_MDI_MM) != 0) { + pcr &= ~RGEPHY_F_PCR1_MDI_MM; + PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr); } - } - - if (sc->mii_mpd_rev >= 2) { - pcr = PHY_READ(sc, RGEPHY_MII_PCR); - if ((pcr & RGEPHY_PCR_MDIX_AUTO) == 0) { - pcr &= ~RGEPHY_PCR_MDI_MASK; - pcr |= RGEPHY_PCR_MDIX_AUTO; - PHY_WRITE(sc, RGEPHY_MII_PCR, pcr); + break; + case RGEPHY_8211C: + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0) { + /* RTL8211C(L) */ + ssr = PHY_READ(sc, RGEPHY_MII_SSR); + if ((ssr & RGEPHY_SSR_ALDPS) != 0) { + ssr &= ~RGEPHY_SSR_ALDPS; + PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); + } } + /* FALLTHROUGH */ + default: + if (sc->mii_mpd_rev >= RGEPHY_8211B) { + pcr = PHY_READ(sc, RGEPHY_MII_PCR); + if ((pcr & RGEPHY_PCR_MDIX_AUTO) == 0) { + pcr &= ~RGEPHY_PCR_MDI_MASK; + pcr |= RGEPHY_PCR_MDIX_AUTO; + PHY_WRITE(sc, RGEPHY_MII_PCR, pcr); + } + } + break; } mii_phy_reset(sc); Modified: stable/10/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/10/sys/dev/mii/rgephyreg.h Thu Mar 26 05:37:44 2015 (r280666) +++ stable/10/sys/dev/mii/rgephyreg.h Thu Mar 26 05:44:21 2015 (r280667) @@ -35,6 +35,10 @@ #ifndef _DEV_MII_RGEPHYREG_H_ #define _DEV_MII_RGEPHYREG_H_ +#define RGEPHY_8211B 2 +#define RGEPHY_8211C 3 +#define RGEPHY_8211F 6 + /* * RealTek 8169S/8110S gigE PHY registers */ @@ -162,4 +166,21 @@ #define RGEPHY_SSR_ALDPS 0x0008 /* RTL8211C(L) only */ #define RGEPHY_SSR_JABBER 0x0001 /* Jabber */ +/* RTL8211F */ +#define RGEPHY_F_MII_PCR1 0x18 /* PHY Specific control register 1 */ +#define RGEPHY_F_PCR1_MDI_MM 0x0200 /* MDI / MDIX Manual Mode */ +#define RGEPHY_F_PCR1_MDI_MODE 0x0100 /* MDI Mode (0=MDIX,1=MDI) */ +#define RGEPHY_F_PCR1_ALDPS_EN 0x0004 /* Link Down Power Saving Enable */ + +/* RTL8211F */ +#define RGEPHY_F_MII_SSR 0x1A /* PHY Specific status register */ +#define RGEPHY_F_SSR_S1000 0x0020 /* 1000Mbps */ +#define RGEPHY_F_SSR_S100 0x0010 /* 100Mbps */ +#define RGEPHY_F_SSR_S10 0x0000 /* 10Mbps */ +#define RGEPHY_F_SSR_SPD_MASK 0x0030 +#define RGEPHY_F_SSR_FDX 0x0008 /* full duplex */ +#define RGEPHY_F_SSR_LINK 0x0004 /* link up */ +#define RGEPHY_F_SSR_MDI 0x0002 /* MDI/MDIX */ +#define RGEPHY_F_SSR_JABBER 0x0001 /* Jabber */ + #endif /* _DEV_RGEPHY_MIIREG_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 08:36:10 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 084FF601; Thu, 26 Mar 2015 08:36:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCA951D2; Thu, 26 Mar 2015 08:36:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q8a9rm034303; Thu, 26 Mar 2015 08:36:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q8a9WG034302; Thu, 26 Mar 2015 08:36:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503260836.t2Q8a9WG034302@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 08:36: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: r280678 - stable/10/sys/geom/mirror 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.18-1 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, 26 Mar 2015 08:36:10 -0000 Author: mav Date: Thu Mar 26 08:36:08 2015 New Revision: 280678 URL: https://svnweb.freebsd.org/changeset/base/280678 Log: MFC r279913: Fix couple BIO_DELETE bugs in geom_mirror. Do not report GEOM::candelete if none of providers support BIO_DELETE. If consumer still requests BIO_DELETE, report error instead of hanging. Modified: stable/10/sys/geom/mirror/g_mirror.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Thu Mar 26 07:28:32 2015 (r280677) +++ stable/10/sys/geom/mirror/g_mirror.c Thu Mar 26 08:36:08 2015 (r280678) @@ -1027,6 +1027,23 @@ g_mirror_sync_done(struct bio *bp) } static void +g_mirror_candelete(struct bio *bp) +{ + struct g_mirror_softc *sc; + struct g_mirror_disk *disk; + int *val; + + sc = bp->bio_to->geom->softc; + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) + break; + } + val = (int *)bp->bio_data; + *val = (disk != NULL); + g_io_deliver(bp, 0); +} + +static void g_mirror_kernel_dump(struct bio *bp) { struct g_mirror_softc *sc; @@ -1120,9 +1137,10 @@ g_mirror_start(struct bio *bp) g_mirror_flush(sc, bp); return; case BIO_GETATTR: - if (g_handleattr_int(bp, "GEOM::candelete", 1)) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) { + g_mirror_candelete(bp); return; - else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + } else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_mirror_kernel_dump(bp); return; } @@ -1686,6 +1704,10 @@ g_mirror_register_request(struct bio *bp ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); } + if (bioq_first(&queue) == NULL) { + g_io_deliver(bp, EOPNOTSUPP); + return; + } while ((cbp = bioq_takefirst(&queue)) != NULL) { G_MIRROR_LOGREQ(3, cbp, "Sending request."); cp = cbp->bio_caller1; From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 08:38:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F18A847; Thu, 26 Mar 2015 08:38:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30F8E1F5; Thu, 26 Mar 2015 08:38:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q8ctnI034776; Thu, 26 Mar 2015 08:38:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q8csGi034774; Thu, 26 Mar 2015 08:38:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503260838.t2Q8csGi034774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 08:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280679 - stable/10/sbin/camcontrol 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.18-1 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, 26 Mar 2015 08:38:55 -0000 Author: mav Date: Thu Mar 26 08:38:53 2015 New Revision: 280679 URL: https://svnweb.freebsd.org/changeset/base/280679 Log: MFC r280249: Add camcontrol subcommands to control APM and AAM levels. Sponsored by: iXsystems, Inc. Modified: stable/10/sbin/camcontrol/camcontrol.8 stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.8 Thu Mar 26 08:36:08 2015 (r280678) +++ stable/10/sbin/camcontrol/camcontrol.8 Thu Mar 26 08:38:53 2015 (r280679) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2014 +.Dd March 19, 2015 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -239,6 +239,16 @@ .Op device id .Op generic args .Nm +.Ic apm +.Op device id +.Op generic args +.Op Fl l Ar level +.Nm +.Ic aam +.Op device id +.Op generic args +.Op Fl l Ar level +.Nm .Ic fwdownload .Op device id .Op generic args @@ -1291,6 +1301,19 @@ Value 0 disables timer. Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic apm +It optional parameter +.Pq Fl l +specified, enables and sets advanced power management level, where +1 -- minimum power, 127 -- maximum performance with standby, +128 -- minimum power without standby, 254 -- maximum performance. +If not specified -- APM is disabled. +.It Ic aam +It optional parameter +.Pq Fl l +specified, enables and sets automatic acoustic management level, where +1 -- minimum noise, 254 -- maximum performance. +If not specified -- AAM is disabled. .It Ic security Update or report security settings, using an ATA identify command (0xec). By default, Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Thu Mar 26 08:36:08 2015 (r280678) +++ stable/10/sbin/camcontrol/camcontrol.c Thu Mar 26 08:38:53 2015 (r280679) @@ -96,7 +96,9 @@ typedef enum { CAM_CMD_SECURITY = 0x0000001d, CAM_CMD_HPA = 0x0000001e, CAM_CMD_SANITIZE = 0x0000001f, - CAM_CMD_PERSIST = 0x00000020 + CAM_CMD_PERSIST = 0x00000020, + CAM_CMD_APM = 0x00000021, + CAM_CMD_AAM = 0x00000022 } cam_cmdmask; typedef enum { @@ -216,6 +218,8 @@ static struct camcontrol_opts option_tab {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"apm", CAM_CMD_APM, CAM_ARG_NONE, "l:"}, + {"aam", CAM_CMD_AAM, CAM_ARG_NONE, "l:"}, {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, @@ -1406,7 +1410,7 @@ atacapprint(struct ata_params *parm) parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no"); if (parm->support.command2 & ATA_SUPPORT_APM) { printf(" %d/0x%02X\n", - parm->apm_value, parm->apm_value); + parm->apm_value & 0xff, parm->apm_value & 0xff); } else printf("\n"); printf("automatic acoustic management %s %s", @@ -8001,6 +8005,68 @@ bailout: return (retval); } +static int +ataaxm(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) +{ + union ccb *ccb; + int retval = 0; + int l = -1; + int c; + u_char cmd, sc; + + ccb = cam_getccb(device); + + if (ccb == NULL) { + warnx("%s: error allocating ccb", __func__); + return (1); + } + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'l': + l = atoi(optarg); + break; + default: + break; + } + } + sc = 0; + if (strcmp(argv[1], "apm") == 0) { + if (l == -1) + cmd = 0x85; + else { + cmd = 0x05; + sc = l; + } + } else /* aam */ { + if (l == -1) + cmd = 0xC2; + else { + cmd = 0x42; + sc = l; + } + } + + retval = ata_do_28bit_cmd(device, + ccb, + /*retries*/retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SETFEATURES, + /*features*/cmd, + /*lba*/0, + /*sector_count*/sc, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/timeout ? timeout : 30 * 1000, + /*quiet*/1); + + cam_freeccb(ccb); + return (retval); +} + #endif /* MINIMALISTIC */ void @@ -8058,6 +8124,8 @@ usage(int printlong) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol apm [dev_id][generic args][-l level]\n" +" camcontrol aam [dev_id][generic args][-l level]\n" " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" " camcontrol security [dev_id][generic args]\n" " <-d pwd | -e pwd | -f | -h pwd | -k pwd>\n" @@ -8578,6 +8646,11 @@ main(int argc, char **argv) error = atapm(cam_dev, argc, argv, combinedopt, retry_count, timeout); break; + case CAM_CMD_APM: + case CAM_CMD_AAM: + error = ataaxm(cam_dev, argc, argv, + combinedopt, retry_count, timeout); + break; case CAM_CMD_SECURITY: error = atasecurity(cam_dev, retry_count, timeout, argc, argv, combinedopt); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 10:25:16 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7962DD79; Thu, 26 Mar 2015 10:25:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62D27F69; Thu, 26 Mar 2015 10:25:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QAPGnm085542; Thu, 26 Mar 2015 10:25:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QAPGLr085541; Thu, 26 Mar 2015 10:25:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503261025.t2QAPGLr085541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 Mar 2015 10:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280681 - 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.18-1 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, 26 Mar 2015 10:25:16 -0000 Author: hselasky Date: Thu Mar 26 10:25:15 2015 New Revision: 280681 URL: https://svnweb.freebsd.org/changeset/base/280681 Log: MFC r280262 and r280263: Add more known bugs to the USB audio manual page. Modified: stable/10/share/man/man4/snd_uaudio.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/10/share/man/man4/snd_uaudio.4 Thu Mar 26 09:13:16 2015 (r280680) +++ stable/10/share/man/man4/snd_uaudio.4 Thu Mar 26 10:25:15 2015 (r280681) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2011 +.Dd March 19, 2015 .Dt SND_UAUDIO 4 .Os .Sh NAME @@ -91,12 +91,27 @@ by The .Tn PCM framework in -.Fx , -as of this writing, does not handle device un-registrations in a properly -abstracted manner, i.e., a detach request is refused by the -.Tn PCM -framework if the device is in use. -It is necessary to allow the device un-registration to complete -successfully, otherwise the +.Fx +only supports synchronous device detach. +That means all mixer and DSP character devices belonging to a given +USB audio device must be closed when receiving an error on a DSP read, +a DSP write or a DSP IOCTL request. +Else the USB audio driver will wait for this to happen, preventing +enumeration of new devices on the parenting USB controller. +.Pp +Some USB audio devices might refuse to work properly unless the sample +rate is configured the same for both recording and playback, even if +only simplex is used. +See the +.Va dev.pcm.%d.[play|rec].vchanrate +sysctls. +.Pp +The .Tn PCM -layer will panic. +framework in +.Fx +currently doesn't support the full set of USB audio mixer +controls. +Some mixer controls are only available as +.Va dev.pcm.%d.mixer +sysctls. From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 10:44:18 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1D514FE; Thu, 26 Mar 2015 10:44:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCF91DD; Thu, 26 Mar 2015 10:44:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QAiG2q094786; Thu, 26 Mar 2015 10:44:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QAiGt8094785; Thu, 26 Mar 2015 10:44:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503261044.t2QAiGt8094785@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Mar 2015 10:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280684 - stable/10/sys/x86/iommu 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.18-1 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, 26 Mar 2015 10:44:18 -0000 Author: kib Date: Thu Mar 26 10:44:16 2015 New Revision: 280684 URL: https://svnweb.freebsd.org/changeset/base/280684 Log: MFC r280254: Provide definitions for all descriptors types in the DMAR invalidation queue. Modified: stable/10/sys/x86/iommu/intel_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_reg.h ============================================================================== --- stable/10/sys/x86/iommu/intel_reg.h Thu Mar 26 10:27:39 2015 (r280683) +++ stable/10/sys/x86/iommu/intel_reg.h Thu Mar 26 10:44:16 2015 (r280684) @@ -180,7 +180,7 @@ typedef struct dmar_irte { /* IOTLB Register Offset */ #define DMAR_ECAP_SC (1 << 7) /* Snoop Control */ #define DMAR_ECAP_PT (1 << 6) /* Pass Through */ -#define DMAR_ECAP_EIM (1 << 4) /* Extended Interrupt Mode */ +#define DMAR_ECAP_EIM (1 << 4) /* Extended Interrupt Mode (x2APIC) */ #define DMAR_ECAP_IR (1 << 3) /* Interrupt Remapping */ #define DMAR_ECAP_DI (1 << 2) /* Device IOTLB */ #define DMAR_ECAP_QI (1 << 1) /* Queued Invalidation */ @@ -320,8 +320,8 @@ typedef struct dmar_irte { #define DMAR_IQ_DESCR_SZ (1 << DMAR_IQ_DESCR_SZ_SHIFT) /* Descriptor size */ -#define DMAR_IQ_DESCR_CTX_INV 0x1 /* Context-cache Invalidate - Descriptor */ +/* Context-cache Invalidate Descriptor */ +#define DMAR_IQ_DESCR_CTX_INV 0x1 #define DMAR_IQ_DESCR_CTX_GLOB (0x1 << 4) /* Granularity: Global */ #define DMAR_IQ_DESCR_CTX_DOM (0x2 << 4) /* Granularity: Domain */ #define DMAR_IQ_DESCR_CTX_DEV (0x3 << 4) /* Granularity: Device */ @@ -329,7 +329,8 @@ typedef struct dmar_irte { #define DMAR_IQ_DESCR_CTX_SRC(x) (((uint64_t)(x)) << 32) /* Source Id */ #define DMAR_IQ_DESCR_CTX_FM(x) (((uint64_t)(x)) << 48) /* Function Mask */ -#define DMAR_IQ_DESCR_IOTLB_INV 0x2 /* IOTLB Invalidate Descriptor */ +/* IOTLB Invalidate Descriptor */ +#define DMAR_IQ_DESCR_IOTLB_INV 0x2 #define DMAR_IQ_DESCR_IOTLB_GLOB (0x1 << 4) /* Granularity: Global */ #define DMAR_IQ_DESCR_IOTLB_DOM (0x2 << 4) /* Granularity: Domain */ #define DMAR_IQ_DESCR_IOTLB_PAGE (0x3 << 4) /* Granularity: Page */ @@ -337,17 +338,31 @@ typedef struct dmar_irte { #define DMAR_IQ_DESCR_IOTLB_DR (1 << 7) /* Drain Reads */ #define DMAR_IQ_DESCR_IOTLB_DID(x) (((uint32_t)(x)) << 16) /* Domain Id */ -#define DMAR_IQ_DESCR_IEC_INV 0x4 /* Invalidate Interrupt Entry Cache */ +/* Device-TLB Invalidate Descriptor */ +#define DMAR_IQ_DESCR_DTLB_INV 0x3 + +/* Invalidate Interrupt Entry Cache */ +#define DMAR_IQ_DESCR_IEC_INV 0x4 #define DMAR_IQ_DESCR_IEC_IDX (1 << 4) /* Index-Selective Invalidation */ #define DMAR_IQ_DESCR_IEC_IIDX(x) (((uint64_t)x) << 32) /* Interrupt Index */ #define DMAR_IQ_DESCR_IEC_IM(x) ((x) << 27) /* Index Mask */ -#define DMAR_IQ_DESCR_WAIT_ID 0x5 /* Invalidation Wait Descriptor */ +/* Invalidation Wait Descriptor */ +#define DMAR_IQ_DESCR_WAIT_ID 0x5 #define DMAR_IQ_DESCR_WAIT_IF (1 << 4) /* Interrupt Flag */ #define DMAR_IQ_DESCR_WAIT_SW (1 << 5) /* Status Write */ #define DMAR_IQ_DESCR_WAIT_FN (1 << 6) /* Fence */ #define DMAR_IQ_DESCR_WAIT_SD(x) (((uint64_t)(x)) << 32) /* Status Data */ +/* Extended IOTLB Invalidate Descriptor */ +#define DMAR_IQ_DESCR_EIOTLB_INV 0x6 + +/* PASID-Cache Invalidate Descriptor */ +#define DMAR_IQ_DESCR_PASIDC_INV 0x7 + +/* Extended Device-TLB Invalidate Descriptor */ +#define DMAR_IQ_DESCR_EDTLB_INV 0x8 + /* Invalidation Queue Head register */ #define DMAR_IQH_REG 0x80 #define DMAR_IQH_MASK 0x7fff0 /* Next cmd index mask */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 17:51:12 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0C9BC8D; Thu, 26 Mar 2015 17:51:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB60DEC6; Thu, 26 Mar 2015 17:51:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QHpCo2098072; Thu, 26 Mar 2015 17:51:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QHpCWM098071; Thu, 26 Mar 2015 17:51:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503261751.t2QHpCWM098071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Mar 2015 17:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280703 - stable/10/sys/modules/drm2 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.18-1 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, 26 Mar 2015 17:51:12 -0000 Author: emaste Date: Thu Mar 26 17:51:11 2015 New Revision: 280703 URL: https://svnweb.freebsd.org/changeset/base/280703 Log: MFC r270572: drm/i915: Disable the build of i915 on PC98 This module is of no use on this platform. Modified: stable/10/sys/modules/drm2/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/drm2/Makefile ============================================================================== --- stable/10/sys/modules/drm2/Makefile Thu Mar 26 17:21:12 2015 (r280702) +++ stable/10/sys/modules/drm2/Makefile Thu Mar 26 17:51:11 2015 (r280703) @@ -3,6 +3,7 @@ .include .if ${MACHINE_CPUARCH} == "amd64" +_i915kms= i915kms _radeonkms= radeonkms . if ${MK_SOURCELESS_UCODE} != "no" _radeonkmsfw= radeonkmsfw @@ -11,6 +12,7 @@ _radeonkmsfw= radeonkmsfw .if ${MACHINE_CPUARCH} == "i386" . if ${MACHINE} != "pc98" +_i915kms= i915kms _radeonkms= radeonkms . if ${MK_SOURCELESS_UCODE} != "no" _radeonkmsfw= radeonkmsfw @@ -20,7 +22,7 @@ _radeonkmsfw= radeonkmsfw SUBDIR = \ drm2 \ - i915kms \ + ${_i915kms} \ ${_radeonkms} \ ${_radeonkmsfw} From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 26 18:45:00 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4591A229; Thu, 26 Mar 2015 18:45:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 312617CD; Thu, 26 Mar 2015 18:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QIixqx023958; Thu, 26 Mar 2015 18:44:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QIixAN023957; Thu, 26 Mar 2015 18:44:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503261844.t2QIixAN023957@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 26 Mar 2015 18:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280705 - stable/10/sys/netinet6 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.18-1 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, 26 Mar 2015 18:45:00 -0000 Author: ae Date: Thu Mar 26 18:44:59 2015 New Revision: 280705 URL: https://svnweb.freebsd.org/changeset/base/280705 Log: MFC r280236: To avoid a possible race, release the reference to ifa after return from nd6_dad_na_input(). Modified: stable/10/sys/netinet6/nd6_nbr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/10/sys/netinet6/nd6_nbr.c Thu Mar 26 18:25:53 2015 (r280704) +++ stable/10/sys/netinet6/nd6_nbr.c Thu Mar 26 18:44:59 2015 (r280705) @@ -700,8 +700,8 @@ nd6_na_input(struct mbuf *m, int off, in */ if (ifa && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE)) { - ifa_free(ifa); nd6_dad_na_input(ifa); + ifa_free(ifa); goto freeit; } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 00:12:48 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1842AE21; Fri, 27 Mar 2015 00:12:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1564100; Fri, 27 Mar 2015 00:12:47 +0000 (UTC) Received: from [192.168.1.73] (75-48-79-118.lightspeed.cncrca.sbcglobal.net [75.48.79.118]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B4739B913; Thu, 26 Mar 2015 20:12:45 -0400 (EDT) Message-ID: <5514A07B.70302@FreeBSD.org> Date: Thu, 26 Mar 2015 17:12:43 -0700 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r280455 - in stable/10: lib/libpmc sys/amd64/conf sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmcstudy References: <201503242000.t2OK0Cbg065573@svn.freebsd.org> In-Reply-To: <201503242000.t2OK0Cbg065573@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 26 Mar 2015 20:12:46 -0400 (EDT) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 27 Mar 2015 00:12:48 -0000 On 3/24/15 1:00 PM, Randall Stewart wrote: > Author: rrs > Date: Tue Mar 24 20:00:11 2015 > New Revision: 280455 > URL: https://svnweb.freebsd.org/changeset/base/280455 > > Log: > MFC of r277177 and r279894 with the fixes for the PMC for Haswell. > > Sponsored by: Netflix Inc. > > Added: > stable/10/usr.sbin/pmcstudy/ > - copied from r277177, head/usr.sbin/pmcstudy/ > Modified: > stable/10/lib/libpmc/libpmc.c > stable/10/sys/amd64/conf/GENERIC The change to GENERIC looks like it slipped in by accident? Neither of the commits to HEAD enabled hwpmc in GENERIC AFAICT. -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 00:42:52 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0A48BBF; Fri, 27 Mar 2015 00:42:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1029622; Fri, 27 Mar 2015 00:42:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R0gqxx095837; Fri, 27 Mar 2015 00:42:52 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R0gqFQ095836; Fri, 27 Mar 2015 00:42:52 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503270042.t2R0gqFQ095836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 27 Mar 2015 00:42: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: r280722 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 27 Mar 2015 00:42:53 -0000 Author: ken Date: Fri Mar 27 00:42:51 2015 New Revision: 280722 URL: https://svnweb.freebsd.org/changeset/base/280722 Log: MFC revision 280463 ------------------------------------------------------------------------ r280463 | ken | 2015-03-24 15:42:28 -0600 (Tue, 24 Mar 2015) | 5 lines Remove some #if 0'ed code that apparently confuses cscope. Requested by: Peter Xu MFC after: 3 days ------------------------------------------------------------------------ Sponsored by: Spectra Logic Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Mar 27 00:37:41 2015 (r280721) +++ stable/10/sys/cam/ctl/ctl.c Fri Mar 27 00:42:51 2015 (r280722) @@ -12154,9 +12154,6 @@ ctl_lun_reset(struct ctl_lun *lun, union /* * Run through the OOA queue and abort each I/O. */ -#if 0 - TAILQ_FOREACH((struct ctl_io_hdr *)xio, &lun->ooa_queue, ooa_links) { -#endif for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS; @@ -12337,9 +12334,6 @@ ctl_abort_task(union ctl_io *io) * untagged command to abort, simply abort the first untagged command * we come to. We only allow one untagged command at a time of course. */ -#if 0 - TAILQ_FOREACH((struct ctl_io_hdr *)xio, &lun->ooa_queue, ooa_links) { -#endif for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { #if 0 @@ -12377,7 +12371,7 @@ ctl_abort_task(union ctl_io *io) #if 0 if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) - || (xio->scsiio.tag_num == io->taskio.tag_num)) { + || (xio->scsiio.tag_num == io->taskio.tag_num)) #endif /* * XXX KDM we've got problems with FC, because it From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:41:50 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACA4CBFC; Fri, 27 Mar 2015 08:41:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EEB2A84; Fri, 27 Mar 2015 08:41:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8foJ3019904; Fri, 27 Mar 2015 08:41:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8foL1019903; Fri, 27 Mar 2015 08:41:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270841.t2R8foL1019903@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280731 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:41:50 -0000 Author: mav Date: Fri Mar 27 08:41:49 2015 New Revision: 280731 URL: https://svnweb.freebsd.org/changeset/base/280731 Log: MFC r279975: Use ahci_write_fis_d2h() for commands completion. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 03:55:04 2015 (r280730) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:41:49 2015 (r280731) @@ -773,8 +773,8 @@ handle_identify(struct ahci_port *p, int hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (p->atapi || hdr->prdtl == 0) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { uint16_t buf[256]; uint64_t sectors; @@ -852,19 +852,16 @@ handle_identify(struct ahci_port *p, int } ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); - p->tfd = ATA_S_DSC | ATA_S_READY; - p->is |= AHCI_P_IX_DP; - p->ci &= ~(1 << slot); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); } - ahci_generate_intr(p->pr_sc); } static void handle_atapi_identify(struct ahci_port *p, int slot, uint8_t *cfis) { if (!p->atapi) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { uint16_t buf[256]; @@ -895,11 +892,8 @@ handle_atapi_identify(struct ahci_port * buf[88] = (1 << 14 | 0x7f); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); - p->tfd = ATA_S_DSC | ATA_S_READY; - p->is |= AHCI_P_IX_DHR; - p->ci &= ~(1 << slot); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); } - ahci_generate_intr(p->pr_sc); } static void @@ -1480,9 +1474,7 @@ ahci_handle_cmd(struct ahci_port *p, int p->mult_sectors = cfis[12]; p->tfd = ATA_S_DSC | ATA_S_READY; } - p->is |= AHCI_P_IX_DP; - p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, p->tfd); break; case ATA_READ_DMA: case ATA_WRITE_DMA: @@ -1518,17 +1510,15 @@ ahci_handle_cmd(struct ahci_port *p, int break; case ATA_PACKET_CMD: if (!p->atapi) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else handle_packet_cmd(p, slot, cfis); break; default: WPRINTF("Unsupported cmd:%02x\n", cfis[2]); - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; } } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:42:56 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCE57D3E; Fri, 27 Mar 2015 08:42:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE355A96; Fri, 27 Mar 2015 08:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8guQY020095; Fri, 27 Mar 2015 08:42:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8gurt020094; Fri, 27 Mar 2015 08:42:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270842.t2R8gurt020094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:42: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: r280732 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:42:57 -0000 Author: mav Date: Fri Mar 27 08:42:55 2015 New Revision: 280732 URL: https://svnweb.freebsd.org/changeset/base/280732 Log: MFC r279960: Add support for PIO variants of READ/WRITE commands for AHCI disks. AHCI API hides all PIO specifics, so this functionality is almost free. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:41:49 2015 (r280731) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:42:55 2015 (r280732) @@ -520,12 +520,14 @@ ahci_handle_dma(struct ahci_port *p, int readop = 1; prdt += seek; - if (cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || - cfis[2] == ATA_WRITE_FPDMA_QUEUED) + if (cfis[2] == ATA_WRITE || cfis[2] == ATA_WRITE48 || + cfis[2] == ATA_WRITE_MUL || cfis[2] == ATA_WRITE_MUL48 || + cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || + cfis[2] == ATA_WRITE_FPDMA_QUEUED) readop = 0; if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || - cfis[2] == ATA_READ_FPDMA_QUEUED) { + cfis[2] == ATA_READ_FPDMA_QUEUED) { lba = ((uint64_t)cfis[10] << 40) | ((uint64_t)cfis[9] << 32) | ((uint64_t)cfis[8] << 24) | @@ -536,7 +538,9 @@ ahci_handle_dma(struct ahci_port *p, int if (!len) len = 65536; ncq = 1; - } else if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { + } else if (cfis[2] == ATA_READ48 || cfis[2] == ATA_WRITE48 || + cfis[2] == ATA_READ_MUL48 || cfis[2] == ATA_WRITE_MUL48 || + cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { lba = ((uint64_t)cfis[10] << 40) | ((uint64_t)cfis[9] << 32) | ((uint64_t)cfis[8] << 24) | @@ -1476,6 +1480,14 @@ ahci_handle_cmd(struct ahci_port *p, int } ahci_write_fis_d2h(p, slot, cfis, p->tfd); break; + case ATA_READ: + case ATA_WRITE: + case ATA_READ48: + case ATA_WRITE48: + case ATA_READ_MUL: + case ATA_WRITE_MUL: + case ATA_READ_MUL48: + case ATA_WRITE_MUL48: case ATA_READ_DMA: case ATA_WRITE_DMA: case ATA_READ_DMA48: From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:43:46 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6031E75; Fri, 27 Mar 2015 08:43:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0826AA0; Fri, 27 Mar 2015 08:43:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8hkap020260; Fri, 27 Mar 2015 08:43:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8hkxL020256; Fri, 27 Mar 2015 08:43:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270843.t2R8hkxL020256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:43: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: r280733 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:43:46 -0000 Author: mav Date: Fri Mar 27 08:43:45 2015 New Revision: 280733 URL: https://svnweb.freebsd.org/changeset/base/280733 Log: MFC r279965: Polish AHCI disk identify data and fix speed negotiation. Modified: stable/10/usr.sbin/bhyve/ahci.h stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/ahci.h ============================================================================== --- stable/10/usr.sbin/bhyve/ahci.h Fri Mar 27 08:42:55 2015 (r280732) +++ stable/10/usr.sbin/bhyve/ahci.h Fri Mar 27 08:43:45 2015 (r280733) @@ -96,13 +96,14 @@ #define ATA_SS_SPD_NO_SPEED 0x00000000 #define ATA_SS_SPD_GEN1 0x00000010 #define ATA_SS_SPD_GEN2 0x00000020 -#define ATA_SS_SPD_GEN3 0x00000040 +#define ATA_SS_SPD_GEN3 0x00000030 #define ATA_SS_IPM_MASK 0x00000f00 #define ATA_SS_IPM_NO_DEVICE 0x00000000 #define ATA_SS_IPM_ACTIVE 0x00000100 #define ATA_SS_IPM_PARTIAL 0x00000200 #define ATA_SS_IPM_SLUMBER 0x00000600 +#define ATA_SS_IPM_DEVSLEEP 0x00000800 #define ATA_SERROR 14 #define ATA_SE_DATA_CORRECTED 0x00000001 @@ -133,17 +134,19 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000040 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 #define ATA_SC_IPM_DIS_PARTIAL 0x00000100 #define ATA_SC_IPM_DIS_SLUMBER 0x00000200 +#define ATA_SC_IPM_DIS_DEVSLEEP 0x00000400 #define ATA_SACTIVE 16 #define AHCI_MAX_PORTS 32 #define AHCI_MAX_SLOTS 32 +#define AHCI_MAX_IRQS 16 /* SATA AHCI v1.0 register defines */ #define AHCI_CAP 0x00 @@ -208,6 +211,9 @@ #define AHCI_CAP2_BOH 0x00000001 #define AHCI_CAP2_NVMP 0x00000002 #define AHCI_CAP2_APST 0x00000004 +#define AHCI_CAP2_SDS 0x00000008 +#define AHCI_CAP2_SADM 0x00000010 +#define AHCI_CAP2_DESO 0x00000020 #define AHCI_OFFSET 0x100 #define AHCI_STEP 0x80 @@ -265,6 +271,7 @@ #define AHCI_P_CMD_ACTIVE 0x10000000 #define AHCI_P_CMD_PARTIAL 0x20000000 #define AHCI_P_CMD_SLUMBER 0x60000000 +#define AHCI_P_CMD_DEVSLEEP 0x80000000 #define AHCI_P_TFD 0x20 #define AHCI_P_SIG 0x24 @@ -284,6 +291,17 @@ #define AHCI_P_FBS_ADO_SHIFT 12 #define AHCI_P_FBS_DWE 0x000f0000 #define AHCI_P_FBS_DWE_SHIFT 16 +#define AHCI_P_DEVSLP 0x44 +#define AHCI_P_DEVSLP_ADSE 0x00000001 +#define AHCI_P_DEVSLP_DSP 0x00000002 +#define AHCI_P_DEVSLP_DETO 0x000003fc +#define AHCI_P_DEVSLP_DETO_SHIFT 2 +#define AHCI_P_DEVSLP_MDAT 0x00007c00 +#define AHCI_P_DEVSLP_MDAT_SHIFT 10 +#define AHCI_P_DEVSLP_DITO 0x01ff8000 +#define AHCI_P_DEVSLP_DITO_SHIFT 15 +#define AHCI_P_DEVSLP_DM 0x0e000000 +#define AHCI_P_DEVSLP_DM_SHIFT 25 /* Just to be sure, if building as module. */ #if MAXPHYS < 512 * 1024 Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:42:55 2015 (r280732) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:43:45 2015 (r280733) @@ -431,7 +431,6 @@ ahci_port_stop(struct ahci_port *p) static void ahci_port_reset(struct ahci_port *pr) { - pr->sctl = 0; pr->serr = 0; pr->sact = 0; pr->xfermode = ATA_UDMA6; @@ -443,8 +442,11 @@ ahci_port_reset(struct ahci_port *pr) pr->tfd = 0x7F; return; } - pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN2 | - ATA_SS_IPM_ACTIVE; + pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_IPM_ACTIVE; + if (pr->sctl & ATA_SC_SPD_MASK) + pr->ssts |= (pr->sctl & ATA_SC_SPD_MASK); + else + pr->ssts |= ATA_SS_SPD_GEN3; pr->tfd = (1 << 8) | ATA_S_DSC | ATA_S_DMA; if (!pr->atapi) { pr->sig = PxSIG_ATA; @@ -470,6 +472,7 @@ ahci_reset(struct pci_ahci_softc *sc) for (i = 0; i < sc->ports; i++) { sc->port[i].ie = 0; sc->port[i].is = 0; + sc->port[i].sctl = 0; ahci_port_reset(&sc->port[i]); } } @@ -808,26 +811,36 @@ handle_identify(struct ahci_port *p, int buf[53] = (1 << 1 | 1 << 2); if (p->mult_sectors) buf[59] = (0x100 | p->mult_sectors); - buf[60] = sectors; - buf[61] = (sectors >> 16); + if (sectors <= 0x0fffffff) { + buf[60] = sectors; + buf[61] = (sectors >> 16); + } else { + buf[60] = 0xffff; + buf[61] = 0x0fff; + } buf[63] = 0x7; if (p->xfermode & ATA_WDMA0) buf[63] |= (1 << ((p->xfermode & 7) + 8)); buf[64] = 0x3; - buf[65] = 100; - buf[66] = 100; - buf[67] = 100; - buf[68] = 100; + buf[65] = 120; + buf[66] = 120; + buf[67] = 120; + buf[68] = 120; buf[69] = 0; buf[75] = 31; - buf[76] = (1 << 8 | 1 << 2); + buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | + ATA_SUPPORT_NCQ); buf[80] = 0x1f0; buf[81] = 0x28; - buf[82] = (1 << 5 | 1 << 14); - buf[83] = (1 << 10 | 1 << 12 | 1 << 13 | 1 << 14); + buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + buf[83] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48 | 1 << 14); buf[84] = (1 << 14); - buf[85] = (1 << 5 | 1 << 14); - buf[86] = (1 << 10 | 1 << 12 | 1 << 13); + buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + buf[86] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48); buf[87] = (1 << 14); buf[88] = 0x7f; if (p->xfermode & ATA_UDMA0) @@ -854,6 +867,7 @@ handle_identify(struct ahci_port *p, int buf[117] = sectsz / 2; buf[118] = ((sectsz / 2) >> 16); } + buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -1851,10 +1865,10 @@ pci_ahci_port_write(struct pci_ahci_soft WPRINTF("pci_ahci_port: read only registers 0x%"PRIx64"\n", offset); break; case AHCI_P_SCTL: + p->sctl = value; if (!(p->cmd & AHCI_P_CMD_ST)) { if (value & ATA_SC_DET_RESET) ahci_port_reset(p); - p->sctl = value; } break; case AHCI_P_SERR: From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:44:59 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05524BC; Fri, 27 Mar 2015 08:44:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3DD1AB2; Fri, 27 Mar 2015 08:44:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8iwYm020483; Fri, 27 Mar 2015 08:44:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8iwUD020482; Fri, 27 Mar 2015 08:44:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270844.t2R8iwUD020482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280734 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:44:59 -0000 Author: mav Date: Fri Mar 27 08:44:58 2015 New Revision: 280734 URL: https://svnweb.freebsd.org/changeset/base/280734 Log: MFC r279967: Change prdbc value reporting. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:43:45 2015 (r280733) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:44:58 2015 (r280734) @@ -1663,6 +1663,9 @@ ata_ioreq_cb(struct blockif_req *br, int */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); + if (!err) + hdr->prdbc = aior->done; + if (dsm) { if (aior->done != aior->len && !err) { ahci_handle_dsm_trim(p, slot, cfis, aior->done); @@ -1678,13 +1681,8 @@ ata_ioreq_cb(struct blockif_req *br, int if (!err && aior->done == aior->len) { tfd = ATA_S_READY | ATA_S_DSC; - if (ncq) - hdr->prdbc = 0; - else - hdr->prdbc = aior->len; } else { tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - hdr->prdbc = 0; if (ncq) p->serr |= (1 << slot); } @@ -1739,6 +1737,9 @@ atapi_ioreq_cb(struct blockif_req *br, i */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); + if (!err) + hdr->prdbc = aior->done; + if (pending && !err) { atapi_read(p, slot, cfis, aior->done, hdr->prdtl - pending); goto out; @@ -1746,12 +1747,10 @@ atapi_ioreq_cb(struct blockif_req *br, i if (!err && aior->done == aior->len) { tfd = ATA_S_READY | ATA_S_DSC; - hdr->prdbc = aior->len; } else { p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; p->asc = 0x21; tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; - hdr->prdbc = 0; } cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:46:13 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 333F34C5; Fri, 27 Mar 2015 08:46:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E058AE3; Fri, 27 Mar 2015 08:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8kC0f021002; Fri, 27 Mar 2015 08:46:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8kCbX021001; Fri, 27 Mar 2015 08:46:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270846.t2R8kCbX021001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280735 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:46:13 -0000 Author: mav Date: Fri Mar 27 08:46:12 2015 New Revision: 280735 URL: https://svnweb.freebsd.org/changeset/base/280735 Log: MFC r279968: Remove incorrect SERR register setting. At this point we have nothing to report through that register. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:44:58 2015 (r280734) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:46:12 2015 (r280735) @@ -1683,8 +1683,6 @@ ata_ioreq_cb(struct blockif_req *br, int tfd = ATA_S_READY | ATA_S_DSC; } else { tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - if (ncq) - p->serr |= (1 << slot); } if (ncq) { From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:47:03 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A30BD60D; Fri, 27 Mar 2015 08:47:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D22DB28; Fri, 27 Mar 2015 08:47:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8l3CQ021166; Fri, 27 Mar 2015 08:47:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8l3Sf021165; Fri, 27 Mar 2015 08:47:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270847.t2R8l3Sf021165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:47: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: r280736 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:47:03 -0000 Author: mav Date: Fri Mar 27 08:47:02 2015 New Revision: 280736 URL: https://svnweb.freebsd.org/changeset/base/280736 Log: MFC r279975: Improve NCQ errors reporting for virtual AHCI disks. While this implementation is still not perfect, previous was just broken. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:46:12 2015 (r280735) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:47:02 2015 (r280736) @@ -134,6 +134,7 @@ struct ahci_port { int reset; int mult_sectors; uint8_t xfermode; + uint8_t err_cfis[20]; uint8_t sense_key; uint8_t asc; uint32_t pending; @@ -299,18 +300,27 @@ ahci_write_fis_piosetup(struct ahci_port } static void -ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd) +ahci_write_fis_sdb(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t tfd) { uint8_t fis[8]; uint8_t error; error = (tfd >> 8) & 0xff; memset(fis, 0, sizeof(fis)); - fis[0] = error; + fis[0] = FIS_TYPE_SETDEVBITS; + fis[1] = (1 << 6); fis[2] = tfd & 0x77; - *(uint32_t *)(fis + 4) = (1 << slot); - if (fis[2] & ATA_S_ERROR) + fis[3] = error; + if (fis[2] & ATA_S_ERROR) { p->is |= AHCI_P_IX_TFE; + p->err_cfis[0] = slot; + p->err_cfis[2] = tfd & 0x77; + p->err_cfis[3] = error; + memcpy(&p->err_cfis[4], cfis + 4, 16); + } else { + *(uint32_t *)(fis + 4) = (1 << slot); + p->sact &= ~(1 << slot); + } p->tfd = tfd; ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); } @@ -337,9 +347,13 @@ ahci_write_fis_d2h(struct ahci_port *p, fis[11] = cfis[11]; fis[12] = cfis[12]; fis[13] = cfis[13]; - if (fis[2] & ATA_S_ERROR) + if (fis[2] & ATA_S_ERROR) { p->is |= AHCI_P_IX_TFE; - else + p->err_cfis[0] = 0x80; + p->err_cfis[2] = tfd & 0xff; + p->err_cfis[3] = error; + memcpy(&p->err_cfis[4], cfis + 4, 16); + } else p->ci &= ~(1 << slot); p->tfd = tfd; ahci_write_fis(p, FIS_TYPE_REGD2H, fis); @@ -774,6 +788,29 @@ write_prdt(struct ahci_port *p, int slot } static void +ahci_handle_read_log(struct ahci_port *p, int slot, uint8_t *cfis) +{ + struct ahci_cmd_hdr *hdr; + uint8_t buf[512]; + + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); + if (p->atapi || hdr->prdtl == 0 || cfis[4] != 0x10 || + cfis[5] != 0 || cfis[9] != 0 || cfis[12] != 1 || cfis[13] != 0) { + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + return; + } + + memset(buf, 0, sizeof(buf)); + memcpy(buf, p->err_cfis, sizeof(p->err_cfis)); + + if (cfis[2] == ATA_READ_LOG_EXT) + ahci_write_fis_piosetup(p); + write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); +} + +static void handle_identify(struct ahci_port *p, int slot, uint8_t *cfis) { struct ahci_cmd_hdr *hdr; @@ -840,7 +877,7 @@ handle_identify(struct ahci_port *p, int buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); buf[86] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | - ATA_SUPPORT_FLUSHCACHE48); + ATA_SUPPORT_FLUSHCACHE48 | 1 << 15); buf[87] = (1 << 14); buf[88] = 0x7f; if (p->xfermode & ATA_UDMA0) @@ -867,6 +904,8 @@ handle_identify(struct ahci_port *p, int buf[117] = sectsz / 2; buf[118] = ((sectsz / 2) >> 16); } + buf[119] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); + buf[120] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); @@ -1523,6 +1562,10 @@ ahci_handle_cmd(struct ahci_port *p, int ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; + case ATA_READ_LOG_EXT: + case ATA_READ_LOG_DMA_EXT: + ahci_handle_read_log(p, slot, cfis); + break; case ATA_STANDBY_CMD: break; case ATA_NOP: @@ -1685,10 +1728,9 @@ ata_ioreq_cb(struct blockif_req *br, int tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; } - if (ncq) { - p->sact &= ~(1 << slot); - ahci_write_fis_sdb(p, slot, tfd); - } else + if (ncq) + ahci_write_fis_sdb(p, slot, cfis, tfd); + else ahci_write_fis_d2h(p, slot, cfis, tfd); /* From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:47:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7AB788C; Fri, 27 Mar 2015 08:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A837CB4F; Fri, 27 Mar 2015 08:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8ltUE021378; Fri, 27 Mar 2015 08:47:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8ltBL021377; Fri, 27 Mar 2015 08:47:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270847.t2R8ltBL021377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:47: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: r280738 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:47:56 -0000 Author: mav Date: Fri Mar 27 08:47:54 2015 New Revision: 280738 URL: https://svnweb.freebsd.org/changeset/base/280738 Log: MFC r279976: Add support for NCQ variant of DSM TRIM for virtual AHCI disks. The code is not really tested yet due to lack of initiator support. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:47:16 2015 (r280737) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:47:54 2015 (r280738) @@ -703,8 +703,13 @@ ahci_handle_dsm_trim(struct ahci_port *p int err; uint8_t buf[512]; - len = (uint16_t)cfis[13] << 8 | cfis[12]; - len *= 512; + if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { + len = (uint16_t)cfis[13] << 8 | cfis[12]; + len *= 512; + } else { /* ATA_SEND_FPDMA_QUEUED */ + len = (uint16_t)cfis[11] << 8 | cfis[3]; + len *= 512; + } read_prdt(p, slot, cfis, buf, sizeof(buf)); next: @@ -867,6 +872,8 @@ handle_identify(struct ahci_port *p, int buf[75] = 31; buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | ATA_SUPPORT_NCQ); + buf[77] = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | + (p->ssts & ATA_SS_SPD_MASK) >> 3); buf[80] = 0x1f0; buf[81] = 0x28; buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| @@ -1562,6 +1569,16 @@ ahci_handle_cmd(struct ahci_port *p, int ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; + case ATA_SEND_FPDMA_QUEUED: + if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM && + cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM && + cfis[11] == 0 && cfis[13] == 1) { + ahci_handle_dsm_trim(p, slot, cfis, 0); + break; + } + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; case ATA_READ_LOG_EXT: case ATA_READ_LOG_DMA_EXT: ahci_handle_read_log(p, slot, cfis); @@ -1689,9 +1706,12 @@ ata_ioreq_cb(struct blockif_req *br, int hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || - cfis[2] == ATA_READ_FPDMA_QUEUED) + cfis[2] == ATA_READ_FPDMA_QUEUED || + cfis[2] == ATA_SEND_FPDMA_QUEUED) ncq = 1; - if (cfis[2] == ATA_DATA_SET_MANAGEMENT) + if (cfis[2] == ATA_DATA_SET_MANAGEMENT || + (cfis[2] == ATA_SEND_FPDMA_QUEUED && + (cfis[13] & 0x1f) == ATA_SFPDMA_DSM)) dsm = 1; pthread_mutex_lock(&sc->mtx); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:48:45 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 333669EB; Fri, 27 Mar 2015 08:48:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7E9B64; Fri, 27 Mar 2015 08:48:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8midj021575; Fri, 27 Mar 2015 08:48:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8miQS021574; Fri, 27 Mar 2015 08:48:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270848.t2R8miQS021574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:48: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: r280739 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:48:45 -0000 Author: mav Date: Fri Mar 27 08:48:44 2015 New Revision: 280739 URL: https://svnweb.freebsd.org/changeset/base/280739 Log: MFC r279977: Fix NOP and IDLE commands for virtual AHCI disks. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:47:54 2015 (r280738) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:48:44 2015 (r280739) @@ -1583,10 +1583,13 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_READ_LOG_DMA_EXT: ahci_handle_read_log(p, slot, cfis); break; - case ATA_STANDBY_CMD: - break; case ATA_NOP: + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; + case ATA_STANDBY_CMD: case ATA_STANDBY_IMMEDIATE: + case ATA_IDLE_CMD: case ATA_IDLE_IMMEDIATE: case ATA_SLEEP: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:49:34 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D890B34; Fri, 27 Mar 2015 08:49:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57F99B71; Fri, 27 Mar 2015 08:49:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8nYb5021731; Fri, 27 Mar 2015 08:49:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8nYI1021730; Fri, 27 Mar 2015 08:49:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270849.t2R8nYI1021730@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:49: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: r280740 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:49:34 -0000 Author: mav Date: Fri Mar 27 08:49:33 2015 New Revision: 280740 URL: https://svnweb.freebsd.org/changeset/base/280740 Log: MFC r279979: Slightly polish virtual AHCI CD reporting. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:48:44 2015 (r280739) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:49:33 2015 (r280740) @@ -86,6 +86,7 @@ enum sata_fis_type { #define READ_TOC 0x43 #define GET_EVENT_STATUS_NOTIFICATION 0x4A #define MODE_SENSE_10 0x5A +#define REPORT_LUNS 0xA0 #define READ_12 0xA8 #define READ_CD 0xBE @@ -874,7 +875,7 @@ handle_identify(struct ahci_port *p, int ATA_SUPPORT_NCQ); buf[77] = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | (p->ssts & ATA_SS_SPD_MASK) >> 3); - buf[80] = 0x1f0; + buf[80] = 0x3f0; buf[81] = 0x28; buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); @@ -940,20 +941,28 @@ handle_atapi_identify(struct ahci_port * buf[53] = (1 << 2 | 1 << 1); buf[62] = 0x3f; buf[63] = 7; + if (p->xfermode & ATA_WDMA0) + buf[63] |= (1 << ((p->xfermode & 7) + 8)); buf[64] = 3; - buf[65] = 100; - buf[66] = 100; - buf[67] = 100; - buf[68] = 100; - buf[76] = (1 << 2 | 1 << 1); + buf[65] = 120; + buf[66] = 120; + buf[67] = 120; + buf[68] = 120; + buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3); + buf[77] = ((p->ssts & ATA_SS_SPD_MASK) >> 3); buf[78] = (1 << 5); - buf[80] = (0x1f << 4); - buf[82] = (1 << 4); + buf[80] = 0x3f0; + buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); buf[83] = (1 << 14); buf[84] = (1 << 14); - buf[85] = (1 << 4); + buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); buf[87] = (1 << 14); - buf[88] = (1 << 14 | 0x7f); + buf[88] = 0x7f; + if (p->xfermode & ATA_UDMA0) + buf[88] |= (1 << ((p->xfermode & 7) + 8)); + buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -966,22 +975,41 @@ atapi_inquiry(struct ahci_port *p, int s uint8_t buf[36]; uint8_t *acmd; int len; + uint32_t tfd; acmd = cfis + 0x40; - buf[0] = 0x05; - buf[1] = 0x80; - buf[2] = 0x00; - buf[3] = 0x21; - buf[4] = 31; - buf[5] = 0; - buf[6] = 0; - buf[7] = 0; - atapi_string(buf + 8, "BHYVE", 8); - atapi_string(buf + 16, "BHYVE DVD-ROM", 16); - atapi_string(buf + 32, "001", 4); + if (acmd[1] & 1) { /* VPD */ + if (acmd[2] == 0) { /* Supported VPD pages */ + buf[0] = 0x05; + buf[1] = 0; + buf[2] = 0; + buf[3] = 1; + buf[4] = 0; + len = 4 + buf[3]; + } else { + p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; + p->asc = 0x24; + tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + ahci_write_fis_d2h(p, slot, cfis, tfd); + return; + } + } else { + buf[0] = 0x05; + buf[1] = 0x80; + buf[2] = 0x00; + buf[3] = 0x21; + buf[4] = 31; + buf[5] = 0; + buf[6] = 0; + buf[7] = 0; + atapi_string(buf + 8, "BHYVE", 8); + atapi_string(buf + 16, "BHYVE DVD-ROM", 16); + atapi_string(buf + 32, "001", 4); + len = sizeof(buf); + } - len = sizeof(buf); if (len > acmd[4]) len = acmd[4]; cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; @@ -1185,6 +1213,19 @@ atapi_read_toc(struct ahci_port *p, int } static void +atapi_report_luns(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t buf[16]; + + memset(buf, 0, sizeof(buf)); + buf[3] = 8; + + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + write_prdt(p, slot, cfis, buf, sizeof(buf)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); +} + +static void atapi_read(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done, int seek) { @@ -1453,6 +1494,9 @@ handle_packet_cmd(struct ahci_port *p, i case READ_TOC: atapi_read_toc(p, slot, cfis); break; + case REPORT_LUNS: + atapi_report_luns(p, slot, cfis); + break; case READ_10: case READ_12: atapi_read(p, slot, cfis, 0, 0); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:50:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 897DAC92; Fri, 27 Mar 2015 08:50:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A135B7E; Fri, 27 Mar 2015 08:50:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8oRdl022422; Fri, 27 Mar 2015 08:50:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8oRSb022421; Fri, 27 Mar 2015 08:50:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270850.t2R8oRSb022421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:50:27 +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: r280741 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:50:27 -0000 Author: mav Date: Fri Mar 27 08:50:26 2015 New Revision: 280741 URL: https://svnweb.freebsd.org/changeset/base/280741 Log: MFC r279987: Add checksums to identify data and NCQ command error log. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:49:33 2015 (r280740) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:50:26 2015 (r280741) @@ -794,6 +794,17 @@ write_prdt(struct ahci_port *p, int slot } static void +ahci_checksum(uint8_t *buf, int size) +{ + int i; + uint8_t sum = 0; + + for (i = 0; i < size - 1; i++) + sum += buf[i]; + buf[size - 1] = 0x100 - sum; +} + +static void ahci_handle_read_log(struct ahci_port *p, int slot, uint8_t *cfis) { struct ahci_cmd_hdr *hdr; @@ -809,6 +820,7 @@ ahci_handle_read_log(struct ahci_port *p memset(buf, 0, sizeof(buf)); memcpy(buf, p->err_cfis, sizeof(p->err_cfis)); + ahci_checksum(buf, sizeof(buf)); if (cfis[2] == ATA_READ_LOG_EXT) ahci_write_fis_piosetup(p); @@ -915,6 +927,8 @@ handle_identify(struct ahci_port *p, int buf[119] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[120] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[222] = 0x1020; + buf[255] = 0x00a5; + ahci_checksum((uint8_t *)buf, sizeof(buf)); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -963,6 +977,8 @@ handle_atapi_identify(struct ahci_port * if (p->xfermode & ATA_UDMA0) buf[88] |= (1 << ((p->xfermode & 7) + 8)); buf[222] = 0x1020; + buf[255] = 0x00a5; + ahci_checksum((uint8_t *)buf, sizeof(buf)); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:51:21 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F3C1DC9; Fri, 27 Mar 2015 08:51:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098F8C1B; Fri, 27 Mar 2015 08:51:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8pKZ4022586; Fri, 27 Mar 2015 08:51:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8pKBq022585; Fri, 27 Mar 2015 08:51:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270851.t2R8pKBq022585@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280742 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:51:21 -0000 Author: mav Date: Fri Mar 27 08:51:20 2015 New Revision: 280742 URL: https://svnweb.freebsd.org/changeset/base/280742 Log: MFC r280004: Give block I/O interface multiple (8) execution threads. On parallel random I/O this allows better utilize wide storage pools. To not confuse prefetcher on linear I/O, consecutive requests are executed sequentially, following the same logic as was earlier implemented in CTL. Benchmarks of virtual AHCI disk, backed by ZVOL on RAID10 pool of 4 HDDs, show ~3.5 times random read performance improvements, while no degradation on linear I/O. Modified: stable/10/usr.sbin/bhyve/block_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:50:26 2015 (r280741) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:51:20 2015 (r280742) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 #define BLOCKIF_MAXREQ 33 +#define BLOCKIF_NUMTHR 8 enum blockop { BOP_READ, @@ -65,6 +66,7 @@ enum blockop { enum blockstat { BST_FREE, + BST_BLOCK, BST_PEND, BST_BUSY, BST_DONE @@ -76,6 +78,7 @@ struct blockif_elem { enum blockop be_op; enum blockstat be_status; pthread_t be_tid; + off_t be_block; }; struct blockif_ctxt { @@ -88,16 +91,15 @@ struct blockif_ctxt { int bc_sectsz; int bc_psectsz; int bc_psectoff; - pthread_t bc_btid; + int bc_closing; + pthread_t bc_btid[BLOCKIF_NUMTHR]; pthread_mutex_t bc_mtx; pthread_cond_t bc_cond; - int bc_closing; /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; TAILQ_HEAD(, blockif_elem) bc_pendq; TAILQ_HEAD(, blockif_elem) bc_busyq; - u_int bc_req_count; struct blockif_elem bc_reqs[BLOCKIF_MAXREQ]; }; @@ -116,58 +118,83 @@ static int blockif_enqueue(struct blockif_ctxt *bc, struct blockif_req *breq, enum blockop op) { - struct blockif_elem *be; - - assert(bc->bc_req_count < BLOCKIF_MAXREQ); + struct blockif_elem *be, *tbe; + off_t off; + int i; be = TAILQ_FIRST(&bc->bc_freeq); assert(be != NULL); assert(be->be_status == BST_FREE); - TAILQ_REMOVE(&bc->bc_freeq, be, be_link); - be->be_status = BST_PEND; be->be_req = breq; be->be_op = op; + switch (op) { + case BOP_READ: + case BOP_WRITE: + case BOP_DELETE: + off = breq->br_offset; + for (i = 0; i < breq->br_iovcnt; i++) + off += breq->br_iov[i].iov_len; + break; + default: + off = OFF_MAX; + } + be->be_block = off; + TAILQ_FOREACH(tbe, &bc->bc_pendq, be_link) { + if (tbe->be_block == breq->br_offset) + break; + } + if (tbe == NULL) { + TAILQ_FOREACH(tbe, &bc->bc_busyq, be_link) { + if (tbe->be_block == breq->br_offset) + break; + } + } + if (tbe == NULL) + be->be_status = BST_PEND; + else + be->be_status = BST_BLOCK; TAILQ_INSERT_TAIL(&bc->bc_pendq, be, be_link); - - bc->bc_req_count++; - - return (0); + return (be->be_status == BST_PEND); } static int -blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem **bep) +blockif_dequeue(struct blockif_ctxt *bc, pthread_t t, struct blockif_elem **bep) { struct blockif_elem *be; - if (bc->bc_req_count == 0) - return (ENOENT); - - be = TAILQ_FIRST(&bc->bc_pendq); - assert(be != NULL); - assert(be->be_status == BST_PEND); + TAILQ_FOREACH(be, &bc->bc_pendq, be_link) { + if (be->be_status == BST_PEND) + break; + assert(be->be_status == BST_BLOCK); + } + if (be == NULL) + return (0); TAILQ_REMOVE(&bc->bc_pendq, be, be_link); be->be_status = BST_BUSY; - be->be_tid = bc->bc_btid; + be->be_tid = t; TAILQ_INSERT_TAIL(&bc->bc_busyq, be, be_link); - *bep = be; - - return (0); + return (1); } static void blockif_complete(struct blockif_ctxt *bc, struct blockif_elem *be) { - assert(be->be_status == BST_DONE); + struct blockif_elem *tbe; - TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + if (be->be_status == BST_DONE || be->be_status == BST_BUSY) + TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + else + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + TAILQ_FOREACH(tbe, &bc->bc_pendq, be_link) { + if (tbe->be_req->br_offset == be->be_block) + tbe->be_status = BST_PEND; + } be->be_tid = 0; be->be_status = BST_FREE; be->be_req = NULL; TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - - bc->bc_req_count--; } static void @@ -228,28 +255,27 @@ blockif_thr(void *arg) { struct blockif_ctxt *bc; struct blockif_elem *be; + pthread_t t; bc = arg; + t = pthread_self(); + pthread_mutex_lock(&bc->bc_mtx); for (;;) { - pthread_mutex_lock(&bc->bc_mtx); - while (!blockif_dequeue(bc, &be)) { + while (blockif_dequeue(bc, t, &be)) { pthread_mutex_unlock(&bc->bc_mtx); blockif_proc(bc, be); pthread_mutex_lock(&bc->bc_mtx); blockif_complete(bc, be); } - pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); - pthread_mutex_unlock(&bc->bc_mtx); - - /* - * Check ctxt status here to see if exit requested - */ + /* Check ctxt status here to see if exit requested */ if (bc->bc_closing) - pthread_exit(NULL); + break; + pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); } + pthread_mutex_unlock(&bc->bc_mtx); - /* Not reached */ + pthread_exit(NULL); return (NULL); } @@ -388,16 +414,16 @@ blockif_open(const char *optstr, const c TAILQ_INIT(&bc->bc_freeq); TAILQ_INIT(&bc->bc_pendq); TAILQ_INIT(&bc->bc_busyq); - bc->bc_req_count = 0; for (i = 0; i < BLOCKIF_MAXREQ; i++) { bc->bc_reqs[i].be_status = BST_FREE; TAILQ_INSERT_HEAD(&bc->bc_freeq, &bc->bc_reqs[i], be_link); } - pthread_create(&bc->bc_btid, NULL, blockif_thr, bc); - - snprintf(tname, sizeof(tname), "blk-%s", ident); - pthread_set_name_np(bc->bc_btid, tname); + for (i = 0; i < BLOCKIF_NUMTHR; i++) { + pthread_create(&bc->bc_btid[i], NULL, blockif_thr, bc); + snprintf(tname, sizeof(tname), "blk-%s-%d", ident, i); + pthread_set_name_np(bc->bc_btid[i], tname); + } return (bc); } @@ -411,13 +437,13 @@ blockif_request(struct blockif_ctxt *bc, err = 0; pthread_mutex_lock(&bc->bc_mtx); - if (bc->bc_req_count < BLOCKIF_MAXREQ) { + if (!TAILQ_EMPTY(&bc->bc_freeq)) { /* * Enqueue and inform the block i/o thread * that there is work available */ - blockif_enqueue(bc, breq, op); - pthread_cond_signal(&bc->bc_cond); + if (blockif_enqueue(bc, breq, op)) + pthread_cond_signal(&bc->bc_cond); } else { /* * Callers are not allowed to enqueue more than @@ -483,11 +509,7 @@ blockif_cancel(struct blockif_ctxt *bc, /* * Found it. */ - TAILQ_REMOVE(&bc->bc_pendq, be, be_link); - be->be_status = BST_FREE; - be->be_req = NULL; - TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - bc->bc_req_count--; + blockif_complete(bc, be); pthread_mutex_unlock(&bc->bc_mtx); return (0); @@ -548,7 +570,7 @@ int blockif_close(struct blockif_ctxt *bc) { void *jval; - int err; + int err, i; err = 0; @@ -558,8 +580,9 @@ blockif_close(struct blockif_ctxt *bc) * Stop the block i/o thread */ bc->bc_closing = 1; - pthread_cond_signal(&bc->bc_cond); - pthread_join(bc->bc_btid, &jval); + pthread_cond_broadcast(&bc->bc_cond); + for (i = 0; i < BLOCKIF_NUMTHR; i++) + pthread_join(bc->bc_btid[i], &jval); /* XXX Cancel queued i/o's ??? */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:53:00 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15E89F17; Fri, 27 Mar 2015 08:53:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3C1CC30; Fri, 27 Mar 2015 08:52:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8qxqD025751; Fri, 27 Mar 2015 08:52:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8qw68025740; Fri, 27 Mar 2015 08:52:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270852.t2R8qw68025740@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280743 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:53:00 -0000 Author: mav Date: Fri Mar 27 08:52:57 2015 New Revision: 280743 URL: https://svnweb.freebsd.org/changeset/base/280743 Log: MFC r280026, r280041: Modify virtqueue helpers added in r253440 to allow queuing. Original virtqueue design allows queued and out-of-order processing, but helpers added in r253440 suppose only direct blocking in-order one. It could be fine for network, etc., but it is a huge limitation for storage devices. Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/pci_virtio_rnd.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:51:20 2015 (r280742) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:52:57 2015 (r280743) @@ -170,9 +170,9 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int writeop, type; off_t offset; struct iovec iov[VTBLK_MAXSEGS + 2]; - uint16_t flags[VTBLK_MAXSEGS + 2]; + uint16_t idx, flags[VTBLK_MAXSEGS + 2]; - n = vq_getchain(vq, iov, VTBLK_MAXSEGS + 2, flags); + n = vq_getchain(vq, &idx, iov, VTBLK_MAXSEGS + 2, flags); /* * The first descriptor will be the read-only fixed header, @@ -258,7 +258,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s * Return the descriptor back to the host. * We wrote 1 byte (our status) to host. */ - vq_relchain(vq, 1); + vq_relchain(vq, idx, 1); } static void @@ -266,7 +266,6 @@ pci_vtblk_notify(void *vsc, struct vqueu { struct pci_vtblk_softc *sc = vsc; - vq_startchains(vq); while (vq_has_descs(vq)) pci_vtblk_proc(sc, vq); vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Mar 27 08:51:20 2015 (r280742) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Mar 27 08:52:57 2015 (r280743) @@ -288,6 +288,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc struct vqueue_info *vq; void *vrx; int len, n; + uint16_t idx; /* * Should never be called without a valid tap fd @@ -310,7 +311,6 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc * Check for available rx buffers */ vq = &sc->vsc_queues[VTNET_RXQ]; - vq_startchains(vq); if (!vq_has_descs(vq)) { /* * Drop the packet and try later. Interrupt on @@ -325,7 +325,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * Get descriptor chain. */ - n = vq_getchain(vq, iov, VTNET_MAXSEGS, NULL); + n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL); assert(n >= 1 && n <= VTNET_MAXSEGS); /* @@ -342,6 +342,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc * No more packets, but still some avail ring * entries. Interrupt if needed/appropriate. */ + vq_retchain(vq); vq_endchains(vq, 0); return; } @@ -362,7 +363,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * Release this chain and handle more chains. */ - vq_relchain(vq, len + sc->rx_vhdrlen); + vq_relchain(vq, idx, len + sc->rx_vhdrlen); } while (vq_has_descs(vq)); /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ @@ -401,13 +402,14 @@ pci_vtnet_proctx(struct pci_vtnet_softc struct iovec iov[VTNET_MAXSEGS + 1]; int i, n; int plen, tlen; + uint16_t idx; /* * Obtain chain of descriptors. The first one is * really the header descriptor, so we need to sum * up two lengths: packet length and transfer length. */ - n = vq_getchain(vq, iov, VTNET_MAXSEGS, NULL); + n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL); assert(n >= 1 && n <= VTNET_MAXSEGS); plen = 0; tlen = iov[0].iov_len; @@ -420,7 +422,7 @@ pci_vtnet_proctx(struct pci_vtnet_softc pci_vtnet_tap_tx(sc, &iov[1], n - 1, plen); /* chain is processed, release it and set tlen */ - vq_relchain(vq, tlen); + vq_relchain(vq, idx, tlen); } static void @@ -479,7 +481,6 @@ pci_vtnet_tx_thread(void *param) sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); - vq_startchains(vq); do { /* * Run through entries, placing them into Modified: stable/10/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Fri Mar 27 08:51:20 2015 (r280742) +++ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Fri Mar 27 08:52:57 2015 (r280743) @@ -103,18 +103,17 @@ pci_vtrnd_notify(void *vsc, struct vqueu struct iovec iov; struct pci_vtrnd_softc *sc; int len; + uint16_t idx; sc = vsc; - vq_startchains(vq); - if (sc->vrsc_fd < 0) { vq_endchains(vq, 0); return; } while (vq_has_descs(vq)) { - vq_getchain(vq, &iov, 1, NULL); + vq_getchain(vq, &idx, &iov, 1, NULL); len = read(sc->vrsc_fd, iov.iov_base, iov.iov_len); @@ -126,7 +125,7 @@ pci_vtrnd_notify(void *vsc, struct vqueu /* * Release this chain and handle more */ - vq_relchain(vq, len); + vq_relchain(vq, idx, len); } vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ } Modified: stable/10/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.c Fri Mar 27 08:51:20 2015 (r280742) +++ stable/10/usr.sbin/bhyve/virtio.c Fri Mar 27 08:52:57 2015 (r280743) @@ -97,6 +97,7 @@ vi_reset_dev(struct virtio_softc *vs) for (vq = vs->vs_queues, i = 0; i < nvq; vq++, i++) { vq->vq_flags = 0; vq->vq_last_avail = 0; + vq->vq_save_used = 0; vq->vq_pfn = 0; vq->vq_msix_idx = VIRTIO_MSI_NO_VECTOR; } @@ -188,6 +189,7 @@ vi_vq_init(struct virtio_softc *vs, uint /* Mark queue as allocated, and start at 0 when we use it. */ vq->vq_flags = VQ_ALLOC; vq->vq_last_avail = 0; + vq->vq_save_used = 0; } /* @@ -247,12 +249,12 @@ _vq_record(int i, volatile struct virtio * that vq_has_descs() does one). */ int -vq_getchain(struct vqueue_info *vq, +vq_getchain(struct vqueue_info *vq, uint16_t *pidx, struct iovec *iov, int n_iov, uint16_t *flags) { int i; u_int ndesc, n_indir; - u_int idx, head, next; + u_int idx, next; volatile struct virtio_desc *vdir, *vindir, *vp; struct vmctx *ctx; struct virtio_softc *vs; @@ -295,8 +297,8 @@ vq_getchain(struct vqueue_info *vq, * index, but we just abort if the count gets excessive. */ ctx = vs->vs_pi->pi_vmctx; - head = vq->vq_avail->va_ring[idx & (vq->vq_qsize - 1)]; - next = head; + *pidx = next = vq->vq_avail->va_ring[idx & (vq->vq_qsize - 1)]; + vq->vq_last_avail++; for (i = 0; i < VQ_MAX_DESCRIPTORS; next = vdir->vd_next) { if (next >= vq->vq_qsize) { fprintf(stderr, @@ -370,16 +372,29 @@ loopy: } /* - * Return the currently-first request chain to the guest, setting - * its I/O length to the provided value. + * Return the currently-first request chain back to the available queue. * * (This chain is the one you handled when you called vq_getchain() * and used its positive return value.) */ void -vq_relchain(struct vqueue_info *vq, uint32_t iolen) +vq_retchain(struct vqueue_info *vq) { - uint16_t head, uidx, mask; + + vq->vq_last_avail--; +} + +/* + * Return specified request chain to the guest, setting its I/O length + * to the provided value. + * + * (This chain is the one you handled when you called vq_getchain() + * and used its positive return value.) + */ +void +vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen) +{ + uint16_t uidx, mask; volatile struct vring_used *vuh; volatile struct virtio_used *vue; @@ -395,11 +410,10 @@ vq_relchain(struct vqueue_info *vq, uint */ mask = vq->vq_qsize - 1; vuh = vq->vq_used; - head = vq->vq_avail->va_ring[vq->vq_last_avail++ & mask]; uidx = vuh->vu_idx; vue = &vuh->vu_ring[uidx++ & mask]; - vue->vu_idx = head; /* ie, vue->id = head */ + vue->vu_idx = idx; vue->vu_tlen = iolen; vuh->vu_idx = uidx; } @@ -436,8 +450,8 @@ vq_endchains(struct vqueue_info *vq, int * entire avail was processed, we need to interrupt always. */ vs = vq->vq_vs; - new_idx = vq->vq_used->vu_idx; old_idx = vq->vq_save_used; + vq->vq_save_used = new_idx = vq->vq_used->vu_idx; if (used_all_avail && (vs->vs_negotiated_caps & VIRTIO_F_NOTIFY_ON_EMPTY)) intr = 1; Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Fri Mar 27 08:51:20 2015 (r280742) +++ stable/10/usr.sbin/bhyve/virtio.h Fri Mar 27 08:52:57 2015 (r280743) @@ -425,20 +425,6 @@ vq_has_descs(struct vqueue_info *vq) } /* - * Called by virtio driver as it starts processing chains. Each - * completed chain (obtained from vq_getchain()) is released by - * calling vq_relchain(), then when all are done, vq_endchains() - * can tell if / how-many chains were processed and know whether - * and how to generate an interrupt. - */ -static inline void -vq_startchains(struct vqueue_info *vq) -{ - - vq->vq_save_used = vq->vq_used->vu_idx; -} - -/* * Deliver an interrupt to guest on the given virtual queue * (if possible, or a generic MSI interrupt if not using MSI-X). */ @@ -465,9 +451,10 @@ int vi_intr_init(struct virtio_softc *vs void vi_reset_dev(struct virtio_softc *); void vi_set_io_bar(struct virtio_softc *, int); -int vq_getchain(struct vqueue_info *vq, +int vq_getchain(struct vqueue_info *vq, uint16_t *pidx, struct iovec *iov, int n_iov, uint16_t *flags); -void vq_relchain(struct vqueue_info *vq, uint32_t iolen); +void vq_retchain(struct vqueue_info *vq); +void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen); void vq_endchains(struct vqueue_info *vq, int used_all_avail); uint64_t vi_pci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:54:00 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8366E3; Fri, 27 Mar 2015 08:54:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88FA6C3D; Fri, 27 Mar 2015 08:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8s00F025928; Fri, 27 Mar 2015 08:54:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8s0tx025919; Fri, 27 Mar 2015 08:54:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270854.t2R8s0tx025919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280744 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:54:00 -0000 Author: mav Date: Fri Mar 27 08:53:59 2015 New Revision: 280744 URL: https://svnweb.freebsd.org/changeset/base/280744 Log: MFC r280037: Rewrite virtio block device driver to work asynchronously and use the block I/O interface. Asynchronous operation, based on r280026 change, allows to not block virtual CPU during I/O processing, that on slow/busy storage can take seconds. Use of recently improved block I/O interface allows to process multiple requests same time, that improves random I/O performance on wide storages. Benchmarks of virtual disk, backed by ZVOL on RAID10 pool of 4 HDDs, show ~3.5 times random read performance improvements, while no degradation on linear I/O. Guest CPU usage during test dropped from 100% to almost zero. Modified: stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:52:57 2015 (r280743) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:53:59 2015 (r280744) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 -#define BLOCKIF_MAXREQ 33 +#define BLOCKIF_MAXREQ 64 #define BLOCKIF_NUMTHR 8 enum blockop { Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:52:57 2015 (r280743) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:53:59 2015 (r280744) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "pci_emul.h" #include "virtio.h" +#include "block_if.h" #define VTBLK_RINGSZ 64 @@ -120,6 +121,13 @@ static int pci_vtblk_debug; #define DPRINTF(params) if (pci_vtblk_debug) printf params #define WPRINTF(params) printf params +struct pci_vtblk_ioreq { + struct blockif_req io_req; + struct pci_vtblk_softc *io_sc; + uint8_t *io_status; + uint16_t io_idx; +}; + /* * Per-device softc */ @@ -127,10 +135,10 @@ struct pci_vtblk_softc { struct virtio_softc vbsc_vs; pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; - int vbsc_fd; - int vbsc_ischr; - struct vtblk_config vbsc_cfg; + struct vtblk_config vbsc_cfg; + struct blockif_ctxt *bc; char vbsc_ident[VTBLK_BLK_ID_BYTES]; + struct pci_vtblk_ioreq vbsc_ios[VTBLK_RINGSZ]; }; static void pci_vtblk_reset(void *); @@ -160,10 +168,34 @@ pci_vtblk_reset(void *vsc) } static void +pci_vtblk_done(struct blockif_req *br, int err) +{ + struct pci_vtblk_ioreq *io = br->br_param; + struct pci_vtblk_softc *sc = io->io_sc; + + /* convert errno into a virtio block error return */ + if (err == EOPNOTSUPP || err == ENOSYS) + *io->io_status = VTBLK_S_UNSUPP; + else if (err != 0) + *io->io_status = VTBLK_S_IOERR; + else + *io->io_status = VTBLK_S_OK; + + /* + * Return the descriptor back to the host. + * We wrote 1 byte (our status) to host. + */ + pthread_mutex_lock(&sc->vsc_mtx); + vq_relchain(&sc->vbsc_vq, io->io_idx, 1); + vq_endchains(&sc->vbsc_vq, 0); + pthread_mutex_unlock(&sc->vsc_mtx); +} + +static void pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vqueue_info *vq) { struct virtio_blk_hdr *vbh; - uint8_t *status; + struct pci_vtblk_ioreq *io; int i, n; int err; int iolen; @@ -184,11 +216,14 @@ pci_vtblk_proc(struct pci_vtblk_softc *s */ assert(n >= 2 && n <= VTBLK_MAXSEGS + 2); + io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); assert(iov[0].iov_len == sizeof(struct virtio_blk_hdr)); vbh = iov[0].iov_base; - - status = iov[--n].iov_base; + memcpy(&io->io_req.br_iov, &iov[1], sizeof(struct iovec) * (n - 2)); + io->io_req.br_iovcnt = n - 2; + io->io_req.br_offset = vbh->vbh_sector * DEV_BSIZE; + io->io_status = iov[--n].iov_base; assert(iov[n].iov_len == 1); assert(flags[n] & VRING_DESC_F_WRITE); @@ -200,8 +235,6 @@ pci_vtblk_proc(struct pci_vtblk_softc *s type = vbh->vbh_type & ~VBH_FLAG_BARRIER; writeop = (type == VBH_OP_WRITE); - offset = vbh->vbh_sector * DEV_BSIZE; - iolen = 0; for (i = 1; i < n; i++) { /* @@ -217,48 +250,28 @@ pci_vtblk_proc(struct pci_vtblk_softc *s DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", writeop ? "write" : "read/ident", iolen, i - 1, offset)); - err = 0; switch (type) { + case VBH_OP_READ: + err = blockif_read(sc->bc, &io->io_req); + break; case VBH_OP_WRITE: - if (pwritev(sc->vbsc_fd, iov + 1, i - 1, offset) < 0) - err = errno; + err = blockif_write(sc->bc, &io->io_req); break; - case VBH_OP_READ: - if (preadv(sc->vbsc_fd, iov + 1, i - 1, offset) < 0) - err = errno; + case VBH_OP_FLUSH: + case VBH_OP_FLUSH_OUT: + err = blockif_flush(sc->bc, &io->io_req); break; case VBH_OP_IDENT: /* Assume a single buffer */ strlcpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); - err = 0; - break; - case VBH_OP_FLUSH: - case VBH_OP_FLUSH_OUT: - if (sc->vbsc_ischr) { - if (ioctl(sc->vbsc_fd, DIOCGFLUSH)) - err = errno; - } else if (fsync(sc->vbsc_fd)) - err = errno; - break; + pci_vtblk_done(&io->io_req, 0); + return; default: - err = -ENOSYS; - break; + pci_vtblk_done(&io->io_req, EOPNOTSUPP); + return; } - - /* convert errno into a virtio block error return */ - if (err == -ENOSYS) - *status = VTBLK_S_UNSUPP; - else if (err != 0) - *status = VTBLK_S_IOERR; - else - *status = VTBLK_S_OK; - - /* - * Return the descriptor back to the host. - * We wrote 1 byte (our status) to host. - */ - vq_relchain(vq, idx, 1); + assert(err == 0); } static void @@ -268,19 +281,18 @@ pci_vtblk_notify(void *vsc, struct vqueu while (vq_has_descs(vq)) pci_vtblk_proc(sc, vq); - vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ } static int pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { - struct stat sbuf; + char bident[sizeof("XX:X:X")]; + struct blockif_ctxt *bctxt; MD5_CTX mdctx; u_char digest[16]; struct pci_vtblk_softc *sc; - off_t size, sts, sto; - int fd; - int sectsz; + off_t size; + int i, sectsz, sts, sto; if (opts == NULL) { printf("virtio-block: backing device required\n"); @@ -290,43 +302,26 @@ pci_vtblk_init(struct vmctx *ctx, struct /* * The supplied backing file has to exist */ - fd = open(opts, O_RDWR); - if (fd < 0) { + snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); + bctxt = blockif_open(opts, bident); + if (bctxt == NULL) { perror("Could not open backing file"); return (1); } - if (fstat(fd, &sbuf) < 0) { - perror("Could not stat backing file"); - close(fd); - return (1); - } - - /* - * Deal with raw devices - */ - size = sbuf.st_size; - sectsz = DEV_BSIZE; - sts = sto = 0; - if (S_ISCHR(sbuf.st_mode)) { - if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || - ioctl(fd, DIOCGSECTORSIZE, §sz)) { - perror("Could not fetch dev blk/sector size"); - close(fd); - return (1); - } - assert(size != 0); - assert(sectsz != 0); - if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0 && sts > 0) - ioctl(fd, DIOCGSTRIPEOFFSET, &sto); - } else - sts = sbuf.st_blksize; + size = blockif_size(bctxt); + sectsz = blockif_sectsz(bctxt); + blockif_psectsz(bctxt, &sts, &sto); sc = calloc(1, sizeof(struct pci_vtblk_softc)); - - /* record fd of storage device/file */ - sc->vbsc_fd = fd; - sc->vbsc_ischr = S_ISCHR(sbuf.st_mode); + sc->bc = bctxt; + for (i = 0; i < VTBLK_RINGSZ; i++) { + struct pci_vtblk_ioreq *io = &sc->vbsc_ios[i]; + io->io_req.br_callback = pci_vtblk_done; + io->io_req.br_param = io; + io->io_sc = sc; + io->io_idx = i; + } pthread_mutex_init(&sc->vsc_mtx, NULL); @@ -375,8 +370,11 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_lintr_request(pi); - if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) + if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) { + blockif_close(sc->bc); + free(sc); return (1); + } vi_set_io_bar(&sc->vbsc_vs, 0); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:54:57 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2766221B; Fri, 27 Mar 2015 08:54:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC46FC49; Fri, 27 Mar 2015 08:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8sutn026109; Fri, 27 Mar 2015 08:54:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8suRp026108; Fri, 27 Mar 2015 08:54:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270854.t2R8suRp026108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:54: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: r280745 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:54:57 -0000 Author: mav Date: Fri Mar 27 08:54:55 2015 New Revision: 280745 URL: https://svnweb.freebsd.org/changeset/base/280745 Log: MFC r280040: Give AHCI disk serial based on backing file path same as for virtio block. It is still not good that they may intersect on different hosts, but that is better then intersecting on the same host. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:53:59 2015 (r280744) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Mar 27 08:54:55 2015 (r280745) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -131,6 +132,7 @@ struct ahci_port { struct pci_ahci_softc *pr_sc; uint8_t *cmd_lst; uint8_t *rfis; + char ident[20 + 1]; int atapi; int reset; int mult_sectors; @@ -855,8 +857,7 @@ handle_identify(struct ahci_port *p, int buf[1] = cyl; buf[3] = heads; buf[6] = sech; - /* TODO emulate different serial? */ - ata_string((uint8_t *)(buf+10), "123456", 20); + ata_string((uint8_t *)(buf+10), p->ident, 20); ata_string((uint8_t *)(buf+23), "001", 8); ata_string((uint8_t *)(buf+27), "BHYVE SATA DISK", 40); buf[47] = (0x8000 | 128); @@ -946,8 +947,7 @@ handle_atapi_identify(struct ahci_port * memset(buf, 0, sizeof(buf)); buf[0] = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); - /* TODO emulate different serial? */ - ata_string((uint8_t *)(buf+10), "123456", 20); + ata_string((uint8_t *)(buf+10), p->ident, 20); ata_string((uint8_t *)(buf+23), "001", 8); ata_string((uint8_t *)(buf+27), "BHYVE SATA DVD ROM", 40); buf[49] = (1 << 9 | 1 << 8); @@ -2167,6 +2167,8 @@ pci_ahci_init(struct vmctx *ctx, struct struct blockif_ctxt *bctxt; struct pci_ahci_softc *sc; int ret, slots; + MD5_CTX mdctx; + u_char digest[16]; ret = 0; @@ -2204,6 +2206,16 @@ pci_ahci_init(struct vmctx *ctx, struct sc->port[0].pr_sc = sc; /* + * Create an identifier for the backing file. Use parts of the + * md5 sum of the filename + */ + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + sprintf(sc->port[0].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + + /* * Allocate blockif request structures and add them * to the free list */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:55:55 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9D7A364; Fri, 27 Mar 2015 08:55:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A155DC59; Fri, 27 Mar 2015 08:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8tt0P026333; Fri, 27 Mar 2015 08:55:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8tt60026332; Fri, 27 Mar 2015 08:55:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270855.t2R8tt60026332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:55: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: r280746 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:55:55 -0000 Author: mav Date: Fri Mar 27 08:55:54 2015 New Revision: 280746 URL: https://svnweb.freebsd.org/changeset/base/280746 Log: MFC r280042: Close potential race on blockif_close(). Reported by: vangyzen Modified: stable/10/usr.sbin/bhyve/block_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:54:55 2015 (r280745) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:55:54 2015 (r280746) @@ -579,7 +579,9 @@ blockif_close(struct blockif_ctxt *bc) /* * Stop the block i/o thread */ + pthread_mutex_lock(&bc->bc_mtx); bc->bc_closing = 1; + pthread_mutex_unlock(&bc->bc_mtx); pthread_cond_broadcast(&bc->bc_cond); for (i = 0; i < BLOCKIF_NUMTHR; i++) pthread_join(bc->bc_btid[i], &jval); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:56:45 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9244F4A3; Fri, 27 Mar 2015 08:56:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB85C6A; Fri, 27 Mar 2015 08:56:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8ujYi026502; Fri, 27 Mar 2015 08:56:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8ujvl026501; Fri, 27 Mar 2015 08:56:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270856.t2R8ujvl026501@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280747 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:56:45 -0000 Author: mav Date: Fri Mar 27 08:56:44 2015 New Revision: 280747 URL: https://svnweb.freebsd.org/changeset/base/280747 Log: MFC r280044: According to Linux and QEMU, s/n equal to buffer is not zero-terminated. This makes same s/n reported for both virtio and AHCI drivers. Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:55:54 2015 (r280746) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:56:44 2015 (r280747) @@ -263,7 +263,9 @@ pci_vtblk_proc(struct pci_vtblk_softc *s break; case VBH_OP_IDENT: /* Assume a single buffer */ - strlcpy(iov[1].iov_base, sc->vbsc_ident, + /* S/n equal to buffer is not zero-terminated. */ + memset(iov[1].iov_base, 0, iov[1].iov_len); + strncpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); pci_vtblk_done(&io->io_req, 0); return; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:57:39 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 338687A6; Fri, 27 Mar 2015 08:57:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E463C85; Fri, 27 Mar 2015 08:57:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8vcsv026772; Fri, 27 Mar 2015 08:57:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8vcUs026771; Fri, 27 Mar 2015 08:57:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270857.t2R8vcUs026771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:57: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: r280748 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:57:39 -0000 Author: mav Date: Fri Mar 27 08:57:38 2015 New Revision: 280748 URL: https://svnweb.freebsd.org/changeset/base/280748 Log: MFC r280126: Pre-allocate one extra request per processing thread. Processing threads call callbacks before freeing requests. As result, new requests may arrive before old ones are freed. Modified: stable/10/usr.sbin/bhyve/block_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:56:44 2015 (r280747) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:57:38 2015 (r280748) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 -#define BLOCKIF_MAXREQ 64 #define BLOCKIF_NUMTHR 8 +#define BLOCKIF_MAXREQ (64 + BLOCKIF_NUMTHR) enum blockop { BOP_READ, From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:58:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 963808DE; Fri, 27 Mar 2015 08:58:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66BADC91; Fri, 27 Mar 2015 08:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8wVFQ026947; Fri, 27 Mar 2015 08:58:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8wUmR026945; Fri, 27 Mar 2015 08:58:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270858.t2R8wUmR026945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280749 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:58:31 -0000 Author: mav Date: Fri Mar 27 08:58:30 2015 New Revision: 280749 URL: https://svnweb.freebsd.org/changeset/base/280749 Log: MFC r280133: Increase S/G list size of 32 to 33 entries. 32 entries are not enough for the worst case of misaligned 128KB request, that made FreeBSD to chunk large quests in odd pieces. Modified: stable/10/usr.sbin/bhyve/block_if.h stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.h ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.h Fri Mar 27 08:57:38 2015 (r280748) +++ stable/10/usr.sbin/bhyve/block_if.h Fri Mar 27 08:58:30 2015 (r280749) @@ -39,7 +39,7 @@ #include #include -#define BLOCKIF_IOV_MAX 32 /* not practical to be IOV_MAX */ +#define BLOCKIF_IOV_MAX 33 /* not practical to be IOV_MAX */ struct blockif_req { struct iovec br_iov[BLOCKIF_IOV_MAX]; Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:57:38 2015 (r280748) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:58:30 2015 (r280749) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #define VTBLK_RINGSZ 64 -#define VTBLK_MAXSEGS 32 - #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 @@ -201,10 +199,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int iolen; int writeop, type; off_t offset; - struct iovec iov[VTBLK_MAXSEGS + 2]; - uint16_t idx, flags[VTBLK_MAXSEGS + 2]; + struct iovec iov[BLOCKIF_IOV_MAX + 2]; + uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; - n = vq_getchain(vq, &idx, iov, VTBLK_MAXSEGS + 2, flags); + n = vq_getchain(vq, &idx, iov, BLOCKIF_IOV_MAX + 2, flags); /* * The first descriptor will be the read-only fixed header, @@ -214,7 +212,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s * XXX - note - this fails on crash dump, which does a * VIRTIO_BLK_T_FLUSH with a zero transfer length */ - assert(n >= 2 && n <= VTBLK_MAXSEGS + 2); + assert(n >= 2 && n <= BLOCKIF_IOV_MAX + 2); io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); @@ -347,7 +345,7 @@ pci_vtblk_init(struct vmctx *ctx, struct /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ - sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; + sc->vbsc_cfg.vbc_seg_max = BLOCKIF_IOV_MAX; sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ sc->vbsc_cfg.vbc_geometry.heads = 0; sc->vbsc_cfg.vbc_geometry.sectors = 0; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 08:59:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3660A1A; Fri, 27 Mar 2015 08:59:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE0ABC99; Fri, 27 Mar 2015 08:59:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8xMkH027118; Fri, 27 Mar 2015 08:59:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8xM3E027117; Fri, 27 Mar 2015 08:59:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270859.t2R8xM3E027117@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 08:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280750 - stable/10/usr.sbin/bhyve 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.18-1 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, 27 Mar 2015 08:59:22 -0000 Author: mav Date: Fri Mar 27 08:59:21 2015 New Revision: 280750 URL: https://svnweb.freebsd.org/changeset/base/280750 Log: MFC r280154: Report that we may have write cache, and that we do support FLUSH. Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:58:30 2015 (r280749) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:59:21 2015 (r280750) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ #define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ +#define VTBLK_F_FLUSH (1 << 9) /* Cache flush support */ #define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ /* @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_HOSTCAPS \ ( VTBLK_F_SEG_MAX | \ VTBLK_F_BLK_SIZE | \ + VTBLK_F_FLUSH | \ VTBLK_F_TOPOLOGY | \ VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 09:01:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBB8D23; Fri, 27 Mar 2015 09:01:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07514CC1; Fri, 27 Mar 2015 09:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R91Q8w030364; Fri, 27 Mar 2015 09:01:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R91QSK030363; Fri, 27 Mar 2015 09:01:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270901.t2R91QSK030363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 09:01: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: r280751 - stable/10/usr.sbin/powerd 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.18-1 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, 27 Mar 2015 09:01:27 -0000 Author: mav Date: Fri Mar 27 09:01:25 2015 New Revision: 280751 URL: https://svnweb.freebsd.org/changeset/base/280751 Log: MFC r280286: Add comment explaining existing powerd behavior on SMP systems. Modified: stable/10/usr.sbin/powerd/powerd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/powerd/powerd.c ============================================================================== --- stable/10/usr.sbin/powerd/powerd.c Fri Mar 27 08:59:21 2015 (r280750) +++ stable/10/usr.sbin/powerd/powerd.c Fri Mar 27 09:01:25 2015 (r280751) @@ -127,6 +127,12 @@ static int devd_pipe = -1; #define DEVD_RETRY_INTERVAL 60 /* seconds */ static struct timeval tried_devd; +/* + * This function returns summary load of all CPUs. It was made so + * intentionally to not reduce performance in scenarios when several + * threads are processing requests as a pipeline -- running one at + * a time on different CPUs and waiting for each other. + */ static int read_usage_times(int *load) { From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 09:28:31 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E337A9C5; Fri, 27 Mar 2015 09:28:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD252FEC; Fri, 27 Mar 2015 09:28:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R9SVKK042993; Fri, 27 Mar 2015 09:28:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R9SVle042992; Fri, 27 Mar 2015 09:28:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270928.t2R9SVle042992@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 09:28: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: r280753 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 27 Mar 2015 09:28:32 -0000 Author: mav Date: Fri Mar 27 09:28:30 2015 New Revision: 280753 URL: https://svnweb.freebsd.org/changeset/base/280753 Log: MFC r279927: Make DIOCGATTR in device mode handle "GEOM::candelete". Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Mar 27 09:04:31 2015 (r280752) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Mar 27 09:28:30 2015 (r280753) @@ -3131,7 +3131,9 @@ zvol_d_ioctl(struct cdev *dev, u_long cm struct diocgattr_arg *arg = (struct diocgattr_arg *)data; uint64_t refd, avail, usedobjs, availobjs; - if (strcmp(arg->name, "blocksavail") == 0) { + if (strcmp(arg->name, "GEOM::candelete") == 0) + arg->value.i = 1; + else if (strcmp(arg->name, "blocksavail") == 0) { dmu_objset_space(zv->zv_objset, &refd, &avail, &usedobjs, &availobjs); arg->value.off = avail / DEV_BSIZE; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 09:31:29 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85144B51; Fri, 27 Mar 2015 09:31:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F3AA10D; Fri, 27 Mar 2015 09:31:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R9VTls046275; Fri, 27 Mar 2015 09:31:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R9VSsn046273; Fri, 27 Mar 2015 09:31:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270931.t2R9VSsn046273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 09:31: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: r280754 - in stable/10/sys: cam/ata 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.18-1 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, 27 Mar 2015 09:31:29 -0000 Author: mav Date: Fri Mar 27 09:31:28 2015 New Revision: 280754 URL: https://svnweb.freebsd.org/changeset/base/280754 Log: MFC r270832 (by imp): Add a few defines and packet types for SATA 3.2 and FPDMA (First Party DMA). Modified: stable/10/sys/cam/ata/ata_all.c stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_all.c ============================================================================== --- stable/10/sys/cam/ata/ata_all.c Fri Mar 27 09:28:30 2015 (r280753) +++ stable/10/sys/cam/ata/ata_all.c Fri Mar 27 09:31:28 2015 (r280754) @@ -108,6 +108,9 @@ ata_op_string(struct ata_cmd *cmd) case 0x51: return ("CONFIGURE_STREAM"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); + case 0x63: return ("NCQ_NON_DATA"); + case 0x64: return ("SEND_FPDMA_QUEUED"); + case 0x65: return ("RECEIVE_FPDMA_QUEUED"); case 0x67: if (cmd->features == 0xec) return ("SEP_ATTN IDENTIFY"); Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Fri Mar 27 09:28:30 2015 (r280753) +++ stable/10/sys/sys/ata.h Fri Mar 27 09:31:28 2015 (r280754) @@ -370,6 +370,7 @@ struct ata_params { #define ATA_READ_LOG_DMA_EXT 0x47 /* read log DMA ext - PIO Data-In */ #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_NCQ_NON_DATA 0x63 /* NCQ non-data command */ #define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ #define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 27 09:32:35 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 223FDCAD; Fri, 27 Mar 2015 09:32:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2A9129; Fri, 27 Mar 2015 09:32:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R9WYT0047105; Fri, 27 Mar 2015 09:32:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R9WY9a047104; Fri, 27 Mar 2015 09:32:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503270932.t2R9WY9a047104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 09:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280755 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 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, 27 Mar 2015 09:32:35 -0000 Author: mav Date: Fri Mar 27 09:32:34 2015 New Revision: 280755 URL: https://svnweb.freebsd.org/changeset/base/280755 Log: MFC r273445 (by imp): Add defines for various FIRST PARTY DMA SEND subcommands. Modified: stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Fri Mar 27 09:31:28 2015 (r280754) +++ stable/10/sys/sys/ata.h Fri Mar 27 09:32:34 2015 (r280755) @@ -372,6 +372,10 @@ struct ata_params { #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ #define ATA_NCQ_NON_DATA 0x63 /* NCQ non-data command */ #define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ +#define ATA_SFPDMA_DSM 0x00 /* Data set management */ +#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxilary */ +#define ATA_SFPDMA_HYBRID_EVICT 0x01 /* Hybrid Evict */ +#define ATA_SFPDMA_WLDMA 0x02 /* Write Log DMA EXT */ #define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 28 05:11:18 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE60047D; Sat, 28 Mar 2015 05:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98734E65; Sat, 28 Mar 2015 05:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S5BI9c006687; Sat, 28 Mar 2015 05:11:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S5BGd7006681; Sat, 28 Mar 2015 05:11:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503280511.t2S5BGd7006681@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 28 Mar 2015 05:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280777 - stable/10/release/arm 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.18-1 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, 28 Mar 2015 05:11:18 -0000 Author: gjb Date: Sat Mar 28 05:11:16 2015 New Revision: 280777 URL: https://svnweb.freebsd.org/changeset/base/280777 Log: MFC r280640: Crochet sources moved to a new home; update accordingly. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf stable/10/release/arm/ZEDBOARD.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Sat Mar 28 05:09:09 2015 (r280776) +++ stable/10/release/arm/BEAGLEBONE.conf Sat Mar 28 05:11:16 2015 (r280777) @@ -24,7 +24,7 @@ XDEV="arm" XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="BEAGLEBONE" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETSRC="https://github.com/freebsd/crochet" CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Sat Mar 28 05:09:09 2015 (r280776) +++ stable/10/release/arm/PANDABOARD.conf Sat Mar 28 05:11:16 2015 (r280777) @@ -24,7 +24,7 @@ XDEV="arm" XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="PANDABOARD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETSRC="https://github.com/freebsd/crochet" CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Sat Mar 28 05:09:09 2015 (r280776) +++ stable/10/release/arm/RPI-B.conf Sat Mar 28 05:11:16 2015 (r280777) @@ -24,7 +24,7 @@ XDEV="arm" XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="RPI-B" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETSRC="https://github.com/freebsd/crochet" CROCHETBRANCH="trunk@r744" UBOOTSRC="https://github.com/gonzoua/u-boot-pi" UBOOTBRANCH="trunk" Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD-QUAD.conf Sat Mar 28 05:09:09 2015 (r280776) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Sat Mar 28 05:11:16 2015 (r280777) @@ -24,7 +24,7 @@ XDEV="arm" XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="WANDBOARD-QUAD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETSRC="https://github.com/freebsd/crochet" CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/ZEDBOARD.conf ============================================================================== --- stable/10/release/arm/ZEDBOARD.conf Sat Mar 28 05:09:09 2015 (r280776) +++ stable/10/release/arm/ZEDBOARD.conf Sat Mar 28 05:11:16 2015 (r280777) @@ -23,7 +23,7 @@ XDEV="arm" XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="ZEDBOARD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETSRC="https://github.com/freebsd/crochet" CROCHETBRANCH="trunk@r744" set +a